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

Java ContextNames类代码示例

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

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



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

示例1: startNeo4jDriverService

import org.jboss.as.naming.deployment.ContextNames; //导入依赖的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.deployment.ContextNames; //导入依赖的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.deployment.ContextNames; //导入依赖的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.deployment.ContextNames; //导入依赖的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.deployment.ContextNames; //导入依赖的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: addDataSourceListener

import org.jboss.as.naming.deployment.ContextNames; //导入依赖的package包/类
static void addDataSourceListener(
		final ServiceTarget serviceTarget,
		final VDBKey vdbKey,
		final String dsName) {
	final String jndiName = getJndiName(dsName);
	ServiceName dsListenerServiceName;
	try {
		dsListenerServiceName = TeiidServiceNames.dsListenerServiceName(vdbKey.getName(), vdbKey.getVersion(), dsName);
	} catch (InvalidServiceNameException e) {
		LogManager.logWarning(LogConstants.CTX_RUNTIME, e, e.getMessage());
		return;
	}
	ContextNames.BindInfo bindInfo = ContextNames.bindInfoFor(jndiName);
	final ServiceName svcName = bindInfo.getBinderServiceName();
	DataSourceListener dsl = new DataSourceListener(dsName, svcName, vdbKey);									
	ServiceBuilder<DataSourceListener> sb = serviceTarget.addService(dsListenerServiceName, dsl);
	sb.addDependency(svcName);
	sb.addDependency(TeiidServiceNames.VDB_STATUS_CHECKER, VDBStatusChecker.class, dsl.vdbStatusCheckInjector);
	sb.setInitialMode(Mode.PASSIVE).install();
}
 
开发者ID:kenweezy,项目名称:teiid,代码行数:21,代码来源:VDBDeployer.java


示例7: performRuntime

import org.jboss.as.naming.deployment.ContextNames; //导入依赖的package包/类
@Override
  protected void performRuntime(OperationContext context, ModelNode operation, ModelNode model) {

      final ModelNode address = operation.require(OP_ADDR);
      final PathAddress pathAddress = PathAddress.pathAddress(address);

  	String transportName = pathAddress.getLastElement().getValue();

  	final ServiceRegistry serviceRegistry = context.getServiceRegistry(true);
  	
  	ServiceName serviceName = TeiidServiceNames.transportServiceName(transportName);
final ServiceController<?> controller = serviceRegistry.getService(serviceName);
if (controller != null) {
	TransportService transport = TransportService.class.cast(controller.getValue());
	
	if (transport.isEmbedded()) {
		final ContextNames.BindInfo bindInfo = ContextNames.bindInfoFor(LocalServerConnection.jndiNameForRuntime(transportName));
		context.removeService(bindInfo.getBinderServiceName());
		context.removeService(TeiidServiceNames.embeddedTransportServiceName(transportName).append("reference-factory")); //$NON-NLS-1$
	}
	context.removeService(serviceName);
}
  }
 
开发者ID:kenweezy,项目名称:teiid,代码行数:24,代码来源:TransportRemove.java


示例8: testCamelSpringDeploymentWaitsForJndiBindings

import org.jboss.as.naming.deployment.ContextNames; //导入依赖的package包/类
@Test
public void testCamelSpringDeploymentWaitsForJndiBindings() {
    CamelContext camelctx = contextRegistry.getCamelContext("jndi-binding-spring-context");
    Assert.assertNotNull("Expected jndi-binding-spring-context to not be null", camelctx);
    Assert.assertEquals(ServiceStatus.Started, camelctx.getStatus());

    ContextNames.BindInfo bindInfo = bindInfoFor("java:/spring/binding/test");
    ServiceName serviceName = bindInfo.getBinderServiceName();
    ServiceController<?> controller = serviceContainer.getService(serviceName);

    Assert.assertNotNull("Expected controller to not be null", controller);
    ManagedReferenceFactory referenceFactory = (ManagedReferenceFactory) controller.getValue();
    DelayedBinderService binderService = (DelayedBinderService) referenceFactory.getReference().getInstance();

    // Make sure the DelayedBinderService did sleep
    Assert.assertTrue("Expected DelayedBinderService.getSleepStart() to be > 0", binderService.getSleepStart() > 0);

    // Verify that the camel context waited for the binding service to finish starting
    CamelContextStartupEventNotifier notifier = (CamelContextStartupEventNotifier) camelctx.getRegistry().lookupByName("contextStartupEventNotifier");
    long startupDelay = notifier.getStartupTime() - binderService.getSleepStart();
    Assert.assertTrue(startupDelay >= binderService.getSleepDelay());
}
 
开发者ID:wildfly-extras,项目名称:wildfly-camel,代码行数:23,代码来源:SpringContextBindingDependenciesTest.java


示例9: createProcessEngineJndiBinding

import org.jboss.as.naming.deployment.ContextNames; //导入依赖的package包/类
protected void createProcessEngineJndiBinding(StartContext context) {
  
  final ProcessEngineManagedReferenceFactory managedReferenceFactory = new ProcessEngineManagedReferenceFactory(processEngine);
  
  final ServiceName processEngineServiceBindingServiceName = ContextNames.GLOBAL_CONTEXT_SERVICE_NAME            
      .append(BpmPlatform.APP_JNDI_NAME)
      .append(BpmPlatform.MODULE_JNDI_NAME)
      .append(processEngine.getName());
  
  final String jndiName = BpmPlatform.JNDI_NAME_PREFIX 
      + "/" + BpmPlatform.APP_JNDI_NAME 
      + "/" + BpmPlatform.MODULE_JNDI_NAME 
      + "/" +processEngine.getName();

  // bind process engine service
  bindingService = BindingUtil.createJndiBindings(context.getChildTarget(), processEngineServiceBindingServiceName, jndiName, managedReferenceFactory);

  // log info message
  LOGG.info("jndi binding for process engine " + processEngine.getName() + " is " + jndiName);
}
 
开发者ID:camunda,项目名称:camunda-bpm-platform,代码行数:21,代码来源:MscManagedProcessEngine.java


示例10: initializeServiceBuilder

import org.jboss.as.naming.deployment.ContextNames; //导入依赖的package包/类
public static void initializeServiceBuilder(ManagedProcessEngineMetadata processEngineConfiguration, MscManagedProcessEngineController service,
        ServiceBuilder<ProcessEngine> serviceBuilder, String jobExecutorName) {

  ContextNames.BindInfo datasourceBindInfo = ContextNames.bindInfoFor(processEngineConfiguration.getDatasourceJndiName());
  serviceBuilder.addDependency(ServiceName.JBOSS.append("txn").append("TransactionManager"), TransactionManager.class, service.getTransactionManagerInjector())
    .addDependency(datasourceBindInfo.getBinderServiceName(), DataSourceReferenceFactoryService.class, service.getDatasourceBinderServiceInjector())
    .addDependency(ServiceNames.forMscRuntimeContainerDelegate(), MscRuntimeContainerDelegate.class, service.getRuntimeContainerDelegateInjector())
    .addDependency(ServiceNames.forMscRuntimeContainerJobExecutorService(jobExecutorName), MscRuntimeContainerJobExecutor.class, service.getMscRuntimeContainerJobExecutorInjector())
    .addDependency(ServiceNames.forMscExecutorService())
    .setInitialMode(Mode.ACTIVE);

  if(processEngineConfiguration.isDefault()) {
    serviceBuilder.addAliases(ServiceNames.forDefaultProcessEngine());
  }

  JBossCompatibilityExtension.addServerExecutorDependency(serviceBuilder, service.getExecutorInjector(), false);

}
 
开发者ID:camunda,项目名称:camunda-bpm-platform,代码行数:19,代码来源:MscManagedProcessEngineController.java


示例11: createJndiBindings

import org.jboss.as.naming.deployment.ContextNames; //导入依赖的package包/类
protected void createJndiBindings() {

    final PlatformServiceReferenceFactory managedReferenceFactory = new PlatformServiceReferenceFactory(this);

    final ServiceName processEngineServiceBindingServiceName = ContextNames.GLOBAL_CONTEXT_SERVICE_NAME
      .append(BpmPlatform.APP_JNDI_NAME)
      .append(BpmPlatform.MODULE_JNDI_NAME)
      .append(BpmPlatform.PROCESS_ENGINE_SERVICE_NAME);

    // bind process engine service
    BindingUtil.createJndiBindings(childTarget, processEngineServiceBindingServiceName, BpmPlatform.PROCESS_ENGINE_SERVICE_JNDI_NAME, managedReferenceFactory);

    final ServiceName processApplicationServiceBindingServiceName = ContextNames.GLOBAL_CONTEXT_SERVICE_NAME
        .append(BpmPlatform.APP_JNDI_NAME)
        .append(BpmPlatform.MODULE_JNDI_NAME)
        .append(BpmPlatform.PROCESS_APPLICATION_SERVICE_NAME);

    // bind process application service
    BindingUtil.createJndiBindings(childTarget, processApplicationServiceBindingServiceName, BpmPlatform.PROCESS_APPLICATION_SERVICE_JNDI_NAME, managedReferenceFactory);

  }
 
开发者ID:camunda,项目名称:camunda-bpm-platform,代码行数:22,代码来源:MscRuntimeContainerDelegate.java


示例12: startCassandraDriverService

import org.jboss.as.naming.deployment.ContextNames; //导入依赖的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


示例13: startMongoDriverService

import org.jboss.as.naming.deployment.ContextNames; //导入依赖的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


示例14: activate

import org.jboss.as.naming.deployment.ContextNames; //导入依赖的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


示例15: activate

import org.jboss.as.naming.deployment.ContextNames; //导入依赖的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


示例16: removeServices

import org.jboss.as.naming.deployment.ContextNames; //导入依赖的package包/类
@Override
protected void removeServices(OperationContext context, ServiceName parentService, ModelNode parentModel)
        throws OperationFailedException {
    super.removeServices(context, parentService, parentModel);
    String jndiName = DatenpumpeAdd.getJndiName(parentModel, context);
    final ContextNames.BindInfo bindInfo = ContextNames.bindInfoFor(jndiName);
    context.removeService(bindInfo.getBinderServiceName());
}
 
开发者ID:mp911de,项目名称:logstash-gelf-subsystem,代码行数:9,代码来源:DatenpumpeWriteAttributeHandler.java


示例17: performRuntime

import org.jboss.as.naming.deployment.ContextNames; //导入依赖的package包/类
@Override
protected void performRuntime(OperationContext context, ModelNode operation, ModelNode model)
        throws OperationFailedException {

    String jndiName = model.get("jndi-name").asString();
    ContextNames.BindInfo bindInfo = ContextNames.bindInfoFor(jndiName);
    ServiceName name = bindInfo.getBinderServiceName();
    context.removeService(name);
}
 
开发者ID:mp911de,项目名称:logstash-gelf-subsystem,代码行数:10,代码来源:GenericRemove.java


示例18: removeBinderService

import org.jboss.as.naming.deployment.ContextNames; //导入依赖的package包/类
private ServiceController<?> removeBinderService(String name) {
    final ContextNames.BindInfo bindInfo = ContextNames.bindInfoFor(name);
    ServiceController<?> controller = serviceRegistry.getService(bindInfo.getBinderServiceName());
    if (controller != null) {
        controller.setMode(Mode.REMOVE);
    }
    return controller;
}
 
开发者ID:wildfly-extras,项目名称:wildfly-camel,代码行数:9,代码来源:NamingContextAssociationHandler.java


示例19: activate

import org.jboss.as.naming.deployment.ContextNames; //导入依赖的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


示例20: createJndiBindings

import org.jboss.as.naming.deployment.ContextNames; //导入依赖的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



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
Java Portlet类代码示例发布时间:2022-05-23
下一篇:
Java Property类代码示例发布时间: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