org.apache.avalon.excalibur.component.servlet
Class AbstractReferenceProxyLatch

java.lang.Object
  extended by org.apache.avalon.framework.logger.AbstractLogEnabled
      extended by org.apache.avalon.excalibur.component.servlet.AbstractReferenceProxyLatch
All Implemented Interfaces:
org.apache.avalon.framework.logger.LogEnabled
Direct Known Subclasses:
ExcaliburComponentManagerServlet.Latch

Deprecated. ECM is no longer supported

abstract class AbstractReferenceProxyLatch
extends org.apache.avalon.framework.logger.AbstractLogEnabled

Servlet containers do not have a guaranteed order in which servlets will be destroyed like there is with initialization. This means that the servlet which created and controls an object may be destroyed while other servlets are still using it. This presents a problem in environments where common objects are placed into the ServletContext and used by more than one servlet. To solve this problem an object is placed into the ServletContext wrapped in a ReferenceProxy. Whe nthe servlet is ready to be shutdown. This proxy latch is used to wait until all other servlets are done with the components before disposing them.

Since:
4.2
Version:
CVS $Revision: 1.4 $ $Date: 2004/02/28 11:47:16 $
Author:
Avalon Development Team

Field Summary
private  java.lang.String m_name
          Deprecated. Name of the latch
private  boolean m_triggerRequested
          Deprecated. Flag that keeps track of when the trigger is requested.
private  int m_waitingProxies
          Deprecated. Number of registered proxies which have not yet been finalized.
 
Constructor Summary
AbstractReferenceProxyLatch()
          Deprecated. Create a new ReferenceProxyLatch.
 
Method Summary
 ReferenceProxy createProxy(java.lang.Object object, java.lang.String name)
          Deprecated.  
(package private)  void notifyFinalized(AbstractReferenceProxy proxy)
          Deprecated. Called by a proxy when it is finalized.
 void requestTrigger()
          Deprecated. Request that the triggered() method be called by asking all of the proxies managed by the latch to notify that they are no longer accepting requests to reference their internal objects.
abstract  void triggered()
          Deprecated. Called when all of the proxies have notified that they are done.
 
Methods inherited from class org.apache.avalon.framework.logger.AbstractLogEnabled
enableLogging, getLogger, setupLogger, setupLogger, setupLogger
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

m_name

private java.lang.String m_name
Deprecated. 
Name of the latch


m_waitingProxies

private int m_waitingProxies
Deprecated. 
Number of registered proxies which have not yet been finalized.


m_triggerRequested

private boolean m_triggerRequested
Deprecated. 
Flag that keeps track of when the trigger is requested.

Constructor Detail

AbstractReferenceProxyLatch

public AbstractReferenceProxyLatch()
Deprecated. 
Create a new ReferenceProxyLatch.

Method Detail

createProxy

public ReferenceProxy createProxy(java.lang.Object object,
                                  java.lang.String name)
Deprecated. 
Parameters:
object - Object to be protected.
name - Name of the object.
Returns:
A new ReferenceProxy instance protecting the object.

requestTrigger

public void requestTrigger()
Deprecated. 
Request that the triggered() method be called by asking all of the proxies managed by the latch to notify that they are no longer accepting requests to reference their internal objects.


notifyFinalized

void notifyFinalized(AbstractReferenceProxy proxy)
Deprecated. 
Called by a proxy when it is finalized.

Parameters:
proxy - The AbstractRefernceProxy that is ready.

triggered

public abstract void triggered()
                        throws java.lang.Exception
Deprecated. 
Called when all of the proxies have notified that they are done.

Throws:
java.lang.Exception