• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

Java ServiceBasedNamingStore类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Java中org.jboss.as.naming.ServiceBasedNamingStore的典型用法代码示例。如果您正苦于以下问题:Java ServiceBasedNamingStore类的具体用法?Java ServiceBasedNamingStore怎么用?Java ServiceBasedNamingStore使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



ServiceBasedNamingStore类属于org.jboss.as.naming包,在下文中一共展示了ServiceBasedNamingStore类的12个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: startNeo4jDriverService

import org.jboss.as.naming.ServiceBasedNamingStore; //导入依赖的package包/类
private void startNeo4jDriverService(OperationContext context, ConfigurationBuilder builder, final Set<String> outboundSocketBindings) throws OperationFailedException {
    if (builder.getJNDIName() != null && builder.getJNDIName().length() > 0) {
        final Neo4jClientConnectionService neo4jClientConnectionService = new Neo4jClientConnectionService(builder);
        final ServiceName serviceName = ConnectionServiceAccess.serviceName(builder.getDescription());
        final ContextNames.BindInfo bindingInfo = ContextNames.bindInfoFor(builder.getJNDIName());

        final BinderService binderService = new BinderService(bindingInfo.getBindName());
        context.getServiceTarget().addService(bindingInfo.getBinderServiceName(), binderService)
                .addDependency(Neo4jSubsystemService.serviceName())
                .addDependency(bindingInfo.getParentContextServiceName(), ServiceBasedNamingStore.class, binderService.getNamingStoreInjector())
                .addDependency(serviceName, Neo4jClientConnectionService.class, new Injector<Neo4jClientConnectionService>() {
                    @Override
                    public void inject(final Neo4jClientConnectionService value) throws
                            InjectionException {
                        binderService.getManagedObjectInjector().inject(new ValueManagedReferenceFactory(new ImmediateValue<>(value.getDriver())));
                    }

                    @Override
                    public void uninject() {
                        binderService.getNamingStoreInjector().uninject();
                    }
                }).install();

        final ServiceBuilder<Neo4jClientConnectionService> serviceBuilder = context.getServiceTarget().addService(serviceName, neo4jClientConnectionService);
        serviceBuilder.addDependency(Neo4jSubsystemService.serviceName(), new CastingInjector<>(neo4jClientConnectionService.getNeo4jSubsystemServiceInjectedValue(), Neo4jSubsystemService.class));
        // add service dependency on each separate hostname/port reference in standalone*.xml referenced from this driver profile definition.
        for (final String outboundSocketBinding : outboundSocketBindings) {
            final ServiceName outboundSocketBindingDependency = context.getCapabilityServiceName(Neo4jDriverDefinition.OUTBOUND_SOCKET_BINDING_CAPABILITY_NAME, outboundSocketBinding, OutboundSocketBinding.class);
            serviceBuilder.addDependency(ServiceBuilder.DependencyType.REQUIRED, outboundSocketBindingDependency, OutboundSocketBinding.class, neo4jClientConnectionService.getOutboundSocketBindingInjector(outboundSocketBinding));
        }
        if (builder.getSecurityDomain() != null) {
            serviceBuilder.addDependency(SubjectFactoryService.SERVICE_NAME, SubjectFactory.class,
                    neo4jClientConnectionService.getSubjectFactoryInjector());
        }

        serviceBuilder.setInitialMode(ServiceController.Mode.ACTIVE).install();
    }
}
 
开发者ID:wildfly,项目名称:wildfly-nosql,代码行数:39,代码来源:Neo4jDefinition.java


示例2: bindJndi

import org.jboss.as.naming.ServiceBasedNamingStore; //导入依赖的package包/类
private <T> void bindJndi(OperationContext context, ServiceName serviceName, String jndiName, Class<T> clazz) {
    ContextNames.BindInfo bindInfo = ContextNames.bindInfoFor(jndiName);
    BinderService binderService = new BinderService(bindInfo.getBindName());
    context.getServiceTarget().addService(bindInfo.getBinderServiceName(), binderService)
            .addDependency(OrientSubsystemService.SERVICE_NAME)
            .addDependency(bindInfo.getParentContextServiceName(), ServiceBasedNamingStore.class,
                    binderService.getNamingStoreInjector())
            .addDependency(serviceName, OrientClientConnectionsService.class,
                    new Injector<OrientClientConnectionsService>() {
                        @Override
                        public void inject(final OrientClientConnectionsService value) throws InjectionException {
                            binderService.getManagedObjectInjector().inject(
                                    new ValueManagedReferenceFactory(new ImmediateValue<>(value.unwrap(clazz))));
                        }

                        @Override
                        public void uninject() {
                            binderService.getNamingStoreInjector().uninject();
                        }
                    })
            .install();
}
 
