Class 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 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 name
        source -
        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, returns true if 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:
        start in interface org.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:
        stop in interface org.jboss.msc.Service
        Parameters:
        context - The stop context
      • 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()