pt.jcodeutil.core.ejb.numbering
Class NumberingManagerBean

java.lang.Object
  |
  +--pt.jcodeutil.core.ejb.numbering.NumberingManagerBean
All Implemented Interfaces:
javax.ejb.EnterpriseBean, java.io.Serializable, javax.ejb.SessionBean

public class NumberingManagerBean
extends java.lang.Object
implements javax.ejb.SessionBean

Title: NumberingManagerBean

Description:

Version:
1.0
Author:
Marco Samuel (samuelbb@sapo.pt)
See Also:
Serialized Form

Field Summary
protected static java.lang.String DATA_SOURCE
           
protected static java.lang.String GET_CURRENT_NUMBER
           
protected static java.lang.String GET_NEXT_NUMBER
           
protected static java.lang.String INSERT_CURRENT_NUMBER
           
protected static java.lang.String UPDATE_CURRENT_NUMBER
           
 
Constructor Summary
NumberingManagerBean()
           
 
Method Summary
 void ejbActivate()
           
 void ejbCreate()
           
 void ejbPassivate()
           
 void ejbRemove()
           
 long getCurrentID(java.lang.String id, java.lang.String dsourceEnv)
          Get the current ID for the identifier given by argument.
 long getNextID(java.lang.String id, java.lang.String dsourceEnv)
          Get the next ID for the identifier given by argument.
 void setSessionContext(javax.ejb.SessionContext context)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DATA_SOURCE

protected static final java.lang.String DATA_SOURCE

GET_NEXT_NUMBER

protected static final java.lang.String GET_NEXT_NUMBER

GET_CURRENT_NUMBER

protected static final java.lang.String GET_CURRENT_NUMBER

UPDATE_CURRENT_NUMBER

protected static final java.lang.String UPDATE_CURRENT_NUMBER

INSERT_CURRENT_NUMBER

protected static final java.lang.String INSERT_CURRENT_NUMBER
Constructor Detail

NumberingManagerBean

public NumberingManagerBean()
Method Detail

ejbCreate

public void ejbCreate()

ejbRemove

public void ejbRemove()
Specified by:
ejbRemove in interface javax.ejb.SessionBean

ejbActivate

public void ejbActivate()
Specified by:
ejbActivate in interface javax.ejb.SessionBean

ejbPassivate

public void ejbPassivate()
Specified by:
ejbPassivate in interface javax.ejb.SessionBean

setSessionContext

public void setSessionContext(javax.ejb.SessionContext context)
Specified by:
setSessionContext in interface javax.ejb.SessionBean

getNextID

public long getNextID(java.lang.String id,
                      java.lang.String dsourceEnv)
               throws java.rmi.RemoteException,
                      java.sql.SQLException
Get the next ID for the identifier given by argument.
Parameters:
id - identifier of the key.
dsourceEnv - the root for the datasource in the environment
Returns:
long Next value for use given the key. If it doesn't exist, it will create one starting in 1.
Throws:
java.rmi.RemoteException -  
java.sql.SQLException -  

getCurrentID

public long getCurrentID(java.lang.String id,
                         java.lang.String dsourceEnv)
                  throws java.rmi.RemoteException,
                         java.sql.SQLException
Get the current ID for the identifier given by argument.
Parameters:
id - identifier of the key.
dsourceEnv - the root for the datasource in the environment
Returns:
long current value for use given the key.
Throws:
java.rmi.RemoteException -  
java.sql.SQLException -