org.spicefactory.pimento.transaction
Class TransactionContext

java.lang.Object
  extended by org.spicefactory.pimento.transaction.TransactionContext

public class TransactionContext
extends Object

The context for a single transaction.

Author:
Jens Halm

Method Summary
 void addDetachedEntity(EntityHandler entity)
          Adds a handler for a detached entity to this context.
 void addLoadedEntity(EntityHandler entity)
          Adds a handler for an entity to be sent to the client to this context.
 void addModifiedEntity(EntityHandler entity)
          Adds a handler for a modified persistent entity to this context.
 void addTransientEntity(EntityHandler entity)
          Adds a handler for a transient entity to this context.
 List<EntityHandler> getDetachedEntities()
          Returns the handlers for all detached entities of this transaction.
 List<EntityHandler> getLoadedEntities()
          Returns the handlers for all entities to be sent to the client.
 List<EntityHandler> getModifiedEntities()
          Returns the handlers for all modified persistent entities of this transaction.
 TransactionRequest getRequest()
          Returns the request sent by the client.
 TransactionResponse getResponse()
          Returns the response to be sent to the client.
 List<EntityHandler> getTransientEntities()
          Returns the handlers for all transient entities of this transaction.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getRequest

public TransactionRequest getRequest()
Returns the request sent by the client.

Returns:
the request sent by the client

getResponse

public TransactionResponse getResponse()
Returns the response to be sent to the client.

Returns:
the response to be sent to the client

addTransientEntity

public void addTransientEntity(EntityHandler entity)
Adds a handler for a transient entity to this context.

Parameters:
entity - a handler for a transient entity

addDetachedEntity

public void addDetachedEntity(EntityHandler entity)
Adds a handler for a detached entity to this context.

Parameters:
entity - a handler for a detached entity

addModifiedEntity

public void addModifiedEntity(EntityHandler entity)
Adds a handler for a modified persistent entity to this context.

Parameters:
entity - a handler for a modified persistent entity

addLoadedEntity

public void addLoadedEntity(EntityHandler entity)
Adds a handler for an entity to be sent to the client to this context.

Parameters:
entity - a handler for an entity to be sent to the client to this context

getTransientEntities

public List<EntityHandler> getTransientEntities()
Returns the handlers for all transient entities of this transaction.

Returns:
the handlers for all transient entities of this transaction

getDetachedEntities

public List<EntityHandler> getDetachedEntities()
Returns the handlers for all detached entities of this transaction.

Returns:
the handlers for all detached entities of this transaction

getModifiedEntities

public List<EntityHandler> getModifiedEntities()
Returns the handlers for all modified persistent entities of this transaction.

Returns:
the handlers for all modified persistent entities of this transaction

getLoadedEntities

public List<EntityHandler> getLoadedEntities()
Returns the handlers for all entities to be sent to the client.

Returns:
the handlers for all entities to be sent to the client