Class AbstractConnectionProxyBasedReplicationRouter<T,L>
java.lang.Object
com.gigaspaces.internal.cluster.node.impl.router.AbstractConnectionProxyBasedReplicationRouter<T,L>
- All Implemented Interfaces:
IReplicationRouter,IReplicationRouterAdmin
- Direct Known Subclasses:
DirectOnlyReplicationRouter,LusReplicationRouter,SpaceProxyReplicationRouter
public abstract class AbstractConnectionProxyBasedReplicationRouter<T,L>
extends Object
implements IReplicationRouter, IReplicationRouterAdmin
A base class for replication routers that are using
IReplicationConnectionProxy to
communicate with each other.- Since:
- 8.0.3
- Author:
- eitany
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionclass -
Field Summary
Fields -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedAbstractConnectionProxyBasedReplicationRouter(String myLookupName, Uuid uuid, IConnectionMonitor<T, L> connectionMonitor, IServiceExporter serviceExporter, IIncomingReplicationHandler incomingReplicationHandler, IAsyncContextProvider asyncContextProvider, boolean setMyIdBeforeDispatch) protectedAbstractConnectionProxyBasedReplicationRouter(String myLookupName, Uuid uuid, IConnectionMonitor<T, L> connectionMonitor, IServiceExporter serviceExporter, IIncomingReplicationHandler incomingReplicationHandler, IAsyncContextProvider asyncContextProvider, boolean setMyIdBeforeDispatch, int replicationMonitorThreadPoolSize) -
Method Summary
Modifier and TypeMethodDescriptionvoidaddRemoteRouterStub(RouterStubHolder routerStubHolder) voidclose()protected IReplicationMonitoredConnectioncreateDirectConnection(String lookupName, boolean connectSynchronously) protected abstract AbstractProxyBasedReplicationMonitoredConnection<T,L> createNewMemberConnection(String lookupName, boolean connectSynchronously) voidgetAdmin()protected IConnectionMonitor<T,L> getDirectConnection(RouterStubHolder remoteStubHolder) Gets a direct connection to the router represented by the given stub.getMemberConnection(String lookupName) Create new replication connection and establishes it.getMemberConnectionAsync(String lookupName) Gets a replication connection to a designated replication node by its name, the received connection is automatically managed by the router and it is in charge of detecting disconnection and reestablish connection when available.Gets this router endpoint detailsGets a stub holder for the current router, that a remote router can use to create a connection to this routergetRemoteRouterStub(String routerLookupName) getStub()booleanhasExistingConnection(String lookupName) booleanisClosed()booleanvoidvoidvoidvoidremoveRemoteStubHolder(String routerLookupName) voidremoveUrlConnection(UrlProxyBasedReplicationMonitoredConnection<T, L> connection) wrapDirectStubWithMonitoredConnection(boolean connectSynchronously, RouterStubHolder routerStubHolder) Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface com.gigaspaces.internal.cluster.node.impl.router.IReplicationRouter
getUrlConnection
-
Field Details
-
_specificLogger
protected final org.slf4j.Logger _specificLogger
-
-
Constructor Details
-
AbstractConnectionProxyBasedReplicationRouter
protected AbstractConnectionProxyBasedReplicationRouter(String myLookupName, Uuid uuid, IConnectionMonitor<T, L> connectionMonitor, IServiceExporter serviceExporter, IIncomingReplicationHandler incomingReplicationHandler, IAsyncContextProvider asyncContextProvider, boolean setMyIdBeforeDispatch, int replicationMonitorThreadPoolSize) -
AbstractConnectionProxyBasedReplicationRouter
protected AbstractConnectionProxyBasedReplicationRouter(String myLookupName, Uuid uuid, IConnectionMonitor<T, L> connectionMonitor, IServiceExporter serviceExporter, IIncomingReplicationHandler incomingReplicationHandler, IAsyncContextProvider asyncContextProvider, boolean setMyIdBeforeDispatch)
-
-
Method Details
-
getMemberConnection
Description copied from interface:IReplicationRouterCreate new replication connection and establishes it.- Specified by:
getMemberConnectionin interfaceIReplicationRouter
-
getMemberConnectionAsync
Description copied from interface:IReplicationRouterGets a replication connection to a designated replication node by its name, the received connection is automatically managed by the router and it is in charge of detecting disconnection and reestablish connection when available. Connection is established asynchronously- Specified by:
getMemberConnectionAsyncin interfaceIReplicationRouter- Parameters:
lookupName- the replication node name to create the connection to- Returns:
- a connection to the specified replication node
-
createDirectConnection
protected IReplicationMonitoredConnection createDirectConnection(String lookupName, boolean connectSynchronously) -
wrapDirectStubWithMonitoredConnection
protected AbstractProxyBasedReplicationMonitoredConnection<IReplicationConnectionProxy,Object> wrapDirectStubWithMonitoredConnection(boolean connectSynchronously, RouterStubHolder routerStubHolder) -
createNewMemberConnection
protected abstract AbstractProxyBasedReplicationMonitoredConnection<T,L> createNewMemberConnection(String lookupName, boolean connectSynchronously) -
addRemoteRouterStub
- Specified by:
addRemoteRouterStubin interfaceIReplicationRouterAdmin
-
removeRemoteStubHolder
- Specified by:
removeRemoteStubHolderin interfaceIReplicationRouterAdmin
-
getDirectConnection
Description copied from interface:IReplicationRouterGets a direct connection to the router represented by the given stub.- Specified by:
getDirectConnectionin interfaceIReplicationRouter- Parameters:
remoteStubHolder- the target router of the connection- Returns:
- a connection to the specified router
-
close
public void close()- Specified by:
closein interfaceIReplicationRouter
-
getMyLookupName
- Specified by:
getMyLookupNamein interfaceIReplicationRouter
-
getMyUniqueId
- Specified by:
getMyUniqueIdin interfaceIReplicationRouter
-
isSetMyIdBeforeDispatch
public boolean isSetMyIdBeforeDispatch() -
getMyStubHolder
Description copied from interface:IReplicationRouterGets a stub holder for the current router, that a remote router can use to create a connection to this router- Specified by:
getMyStubHolderin interfaceIReplicationRouter- See Also:
-
getMyEndpointDetails
Description copied from interface:IReplicationRouterGets this router endpoint details- Specified by:
getMyEndpointDetailsin interfaceIReplicationRouter- Specified by:
getMyEndpointDetailsin interfaceIReplicationRouterAdmin
-
dumpState
- Specified by:
dumpStatein interfaceIReplicationRouter
-
pingStub
- Throws:
RemoteException
-
createStub
-
getStub
-
isClosed
public boolean isClosed() -
removeUrlConnection
-
removeMemberConnection
-
removeDirectConnection
-
getConnectionMonitor
-
getAsyncContextProvider
-
hasExistingConnection
-
getAdmin
- Specified by:
getAdminin interfaceIReplicationRouter
-
getMyRouterStubHolder
- Specified by:
getMyRouterStubHolderin interfaceIReplicationRouterAdmin
-
getRemoteRouterStub
- Specified by:
getRemoteRouterStubin interfaceIReplicationRouterAdmin
-
enableIncomingCommunication
public void enableIncomingCommunication()- Specified by:
enableIncomingCommunicationin interfaceIReplicationRouterAdmin
-