org.apache.xbean.naming.reference
Class SimpleReference

java.lang.Object
  extended by javax.naming.Reference
      extended by org.apache.xbean.naming.reference.SimpleReference
All Implemented Interfaces:
Serializable, Cloneable
Direct Known Subclasses:
CachingReference

public abstract class SimpleReference
extends Reference

Version:
$Rev: 355877 $ $Date: 2005-12-10 18:48:27 -0800 (Sat, 10 Dec 2005) $
See Also:
Serialized Form

Nested Class Summary
static class SimpleReference.SimpleObjectFactory
          Simply calls getContent() on the SimpleReference
 
Field Summary
 
Fields inherited from class javax.naming.Reference
addrs, classFactory, classFactoryLocation, className
 
Constructor Summary
SimpleReference()
           
 
Method Summary
 void add(int posn, RefAddr addr)
           
 void add(RefAddr addr)
           
 void clear()
           
 Object clone()
           
 boolean equals(Object obj)
           
 RefAddr get(int posn)
           
 RefAddr get(String addrType)
           
 Enumeration getAll()
           
 String getClassName()
          We will atleast return an Object.
abstract  Object getContent()
          Gets the actual referenced Object.
 String getFactoryClassLocation()
           
 String getFactoryClassName()
          If the JNDI context does not understand simple references, this method will be called to obtain the class name of a factory.
 int hashCode()
           
 Object remove(int posn)
           
 int size()
           
 String toString()
           
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

SimpleReference

public SimpleReference()
Method Detail

getContent

public abstract Object getContent()
                           throws NamingException
Gets the actual referenced Object.

Returns:
the referenced object
Throws:
NamingException

getClassName

public String getClassName()
We will atleast return an Object. Subclasses may want to provide a more specific class.

Overrides:
getClassName in class Reference
Returns:
"java.lang.Object"

getFactoryClassName

public final String getFactoryClassName()
If the JNDI context does not understand simple references, this method will be called to obtain the class name of a factory. This factory in turn understands the simple reference. This style is much slower because JNDI will use reflection to load and create this class.

Overrides:
getFactoryClassName in class Reference
Returns:

getFactoryClassLocation

public final String getFactoryClassLocation()
Overrides:
getFactoryClassLocation in class Reference

get

public final RefAddr get(String addrType)
Overrides:
get in class Reference

get

public final RefAddr get(int posn)
Overrides:
get in class Reference

getAll

public final Enumeration getAll()
Overrides:
getAll in class Reference

size

public final int size()
Overrides:
size in class Reference

add

public final void add(RefAddr addr)
Overrides:
add in class Reference

add

public final void add(int posn,
                      RefAddr addr)
Overrides:
add in class Reference

remove

public final Object remove(int posn)
Overrides:
remove in class Reference

clear

public final void clear()
Overrides:
clear in class Reference

equals

public boolean equals(Object obj)
Overrides:
equals in class Reference

hashCode

public int hashCode()
Overrides:
hashCode in class Reference

toString

public String toString()
Overrides:
toString in class Reference

clone

public Object clone()
Overrides:
clone in class Reference


Copyright © 2005-2011 Apache Software Foundation. All Rights Reserved.