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
-
-
Constructor Summary
Constructors Constructor Description BinderService(String name)BinderService(String name, Object source)Construct new instance.BinderService(String name, Object source, boolean shared)Construct new instance.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidacquire()org.jboss.msc.value.InjectedValue<ManagedReferenceFactory>getManagedObjectInjector()Get the injector for the item to be bound.StringgetName()org.jboss.msc.value.InjectedValue<ServiceBasedNamingStore>getNamingStoreInjector()Get the naming store injector.org.jboss.msc.service.ServiceNamegetServiceName()ObjectgetSource()ManagedReferenceFactorygetValue()Get the value from the injected context.booleanrelease()Releases the service, returnstrueif the service is removed as a result, or false otherwisevoidsetSource(Object source)voidstart(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.StringtoString()
-
-
-
Constructor Detail
-
BinderService
public BinderService(String name, Object source, boolean shared)
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
public BinderService(String name, Object source)
Construct new instance.- Parameters:
name- The JNDI name to use for binding. May be either an absolute or relative name
-
BinderService
public BinderService(String name)
-
-
Method Detail
-
getSource
public Object getSource()
-
setSource
public void setSource(Object source)
-
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.StartExceptionBind 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
public ManagedReferenceFactory getValue() throws IllegalStateException
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
public org.jboss.msc.value.InjectedValue<ManagedReferenceFactory> getManagedObjectInjector()
Get the injector for the item to be bound.- Returns:
- the injector
-
getNamingStoreInjector
public org.jboss.msc.value.InjectedValue<ServiceBasedNamingStore> getNamingStoreInjector()
Get the naming store injector.- Returns:
- the injector
-
getName
public String getName()
-
-