开发者ID:wildfly,项目名称:wildfly-nosql,代码行数:23,代码来源:OrientDefinition.java


示例3: activate

import org.jboss.as.naming.ServiceBasedNamingStore; //导入依赖的package包/类
@Override
public void activate(ServiceActivatorContext context) throws ServiceRegistryException {
    ServiceTarget target = context.getServiceTarget();

    target.addService(TopologyManager.SERVICE_NAME, new ValueService<>(new ImmediateValue<>(TopologyManager.INSTANCE)))
            .install();

    BinderService binderService = new BinderService(Topology.JNDI_NAME, null, true);

    target.addService(ContextNames.buildServiceName(ContextNames.JBOSS_CONTEXT_SERVICE_NAME, Topology.JNDI_NAME), binderService)
            .addDependency(ContextNames.JBOSS_CONTEXT_SERVICE_NAME, ServiceBasedNamingStore.class, binderService.getNamingStoreInjector())
            .addInjection(binderService.getManagedObjectInjector(), new ImmediateManagedReferenceFactory(TopologyManager.INSTANCE))
            .setInitialMode(ServiceController.Mode.ACTIVE)
            .install();

}
 
开发者ID:wildfly-swarm-archive,项目名称:wildfly-swarm-topology,代码行数:17,代码来源:TopologyManagerActivator.java


示例4: activate

import org.jboss.as.naming.ServiceBasedNamingStore; //导入依赖的package包/类
@Override
public void activate(ServiceActivatorContext context) throws ServiceRegistryException {
    ServiceTarget target = context.getServiceTarget();

    TopologyManager.INSTANCE.setServiceTarget(target);

    target.addService(SERVICE_NAME, new ValueService<>(new ImmediateValue<>(TopologyManager.INSTANCE)))
            .install();

    BinderService binderService = new BinderService(Topology.JNDI_NAME, null, true);

    target.addService(ContextNames.buildServiceName(ContextNames.JBOSS_CONTEXT_SERVICE_NAME, Topology.JNDI_NAME), binderService)
            .addDependency(ContextNames.JBOSS_CONTEXT_SERVICE_NAME, ServiceBasedNamingStore.class, binderService.getNamingStoreInjector())
            .addInjection(binderService.getManagedObjectInjector(), new ImmediateManagedReferenceFactory(TopologyManager.INSTANCE))
            .setInitialMode(ServiceController.Mode.ACTIVE)
            .install();

}
 
开发者ID:wildfly-swarm,项目名称:wildfly-swarm,代码行数:19,代码来源:TopologyManagerActivator.java


示例5: activate

import org.jboss.as.naming.ServiceBasedNamingStore; //导入依赖的package包/类
@Override
public void activate(ServiceActivatorContext serviceActivatorContext) throws ServiceRegistryException {

    ServiceTarget target = serviceActivatorContext.getServiceTarget();

    MetricsService service = new MetricsService();
    ServiceBuilder<MetricsService> metricsServiceBuilder = target.addService(MetricsService.SERVICE_NAME, service);

    RegistryFactory factory = new RegistryFactoryImpl();

    ServiceBuilder<MetricsService> serviceBuilder = metricsServiceBuilder
            .addDependency(ServerEnvironmentService.SERVICE_NAME, ServerEnvironment.class, service.getServerEnvironmentInjector())
            .addDependency(ServiceName.parse("jboss.eclipse.microprofile.config.config-provider"))
            .addDependency(Services.JBOSS_SERVER_CONTROLLER, ModelController.class, service.getModelControllerInjector());

    serviceBuilder.setInitialMode(ServiceController.Mode.ACTIVE)
            .install();

    BinderService binderService = new BinderService(SWARM_MP_METRICS, null, true);

    target.addService(ContextNames.buildServiceName(ContextNames.JBOSS_CONTEXT_SERVICE_NAME, SWARM_MP_METRICS), binderService)
            .addDependency(ContextNames.JBOSS_CONTEXT_SERVICE_NAME, ServiceBasedNamingStore.class, binderService.getNamingStoreInjector())
            .addInjection(binderService.getManagedObjectInjector(), new ImmediateManagedReferenceFactory(factory))
            .setInitialMode(ServiceController.Mode.ACTIVE)
            .install();
}
 
开发者ID:wildfly-swarm,项目名称:wildfly-swarm,代码行数:27,代码来源:MetricsServiceActivator.java


示例6: startCassandraDriverService

