forked from crysknife-io/crysknife
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #2 from treblereel/generators_refactoring
Generators refactoring
- Loading branch information
Showing
489 changed files
with
5,167 additions
and
17,452 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
44 changes: 44 additions & 0 deletions
44
core/src/main/java/io/crysknife/client/internal/managed/InstanceContextualTypeProvider.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
/* | ||
* Copyright © 2023 Treblereel | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except | ||
* in compliance with the License. You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software distributed under the License | ||
* is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express | ||
* or implied. See the License for the specific language governing permissions and limitations under | ||
* the License. | ||
*/ | ||
|
||
package io.crysknife.client.internal.managed; | ||
|
||
import io.crysknife.client.BeanManager; | ||
import io.crysknife.client.internal.InstanceImpl; | ||
import io.crysknife.client.ioc.ContextualTypeProvider; | ||
import io.crysknife.client.ioc.IOCProvider; | ||
import jakarta.enterprise.inject.Instance; | ||
import jakarta.inject.Inject; | ||
|
||
import java.lang.annotation.Annotation; | ||
|
||
@IOCProvider | ||
public class InstanceContextualTypeProvider implements ContextualTypeProvider<Instance> { | ||
|
||
private final BeanManager manager; | ||
|
||
@Inject | ||
public InstanceContextualTypeProvider(BeanManager manager) { | ||
this.manager = manager; | ||
} | ||
|
||
@Override | ||
public Instance provide(Class<?>[] typeargs, Annotation[] qualifiers) { | ||
Class clazz = typeargs[0]; | ||
if (qualifiers.length > 0) { | ||
return new InstanceImpl(manager.lookupBean(clazz, qualifiers)); | ||
} | ||
return new InstanceImpl(manager.lookupBean(clazz)); | ||
} | ||
} |
43 changes: 43 additions & 0 deletions
43
...main/java/io/crysknife/client/internal/managed/ManagedInstanceContextualTypeProvider.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
/* | ||
* Copyright © 2023 Treblereel | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except | ||
* in compliance with the License. You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software distributed under the License | ||
* is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express | ||
* or implied. See the License for the specific language governing permissions and limitations under | ||
* the License. | ||
*/ | ||
|
||
package io.crysknife.client.internal.managed; | ||
|
||
import io.crysknife.client.BeanManager; | ||
import io.crysknife.client.ManagedInstance; | ||
import io.crysknife.client.internal.ManagedInstanceImpl; | ||
import io.crysknife.client.ioc.ContextualTypeProvider; | ||
import io.crysknife.client.ioc.IOCProvider; | ||
import jakarta.inject.Inject; | ||
|
||
import java.lang.annotation.Annotation; | ||
|
||
@IOCProvider | ||
public class ManagedInstanceContextualTypeProvider | ||
implements ContextualTypeProvider<ManagedInstance> { | ||
|
||
private final BeanManager manager; | ||
|
||
@Inject | ||
public ManagedInstanceContextualTypeProvider(BeanManager manager) { | ||
this.manager = manager; | ||
} | ||
|
||
@Override | ||
public ManagedInstance provide(Class<?>[] typeargs, Annotation[] qualifiers) { | ||
Class clazz = typeargs[0]; | ||
return new ManagedInstanceImpl(manager, clazz, qualifiers); | ||
} | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
48 changes: 0 additions & 48 deletions
48
demo/src/main/java/io/crysknife/demo/client/qualifiers/Qualifiers2.java
This file was deleted.
Oops, something went wrong.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.