org.objectweb.jorm.naming.lib
Class BasicPName

java.lang.Object
  extended byorg.objectweb.jorm.naming.lib.BasicPName
All Implemented Interfaces:
java.lang.Cloneable, PName, java.io.Serializable
Direct Known Subclasses:
BasicPolymorphicPName, PolymorphIdRefN

public abstract class BasicPName
extends java.lang.Object
implements PName

This basic implementation of a PName delegates all calls to its methods to the PNamingContext it references. The only calls that are not delegated are calls to isNull, getPNamingContext.

Author:
P. D?chamboux
See Also:
Serialized Form

Field Summary
protected  PNameManager pnc
          The PNamingContext that manages this PName
 
Constructor Summary
BasicPName()
           
 
Method Summary
 boolean codingSupported(int codingtype)
          It tests if a given coding type is supported for this PName.
 byte[] encode()
          The encode method produces an encoded representation of this PName within its naming context.
 java.lang.Object encodeAbstract()
          The encodeAbstract method produces an encoded representation of this PName.
 java.math.BigDecimal encodeBigDecimal()
          The encodeBigDecimal method produces an encoded representation of this PName within its naming context.
 java.math.BigInteger encodeBigInteger()
          The encodeBigInteger method produces an encoded representation of this PName within its naming context.
 byte encodeByte()
          The encodeByte method produces an encoded representation of this PName within its naming context.
 char encodeChar()
          The encodeChar method produces an encoded representation of this PName within its naming context.
 char[] encodeCharArray()
          The encodeCharArray method produces an encoded representation of this PName within its naming context.
 java.util.Date encodeDate()
          The encodeDate method produces an encoded representation of this PName within its naming context.
 int encodeInt()
          The encodeInt method produces an encoded representation of this PName within its naming context.
 long encodeLong()
          The encodeLong method produces an encoded representation of this PName within its naming context.
 java.lang.Byte encodeObyte()
          The encodeObyte method produces an encoded representation of this PName within its naming context.
 java.lang.Character encodeOchar()
          The encodeOchar method produces an encoded representation of this PName within its naming context.
 java.lang.Integer encodeOint()
          The encodeOint method produces an encoded representation of this PName within its naming context.
 java.lang.Long encodeOlong()
          The encodeOlong method produces an encoded representation of this PName within its naming context.
 java.lang.Short encodeOshort()
          The encodeOshort method produces an encoded representation of this PName within its naming context.
 short encodeShort()
          The encodeShort method produces an encoded representation of this PName within its naming context.
 java.lang.String encodeString()
          The encodeString method produces an encoded representation of this PName within its naming context.
 PName export(java.lang.Object conn, PNamingContext pnc)
          It associates a PName to an information item within a naming context.
 PName export(java.lang.Object conn, PNamingContext pnc, java.lang.Object hints)
          It associates a PName to an information item within a naming context.
 PNameManager getPNameManager()
          It retrieves the name manager associated to this PName.
 PType getPType()
          It retrieves the PType associated to this PName if any exists.
 PName resolve(java.lang.Object conn)
          It retrieves the information item associated to the given PName (if any exists).
 void setPNamingContext(PNamingContext pnc)
           
 java.lang.String toString()
           
 void unexport(java.lang.Object conn)
          It removes this PName and all the associated information within a naming context (i.e., the association between the PName and its information item).
 void unexport(java.lang.Object conn, java.lang.Object hints)
          It removes this PName and all the associated information within a naming context (i.e., the association between the PName and its information item).
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.objectweb.jorm.naming.api.PName
isNull
 

Field Detail

pnc

protected transient PNameManager pnc
The PNamingContext that manages this PName

Constructor Detail

BasicPName

public BasicPName()
Method Detail

toString

public java.lang.String toString()

setPNamingContext

public void setPNamingContext(PNamingContext pnc)

codingSupported

public boolean codingSupported(int codingtype)
Description copied from interface: PName
It tests if a given coding type is supported for this PName.

Specified by:
codingSupported in interface PName
Parameters:
codingtype - One of the coding type defined by PNamingContext.CTxxx constants defined within the PNamingContext interface.
Returns:
It returns true if the coding type is supported for this PName.

encode

public byte[] encode()
              throws PExceptionNaming
Description copied from interface: PName
The encode method produces an encoded representation of this PName within its naming context. The encoding format in the case of this method is an array of bytes.

Specified by:
encode in interface PName
Returns:
The array of bytes corresponding to the encoded representation.
Throws:
PExceptionNaming

encodeAbstract

