|
OpMath | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Object | +--com.opmath.test.j2ee.uid.UniqueIdGeneratorBean
The business logic for the unique ID generator. This CMP EJB performs an immensely
simple task: it holds one long value, amd increments it on request.
This EJB also has a unique key, which is used by the container as a primary key.
Copyright: (c) 2002 The Open Math Company Limited
The Terms of Distribution of this software are stipulated in the javadoc Overview for this project.
| Constructor Summary | |
UniqueIdGeneratorBean()
|
|
| Method Summary | |
void |
ejbActivate()
Invoked when the instance is taken out of the pool of available instances to become associated with a specific EJB object. |
UniqueIdGeneratorPK |
ejbCreate(UniqueIdGeneratorPK key)
Creates a new UniqueIdGenerator EJB instance. |
void |
ejbLoad()
The container invokes this method to instruct the instance to synchronize its state by loading its state from the underlying database. |
void |
ejbPassivate()
A container invokes this method on an instance before the instance becomes disassociated with a specific EJB object. |
void |
ejbPostCreate(UniqueIdGeneratorPK key)
Executed after the create operation has completed. |
void |
ejbRemove()
The container invokes this method before it removes the EJB object that is currently associated with the instance. |
void |
ejbStore()
The container invokes this method to instruct the instance to synchronize its state by storing it to the underlying database. |
abstract long |
getId()
Returns the current unique ID as issued by this UniqueIdGenerator EJB. |
abstract UniqueIdGeneratorPK |
getKey()
Returns the primary key for this UniqueIdGenerator EJB. |
long |
nextId()
Generates the next unique ID . |
void |
setEntityContext(EntityContext ctx)
Sets the private entity context of this instance. |
abstract void |
setId(long id)
Sets the unique ID for this UniqueIdGenerator EJB to the given long value. |
abstract void |
setKey(UniqueIdGeneratorPK key)
Sets the primary key for this UniqueIdGenerator EJB to the given UniqueIdGeneratorPK object. |
void |
unsetEntityContext()
Sets the private entity context of this instance to null. |
| Methods inherited from class java.lang.Object |
|
| Constructor Detail |
public UniqueIdGeneratorBean()
| Method Detail |
public abstract UniqueIdGeneratorPK getKey()
Returns the primary key for this UniqueIdGenerator EJB.
This method is implemented by the EJB 2.0 compliant container.
UniqueIdGeneratorPK uniquely identifying this instance.public abstract void setKey(UniqueIdGeneratorPK key)
Sets the primary key for this UniqueIdGenerator EJB to the given
UniqueIdGeneratorPK object. Note that this method should not
be made available via the EJB's remote interface.
This method is implemented by the EJB 2.0 compliant container.
key - a UniqueIdGeneratorPK specifying the key.public abstract long getId()
Returns the current unique ID as issued by this UniqueIdGenerator EJB.
This method is implemented by the EJB 2.0 compliant container.
long indicating the current unique ID as issied by this
UniqueIdGenerator EJB.public abstract void setId(long id)
Sets the unique ID for this UniqueIdGenerator EJB to the given
long value. Note that this method should not
be made available via the EJB's remote interface.
This method is implemented by the EJB 2.0 compliant container.
id - a long specifying the new unique ID value.public long nextId()
Generates the next unique ID . The method returns the new unique ID value.
long indicating the new current unique ID as issied by this
UniqueIdGenerator EJB.
public UniqueIdGeneratorPK ejbCreate(UniqueIdGeneratorPK key)
throws CreateException
Creates a new UniqueIdGenerator EJB instance. The new instance will have
the given key and will have its unique ID set to 0.
key - a UniqueIdGeneratorPK specifying the key.UniqueIdGeneratorPK uniquely identifying this
UniqueIdGenerator EJBinstance.CreateException - if the new instance could not be created,
for whatever reason.
public void ejbPostCreate(UniqueIdGeneratorPK key)
throws CreateException
Executed after the create operation has completed. Does nothing.
key - a UniqueIdGeneratorPK specifying the key.CreateException - if the method not be executed,
for whatever reason (for example, because a UniqueIdGenerator
with the same key already exists).public void setEntityContext(EntityContext ctx)
Sets the private entity context of this instance. The container invokes this method on an instance after it has been created.
setEntityContext in interface EntityBeanctx - an EntityContext specifying the key.public void unsetEntityContext()
Sets the private entity context of this instance to null.
The container calls this method before removing the instance.
unsetEntityContext in interface EntityBeanpublic void ejbLoad()
The container invokes this method to instruct the instance to synchronize its state by loading its state from the underlying database. Does nothing.
ejbLoad in interface EntityBeanpublic void ejbStore()
The container invokes this method to instruct the instance to synchronize its state by storing it to the underlying database. Does nothing.
ejbStore in interface EntityBeanpublic void ejbRemove()
The container invokes this method before it removes the EJB object that is currently associated with the instance. This method is invoked when a client invokes a remove operation on the enterprise Bean's home interface or the EJB object's remote interface.
This transitions the instance from the ready state to the pool of available instances.
ejbRemove in interface EntityBeanpublic void ejbActivate()
Invoked when the instance is taken out of the pool of available instances to become associated with a specific EJB object.
This transitions the instance to the ready state.
ejbActivate in interface EntityBeanpublic void ejbPassivate()
A container invokes this method on an instance before the instance becomes disassociated with a specific EJB object.
After this method completes, the container will place the instance into the pool of available instances.
ejbPassivate in interface EntityBean
|
OpMath | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||