import org.jboss.as.naming.ServiceBasedNamingStore; //导入依赖的package包/类
private void startCassandraDriverService(OperationContext context, ConfigurationBuilder builder, final Set<String> outboundSocketBindings) throws OperationFailedException {
    if (builder.getJNDIName() != null && builder.getJNDIName().length() > 0) {
        final CassandraClientConnectionsService cassandraClientConnectionsService = new CassandraClientConnectionsService(builder);
        final ServiceName serviceName = ConnectionServiceAccess.serviceName(builder.getDescription());
        final ContextNames.BindInfo bindingInfo = ContextNames.bindInfoFor(builder.getJNDIName());

        final BinderService binderService = new BinderService(bindingInfo.getBindName());
        context.getServiceTarget().addService(bindingInfo.getBinderServiceName(), binderService)
                .addDependency(CassandraSubsystemService.serviceName())
                .addDependency(bindingInfo.getParentContextServiceName(), ServiceBasedNamingStore.class, binderService.getNamingStoreInjector())
                .addDependency(serviceName, CassandraClientConnectionsService.class, new Injector<CassandraClientConnectionsService>() {
                    @Override
                    public void inject(final CassandraClientConnectionsService value) throws
                            InjectionException {
                        binderService.getManagedObjectInjector().inject(new ValueManagedReferenceFactory(new ImmediateValue<>(value.getSession() != null ? value.getSession() : value.getCluster())));
                    }

                    @Override
                    public void uninject() {
                        binderService.getNamingStoreInjector().uninject();
                    }
                }).install();

        final ServiceBuilder<CassandraClientConnectionsService> serviceBuilder = context.getServiceTarget().addService(serviceName, cassandraClientConnectionsService);
        serviceBuilder.addDependency(CassandraSubsystemService.serviceName(), new CastingInjector<>(cassandraClientConnectionsService.getCassandraSubsystemServiceInjectedValue(), CassandraSubsystemService.class));
        // add service dependency on each separate hostname/port reference in standalone*.xml referenced from this driver profile definition.
        for (final String outboundSocketBinding : outboundSocketBindings) {
            final ServiceName outboundSocketBindingDependency = context.getCapabilityServiceName(CassandraDriverDefinition.OUTBOUND_SOCKET_BINDING_CAPABILITY_NAME, outboundSocketBinding, OutboundSocketBinding.class);
            serviceBuilder.addDependency(ServiceBuilder.DependencyType.REQUIRED, outboundSocketBindingDependency, OutboundSocketBinding.class, cassandraClientConnectionsService.getOutboundSocketBindingInjector(outboundSocketBinding));
        }

        if (builder.getSecurityDomain() != null) {
            serviceBuilder.addDependency(SubjectFactoryService.SERVICE_NAME, SubjectFactory.class,
                    cassandraClientConnectionsService.getSubjectFactoryInjector());
        }

        serviceBuilder.setInitialMode(ServiceController.Mode.ACTIVE).install();
    }
}
 
开发者ID:wildfly,项目名称:wildfly-nosql,代码行数:40,代码来源:CassandraDefinition.java


示例7: startMongoDriverService

import org.jboss.as.naming.ServiceBasedNamingStore; //导入依赖的package包/类
private void startMongoDriverService(OperationContext context, ConfigurationBuilder builder, Set<String> outboundSocketBindings) {
    if (builder.getJNDIName() != null && builder.getJNDIName().length() > 0) {
        final MongoClientConnectionsService mongoClientConnectionsService = new MongoClientConnectionsService(builder);
        final ServiceName serviceName = ConnectionServiceAccess.serviceName(builder.getDescription());
        final ContextNames.BindInfo bindingInfo = ContextNames.bindInfoFor(builder.getJNDIName());

        final BinderService binderService = new BinderService(bindingInfo.getBindName());

        context.getServiceTarget().addService(bindingInfo.getBinderServiceName(), binderService)
                .addDependency(MongoSubsystemService.serviceName())
                .addDependency(bindingInfo.getParentContextServiceName(), ServiceBasedNamingStore.class, binderService.getNamingStoreInjector())
                .addDependency(serviceName, MongoClientConnectionsService.class, new Injector<MongoClientConnectionsService>() {
                    @Override
                    public void inject(final MongoClientConnectionsService value) throws
                            InjectionException {
                        binderService.getManagedObjectInjector().inject(new ValueManagedReferenceFactory(new ImmediateValue<>(value.getDatabase() != null ? value.getDatabase() : value.getClient())));
                    }

                    @Override
                    public void uninject() {
                        binderService.getNamingStoreInjector().uninject();
                    }
                }).install();
        final ServiceBuilder<MongoClientConnectionsService> serviceBuilder = context.getServiceTarget().addService(serviceName, mongoClientConnectionsService);
        serviceBuilder.addDependency(MongoSubsystemService.serviceName(), new CastingInjector<>(mongoClientConnectionsService.getMongoSubsystemServiceInjectedValue(), MongoSubsystemService.class));
        // add service dependency on each separate hostname/port reference in standalone*.xml referenced from this driver profile definition.
        for (final String outboundSocketBinding : outboundSocketBindings) {
            final ServiceName outboundSocketBindingDependency = context.getCapabilityServiceName(OUTBOUND_SOCKET_BINDING_CAPABILITY_NAME, outboundSocketBinding, OutboundSocketBinding.class);
            serviceBuilder.addDependency(ServiceBuilder.DependencyType.REQUIRED, outboundSocketBindingDependency, OutboundSocketBinding.class, mongoClientConnectionsService.getOutboundSocketBindingInjector(outboundSocketBinding));
        }
        if (builder.getSecurityDomain() != null) {
            serviceBuilder.addDependency(SubjectFactoryService.SERVICE_NAME, SubjectFactory.class,
                    mongoClientConnectionsService.getSubjectFactoryInjector());
        }
        serviceBuilder.setInitialMode(ServiceController.Mode.ACTIVE).install();
    }
}
 
