Object failover = System.getProperty ("JBossCluster-DoFail");
boolean doFail = false;
if (failover != null &&
failover instanceof java.lang.String)
{
String strFailover = (java.lang.String)failover;
if (strFailover.equalsIgnoreCase ("true"))
{
doFail = true;
}
else if (strFailover.equalsIgnoreCase ("once"))
{
doFail = true;
System.setProperty ("JBossCluster-DoFail", "false");
}
}
if (doFail)
{
mi.setValue ("DO_FAIL_DURING_NEXT_CALL", Boolean.TRUE, PayloadKey.AS_IS);
System.out.println("SYSTEM : We fail during next call!!!");
}
else
mi.setValue ("DO_FAIL_DURING_NEXT_CALL", Boolean.FALSE, PayloadKey.AS_IS);
return getNext().invoke(mi);