| java.lang.Object java.lang.Thread org.jgroups.stack.UpHandler org.jgroups.stack.ProtocolStack
ProtocolStack | public class ProtocolStack extends Protocol implements Transport(Code) | | A ProtocolStack manages a number of protocols layered above each other. It creates all
protocol classes, initializes them and, when ready, starts all of them, beginning with the
bottom most protocol. It also dispatches messages received from the stack to registered
objects (e.g. channel, GMP) and sends messages sent by those objects down the stack.
The ProtocolStack makes use of the Configurator to setup and initialize stacks, and to
destroy them again when not needed anymore
author: Bela Ban |
ABOVE | final public static int ABOVE(Code) | | |
BELOW | final public static int BELOW(Code) | | |
start_promise | Promise start_promise(Code) | | Used to sync on START/START_OK events for start()
|
stop_promise | Promise stop_promise(Code) | | used to sync on STOP/STOP_OK events for stop()
|
ProtocolStack | public ProtocolStack()(Code) | | Only used by Simulator; don't use
|
createProtocol | public Protocol createProtocol(String prot_spec) throws Exception(Code) | | Creates a new protocol given the protocol specification.
Parameters: prot_spec - The specification of the protocol. Same convention as for specifying a protocol stack.An exception will be thrown if the class cannot be created. Example:"VERIFY_SUSPECT(timeout=1500)" Note that no colons (:) have to bespecified Protocol The newly created protocol exception: Exception - Will be thrown when the new protocol cannot be created |
destroy | public void destroy()(Code) | | |
findProtocol | public Protocol findProtocol(String name)(Code) | | Returns a given protocol or null if not found
|
flushEvents | public void flushEvents()(Code) | | Not needed anymore, just left in here for backwards compatibility with JBoss AS
|
getProtocols | public Vector getProtocols()(Code) | | Returns all protocols in a list, from top to bottom. These are not copies of protocols,
so modifications will affect the actual instances !
|
insertProtocol | public void insertProtocol(Protocol prot, int position, String neighbor_prot) throws Exception(Code) | | Inserts an already created (and initialized) protocol into the protocol list. Sets the links
to the protocols above and below correctly and adjusts the linked list of protocols accordingly.
Note that this method may change the value of top_prot or bottom_prot.
Parameters: prot - The protocol to be inserted. Before insertion, a sanity check will ensure that noneof the existing protocols have the same name as the new protocol. Parameters: position - Where to place the protocol with respect to the neighbor_prot (ABOVE, BELOW) Parameters: neighbor_prot - The name of the neighbor protocol. An exception will be thrown if this nameis not found exception: Exception - Will be thrown when the new protocol cannot be created, or inserted. |
printProtocolSpec | public String printProtocolSpec(boolean include_properties)(Code) | | Prints the names of the protocols, from the bottom to top. If include_properties is true,
the properties for each protocol will also be printed.
|
printProtocolSpecAsXML | public String printProtocolSpecAsXML()(Code) | | |
receiveUpEvent | protected void receiveUpEvent(Event evt)(Code) | | |
removeProtocol | public void removeProtocol(String prot_name) throws Exception(Code) | | Removes a protocol from the stack. Stops the protocol and readjusts the linked lists of
protocols.
Parameters: prot_name - The name of the protocol. Since all protocol names in a stack have to be unique(otherwise the stack won't be created), the name refers to just 1 protocol. exception: Exception - Thrown if the protocol cannot be stopped correctly. |
startDownHandler | public void startDownHandler()(Code) | | |
startStack | public void startStack() throws Exception(Code) | | Start all layers. The
Protocol.start method is called in each protocol,
from top to bottom.
Each layer can perform some initialization, e.g. create a multicast socket
|
startUpHandler | public void startUpHandler()(Code) | | |
startWork | public void startWork()(Code) | | Override with null functionality: we don't need any threads to be started !
|
stopInternal | public void stopInternal()(Code) | | |
stopStack | public void stopStack()(Code) | | Iterates through all the protocols from top to bottom and does the following:
- Waits until all messages in the down queue have been flushed (ie., size is 0)
- Calls stop() on the protocol
|
stopWork | public void stopWork()(Code) | | Override with null functionality: we don't need any threads to be started !
|
Fields inherited from org.jgroups.stack.UpHandler | final protected Log log(Code)(Java Doc)
|
|
|