public java.lang.Object encodeAbstract()
                                throws PExceptionNaming,
                                       java.lang.UnsupportedOperationException
Description copied from interface: PName
The encodeAbstract method produces an encoded representation of this PName. The encoding format is the case of this method is a Java object of any complexity. Example of such object is a getter interface giving access of the fields of a composite relational primary key.

Specified by:
encodeAbstract in interface PName
Returns:
The Object corresponding to the encoded representation.
Throws:
PExceptionNaming
java.lang.UnsupportedOperationException

encodeByte

public byte encodeByte()
                throws PExceptionNaming,
                       java.lang.UnsupportedOperationException
Description copied from interface: PName
The encodeByte method produces an encoded representation of this PName within its naming context. The encoding format in the case of this method is a byte.

Specified by:
encodeByte in interface PName
Returns:
The byte corresponding to the encoded representation.
Throws:
PExceptionNaming
java.lang.UnsupportedOperationException

encodeObyte

public java.lang.Byte encodeObyte()
                           throws PExceptionNaming,
                                  java.lang.UnsupportedOperationException
Description copied from interface: PName
The encodeObyte method produces an encoded representation of this PName within its naming context. The encoding format in the case of this method is a Byte.

Specified by:
encodeObyte in interface PName
Returns:
The Byte corresponding to the encoded representation.
Throws:
PExceptionNaming
java.lang.UnsupportedOperationException

encodeChar

public char encodeChar()
                throws PExceptionNaming,
                       java.lang.UnsupportedOperationException
Description copied from interface: PName
The encodeChar method produces an encoded representation of this PName within its naming context. The encoding format in the case of this method is a char.

Specified by:
encodeChar in interface PName
Returns:
The char corresponding to the encoded representation.
Throws:
PExceptionNaming
java.lang.UnsupportedOperationException

encodeOchar

public java.lang.Character encodeOchar()
                                throws PExceptionNaming,
                                       java.lang.UnsupportedOperationException
Description copied from interface: PName
The encodeOchar method produces an encoded representation of this PName within its naming context. The encoding format in the case of this method is a Character.

Specified by:
encodeOchar in interface PName
Returns:
The Character corresponding to the encoded representation.
Throws:
PExceptionNaming
java.lang.UnsupportedOperationException

encodeInt

public int encodeInt()
              throws PExceptionNaming,
                     java.lang.UnsupportedOperationException
Description copied from interface: PName
The encodeInt method produces an encoded representation of this PName within its naming context. The encoding format in the case of this method is a int.

Specified by:
encodeInt in interface PName
Returns:
The int corresponding to the encoded representation.
Throws:
PExceptionNaming
java.lang.UnsupportedOperationException

encodeOint

public java.lang.Integer encodeOint()
                             throws PExceptionNaming,
                                    java.lang.UnsupportedOperationException
Description copied from interface: PName
The encodeOint method produces an encoded representation of this PName within its naming context. The encoding format in the case of this method is a Integer.

Specified by:
encodeOint in interface PName
Returns:
The Integer corresponding to the encoded representation.
Throws:
PExceptionNaming
java.lang.UnsupportedOperationException

encodeLong

public long encodeLong()
                throws PExceptionNaming,
                       java.lang.UnsupportedOperationException
Description copied from interface: PName
The encodeLong method produces an encoded representation of this PName within its naming context. The encoding format in the case of this method is a long.

Specified by:
encodeLong in interface PName
Returns:
The long corresponding to the encoded representation.
Throws:
PExceptionNaming
java.lang.UnsupportedOperationException

encodeOlong

public java.lang.Long encodeOlong()
                           throws PExceptionNaming,
                                  java.lang.UnsupportedOperationException
Description copied from interface: PName
The encodeOlong method produces an encoded representation of this PName within its naming context. The encoding format in the case of this method is a Long.

Specified by:
encodeOlong in interface PName
Returns:
The Long corresponding to the encoded representation.
Throws:
PExceptionNaming
java.lang.UnsupportedOperationException

encodeShort

public short encodeShort()
                  throws PExceptionNaming,
                         java.lang.UnsupportedOperationException
Description copied from interface: PName
The encodeShort method produces an encoded representation of this PName within its naming context. The encoding format in the case of this method is a short.

Specified by:
encodeShort in interface PName
Returns:
The short corresponding to the encoded representation.
Throws:
PExceptionNaming
java.lang.UnsupportedOperationException

encodeOshort

public java.lang.Short encodeOshort()
                             throws PExceptionNaming,
                                    java.lang.UnsupportedOperationException
