| 
 | ||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.jgroups.stack.Protocol
org.jgroups.protocols.FORWARD_TO_COORD
public class FORWARD_TO_COORD
Forwards a message to the current coordinator. When the coordinator changes, forwards all pending messages to the new coordinator. Only looks at unicast messages.
Note that the ordering of messages sent in parallel to the resending of messages is currently (Sept 2012) undefined: when resending messages 1-4, and concurrently sending (new) messages 5 and 6, then FORWARD_TO_COORD only guarantees that messages [1,2,3,4] are delivered in that order and messages [5,6] are delivered in that order, too, but there are no guarantees regarding the ordering between [1,2,3,4] and [5,6], e.g. a receiver could deliver 1,5,2,3,6,4. This is currently not an issue, as the main consumer of FORWARD_TO_COORD is RELAY2, which is used by Infinispan to invoke sync or async RPCs across sites. In the former case, a unicast #2 will not be sent until unicast #1 is either ack'ed or times out. In a future version, ordering may be provided. Note though that OOB or UNRELIABLE messages don't need to be ordered.
| Nested Class Summary | |
|---|---|
| protected static class | FORWARD_TO_COORD.ForwardHeader | 
| Field Summary | |
|---|---|
| protected  Address | coordthe address of the current coordinator, all msgs are forwarded to it | 
| protected  java.util.concurrent.atomic.AtomicLong | current_idID to be used to identify forwarded messages. | 
| protected  ForwardQueue | fwd_queue | 
| protected  Address | local_addr | 
| protected  boolean | received_not_coordSet when NOT_COORD message has been received. | 
| protected  long | resend_delayDeprecated. | 
| Fields inherited from class org.jgroups.stack.Protocol | 
|---|
| down_prot, ergonomics, id, log, name, stack, stats, up_prot | 
| Constructor Summary | |
|---|---|
| FORWARD_TO_COORD() | |
| Method Summary | |
|---|---|
|  java.lang.Object | down(Event evt)An event is to be sent down the stack. | 
|  int | getDeliveryTableSize() | 
|  int | getForwardTableSize() | 
| protected  long | getNextId() | 
| protected  void | handleViewChange(View view) | 
|  java.util.List<java.lang.Integer> | providedUpServices()List of events that are provided to layers above (they will be handled when sent down from above) | 
| protected  void | send(Address target,
     long ack_id,
     byte type) | 
| protected  void | sendAck(Address target,
        long ack_id) | 
| protected  void | sendNotCoord(Address target,
             long ack_id) | 
|  void | start()This method is called on a Channel.connect(String). | 
|  void | stop()This method is called on a Channel.disconnect(). | 
|  java.lang.Object | up(Event evt)An event was received from the layer below. | 
| Methods inherited from class org.jgroups.stack.Protocol | 
|---|
| destroy, dumpStats, enableStats, getConfigurableObjects, getDownProtocol, getDownServices, getId, getIdsAbove, getLevel, getName, getProtocolStack, getSocketFactory, getThreadFactory, getTransport, getUpProtocol, getUpServices, getValue, init, isErgonomics, printStats, providedDownServices, requiredDownServices, requiredUpServices, resetStatistics, resetStats, setDownProtocol, setErgonomics, setId, setLevel, setProtocolStack, setSocketFactory, setUpProtocol, setValue, setValues, statsEnabled | 
| Methods inherited from class java.lang.Object | 
|---|
| clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait | 
| Field Detail | 
|---|
@Deprecated protected long resend_delay
protected volatile Address coord
protected volatile Address local_addr
protected final java.util.concurrent.atomic.AtomicLong current_id
protected final ForwardQueue fwd_queue
protected volatile boolean received_not_coord
| Constructor Detail | 
|---|
public FORWARD_TO_COORD()
| Method Detail | 
|---|
public int getForwardTableSize()
public int getDeliveryTableSize()
public java.util.List<java.lang.Integer> providedUpServices()
Protocol
providedUpServices in class Protocol
public void start()
           throws java.lang.Exception
ProtocolChannel.connect(String). Starts work.
 Protocols are connected and queues are ready to receive events.
 Will be called from bottom to top. This call will replace
 the START and START_OK events.
start in class Protocoljava.lang.Exception - Thrown if protocol cannot be started successfully. This will cause the ProtocolStack
                      to fail, so Channel.connect(String) will throw an exceptionpublic void stop()
ProtocolChannel.disconnect(). Stops work (e.g. by closing multicast socket).
 Will be called from top to bottom. This means that at the time of the method invocation the
 neighbor protocol below is still working. This method will replace the
 STOP, STOP_OK, CLEANUP and CLEANUP_OK events. The ProtocolStack guarantees that
 when this method is called all messages in the down queue will have been flushed
stop in class Protocolpublic java.lang.Object down(Event evt)
Protocoldown_prot.down(). In case of a GET_ADDRESS event (which tries to
 retrieve the stack's address from one of the bottom layers), the layer may need to send
 a new response event back up the stack using up_prot.up().
down in class Protocolpublic java.lang.Object up(Event evt)
Protocoldown_prot.down() or c) the event (or another event) is sent up
 the stack using up_prot.up().
up in class Protocolprotected long getNextId()
protected void handleViewChange(View view)
protected void sendAck(Address target,
                       long ack_id)
protected void sendNotCoord(Address target,
                            long ack_id)
protected void send(Address target,
                    long ack_id,
                    byte type)
| 
 | ||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||