本文整理了Java中org.jboss.arquillian.core.api.annotation.Inject.<init>()
方法的一些代码示例,展示了Inject.<init>()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Inject.<init>()
方法的具体详情如下:
包路径:org.jboss.arquillian.core.api.annotation.Inject
类名称:Inject
方法名:<init>
暂无
代码示例来源:origin: org.jboss.arquillian.extension/arquillian-warp-impl
public class OperationalContextInitializer {
@Inject
@ApplicationScoped
private InstanceProducer<OperationalContexts> contextsInst;
@Inject
private Instance<Injector> injector;
public void initializeOperationalContexts(@Observes ManagerStarted event) {
OperationalContexts contexts = new OperationalContexts();
injector.get().inject(contexts);
contextsInst.set(contexts);
}
}
代码示例来源:origin: org.arquillian.cube/arquillian-cube-kubernetes
public class ConfigurationRegistar {
private static final String EXTENSION_NAME = "kubernetes";
@Inject
private Instance<ServiceLoader> serviceLoader;
@Inject
@ApplicationScoped
private InstanceProducer<Configuration> configurationProducer;
public void configure(@Observes ArquillianDescriptor arquillian) {
ConfigurationFactory configurationFactory = serviceLoader.get().onlyOne(ConfigurationFactory.class);
configurationProducer.set(configurationFactory.create(arquillian));
}
}
代码示例来源:origin: org.arquillian.cube/arquillian-cube-kubernetes
public class DependencyResolverRegistar {
@Inject @ApplicationScoped
InstanceProducer<DependencyResolver> dependencyResolver;
@Inject
private Instance<ServiceLoader> serviceLoader;
public void install(@Observes(precedence = 100) Configuration configuration) {
dependencyResolver.set(serviceLoader.get().onlyOne(DependencyResolver.class, ShrinkwrapResolver.class));
}
}
代码示例来源:origin: org.arquillian.cube/arquillian-cube-core
public class ContainerCubeControllerCreator {
@Inject
@ApplicationScoped
private InstanceProducer<CubeController> cubeController;
@Inject
private Instance<Injector> injector;
public void createClientCubeController(@Observes BeforeSuite event) {
cubeController.set(injector.get().inject(new ContainerCubeController()));
}
}
代码示例来源:origin: org.arquillian.cube/arquillian-cube-kubernetes
public class AnnotationProviderRegistar {
@Inject @ApplicationScoped
InstanceProducer<AnnotationProvider> annotationProvider;
@Inject
private Instance<ServiceLoader> serviceLoader;
public void install(@Observes(precedence = 100) Configuration configuration) {
annotationProvider.set(serviceLoader.get().onlyOne(AnnotationProvider.class, DefaultAnnotationProvider.class));
}
}
代码示例来源:origin: org.arquillian.cube/arquillian-cube-kubernetes
public class LabelProviderRegistar {
@Inject @ApplicationScoped
InstanceProducer<LabelProvider> labelProvider;
@Inject
private Instance<ServiceLoader> serviceLoader;
public void install(@Observes(precedence = 100) Configuration configuration) {
labelProvider.set(serviceLoader.get().onlyOne(LabelProvider.class, DefaultLabelProvider.class));
}
}
代码示例来源:origin: org.arquillian.cube/arquillian-cube-kubernetes
public class ResourceInstallerRegistar {
@Inject @ApplicationScoped
InstanceProducer<ResourceInstaller> resourceInstaller;
@Inject
private Instance<ServiceLoader> serviceLoader;
public void install(@Observes(precedence = 100) Configuration configuration) {
resourceInstaller.set(serviceLoader.get().onlyOne(ResourceInstaller.class, DefaultResourceInstaller.class));
}
}
代码示例来源:origin: org.arquillian.cube/arquillian-cube-kubernetes
public class NamespaceServiceRegistar {
@Inject @ApplicationScoped
InstanceProducer<NamespaceService> namespaceService;
@Inject
private Instance<ServiceLoader> serviceLoader;
public void install(@Observes(precedence = 100) Configuration configuration) {
namespaceService.set(serviceLoader.get().onlyOne(NamespaceService.class, DefaultNamespaceService.class));
}
}
代码示例来源:origin: arquillian/arquillian-cube
public class AnnotationProviderRegistar {
@Inject @ApplicationScoped
InstanceProducer<AnnotationProvider> annotationProvider;
@Inject
private Instance<ServiceLoader> serviceLoader;
public void install(@Observes(precedence = 100) Configuration configuration) {
annotationProvider.set(serviceLoader.get().onlyOne(AnnotationProvider.class, DefaultAnnotationProvider.class));
}
}
代码示例来源:origin: arquillian/arquillian-cube
public class ClientCubeControllerCreator {
@Inject
@ApplicationScoped
private InstanceProducer<CubeController> cubeController;
@Inject
private Instance<Injector> injector;
public void createClientCubeController(@Observes CubeConfiguration event) {
cubeController.set(injector.get().inject(new ClientCubeController()));
}
}
代码示例来源:origin: org.arquillian.cube/arquillian-cube-kubernetes
public class KubernetesResourceLocatorRegistar {
@Inject @ApplicationScoped
InstanceProducer<KubernetesResourceLocator> kubernetesResourceLocator;
@Inject
private Instance<ServiceLoader> serviceLoader;
public void install(@Observes(precedence = 100) Configuration configuration) {
kubernetesResourceLocator.set(
serviceLoader.get().onlyOne(KubernetesResourceLocator.class, DefaultKubernetesResourceLocator.class));
}
}
代码示例来源:origin: org.arquillian.cube/arquillian-cube-docker
public class ContainerObjectFactoryRegistrar {
@Inject
@ApplicationScoped
private InstanceProducer<ContainerObjectFactory> producer;
@Inject
private Instance<Injector> injector;
public void createClientCubeController(@Observes CubeConfiguration event) {
producer.set(injector.get().inject(new DockerContainerObjectFactory()));
}
}
代码示例来源:origin: org.arquillian.cube.q/arquillian-cube-q-toxic
public class QNetworkChaosToxicCreator {
@Inject
@ApplicationScoped
private InstanceProducer<NetworkChaos> qInst;
@Inject
private Instance<Injector> injectorInstance;
public void createProxy(@Observes ToxiProxyScenario proxy) {
QNetworkChaosToxic qNetworkChaosToxic = new QNetworkChaosToxic(proxy);
injectorInstance.get().inject(qNetworkChaosToxic);
qInst.set(qNetworkChaosToxic);
}
}
代码示例来源:origin: org.jboss.arquillian.protocol/arquillian-protocol-servlet
public class ServletContextRegistrar {
@Inject
@ApplicationScoped
private InstanceProducer<ServletContext> servletContextInstanceProducer;
public void registerServletContext(@Observes ManagerStarted managerStarted) {
servletContextInstanceProducer.set(ServletTestRunner.getCurrentServletContext());
}
}
代码示例来源:origin: io.fabric8/fabric8-arquillian
public class ClientCreator {
@Inject
@ApplicationScoped
private InstanceProducer<KubernetesClient> kubernetesProducer;
public void createClient(@Observes Configuration config) {
kubernetesProducer.set(config.getKubernetesClient());
}
}
代码示例来源:origin: io.fabric8/fabric8-arquillian
public class ControllerCreator {
@Inject
@ApplicationScoped
private InstanceProducer<Controller> kubernetesControllerProducer;
public void createController(@Observes KubernetesClient client) {
//TODO: do something for this cast.
kubernetesControllerProducer.set(new Controller(client));
}
}
代码示例来源:origin: io.fabric8/fabric8-arquillian
public class LoggerFactory {
@Inject
@ApplicationScoped
private InstanceProducer<Logger> loggerPoducer;
public void createLogger(@Observes Configuration configuration) {
if (configuration.isAnsiLoggerEnabled()) {
loggerPoducer.set(new AnsiLogger());
} else {
loggerPoducer.set(new SimpleLogger());
}
}
}
代码示例来源:origin: arquillian/arquillian-core
public class ServletContextRegistrar {
@Inject
@ApplicationScoped
private InstanceProducer<ServletContext> servletContextInstanceProducer;
public void registerServletContext(@Observes ManagerStarted managerStarted) {
servletContextInstanceProducer.set(ServletTestRunner.getCurrentServletContext());
}
}
代码示例来源:origin: org.arquillian.cube/arquillian-cube-core
public class CubeConfigurator {
private static final String EXTENSION_NAME = "cube";
@Inject
@ApplicationScoped
private InstanceProducer<CubeConfiguration> configurationProducer;
//Add precedence -10 because we need that ContainerRegistry is available in the Arquillian scope.
public void configure(@Observes(precedence = -10) ArquillianDescriptor arquillianDescriptor) {
Map<String, String> config = arquillianDescriptor.extension(EXTENSION_NAME).getExtensionProperties();
CubeConfiguration cubeConfiguration = CubeConfiguration.fromMap(config);
configurationProducer.set(cubeConfiguration);
}
}
代码示例来源:origin: org.arquillian.cube/arquillian-cube-kubernetes
public class KubernetesAssistantCreator {
@Inject
@ApplicationScoped
private InstanceProducer<KubernetesAssistant> kubernetesAssistantInstanceProducer;
public void createKubernetesAssistant(@Observes KubernetesClient kubernetesClient) {
KubernetesAssistant kubernetesAssistant = new KubernetesAssistant(kubernetesClient, kubernetesClient.getNamespace());
kubernetesAssistantInstanceProducer.set(kubernetesAssistant);
}
}
内容来源于网络,如有侵权,请联系作者删除!