|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.apache.directory.server.protocol.shared.chain.impl.ChainBase
public class ChainBase
Convenience base class for Chain implementations.
| Field Summary | |
|---|---|
protected Command[] |
commands
The list of Commands configured for this Chain, in
the order in which they may delegate processing to the remainder of
the Chain. |
protected boolean |
frozen
Flag indicating whether the configuration of our commands list has been frozen by a call to the execute() method. |
| Constructor Summary | |
|---|---|
ChainBase()
Construct a Chain with no configured Commands. |
|
ChainBase(java.util.Collection commands)
Construct a Chain configured with the specified
Commands. |
|
ChainBase(Command command)
Construct a Chain configured with the specified
Command. |
|
ChainBase(Command[] commands)
Construct a Chain configured with the specified
Commands. |
|
| Method Summary | |
|---|---|
void |
addCommand(Command command)
Add a Command to the list of Commands that will
be called in turn when this Chain's execute()
method is called. |
boolean |
execute(Context context)
Execute the processing represented by this Chain according
to the following algorithm. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected Command[] commands
The list of Commands configured for this Chain, in
the order in which they may delegate processing to the remainder of
the Chain.
protected boolean frozen
Flag indicating whether the configuration of our commands list
has been frozen by a call to the execute() method.
| Constructor Detail |
|---|
public ChainBase()
public ChainBase(Command command)
Construct a Chain configured with the specified
Command.
command - The Command to be configured
java.lang.IllegalArgumentException - if command
is nullpublic ChainBase(Command[] commands)
Construct a Chain configured with the specified
Commands.
commands - The Commands to be configured
java.lang.IllegalArgumentException - if commands,
or one of the individual Command elements,
is nullpublic ChainBase(java.util.Collection commands)
Construct a Chain configured with the specified
Commands.
commands - The Commands to be configured
java.lang.IllegalArgumentException - if commands,
or one of the individual Command elements,
is null| Method Detail |
|---|
public void addCommand(Command command)
ChainAdd a Command to the list of Commands that will
be called in turn when this Chain's execute()
method is called. Once execute() has been called
at least once, it is no longer possible to add additional
Commands; instead, an exception will be thrown.
addCommand in interface Chaincommand - The Command to be added
public boolean execute(Context context)
throws java.lang.Exception
ChainExecute the processing represented by this Chain according
to the following algorithm.
Commands in the Chain,
return false.execute() method of each Command
configured on this chain, in the order they were added via calls
to the addCommand() method, until the end of the
configured Commands is encountered, or until one of
the executed Commands returns true
or throws an exception.Commands whose
execute() methods, starting with the last one that
was executed. If this Command instance is also a
Filter, call its postprocess() method,
discarding any exception that is thrown.Command whose execute() method
was called threw an exception, rethrow that exception.execute()
method of the last Command that was executed. This will be
true if the last Command indicated that
processing of this Context has been completed, or
false if none of the called Commands
returned true.
execute in interface Chainexecute in interface Commandcontext - The Context to be processed by this
Chain
true if the processing of this Context
has been completed, or false if the processing
of this Context should be delegated to a subsequent
Command in an enclosing Chain
java.lang.Exception - if thrown by one of the Commands
in this Chain but not handled by a postprocess()
method of a Filter
java.lang.IllegalArgumentException - if context
is null
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||