Package org.jboss.as.naming.service
Class BinderService
java.lang.Object
org.jboss.as.naming.service.BinderService
- All Implemented Interfaces:
org.jboss.msc.Service,org.jboss.msc.service.Service<ManagedReferenceFactory>,org.jboss.msc.value.Value<ManagedReferenceFactory>
- Direct Known Subclasses:
ExternalContextBinderService
public class BinderService
extends Object
implements org.jboss.msc.service.Service<ManagedReferenceFactory>
Service responsible for binding and unbinding an entry into a naming context. This service can be used as a dependency for
any service that needs to retrieve this entry from the context.
- Author:
- John E. Bailey, Eduardo Martins
-
Field Summary
Fields inherited from interface org.jboss.msc.service.Service
NULL -
Constructor Summary
ConstructorsConstructorDescriptionBinderService(String name) BinderService(String name, Object source) Construct new instance.BinderService(String name, Object source, boolean shared) Construct new instance. -
Method Summary
Modifier and TypeMethodDescriptionvoidacquire()org.jboss.msc.value.InjectedValue<ManagedReferenceFactory>Get the injector for the item to be bound.getName()org.jboss.msc.value.InjectedValue<ServiceBasedNamingStore>Get the naming store injector.org.jboss.msc.service.ServiceNamegetValue()Get the value from the injected context.booleanrelease()Releases the service, returnstrueif the service is removed as a result, or false otherwisevoidvoidstart(org.jboss.msc.service.StartContext context) Bind the entry into the injected context.voidstop(org.jboss.msc.service.StopContext context) Unbind the entry from the injected context.toString()
-
Constructor Details
-
BinderService
Construct new instance.- Parameters:
name- The JNDI name to use for binding. May be either an absolute or relative namesource-shared- indicates if the bind may be shared among multiple deployments, if true the service tracks references indicated through acquire(), and automatically stops once all deployments unreference it through release()
-
BinderService
Construct new instance.- Parameters:
name- The JNDI name to use for binding. May be either an absolute or relative name
-
BinderService
-
-
Method Details
-
getSource
-
setSource
-
acquire
public void acquire() -
release
public boolean release()Releases the service, returnstrueif the service is removed as a result, or false otherwise- Returns:
-
getServiceName
public org.jboss.msc.service.ServiceName getServiceName() -
start
public void start(org.jboss.msc.service.StartContext context) throws org.jboss.msc.service.StartException Bind the entry into the injected context.- Specified by:
startin interfaceorg.jboss.msc.Service- Parameters:
context- The start context- Throws:
org.jboss.msc.service.StartException- If the entity can not be bound
-
stop
public void stop(org.jboss.msc.service.StopContext context) Unbind the entry from the injected context.- Specified by:
stopin interfaceorg.jboss.msc.Service- Parameters:
context- The stop context
-
getValue
Get the value from the injected context.- Specified by:
getValuein interfaceorg.jboss.msc.value.Value<ManagedReferenceFactory>- Returns:
- The value of the named entry
- Throws:
IllegalStateException
-
getManagedObjectInjector
Get the injector for the item to be bound.- Returns:
- the injector
-
getNamingStoreInjector
Get the naming store injector.- Returns:
- the injector
-
toString
-
getName
-