org.jboss.jms.client.container
Class ClosedInterceptor

java.lang.Object
  extended byorg.jboss.jms.client.container.ClosedInterceptor

public class ClosedInterceptor
extends java.lang.Object

An interceptor for checking closed state. It waits for other invocations to complete before allowing the close. I.e. it performs the function of a "valve". This interceptor is PER_INSTANCE.

Author:
Tim Fox,
Constructor Summary
ClosedInterceptor()
           
 
Method Summary
protected  boolean checkCloseAlreadyDone()
          Check the close has not already been done and wait for all invocations to complete
protected  boolean checkClosingAlreadyDone()
          Check the closing notification has not already been done
protected  void closed()
          Closed the object
protected  void closing()
          Closing the object
protected  void done()
          Mark the object as no longer inuse
 java.lang.String getName()
           
 java.lang.Object invoke(Invocation invocation)
           
protected  void maintainRelatives(Invocation invocation)
          Close children and remove from parent
protected  void removeSelf(Invocation invocation)
          Remove from parent
static java.lang.String stateToString(int state)
           
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ClosedInterceptor

public ClosedInterceptor()
Method Detail

stateToString

public static java.lang.String stateToString(int state)

toString

public java.lang.String toString()

getName

public java.lang.String getName()

invoke

public java.lang.Object invoke(Invocation invocation)
                        throws java.lang.Throwable
Throws:
java.lang.Throwable

checkClosingAlreadyDone

protected boolean checkClosingAlreadyDone()
                                   throws java.lang.Throwable
Check the closing notification has not already been done

Returns:
true when already closing or closed
Throws:
java.lang.Throwable

closing

protected void closing()
                throws java.lang.Throwable
Closing the object

Throws:
java.lang.Throwable

checkCloseAlreadyDone

protected boolean checkCloseAlreadyDone()
                                 throws java.lang.Throwable
Check the close has not already been done and wait for all invocations to complete

Returns:
true when already closed
Throws:
java.lang.Throwable

closed

protected void closed()
               throws java.lang.Throwable
Closed the object

Throws:
java.lang.Throwable

done

protected void done()
             throws java.lang.Throwable
Mark the object as no longer inuse

Throws:
java.lang.Throwable

maintainRelatives

protected void maintainRelatives(Invocation invocation)
Close children and remove from parent

Parameters:
invocation - the invocation

removeSelf

protected void removeSelf(Invocation invocation)
Remove from parent

Parameters:
invocation - the invocation


Copyright © 2006 JBoss Inc. All Rights Reserved.