public Object invoke(MethodCall call) throws Throwable
{
JBCMethodCall m = (JBCMethodCall) call;
InvocationContext ctx = getInvocationContext();
GlobalTransaction gtx = ctx.getGlobalTransaction();
// bypass for buddy group org metod calls.
if (isBuddyGroupOrganisationMethod(m)) return super.invoke(m);
boolean isLocalCommitOrRollback = gtx != null && !gtx.isRemote() && (m.getMethodId() == MethodDeclarations.commitMethod_id || m.getMethodId() == MethodDeclarations.rollbackMethod_id);
// pass up the chain if not a local commit or rollback (in which case replicate first)
Object o = isLocalCommitOrRollback ? null : super.invoke(m);
Option optionOverride = ctx.getOptionOverrides();
if (optionOverride != null && optionOverride.isCacheModeLocal() && ctx.getTransaction() == null)
{
log.trace("skip replication");
return isLocalCommitOrRollback ? super.invoke(m) : o;
}
Method method = m.getMethod();
// could be potentially TRANSACTIONAL. If so, we register for transaction completion callbacks (if we
// have not yet done so
if (ctx.getTransaction() != null)
{
if (gtx != null && !gtx.isRemote())
{
// lets see what sort of method we've got.
switch(m.getMethodId())
{
case MethodDeclarations.commitMethod_id: