if (type==NULL)
{
return invocation.invokeNext();
}
MethodInvocation mi = (MethodInvocation)invocation;
String methodName = mi.getMethod().getName();
Object target = mi.getTargetObject();
log.info("Invoke target=" + target.getClass().getName() + " method = " + methodName);
if (target instanceof ConnectionAdvised && "createSessionDelegate".equals(methodName)
&& type == TYPE_CREATE_SESSION)
{
// Used by the failover tests to kill server in the middle of an invocation.
log.info("##### Crashing on createSessionDelegate!!");
crash(target);
}
else if (target instanceof ConnectionAdvised && "sendTransaction".equals(methodName))
{
TransactionRequest request = (TransactionRequest)mi.getArguments()[0];
if (request.getRequestType() == TransactionRequest.TWO_PHASE_COMMIT_REQUEST
&& type == TYPE_2PC_COMMIT)
{
//Crash before 2pc commit (after prepare)- used in message bridge tests