org.prevayler.implementation
Class Capsule

java.lang.Object
  extended by org.prevayler.implementation.Capsule
All Implemented Interfaces:
Serializable

public abstract class Capsule
extends Object
implements Serializable

See Also:
Serialized Form

Constructor Summary
protected Capsule(byte[] serialized)
           
protected Capsule(Object transaction, Serializer journalSerializer, boolean transactionDeepCopyMode)
           
 
Method Summary
abstract  Capsule cleanCopy()
          Makes a clean copy of this capsule that will have its own query result fields.
 Object deserialize(Serializer journalSerializer)
          Deserializes the contained Transaction or TransactionWithQuery.
 void executeOn(Object prevalentSystem, Date executionTime, Serializer journalSerializer)
          Executes a freshly deserialized copy of the transaction by default.
protected abstract  void justExecute(Object transaction, Object prevalentSystem, Date executionTime)
          Actually executes the Transaction or TransactionWithQuery.
 byte[] serialized()
          Gets the serialized representation of the transaction.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Capsule

protected Capsule(Object transaction,
                  Serializer journalSerializer,
                  boolean transactionDeepCopyMode)

Capsule

protected Capsule(byte[] serialized)
Method Detail

serialized

public byte[] serialized()
Gets the serialized representation of the transaction. Callers must not modify the returned array.


deserialize

public Object deserialize(Serializer journalSerializer)
Deserializes the contained Transaction or TransactionWithQuery.


executeOn

public void executeOn(Object prevalentSystem,
                      Date executionTime,
                      Serializer journalSerializer)
Executes a freshly deserialized copy of the transaction by default. If configureTransactionDeepCopy was set to true on your PrevaylerFactory, this will execute the transaction directly. The execution will synchronize on the prevalentSystem.


justExecute

protected abstract void justExecute(Object transaction,
                                    Object prevalentSystem,
                                    Date executionTime)
Actually executes the Transaction or TransactionWithQuery. The caller is responsible for synchronizing on the prevalentSystem.


cleanCopy

public abstract Capsule cleanCopy()
Makes a clean copy of this capsule that will have its own query result fields.



Copyright © 2001-2013. All Rights Reserved.