Package org.jboss.as.naming
Class ServiceReferenceObjectFactory
- java.lang.Object
-
- org.jboss.as.naming.ServiceReferenceObjectFactory
-
- All Implemented Interfaces:
ObjectFactory,ServiceAwareObjectFactory
- Direct Known Subclasses:
ManagedReferenceObjectFactory
public class ServiceReferenceObjectFactory extends Object implements ServiceAwareObjectFactory
Abstract object factory that allows for the creation of service references. Object factories that subclassServiceReferenceObjectFactorycan get access to the value of the service described by the reference. If the factory state is noState#UPthen the factory will block. If the state isState#START_FAILEDorState#REMOVED(or the state transactions to one of these states while blocking) an exception is thrown.- Author:
- Stuart Douglas, Richard Opalka
-
-
Constructor Summary
Constructors Constructor Description ServiceReferenceObjectFactory()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static 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.ObjectgetObjectInstance(Object serviceValue, Object obj, Name name, Context nameCtx, Hashtable<?,?> environment)Handles the service reference.ObjectgetObjectInstance(Object obj, Name name, Context nameCtx, Hashtable<?,?> environment)voidinjectServiceRegistry(org.jboss.msc.service.ServiceRegistry registry)
-
-
-
Method Detail
-
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 Exception
Handles 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
-
-