public class ServiceReferenceObjectFactory extends Object implements ServiceAwareObjectFactory
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.Constructor and Description |
---|
ServiceReferenceObjectFactory() |
Modifier and Type | Method and Description |
---|---|
static Reference |
createReference(org.jboss.msc.service.ServiceName service,
Class<? extends ServiceReferenceObjectFactory> factory)
Create a reference to a sub class of
ServiceReferenceObjectFactory that injects the value of the given service. |
Object |
getObjectInstance(Object obj,
Name name,
Context nameCtx,
Hashtable<?,?> environment) |
Object |
getObjectInstance(Object serviceValue,
Object obj,
Name name,
Context nameCtx,
Hashtable<?,?> environment)
Handles the service reference.
|
void |
injectServiceRegistry(org.jboss.msc.service.ServiceRegistry registry) |
public static Reference createReference(org.jboss.msc.service.ServiceName service, Class<? extends ServiceReferenceObjectFactory> factory)
ServiceReferenceObjectFactory
that injects the value of the given service.public void injectServiceRegistry(org.jboss.msc.service.ServiceRegistry registry)
injectServiceRegistry
in interface ServiceAwareObjectFactory
public final Object getObjectInstance(Object obj, Name name, Context nameCtx, Hashtable<?,?> environment) throws Exception
getObjectInstance
in interface ObjectFactory
Exception
public Object getObjectInstance(Object serviceValue, Object obj, Name name, Context nameCtx, Hashtable<?,?> environment) throws Exception
ObjectFactory.getObjectInstance(Object, Name, Context, Hashtable)
, but with the addition of the service value as
the first parameter.Exception
Copyright © 2018 JBoss by Red Hat. All rights reserved.