org.objectweb.speedo.pm.lib
Class SpeedoProxyManagerSwitch

java.lang.Object
  extended byorg.objectweb.speedo.pm.lib.SpeedoProxyManagerSwitch
All Implemented Interfaces:
ProxyManagerSwitch

public class SpeedoProxyManagerSwitch
extends java.lang.Object
implements ProxyManagerSwitch

This class is an implementation of the ProxyManagerSwitch based on the use of a ThreadLocal field. This field contains an instance of ProxyManager of an ArrayList of ProxyManager. A SpeedoProxyManagerSwitch is a fractal component which have no bindings.

Author:
S.Chassande-Barrioz

Field Summary
static java.lang.String BIND_ERROR_MSG
           
protected  java.lang.ThreadLocal pms
           
 
Constructor Summary
SpeedoProxyManagerSwitch()
           
 
Method Summary
 void bind(ProxyManager pm)
          It assignes a ProxyManager to the current context.
 void clear()
          It clears the list of ProxyManager for the current context.
 java.util.Collection entries()
           
 ProxyManager lookup(ProxyManagerFactory pmf)
           
 boolean unbind(ProxyManager pm)
          It clears a ProxyManager for the current context.
 boolean unbind(ProxyManagerFactory pmf)
          It clears the ProxyManager associated to a ProxyManagerFactory for the current context
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

pms

protected java.lang.ThreadLocal pms

BIND_ERROR_MSG

public static final java.lang.String BIND_ERROR_MSG
See Also:
Constant Field Values
Constructor Detail

SpeedoProxyManagerSwitch

public SpeedoProxyManagerSwitch()
Method Detail

lookup

public ProxyManager lookup(ProxyManagerFactory pmf)
Specified by:
lookup in interface ProxyManagerSwitch
Parameters:
pmf - is persistent manager factory which manages the returned proxy manager.
Returns:
the ProxyManager managed by the given persistence manager factory and bound to current the context, or the null value if there is no ProxyManager.

bind

public void bind(ProxyManager pm)
It assignes a ProxyManager to the current context.

Specified by:
bind in interface ProxyManagerSwitch
Parameters:
pm - is the ProxyManager

clear

public void clear()
It clears the list of ProxyManager for the current context.

Specified by:
clear in interface ProxyManagerSwitch

unbind

public boolean unbind(ProxyManager pm)
It clears a ProxyManager for the current context.

Specified by:
unbind in interface ProxyManagerSwitch
Returns:
true if the specified pm has been unbound from the context/thread

unbind

public boolean unbind(ProxyManagerFactory pmf)
Description copied from interface: ProxyManagerSwitch
It clears the ProxyManager associated to a ProxyManagerFactory for the current context

Specified by:
unbind in interface ProxyManagerSwitch
Returns:
true if a pm associated to the specified PMF, has been unbound from the context/thread

entries

public java.util.Collection entries()
Specified by:
entries in interface ProxyManagerSwitch
Returns:
all ProxyManager instances bound with the current context