org.objectweb.jonas.ha.interceptor
Class HACurrentDelegateImpl

java.lang.Object
  extended byorg.objectweb.jonas.ha.interceptor.HACurrentDelegateImpl
All Implemented Interfaces:
org.objectweb.carol.cmi.ha.interceptor.HACurrentDelegate

public class HACurrentDelegateImpl
extends java.lang.Object
implements org.objectweb.carol.cmi.ha.interceptor.HACurrentDelegate

This class handles the HAContext/Thread association

Author:
Francisco Perez-Sorrosal (fpsorrosal@no-spam@fi.upm.es), Alberto Paz-Jimenez (apaz@no-spam@fi.upm.es)

Constructor Summary
HACurrentDelegateImpl()
           
 
Method Summary
static HACurrentDelegateImpl getCurrent()
          Returns the unique instance
 org.objectweb.carol.cmi.ha.RequestId getCurrentReq()
          Get the current request in the current context if exists
 HAContext getHAContext()
          Returns the HA context associated with the current thread
 org.objectweb.carol.cmi.ha.RequestId getNextReq()
          Get the next request in the current context if exists
 org.objectweb.carol.cmi.ha.RequestId getRootReq()
          Get the root request in the current context if exists
 boolean replicate()
          Get the if it is necessary to replicate in the current context if exists
 void setCurrentReq(org.objectweb.carol.cmi.ha.RequestId currentReq)
          Set the current request in the current context if exists
 void setHAContext(HAContext ctx)
          Associates a HA context with the current thread
 void setNextReq(org.objectweb.carol.cmi.ha.RequestId nextReq)
          Set the next request in the current context if exists
 void setReplicate(boolean replicate)
          Set the if it is necessary to replicate in the current context if exists
 void setRootReq(org.objectweb.carol.cmi.ha.RequestId nextReq)
          Set the root request in the current context if exists
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

HACurrentDelegateImpl

public HACurrentDelegateImpl()
Method Detail

getCurrent

public static HACurrentDelegateImpl getCurrent()
Returns the unique instance

Returns:
the current instance

setHAContext

public void setHAContext(HAContext ctx)
Associates a HA context with the current thread

Parameters:
ctx - HAcontext to associate to the current thread

getHAContext

public HAContext getHAContext()
Returns the HA context associated with the current thread

Returns:
the HA context associated to the current thread

setCurrentReq

public void setCurrentReq(org.objectweb.carol.cmi.ha.RequestId currentReq)
Set the current request in the current context if exists

Parameters:
currentReq - the current request

getCurrentReq

public org.objectweb.carol.cmi.ha.RequestId getCurrentReq()
Get the current request in the current context if exists

Returns:
the current request

setNextReq

public void setNextReq(org.objectweb.carol.cmi.ha.RequestId nextReq)
Set the next request in the current context if exists

Specified by:
setNextReq in interface org.objectweb.carol.cmi.ha.interceptor.HACurrentDelegate
Parameters:
nextReq - the next request

getNextReq

public org.objectweb.carol.cmi.ha.RequestId getNextReq()
Get the next request in the current context if exists

Returns:
the next request

setRootReq

public void setRootReq(org.objectweb.carol.cmi.ha.RequestId nextReq)
Set the root request in the current context if exists

Parameters:
nextReq - the next request

getRootReq

public org.objectweb.carol.cmi.ha.RequestId getRootReq()
Get the root request in the current context if exists

Returns:
the root request

setReplicate

public void setReplicate(boolean replicate)
Set the if it is necessary to replicate in the current context if exists

Parameters:
replicate - true if it is necessary the replication procedure

replicate

public boolean replicate()
Get the if it is necessary to replicate in the current context if exists

Returns:
true if it is necessary the replication procedure