Class SHARED_LOOPBACK
java.lang.Object
org.jgroups.stack.Protocol
org.jgroups.protocols.TPConfig
org.jgroups.protocols.TP
org.jgroups.protocols.SHARED_LOOPBACK
- All Implemented Interfaces:
Lifecycle, DiagnosticsHandler.ProbeHandler
Loopback transport shared by all channels within the same VM. Property for testing is that no messages are lost.
Allows us to test various protocols at maximum speed.
- Author:
- Bela Ban
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected Viewprotected static final Function<AsciiString, Map<Address, SHARED_LOOPBACK>> protected booleanprotected booleanprotected PhysicalAddressprotected shortprotected static final Map<AsciiString, Map<Address, SHARED_LOOPBACK>> Map of cluster names and address-protocol mappings.Fields inherited from class TP
LIST, MIN_WAIT_BETWEEN_DISCOVERIES, MSG_OVERHEAD, MULTICASTFields inherited from class TPConfig
async_executor, bind_addr, bind_port, bundler, bundler_type, cluster_name, connectLock, diag_handler, external_addr, external_port, header, is_trace, last_discovery_request, local_physical_addr, local_transport, local_transport_class, log_discard_msgs, log_discard_msgs_version, logical_addr_cache, logical_addr_cache_expiration, logical_addr_cache_max_size, logical_addr_cache_reaper, logical_addr_cache_reaper_interval, members, message_processing_policy, msg_processing_policy, msg_stats, port_range, print_function, receive_interfaces, receive_on_all_interfaces, rtt, socket_factory, suppress_log_different_cluster, suppress_log_different_version, suppress_time_different_cluster_warnings, suppress_time_different_version_warnings, thread_factory, thread_naming_pattern, thread_pool, time_service, time_service_interval, timer, timer_handle_non_blocking_tasks, use_direct_memory, use_vthreads, view, who_has_cache, who_has_cache_timeoutFields inherited from class Protocol
after_creation_hook, down_prot, ergonomics, id, local_addr, log, policies, preview_warning, stack, stats, up_prot -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic voidclear(AsciiString cluster) coord(boolean b) voiddestroy()This method is called on aJChannel.close().An event is to be sent down the stack.static StringgetDiscoveryResponsesFor(String cluster_name) protected PhysicalAddressReturns the physical address of this transportgetView()protected voidvoidinit()Called after a protocol has been created and before the protocol is started.booleanisCoord()booleanisServer()protected static voidregister(AsciiString cluster, Address local_addr, SHARED_LOOPBACK shared_loopback) protected voidsendTo(Address dest, ByteBuffer buf) voidsendToAll(ByteBuffer data) Fetches the physical addrs for all mbrs and sends the msg to each physical address.voidsendUnicast(PhysicalAddress dest, ByteBuffer data) Send a unicast message to a member.voidstop()Called on aJChannel.disconnect(); stops work (e.g.booleanWhether hardware multicasting is supportedtoString()protected static voidunregister(AsciiString cluster, Address local_addr) Methods inherited from class TP
addPhysicalAddressToCache, addPhysicalAddressToCache, clearLogicalAddressCache, disableDiagnostics, doSend, down, enableDiagnostics, evictLogicalAddressCache, evictLogicalAddressCache, fetchLocalAddresses, fetchPhysicalAddrs, fetchResponsesFromDiscoveryProtocol, getAllPhysicalAddressesFromCache, getPhysicalAddressFromCache, handleConnect, handleDisconnect, handleMessageBatch, handleProbe, handleSingleMessage, passBatchUp, passMessageUp, processBatch, receive, receive, registerLocalAddress, removeLogicalAddressFromCache, sendUnicasts, setAddress, setInAllThreadFactories, setSourceAddress, setThreadNames, start, startDiagnostics, stopDiagnostics, supportedKeys, unicastDestMismatch, unsetThreadNames, versionMatchMethods inherited from class TPConfig
bundler, clearDifferentClusterCache, clearDifferentVersionCache, clusterName, createBundler, createDiagnosticsHandler, defaultHeaders, dumpTimerTasks, enableAllStats, enableBlockingTimerTasks, enableStats, getAsyncExecutor, getBindAddr, getBindAddress, getBindPort, getBundler, getBundlerClass, getBundlerType, getClusterName, getClusterNameAscii, getDiagnosticsHandler, getDifferentClusterMessages, getDifferentVersionMessages, getExternalAddr, getExternalPort, getLocalPhysicalAddress, getLocalTransport, getLogDiscardMessages, getLogDiscardMessagesVersion, getLogicalAddrCacheExpiration, getLogicalAddrCacheMaxSize, getLogicalAddrCacheReaperInterval, getLogicalAddressCache, getMessageProcessingPolicy, getMessageStats, getNumberOfThreadDumps, getNumMcastMsgsReceived, getNumMcastMsgsSent, getNumRejectedMsgs, getNumThreads, getNumTimerTasks, getNumUcastMsgsReceived, getNumUcastMsgsSent, getPortRange, getReceiveInterfaces, getRTT, getSocketFactory, getSuppressTimeDifferentClusterWarnings, getSuppressTimeDifferentVersionWarnings, getThreadFactory, getThreadNamingPattern, getThreadPool, getTimer, getTimerClass, getTimerThreads, getTimeService, getTimeServiceInterval, getWhoHasCacheTimeout, isLogicalAddressCacheReaperRunning, isReceiveOnAllInterfaces, isTrace, isTrace, localPhysicalAddress, logDiscardMsgs, logDiscardMsgs, logDiscardMsgsVersion, logDiscardMsgsVersion, loggerType, msgProcessingPolicy, msgProcessingPolicy, printLogicalAddressCache, printWhoHasCache, receiveOnAllInterfaces, receiveOnAllInterfaces, registerProbeHandler, removeCancelledTimerTasks, resetStats, sameCluster, setAsyncExecutor, setBindAddr, setBindAddress, setBindPort, setBindToAllInterfaces, setBundler, setBundlerType, setDiagnosticsHandler, setExternalAddr, setExternalPort, setLevel, setLocalTransport, setLocalTransport, setLogDiscardMessages, setLogDiscardMessagesVersion, setLogicalAddrCacheExpiration, setLogicalAddrCacheMaxSize, setLogicalAddrCacheReaperInterval, setMessageProcessingPolicy, setMessageStats, setPortRange, setSocketFactory, setSuppressTimeDifferentClusterWarnings, setSuppressTimeDifferentVersionWarnings, setThreadFactory, setThreadPool, setTimer, setTimeService, setTimeServiceInterval, setWhoHasCacheTimeout, threadNamingPattern, timestamp, unregisterProbeHandler, unregisterProbeHandler, useDirectMemory, useDirectMemory, useVirtualThreads, useVirtualThreads, viewMethods inherited from class Protocol
accept, addPolicy, addr, addr, afterCreationHook, down, getAddress, getComponents, getDownProtocol, getDownServices, getId, getIdsAbove, getLevel, getLog, getName, getPolicies, getProtocolStack, getTransport, getUpProtocol, getUpServices, getValue, isErgonomics, level, parse, policies, previewWarning, previewWarning, providedDownServices, providedUpServices, removePolicy, requiredDownServices, requiredUpServices, resetStatistics, setDownProtocol, setErgonomics, setId, setPolicies, setProtocolStack, setUpProtocol, setValue, statsEnabled, up, up, up
-
Field Details
-
port
protected short port -
physical_addr
-
curr_view
-
is_server
protected volatile boolean is_server -
is_coord
protected volatile boolean is_coord -
routing_table
Map of cluster names and address-protocol mappings. Used for routing messages to all or single members -
FUNC
-
-
Constructor Details
-
SHARED_LOOPBACK
public SHARED_LOOPBACK()
-
-
Method Details
-
supportsMulticasting
public boolean supportsMulticasting()Description copied from class:TPWhether hardware multicasting is supported- Specified by:
supportsMulticastingin classTP
-
getView
-
isServer
public boolean isServer() -
isCoord
public boolean isCoord() -
coord
-
toString
-
dumpRoutingTable
-
sendToAll
-
sendUnicast
Description copied from class:TPSend a unicast message to a member. Note that the destination address is a *physical*, not a logical address- Specified by:
sendUnicastin classTP- Parameters:
dest- Must be a non-null physical unicast address (e.g.IpAddress)data- The data to be sent. This is not a copy, so don't modify it- Throws:
Exception
-
sendTo
-
getDiscoveryResponsesFor
-
getPhysicalAddress
Description copied from class:TPReturns the physical address of this transport- Specified by:
getPhysicalAddressin classTP
-
down
Description copied from class:ProtocolAn event is to be sent down the stack. A protocol 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 protocol may need to add a header to it (or do nothing at all) before sending it down the stack usingdown_prot.down(). -
init
Description copied from class:ProtocolCalled after a protocol has been created and before the protocol is started. Attributes are already set. Other protocols are not yet connected and events cannot yet be sent. -
stop
-
destroy
-
clear
-
handleViewChange
-
register
protected static void register(AsciiString cluster, Address local_addr, SHARED_LOOPBACK shared_loopback) -
unregister
-