Package org.jboss.as.naming
Class ServiceReferenceObjectFactory
java.lang.Object
org.jboss.as.naming.ServiceReferenceObjectFactory
- All Implemented Interfaces:
ObjectFactory,ServiceAwareObjectFactory
- Direct Known Subclasses:
ManagedReferenceObjectFactory
Abstract object factory that allows for the creation of service references. Object factories that subclass
ServiceReferenceObjectFactory can get access to the value of the service described by the reference.
If the factory state is no State#UP then the factory will block. If the state is State#START_FAILED or
State#REMOVED (or the state transactions to one of these states while blocking) an exception is thrown.- Author:
- Stuart Douglas, Richard Opalka
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic ReferencecreateReference(org.jboss.msc.service.ServiceName service, Class<? extends ServiceReferenceObjectFactory> factory) Create a reference to a sub class ofServiceReferenceObjectFactorythat injects the value of the given service.getObjectInstance(Object serviceValue, Object obj, Name name, Context nameCtx, Hashtable<?, ?> environment) Handles the service reference.final ObjectgetObjectInstance(Object obj, Name name, Context nameCtx, Hashtable<?, ?> environment) voidinjectServiceRegistry(org.jboss.msc.service.ServiceRegistry registry)
-
Constructor Details
-
ServiceReferenceObjectFactory
public ServiceReferenceObjectFactory()
-
-
Method Details
-
createReference
public static Reference createReference(org.jboss.msc.service.ServiceName service, Class<? extends ServiceReferenceObjectFactory> factory) Create a reference to a sub class ofServiceReferenceObjectFactorythat injects the value of the given service. -
injectServiceRegistry
public void injectServiceRegistry(org.jboss.msc.service.ServiceRegistry registry) - Specified by:
injectServiceRegistryin interfaceServiceAwareObjectFactory
-
getObjectInstance
public final Object getObjectInstance(Object obj, Name name, Context nameCtx, Hashtable<?, ?> environment) throws Exception- Specified by:
getObjectInstancein interfaceObjectFactory- Throws:
Exception
-
getObjectInstance
public Object getObjectInstance(Object serviceValue, Object obj, Name name, Context nameCtx, Hashtable<?, ?> environment) throws ExceptionHandles the service reference. The parameters are the same asObjectFactory.getObjectInstance(Object, Name, Context, Hashtable), but with the addition of the service value as the first parameter.- Throws:
Exception
-