|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.jboss.portal.common.concurrent.Valve
Start in closed mode and adds an open() method to keep the same valve.
Field Summary | |
static int |
CLOSED
The valve is in hold state. |
static int |
CLOSING
The valve is in holding state. |
protected int |
invocations
The invocation count. |
static int |
OPEN
The valve is open. |
protected int |
state
The state. |
private static java.lang.String[] |
STATE_NAMES
User friendly names. |
protected java.lang.Object |
stateLock
The state lock. |
Constructor Summary | |
|
Valve()
Create a valve in the closed state |
protected |
Valve(int state)
Create a valve with the give initial state |
Method Summary | |
void |
afterInvocation()
Invoked after an invocation |
boolean |
beforeInvocation()
Invoked before an invocation |
void |
closed()
Invoked after closing. |
void |
closing()
Invoked before closing. |
boolean |
closing(long millis)
Invoked before closing. |
int |
getInvocations()
How many invocations are held in the valve. |
int |
getState()
Return the state. |
boolean |
isClosed()
Are we closed? |
void |
open()
Open the valve. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public static final int OPEN
public static final int CLOSING
public static final int CLOSED
private static final java.lang.String[] STATE_NAMES
protected final java.lang.Object stateLock
protected int state
protected int invocations
Constructor Detail |
public Valve()
protected Valve(int state)
state
- the initial stateMethod Detail |
public boolean isClosed()
public boolean beforeInvocation()
public void afterInvocation()
public int getState()
public int getInvocations()
public void open() throws java.lang.IllegalStateException
java.lang.IllegalStateException
- if the valve is not closedpublic void closing() throws java.lang.IllegalStateException
java.lang.IllegalStateException
- if the valve is closedpublic boolean closing(long millis) throws java.lang.IllegalStateException
java.lang.IllegalStateException
- if the valve is closedpublic void closed() throws java.lang.IllegalStateException
java.lang.IllegalStateException
- if the valve is not closing
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |