org.picocontainer.gems.jndi
Class JNDIProvided<T>

java.lang.Object
  extended by org.picocontainer.gems.jndi.JNDIProvided<T>
All Implemented Interfaces:
Serializable, ComponentAdapter<T>

public class JNDIProvided<T>
extends Object
implements ComponentAdapter<T>, Serializable

represents dependency provided via JNDI. This dependency is not to be managed by container at all, so there is no lifecycle, no monitoring etc.

Author:
Konstantin Pribluda
See Also:
Serialized Form

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
<U extends ComponentAdapter>
U
findAdapterOfType(Class<U> adapterType)
           
 Class getComponentImplementation()
           
 T getComponentInstance(PicoContainer container)
           
 T getComponentInstance(PicoContainer container, Type into)
          retrieve instance out of JNDI
 Object getComponentKey()
           
 ComponentAdapter<T> getDelegate()
           
 String getDescriptor()
           
 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

JNDIProvided

public JNDIProvided(Object componentKey,
                    JNDIObjectReference<T> reference)
create adapter with specified key and reference

Parameters:
componentKey - component key
reference - JNDI reference storing component

JNDIProvided

public JNDIProvided(JNDIObjectReference<T> reference)
create adapter with JNDI reference. referenced object class will be takes as key

Parameters:
reference - JNDI reference storing component

JNDIProvided

public JNDIProvided(String jndiName)
             throws NamingException
create adapter based on JNDI name. I leave this unchecked because type is really not known at this time

Parameters:
jndiName - name to be used
Throws:
NamingException - will be thrown if something goes wrong in JNDI
Method Detail

getComponentKey

public Object getComponentKey()
Specified by:
getComponentKey in interface ComponentAdapter<T>

getComponentImplementation

public Class getComponentImplementation()
Specified by:
getComponentImplementation in interface ComponentAdapter<T>

getComponentInstance

public T getComponentInstance(PicoContainer container)
                       throws PicoCompositionException
Specified by:
getComponentInstance in interface ComponentAdapter<T>
Throws:
PicoCompositionException

getComponentInstance

public T getComponentInstance(PicoContainer container,
                              Type into)
                       throws PicoCompositionException
retrieve instance out of JNDI

Specified by:
getComponentInstance in interface ComponentAdapter<T>
Throws:
PicoCompositionException

verify

public void verify(PicoContainer container)
            throws PicoCompositionException
we have nothing to verify here

Specified by:
verify in interface ComponentAdapter<T>
Throws:
PicoCompositionException

accept

public void accept(PicoVisitor visitor)
as there is no puprose of proceeding further down, we do nothing here

Specified by:
accept in interface ComponentAdapter<T>

getDelegate

public ComponentAdapter<T> getDelegate()
Specified by:
getDelegate in interface ComponentAdapter<T>

findAdapterOfType

public <U extends ComponentAdapter> U findAdapterOfType(Class<U> adapterType)
Specified by:
findAdapterOfType in interface ComponentAdapter<T>

getDescriptor

public String getDescriptor()
Specified by:
getDescriptor in interface ComponentAdapter<T>


Copyright © 2003-2010 Codehaus. All Rights Reserved.