Package org.jgroups.protocols
Class TP.ProtocolAdapter
java.lang.Object
org.jgroups.stack.Protocol
org.jgroups.protocols.TP.ProtocolAdapter
- All Implemented Interfaces:
TP.ProbeHandler
- Enclosing class:
TP
Used when the transport is shared (singleton_name is not null). Maintains the cluster name, local address and
view
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionAn event is to be sent down the stack.getName()All protocol names have to be unique !Returns the SocketFactory associated with this protocol, if overridden in a subclass, or passes the call downSupposed to be overwritten by subclasses.shorthandleProbe(String... keys) Handles a probe.voidsetSocketFactory(SocketFactory factory) Sets a SocketFactory.voidstart()This method is called on aChannel.connect(String).voidstop()This method is called on aChannel.disconnect().String[]Returns a list of supported keystoString()Methods inherited from class org.jgroups.stack.Protocol
destroy, downThreadEnabled, dumpStats, enableStats, getConfigurableObjects, getDownProtocol, getId, getLevel, getProperties, getProtocolStack, getTransport, getUpProtocol, getValue, init, isErgonomics, printStats, providedDownServices, providedUpServices, requiredDownServices, requiredUpServices, resetStats, setDownProtocol, setErgonomics, setId, setLevel, setProperties, setPropertiesInternal, setProperty, setProtocolStack, setUpProtocol, setValue, setValues, statsEnabled, up, upThreadEnabled
-
Field Details
-
socket_factory
-
-
Constructor Details
-
ProtocolAdapter
-
-
Method Details
-
getClusterName
-
getAddress
-
getAddressAsString
-
getAddressAsUUID
-
getTransportName
public short getTransportName() -
getMembers
-
getThreadFactory
Description copied from class:ProtocolSupposed to be overwritten by subclasses. Usually the transport returns a valid non-null thread factory, but thread factories can also be created by individual protocols- Overrides:
getThreadFactoryin classProtocol- Returns:
-
getSocketFactory
Description copied from class:ProtocolReturns the SocketFactory associated with this protocol, if overridden in a subclass, or passes the call down- Overrides:
getSocketFactoryin classProtocol- Returns:
- SocketFactory
-
setSocketFactory
Description copied from class:ProtocolSets a SocketFactory. Socket factories are typically provided by the transport (TP) orTP.ProtocolAdapter- Overrides:
setSocketFactoryin classProtocol- Parameters:
factory-
-
start
Description copied from class:ProtocolThis method is called on aChannel.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.- Overrides:
startin classProtocol- Throws:
Exception- Thrown if protocol cannot be started successfully. This will cause the ProtocolStack to fail, soChannel.connect(String)will throw an exception
-
stop
public void stop()Description copied from class:ProtocolThis method is called on aChannel.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 -
down
Description copied from class:ProtocolAn event is to be sent down the stack. The layer may want to examine its type and perform some action on it, depending on the event's type. If the event is a message MSG, then the layer may need to add a header to it (or do nothing at all) before sending it down the stack usingdown_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 usingup_prot.up(). -
getName
Description copied from class:ProtocolAll protocol names have to be unique ! -
toString
-
handleProbe
Description copied from interface:TP.ProbeHandlerHandles a probe. For each key that is handled, the key and its result should be in the returned map.- Specified by:
handleProbein interfaceTP.ProbeHandler- Parameters:
keys-- Returns:
- Mapinvalid input: '<'String,String>. A map of keys and values. A null return value is permissible.
-
supportedKeys
Description copied from interface:TP.ProbeHandlerReturns a list of supported keys- Specified by:
supportedKeysin interfaceTP.ProbeHandler
-