org.objectweb.jorm.naming.lib
Class BasicPName

java.lang.Object
  |
  +--org.objectweb.jorm.naming.lib.BasicPName
All Implemented Interfaces:
java.lang.Cloneable, PName
Direct Known Subclasses:
BasidName, 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 call wich is not delegated is to isNull and getPNameManager.

Author:
P. D?chamboux

Field Summary
protected  PNameManager pnc
          The PNamingContext that manages this PName
 
Constructor Summary
BasicPName()
           
 
Method Summary
 boolean codingSupported(short 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.
 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.
 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.
 java.lang.Object resolve(java.lang.Object conn)
          It retrieves the information item associated to the given PName (if any exists).
 void setPNamingContext(PNamingContext pnc)
           
 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).
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.objectweb.jorm.naming.api.PName
isNull
 

Field Detail

pnc

protected PNameManager pnc
The PNamingContext that manages this PName
Constructor Detail

BasicPName

public BasicPName()
Method Detail

setPNamingContext

public void setPNamingContext(PNamingContext pnc)

codingSupported

public boolean codingSupported(short codingtype)
Description copied from interface: PName
It tests if a given coding type is supported for this PName.
Specified by:
codingSupported in interface PName
Following copied from interface: org.objectweb.jorm.naming.api.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
Following copied from interface: org.objectweb.jorm.naming.api.PName
Parameters:
conn - The connection which can be used to access the data store.
Returns:
The array of bytes corresponding to the encoded representation.

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
Following copied from interface: org.objectweb.jorm.naming.api.PName
Parameters:
conn - The connection which can be used to access the data store.
Returns:
The Object corresponding to the encoded representation.

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
Following copied from interface: org.objectweb.jorm.naming.api.PName
Parameters:
conn - The connection which can be used to access the data store.
Returns:
The byte corresponding to the encoded representation.

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
Following copied from interface: org.objectweb.jorm.naming.api.PName
Parameters:
conn - The connection which can be used to access the data store.
Returns:
The Byte corresponding to the encoded representation.

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
Following copied from interface: org.objectweb.jorm.naming.api.PName
Parameters:
conn - The connection which can be used to access the data store.
Returns:
The char corresponding to the encoded representation.

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
Following copied from interface: org.objectweb.jorm.naming.api.PName
Parameters:
conn - The connection which can be used to access the data store.
Returns:
The Character corresponding to the encoded representation.

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
Following copied from interface: org.objectweb.jorm.naming.api.PName
Parameters:
conn - The connection which can be used to access the data store.
Returns:
The int corresponding to the encoded representation.

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
Following copied from interface: org.objectweb.jorm.naming.api.PName
Parameters:
conn - The connection which can be used to access the data store.
Returns:
The Integer corresponding to the encoded representation.

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
Following copied from interface: org.objectweb.jorm.naming.api.PName
Parameters:
conn - The connection which can be used to access the data store.
Returns:
The long corresponding to the encoded representation.

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
Following copied from interface: org.objectweb.jorm.naming.api.PName
Parameters:
conn - The connection which can be used to access the data store.
Returns:
The Long corresponding to the encoded representation.

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
Following copied from interface: org.objectweb.jorm.naming.api.PName
Parameters:
conn - The connection which can be used to access the data store.
Returns:
The short corresponding to the encoded representation.

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
Following copied from interface: org.objectweb.jorm.naming.api.PName
Parameters:
conn - The connection which can be used to access the data store.
Returns:
The Short corresponding to the encoded representation.

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
Following copied from interface: org.objectweb.jorm.naming.api.PName
Parameters:
conn - The connection which can be used to access the data store.
Returns:
The String corresponding to the encoded representation.

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
Following copied from interface: org.objectweb.jorm.naming.api.PName
Parameters:
conn - The connection which can be used to access the data store.
Returns:
The Date corresponding to the encoded representation.

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
Following copied from interface: org.objectweb.jorm.naming.api.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:
PExceptionNaming - Raised in case of problem within the naming context.
PExceptionIO - Raised in case of problem during the access of the data store

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
Following copied from interface: org.objectweb.jorm.naming.api.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:
PExceptionNaming - Raised in case of problem within the naming context.
PExceptionIO - Raised in case of problem during the access of the data store

getPNameManager

public PNameManager getPNameManager()
Description copied from interface: PName
It retrieves the name manager associated to this PName.
Specified by:
getPNameManager in interface PName
Following copied from interface: org.objectweb.jorm.naming.api.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
Following copied from interface: org.objectweb.jorm.naming.api.PName
Returns:
The PType associated to this PName.

resolve

public java.lang.Object 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
Following copied from interface: org.objectweb.jorm.naming.api.PName
Parameters:
conn - The connection that can be used to access the data store.
pn - The PName to be looked up.
Returns:
The information item associated with the given PName within a naming context.
Throws:
PExceptionNaming - Raised in case of problem within the naming context.
PExceptionIO - Raised in case of problem during the access of the data store

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
Following copied from interface: org.objectweb.jorm.naming.api.PName
Parameters:
conn - The connection that can be used to access the data store.
Throws:
PExceptionNaming - Raised in case of problem within the naming context.
PExceptionIO - Raised in case of problem during the access of the data store