Description copied from interface: PName
The encodeOshort method produces an encoded representation of this PName within its naming context. The encoding format in the case of this method is a Short.

Specified by:
encodeOshort in interface PName
Returns:
The Short corresponding to the encoded representation.
Throws:
PExceptionNaming
java.lang.UnsupportedOperationException

encodeString

public java.lang.String encodeString()
                              throws PExceptionNaming
Description copied from interface: PName
The encodeString method produces an encoded representation of this PName within its naming context. The encoding format in the case of this method is a String.

Specified by:
encodeString in interface PName
Returns:
The String corresponding to the encoded representation.
Throws:
PExceptionNaming

encodeCharArray

public char[] encodeCharArray()
                       throws PExceptionNaming
Description copied from interface: PName
The encodeCharArray method produces an encoded representation of this PName within its naming context. The encoding format in the case of this method is a char[].

Specified by:
encodeCharArray in interface PName
Returns:
The char[] corresponding to the encoded representation.
Throws:
PExceptionNaming

encodeDate

public java.util.Date encodeDate()
                          throws PExceptionNaming
Description copied from interface: PName
The encodeDate method produces an encoded representation of this PName within its naming context. The encoding format in the case of this method is a Date.

Specified by:
encodeDate in interface PName
Returns:
The Date corresponding to the encoded representation.
Throws:
PExceptionNaming

encodeBigInteger

public java.math.BigInteger encodeBigInteger()
                                      throws PExceptionNaming
Description copied from interface: PName
The encodeBigInteger method produces an encoded representation of this PName within its naming context. The encoding format in the case of this method is a BigInteger.

Specified by:
encodeBigInteger in interface PName
Returns:
The BigInteger corresponding to the encoded representation.
Throws:
PExceptionNaming

encodeBigDecimal

public java.math.BigDecimal encodeBigDecimal()
                                      throws PExceptionNaming
Description copied from interface: PName
The encodeBigDecimal method produces an encoded representation of this PName within its naming context. The encoding format in the case of this method is a BigDecimal.

Specified by:
encodeBigDecimal in interface PName
Returns:
The BigDecimal corresponding to the encoded representation.
Throws:
PExceptionNaming

export

public PName export(java.lang.Object conn,
                    PNamingContext pnc)
             throws PException
Description copied from interface: PName
It associates a PName to an information item within a naming context.

Specified by:
export in interface PName
Parameters:
conn - The connection that can be used to access the data store.
pnc - Thhe naming context which must provide a PName for this PName.
Returns:
The new PName associated to this PName.
Throws:
PException

export

public PName export(java.lang.Object conn,
                    PNamingContext pnc,
                    java.lang.Object hints)
             throws PException
Description copied from interface: PName
It associates a PName to an information item within a naming context.

Specified by:
export in interface PName
Parameters:
conn - The connection that can be used to access the data store.
pnc - Thhe naming context which must provide a PName for this PName.
hints - Any information relevant for name creation.
Returns:
The new PName associated to this PName.
Throws:
PException

getPNameManager

public PNameManager getPNameManager()
Description copied from interface: PName
It retrieves the name manager associated to this PName.

Specified by:
getPNameManager in interface PName
Returns:
The naming context which provide this pname

getPType

public PType getPType()
Description copied from interface: PName
It retrieves the PType associated to this PName if any exists. If none is associated, it returns null.

Specified by:
getPType in interface PName
Returns:
The PType associated to this PName.

resolve

public PName resolve(java.lang.Object conn)
              throws java.lang.UnsupportedOperationException,
                     PException
Description copied from interface: PName
It retrieves the information item associated to the given PName (if any exists).

Specified by:
resolve in interface PName
Parameters:
conn - The connection that can be used to access the data store.
Returns:
The information item associated with the given PName within a naming context.
Throws:
java.lang.UnsupportedOperationException
PException

unexport

public void unexport(java.lang.Object conn)
              throws PException
Description copied from interface: PName
It removes this PName and all the associated information within a naming context (i.e., the association between the PName and its information item).

Specified by:
unexport in interface PName
Parameters:
conn - The connection that can be used to access the data store.
Throws:
PException

unexport

public void unexport(java.lang.Object conn,
                     java.lang.Object hints)
              throws PException
Description copied from interface: PName
It removes this PName and all the associated information within a naming context (i.e., the association between the PName and its information item).

Specified by:
unexport in interface PName
Parameters:
conn - The connection that can be used to access the data store.
hints - Any information relevant for name removing.
Throws:
PException