Heres my specifications.
Deuce api modification draft
Goal : Provide one external handler to listen to the course of the
transaction.
we define a Method class that hold all informations we need on origin
method. I added getAnnotations() method because i want to have the
flexibility to allow other annotations that the handler can use (like
@Persist)
class Method {
/* return method name */
public String getName();
/* return method parameters values or an empty array if none */
public Object[] getParameters();
/* return run time annotations or an empty array */
public Annotation[] getAnnotations();
}
we define a TransactionEvent class
class TransactionEvent {
public static enum Type {
INIT, COMMIT, ROLLBACK, RETRY,
/* HOOK to allow, just before commiting, an external agent to do
something that if throws an exception will rollback the transaction.
*/
HOOK
};
public Type getType();
public Method getOriginMethod();
/* return the origin object (a class if method call was static) */
public Object getOriginObject();
}
we define a TransactionEventHandler interface
interface TransactionEventHandler {
/* called after event in Deuce */
void handle(TransactionEvent event);
}
we hook the TransactionEventHandler to the Deuce api via System
properties, the same way we hook transaction manager (lsa, tl2, ...)
I made it more generic because i think that, with my persistence
implementation, it would not be possible to persist correctly all type
of transaction and that persistence would not be achieved by Deuce
itself. So this api modification can serve more purposes.
steeve
On 1 nov, 06:53, Guy Korland <
gkorl...@gmail.com> wrote:
> Yes it's possible to add to the Context.init() this info.
> Can you please define the API change more specific?
> Notice that a transaction can span between many object and many classes.
>
> Guy
>