private BindInfo(final ServiceName parentContextServiceName, final String bindName) { this.parentContextServiceName = parentContextServiceName; this.binderServiceName = buildServiceName(parentContextServiceName, bindName); this.bindName = bindName; this.absoluteJndiName = this.generateAbsoluteJndiName(); }
/** * <p> * Adds a {@code BinderService} to the specified target. The service binds the specified value to JNDI under the * {@code java:/jboss/contextName} context. * </p> * * @param target the {@code ServiceTarget} where the service will be added. * @param contextName the JNDI context name where the value will be bound. * @param value the value to be bound. */ public static void bindObject(final ServiceTarget target, final String contextName, final Object value) { final BinderService binderService = new BinderService(contextName); binderService.getManagedObjectInjector().inject(new ValueManagedReferenceFactory(Values.immediateValue(value))); target.addService(ContextNames.buildServiceName(ContextNames.JBOSS_CONTEXT_SERVICE_NAME, contextName), binderService) .addDependency(ContextNames.JBOSS_CONTEXT_SERVICE_NAME, ServiceBasedNamingStore.class, binderService.getNamingStoreInjector()) .install(); } }
private void setupPolicyRegistration(final StartContext context) { ServiceTarget target = context.getChildTarget(); final BinderService binderService = new BinderService(POLICY_REGISTRATION); binderService.getManagedObjectInjector().inject(new ValueManagedReferenceFactory( Values.immediateValue(new JBossPolicyRegistration()))); target.addService(ContextNames.buildServiceName(ContextNames.JAVA_CONTEXT_SERVICE_NAME, POLICY_REGISTRATION), binderService) .addDependency(ContextNames.JAVA_CONTEXT_SERVICE_NAME, ServiceBasedNamingStore.class, binderService.getNamingStoreInjector()) .install(); }
private BindInfo(final ServiceName parentContextServiceName, final String bindName) { this.parentContextServiceName = parentContextServiceName; this.binderServiceName = buildServiceName(parentContextServiceName, bindName); this.bindName = bindName; this.absoluteJndiName = this.generateAbsoluteJndiName(); }
private BindInfo(final ServiceName parentContextServiceName, final String bindName) { this.parentContextServiceName = parentContextServiceName; this.binderServiceName = buildServiceName(parentContextServiceName, bindName); this.bindName = bindName; this.absoluteJndiName = this.generateAbsoluteJndiName(); }
private BindInfo(final ServiceName parentContextServiceName, final String bindName) { this.parentContextServiceName = parentContextServiceName; this.binderServiceName = buildServiceName(parentContextServiceName, bindName); this.bindName = bindName; this.absoluteJndiName = this.generateAbsoluteJndiName(); }
@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(); } }
/** * <p> * Adds a {@code BinderService} to the specified target. The service binds the specified value to JNDI under the * {@code java:/jboss/contextName} context. * </p> * * @param target the {@code ServiceTarget} where the service will be added. * @param contextName the JNDI context name where the value will be bound. * @param value the value to be bound. */ public static void bindObject(final ServiceTarget target, final String contextName, final Object value) { final BinderService binderService = new BinderService(contextName); binderService.getManagedObjectInjector().inject(new ValueManagedReferenceFactory(Values.immediateValue(value))); target.addService(ContextNames.buildServiceName(ContextNames.JBOSS_CONTEXT_SERVICE_NAME, contextName), binderService) .addDependency(ContextNames.JBOSS_CONTEXT_SERVICE_NAME, ServiceBasedNamingStore.class, binderService.getNamingStoreInjector()) .install(); } }
@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(); }
@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(); } }
@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(); } }
@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(); }
/** * <p> * Adds a {@code BinderService} to the specified target. The service binds the specified value to JNDI under the * {@code java:/jboss/contextName} context. * </p> * * @param target the {@code ServiceTarget} where the service will be added. * @param contextName the JNDI context name where the value will be bound. * @param value the value to be bound. */ public static void bindObject(final ServiceTarget target, final String contextName, final Object value) { final BinderService binderService = new BinderService(contextName); target.addService(ContextNames.buildServiceName(ContextNames.JBOSS_CONTEXT_SERVICE_NAME, contextName), binderService) .addDependency(ContextNames.JBOSS_CONTEXT_SERVICE_NAME, ServiceBasedNamingStore.class, binderService.getNamingStoreInjector()) .addInjection(binderService.getManagedObjectInjector(), new ValueManagedReferenceFactory( Values.immediateValue(value))) .setInitialMode(ServiceController.Mode.ACTIVE) .install(); } }
private void setupPolicyRegistration(final StartContext context) { ServiceTarget target = context.getChildTarget(); final BinderService binderService = new BinderService(POLICY_REGISTRATION); target.addService(ContextNames.buildServiceName(ContextNames.JAVA_CONTEXT_SERVICE_NAME, POLICY_REGISTRATION), binderService) .addDependency(ContextNames.JAVA_CONTEXT_SERVICE_NAME, ServiceBasedNamingStore.class, binderService.getNamingStoreInjector()) .addInjection(binderService.getManagedObjectInjector(), new ValueManagedReferenceFactory( Values.immediateValue(new JBossPolicyRegistration()))) .setInitialMode(ServiceController.Mode.ACTIVE) .install(); }
@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(); }
context.getServiceTarget().addService(ContextNames.buildServiceName(ContextNames.JBOSS_CONTEXT_SERVICE_NAME, "swarm/stage-config"), binderService) .addDependency(ContextNames.JBOSS_CONTEXT_SERVICE_NAME, ServiceBasedNamingStore.class, binderService.getNamingStoreInjector()) .addInjection(binderService.getManagedObjectInjector(), new ImmediateManagedReferenceFactory(new StageConfig(enabledStage.get())))