org.objectweb.jorm.facility.naming.rdbsequence
Class RdbSequenceBinder

java.lang.Object
  extended byorg.objectweb.jorm.naming.lib.BasicPNamingContext
      extended byorg.objectweb.jorm.naming.lib.BasicPBinder
          extended byorg.objectweb.jorm.facility.naming.rdbsequence.RdbSequenceBinder
All Implemented Interfaces:
PBinder, PNameCoder, PNameManager, PNamingContext

public class RdbSequenceBinder
extends BasicPBinder

This binder is specific to the rdb mapper.

Author:
S.Chassande-Barrioz

Field Summary
 
Fields inherited from class org.objectweb.jorm.naming.lib.BasicPBinder
cache, nullPName, pcm
 
Fields inherited from class org.objectweb.jorm.naming.lib.BasicPNamingContext
ptype
 
Fields inherited from interface org.objectweb.jorm.naming.api.PNameCoder
CTBIGDECIMAL, CTBIGINTEGER, CTBYTE, CTBYTEARRAY, CTCHAR, CTCHARARRAY, CTCOMPOSITE, CTDATE, CTINT, CTLONG, CTOBYTE, CTOCHAR, CTOINT, CTOLONG, CTOSHORT, CTSHORT, CTSTRING, CTSYSTEM
 
Constructor Summary
RdbSequenceBinder()
           
 
Method Summary
 boolean codingSupported(int codingtype)
          It tests if a given coding type is supported by this naming context.
 PName decodeLong(long en)
          The decodeLong methods recreates PName within a naming context from an encoded representation.
 PName decodeOlong(java.lang.Long en)
          The decodeOlong methods recreates PName within a naming context from an encoded representation.
 PName decodeString(java.lang.String en)
          The decodeString methods recreates PName within a naming context from an encoded representation.
 long encodeLong(PName pn)
          The encodeLong method produces an encoded representation of a PName within a naming context.
 java.lang.Long encodeOlong(PName pn)
          The encodeOlong method produces an encoded representation of a PName within a naming context.
 java.lang.String encodeString(PName pn)
          The encodeString method produces an encoded representation of a PName within a naming context.
 PName export(java.lang.Object c, java.lang.Object en)
          It associates a PName to an information item within a naming context.
 PName export(java.lang.Object conn, java.lang.Object infoitem, java.lang.Object hints)
          It associates a PName to an information item within a naming context.
 RdbSequenceHelper getSequenceHelper()
           
 SequenceIdAllocator getSequenceIdAllocator()
           
protected  void initSequenceHelper()
           
 PName resolve(java.lang.Object conn, PName pn)
          It retrieves the information item associated to the given PName (if any exists).
 void setSequenceHelper(RdbSequenceHelper sequenceHelper)
           
 void setSequenceIdAllocator(SequenceIdAllocator sia)
           
 void unexport(java.lang.Object conn, PName pn)
          It removes the 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, PName pn, java.lang.Object hints)
          It removes the 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 org.objectweb.jorm.naming.lib.BasicPBinder
bind, getBinderClassMapping, getCacheManager, getClassName, getNull, lookup, setCacheManager, setNullPName, setPClassMapping, unbind
 
Methods inherited from class org.objectweb.jorm.naming.lib.BasicPNamingContext
decode, decodeAbstract, decodeBigDecimal, decodeBigInteger, decodeByte, decodeChar, decodeCharArray, decodeDate, decodeInt, decodeObyte, decodeOchar, decodeOint, decodeOshort, decodeShort, encode, encodeAbstract, encodeBigDecimal, encodeBigInteger, encodeByte, encodeChar, encodeCharArray, encodeDate, encodeInt, encodeObyte, encodeOchar, encodeOint, encodeOshort, encodeShort, getPType, setPType, supportCompositeField, supportDynamicComposite, supportStaticComposite
 
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.PNameCoder
decode, decodeAbstract, decodeBigDecimal, decodeBigInteger, decodeByte, decodeChar, decodeCharArray, decodeDate, decodeInt, decodeObyte, decodeOchar, decodeOint, decodeOshort, decodeShort, encode, encodeAbstract, encodeBigDecimal, encodeBigInteger, encodeByte, encodeChar, encodeCharArray, encodeDate, encodeInt, encodeObyte, encodeOchar, encodeOint, encodeOshort, encodeShort, getPType, setPType, supportCompositeField, supportDynamicComposite, supportStaticComposite
 

Constructor Detail

RdbSequenceBinder

public RdbSequenceBinder()
Method Detail

setSequenceIdAllocator

public void setSequenceIdAllocator(SequenceIdAllocator sia)

getSequenceIdAllocator

public SequenceIdAllocator getSequenceIdAllocator()

getSequenceHelper

public RdbSequenceHelper getSequenceHelper()

setSequenceHelper

public void setSequenceHelper(RdbSequenceHelper sequenceHelper)

initSequenceHelper

protected void initSequenceHelper()

resolve

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

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:
PException

export

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

Parameters:
conn - The connection that can be used to access the data store.
infoitem - The information item that must be accessible through a PName within a naming context.
hints - Any information relevant for name creation.
Returns:
The PName associated to the given information item.
Throws:
PException

export

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

Parameters:
c - The connection that can be used to access the data store.
en - The information item that must be accessible through a PName within a naming context.
Returns:
The PName associated to the given information item.
Throws:
PException

unexport

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

Parameters:
conn - The connection that can be used to access the data store.
pn - A PName valid in this naming context. In case of a PBinder, export is done on a PBinding.
Throws:
PException

unexport

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

Parameters:
conn - The connection that can be used to access the data store.
pn - A PName valid in this naming context. In case of a PBinder, export is done on a PBinding.
hints - Any information relevant for name removing.
Throws:
PException

encodeLong

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

Specified by:
encodeLong in interface PNameCoder
Overrides:
encodeLong in class BasicPNamingContext
Throws:
PExceptionNaming
java.lang.UnsupportedOperationException

encodeOlong

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

Specified by:
encodeOlong in interface PNameCoder
Overrides:
encodeOlong in class BasicPNamingContext
Throws:
PExceptionNaming
java.lang.UnsupportedOperationException

decodeLong

public PName decodeLong(long en)
                 throws PExceptionNaming,
                        java.lang.UnsupportedOperationException
Description copied from interface: PNameCoder
The decodeLong methods recreates PName within a naming context from an encoded representation. In the case of this method, the encoded representation is a long.

Specified by:
decodeLong in interface PNameCoder
Overrides:
decodeLong in class BasicPNamingContext
Throws:
PExceptionNaming
java.lang.UnsupportedOperationException

decodeOlong

public PName decodeOlong(java.lang.Long en)
                  throws PExceptionNaming,
                         java.lang.UnsupportedOperationException
Description copied from interface: PNameCoder
The decodeOlong methods recreates PName within a naming context from an encoded representation. In the case of this method, the encoded representation is a Long.

Specified by:
decodeOlong in interface PNameCoder
Overrides:
decodeOlong in class BasicPNamingContext
Throws:
PExceptionNaming
java.lang.UnsupportedOperationException

decodeString

public PName decodeString(java.lang.String en)
                   throws PExceptionNaming
Description copied from interface: PNameCoder
The decodeString methods recreates PName within a naming context from an encoded representation. In the case of this method, the encoded representation is a String.

Parameters:
en - The String to be decoded.
Returns:
The resulting PName.
Throws:
PExceptionNaming

codingSupported

public boolean codingSupported(int codingtype)
Description copied from interface: PNameCoder
It tests if a given coding type is supported by this naming context.

Specified by:
codingSupported in interface PNameCoder
Overrides:
codingSupported in class BasicPNamingContext

encodeString

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

Parameters:
pn - The PName to be encoded
Returns:
The String corresponding to the encoded representation.
Throws:
PExceptionNaming