public class Valve extends Object
| Modifier and Type | Field and Description |
|---|---|
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.
|
protected Object |
stateLock
The state lock.
|
| Modifier | Constructor and Description |
|---|---|
|
Valve()
Create a valve in the closed state
|
protected |
Valve(int state)
Create a valve with the give initial state
|
| Modifier and Type | Method and Description |
|---|---|
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.
|
public static final int OPEN
public static final int CLOSING
public static final int CLOSED
protected final Object stateLock
protected int state
protected int invocations
public Valve()
protected Valve(int state)
state - the initial statepublic boolean isClosed()
public boolean beforeInvocation()
public void afterInvocation()
public int getState()
public int getInvocations()
public void open()
throws IllegalStateException
IllegalStateException - if the valve is not closedpublic void closing()
throws IllegalStateException
IllegalStateException - if the valve is closedpublic boolean closing(long millis)
throws IllegalStateException
IllegalStateException - if the valve is closedpublic void closed()
throws IllegalStateException
IllegalStateException - if the valve is not closingCopyright © 2025 JBoss by Red Hat. All Rights Reserved.