开发者ID:wildfly,项目名称:wildfly-nosql,代码行数:38,代码来源:MongoDefinition.java


示例8: activate

import org.jboss.as.naming.ServiceBasedNamingStore; //导入依赖的package包/类
@Override
public void activate(ServiceActivatorContext context) throws ServiceRegistryException {
    Optional<String> securityRealm = Optional.empty();

    if (!healthFractionInstance.isUnsatisfied()) {
        securityRealm = healthFractionInstance.get().securityRealm();
    }

    ServiceTarget target = context.getServiceTarget();

    MonitorService service = new MonitorService(securityRealm);

    ServiceBuilder<MonitorService> monitorServiceServiceBuilder = target.addService(MonitorService.SERVICE_NAME, service);

    ServiceBuilder<MonitorService> serviceBuilder = monitorServiceServiceBuilder
            .addDependency(ServerEnvironmentService.SERVICE_NAME, ServerEnvironment.class, service.getServerEnvironmentInjector())
            .addDependency(Services.JBOSS_SERVER_CONTROLLER, ModelController.class, service.getModelControllerInjector());

    if (securityRealm.isPresent()) { // configured through the fraction interface
        serviceBuilder.addDependency(
                createRealmName(securityRealm.get()),
                SecurityRealm.class,
                service.getSecurityRealmInjector()
        );
    }

    serviceBuilder.setInitialMode(ServiceController.Mode.ACTIVE)
            .install();

    BinderService binderService = new BinderService(Monitor.JNDI_NAME, null, true);

    target.addService(ContextNames.buildServiceName(ContextNames.JBOSS_CONTEXT_SERVICE_NAME, Monitor.JNDI_NAME), binderService)
            .addDependency(ContextNames.JBOSS_CONTEXT_SERVICE_NAME, ServiceBasedNamingStore.class, binderService.getNamingStoreInjector())
            .addInjection(binderService.getManagedObjectInjector(), new ImmediateManagedReferenceFactory(service))
            .setInitialMode(ServiceController.Mode.ACTIVE)
            .install();

}
 
开发者ID:wildfly-swarm,项目名称:wildfly-swarm,代码行数:39,代码来源:MonitorServiceActivator.java


示例9: activate

import org.jboss.as.naming.ServiceBasedNamingStore; //导入依赖的package包/类
@Override
public void activate(ServiceActivatorContext context) throws ServiceRegistryException {
    Optional<String> securityRealm = Optional.empty();

    if (!monitorFractionInstance.isUnsatisfied()) {
        securityRealm = monitorFractionInstance.get().securityRealm();
    }

    ServiceTarget target = context.getServiceTarget();

    MonitorService service = new MonitorService(securityRealm);

    ServiceBuilder<MonitorService> monitorServiceServiceBuilder = target.addService(MonitorService.SERVICE_NAME, service);

    ServiceBuilder<MonitorService> serviceBuilder = monitorServiceServiceBuilder
            .addDependency(ServerEnvironmentService.SERVICE_NAME, ServerEnvironment.class, service.getServerEnvironmentInjector())
            .addDependency(Services.JBOSS_SERVER_CONTROLLER, ModelController.class, service.getModelControllerInjector());

    if (securityRealm.isPresent()) { // configured through the fraction interface
        serviceBuilder.addDependency(
                createRealmName(securityRealm.get()),
                SecurityRealm.class,
                service.getSecurityRealmInjector()
        );
    }

    serviceBuilder.setInitialMode(ServiceController.Mode.ACTIVE)
            .install();

    BinderService binderService = new BinderService(Monitor.JNDI_NAME, null, true);

    target.addService(ContextNames.buildServiceName(ContextNames.JBOSS_CONTEXT_SERVICE_NAME, Monitor.JNDI_NAME), binderService)
            .addDependency(ContextNames.JBOSS_CONTEXT_SERVICE_NAME, ServiceBasedNamingStore.class, binderService.getNamingStoreInjector())
            .addInjection(binderService.getManagedObjectInjector(), new ImmediateManagedReferenceFactory(service))
            .setInitialMode(ServiceController.Mode.ACTIVE)
            .install();

}
 
开发者ID:wildfly-swarm,项目名称:wildfly-swarm,代码行数:39,代码来源:MonitorServiceActivator.java


示例10: activate

import org.jboss.as.naming.ServiceBasedNamingStore; //导入依赖的package包/类
@Override
public void activate(ServiceActivatorContext context) throws ServiceRegistryException {
    BindInfo bindInfo = ContextNames.bindInfoFor("java:/spring/binding/test");
    DelayedBinderService service = new DelayedBinderService(bindInfo.getBindName());
    ManagedReferenceFactory managedReferenceFactory = new ImmediateManagedReferenceFactory(service);

    ServiceTarget serviceTarget = context.getServiceTarget();
    serviceTarget.addService(bindInfo.getBinderServiceName(), service)
        .addInjection(service.getManagedObjectInjector(), managedReferenceFactory)
        .addDependency(bindInfo.getParentContextServiceName(), ServiceBasedNamingStore.class, service.getNamingStoreInjector())
        .install();
}
 
开发者ID:wildfly-extras,项目名称:wildfly-camel,代码行数:13,代码来源:DelayedBinderServiceActivator.java


示例11: createJndiBindings

import org.jboss.as.naming.ServiceBasedNamingStore; //导入依赖的package包/类
public static ServiceController<ManagedReferenceFactory> createJndiBindings(ServiceTarget target, ServiceName serviceName, String binderServiceName,  ManagedReferenceFactory managedReferenceFactory) {

    BinderService binderService = new BinderService(binderServiceName);
    ServiceBuilder<ManagedReferenceFactory> serviceBuilder = target
            .addService(serviceName, binderService)
            .addDependency(ContextNames.GLOBAL_CONTEXT_SERVICE_NAME, ServiceBasedNamingStore.class, binderService.getNamingStoreInjector());
    binderService.getManagedObjectInjector().inject(managedReferenceFactory);
            
    return serviceBuilder.install();
  }
 
开发者ID:camunda,项目名称:camunda-bpm-platform,代码行数:11,代码来源:BindingUtil.java


示例12: activate

import org.jboss.as.naming.ServiceBasedNamingStore; //导入依赖的package包/类
@Override
public void activate(ServiceActivatorContext context) throws ServiceRegistryException {

    ServiceTarget target = context.getServiceTarget();

    BraveService service = new BraveService(zipKinFractionInstance.get().getBraveInstance());

    ServiceBuilder<BraveService> serviceBuilder = target.addService(BraveService.SERVICE_NAME, service);

    serviceBuilder.setInitialMode(ServiceController.Mode.ACTIVE).install();

    BinderService binderService = new BinderService(BraveLookup.JNDI_NAME, null, true);

    target.addService(ContextNames.buildServiceName(ContextNames.JBOSS_CONTEXT_SERVICE_NAME, BraveLookup.JNDI_NAME), binderService)
            .addDependency(ContextNames.JBOSS_CONTEXT_SERVICE_NAME, ServiceBasedNamingStore.class, binderService.getNamingStoreInjector())
            .addInjection(binderService.getManagedObjectInjector(), new ImmediateManagedReferenceFactory(service))
            .setInitialMode(ServiceController.Mode.ACTIVE)
            .install();

}
 
开发者ID:wildfly-swarm,项目名称:wildfly-swarm,代码行数:21,代码来源:BraveServiceActivator.java



注:本文中的org.jboss.as.naming.ServiceBasedNamingStore类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java CommonsTestHelper类代码示例发布时间:2022-05-23
下一篇:
Java ModelProperties类代码示例发布时间:2022-05-23
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap