use of org.jboss.as.naming.service.BinderService in project wildfly by wildfly.
the class EEConcurrentAbstractService method bindValueToJndi.
private void bindValueToJndi(final StartContext context) {
final ContextNames.BindInfo bindInfo = ContextNames.bindInfoFor(jndiName);
final BinderService binderService = new BinderService(bindInfo.getBindName());
final ImmediateManagedReferenceFactory managedReferenceFactory = new ImmediateManagedReferenceFactory(getValue());
context.getChildTarget().addService(bindInfo.getBinderServiceName(), binderService).addInjectionValue(binderService.getManagedObjectInjector(), new ImmediateValue<ManagedReferenceFactory>(managedReferenceFactory)).addDependency(bindInfo.getParentContextServiceName(), ServiceBasedNamingStore.class, binderService.getNamingStoreInjector()).install();
}
use of org.jboss.as.naming.service.BinderService in project wildfly by wildfly.
the class InApplicationClientBindingProcessor method bindServices.
private void bindServices(DeploymentUnit deploymentUnit, ServiceTarget serviceTarget, ServiceName contextServiceName) {
final ServiceName inAppClientServiceName = contextServiceName.append("InAppClientContainer");
BinderService inAppClientContainerService = new BinderService("InAppClientContainer");
serviceTarget.addService(inAppClientServiceName, inAppClientContainerService).addInjection(inAppClientContainerService.getManagedObjectInjector(), new ValueManagedReferenceFactory(Values.immediateValue(appclient))).addDependency(contextServiceName, ServiceBasedNamingStore.class, inAppClientContainerService.getNamingStoreInjector()).install();
deploymentUnit.addToAttachmentList(org.jboss.as.server.deployment.Attachments.JNDI_DEPENDENCIES, inAppClientServiceName);
}
use of org.jboss.as.naming.service.BinderService in project wildfly by wildfly.
the class IIOPJndiBindingProcessor method bindService.
/**
* Binds java:comp/ORB
*
* @param serviceTarget The service target
* @param contextServiceName The service name of the context to bind to
*/
private void bindService(final ServiceTarget serviceTarget, final ServiceName contextServiceName, final Module module) {
final ServiceName orbServiceName = contextServiceName.append("ORB");
final BinderService orbService = new BinderService("ORB");
serviceTarget.addService(orbServiceName, orbService).addDependency(CorbaORBService.SERVICE_NAME, ORB.class, new ManagedReferenceInjector<ORB>(orbService.getManagedObjectInjector())).addDependency(contextServiceName, ServiceBasedNamingStore.class, orbService.getNamingStoreInjector()).install();
final ServiceName handleDelegateServiceName = contextServiceName.append("HandleDelegate");
final BinderService handleDelegateBindingService = new BinderService("HandleDelegate");
handleDelegateBindingService.getManagedObjectInjector().inject(new ValueManagedReferenceFactory(new ImmediateValue(new HandleDelegateImpl(module.getClassLoader()))));
serviceTarget.addService(handleDelegateServiceName, handleDelegateBindingService).addDependency(contextServiceName, ServiceBasedNamingStore.class, handleDelegateBindingService.getNamingStoreInjector()).install();
}
use of org.jboss.as.naming.service.BinderService in project wildfly by wildfly.
the class BeanValidationFactoryDeployer method bindServices.
/**
*
* @param factory The ValidatorFactory to bind
* @param serviceTarget The service target
* @param contextServiceName The service name of the context to bind to
*/
private void bindServices(LazyValidatorFactory factory, ServiceTarget serviceTarget, EEModuleDescription description, String componentName, ServiceName contextServiceName) {
BinderService validatorFactoryBindingService = new BinderService("ValidatorFactory");
validatorFactoryBindingService.getManagedObjectInjector().inject(new ValueManagedReferenceFactory(new ImmediateValue<Object>(factory)));
serviceTarget.addService(contextServiceName.append("ValidatorFactory"), validatorFactoryBindingService).addDependency(contextServiceName, ServiceBasedNamingStore.class, validatorFactoryBindingService.getNamingStoreInjector()).install();
BinderService validatorBindingService = new BinderService("Validator");
validatorBindingService.getManagedObjectInjector().inject(new ValidatorJndiInjectable(factory));
serviceTarget.addService(contextServiceName.append("Validator"), validatorBindingService).addDependency(contextServiceName, ServiceBasedNamingStore.class, validatorBindingService.getNamingStoreInjector()).install();
}
use of org.jboss.as.naming.service.BinderService in project wildfly by wildfly.
the class CorbaServiceUtil method bindObject.
/**
* <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();
}
Aggregations