JGroupsJChannel

JChannel Structure

 

 

JChannel Life Cycle

 

 

A newly created JChannel instance is by default in Open state:

 

  • The Queue is created and is open

  • The protocol stack is created and set up (the protocol stack's queues and threads are created and started)

  • The closed flag is false

  • The connected flag is false

 

The JChannel transitions from Open to Connected upon the invocation of the connect() method.  The JChannel connects to the group:

  • The start() method is invoked on the ProtocolStack, which in turn calls stack() on all protocols, from top to bottom.

  • Event.START is sent down the stack.

  • The closed stays false

  • The connected becomes true

 

 

The JChannel transitions from Connected to Open upon the invocation of the disconnect() method, when the JChannel leaves the group.

 

From both Open and Connected states, the JChannel can be brought in the Closed state by invoking close(). Once the channel is closed, it cannot be used anymore.

 

Upon the arrival of an EXIT event, the channel is shunned: a new CloserThread is created and started, and depending on the auto_reconnect configuration parameter value, the thread could re-connect or permanently close the channel.

 

 

 

 

 

 

 

Back to JGroups