|
![]() |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.picocontainer.gems.jndi.JNDIProvided<T>
public class JNDIProvided<T>
represents dependency provided via JNDI. This dependency is not to be managed by container at all, so there is no lifecycle, no monitoring etc.
Nested Class Summary |
---|
Nested classes/interfaces inherited from interface org.picocontainer.ComponentAdapter |
---|
ComponentAdapter.NOTHING |
Constructor Summary | |
---|---|
JNDIProvided(JNDIObjectReference<T> reference)
create adapter with JNDI reference. |
|
JNDIProvided(Object componentKey,
JNDIObjectReference<T> reference)
create adapter with specified key and reference |
|
JNDIProvided(String jndiName)
create adapter based on JNDI name. |
Method Summary | ||
---|---|---|
void |
accept(PicoVisitor visitor)
as there is no puprose of proceeding further down, we do nothing here |
|
|
findAdapterOfType(Class<U> componentAdapterType)
Locates a component adapter of type componentAdapterType in the ComponentAdapter chain. |
|
Class |
getComponentImplementation()
Retrieve the class of the component. |
|
T |
getComponentInstance(PicoContainer container)
Retrieve the component instance. |
|
T |
getComponentInstance(PicoContainer container,
Type into)
retrieve instance out of JNDI |
|
Object |
getComponentKey()
Retrieve the key associated with the component. |
|
ComponentAdapter<T> |
getDelegate()
Component adapters may be nested in a chain, and this method is used to grab the next ComponentAdapter in the chain. |
|
String |
getDescriptor()
Get a string key descriptor of the component adapter. |
|
void |
verify(PicoContainer container)
we have nothing to verify here |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public JNDIProvided(Object componentKey, JNDIObjectReference<T> reference)
componentKey
- component keyreference
- JNDI reference storing componentpublic JNDIProvided(JNDIObjectReference<T> reference)
reference
- JNDI reference storing componentpublic JNDIProvided(String jndiName) throws NamingException
jndiName
- name to be used
NamingException
- will be thrown if something goes
wrong in JNDIMethod Detail |
---|
public Object getComponentKey()
ComponentAdapter
getComponentKey
in interface ComponentAdapter<T>
public Class getComponentImplementation()
ComponentAdapter
getComponentImplementation
in interface ComponentAdapter<T>
public T getComponentInstance(PicoContainer container) throws PicoCompositionException
ComponentAdapter
Cached
will always return the
same instance.
getComponentInstance
in interface ComponentAdapter<T>
container
- the PicoContainer
, that is used to resolve any possible dependencies of the instance.
PicoCompositionException
- if the component has dependencies which could not be resolved, or
instantiation of the component lead to an ambigous situation within the
container.public T getComponentInstance(PicoContainer container, Type into) throws PicoCompositionException
getComponentInstance
in interface ComponentAdapter<T>
container
- the PicoContainer
, that is used to resolve any possible dependencies of the instance.into
- the class that is about to be injected into. Use ComponentAdapter.NOTHING.class if this is not important to you.
PicoCompositionException
- if the component has dependencies which could not be resolved, or
instantiation of the component lead to an ambiguous situation within the
container.public void verify(PicoContainer container) throws PicoCompositionException
verify
in interface ComponentAdapter<T>
container
- the PicoContainer
, that is used to resolve any possible dependencies of the instance.
PicoCompositionException
- if one or more dependencies cannot be resolved.public void accept(PicoVisitor visitor)
accept
in interface ComponentAdapter<T>
visitor
- the visitor.public ComponentAdapter<T> getDelegate()
ComponentAdapter
getDelegate
in interface ComponentAdapter<T>
public <U extends ComponentAdapter> U findAdapterOfType(Class<U> componentAdapterType)
ComponentAdapter
findAdapterOfType
in interface ComponentAdapter<T>
U
- the type of ComponentAdapter being located.componentAdapterType
- the class of the adapter type being located. Never null.
public String getDescriptor()
ComponentAdapter
getDescriptor
in interface ComponentAdapter<T>
|
![]() |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |