public class RemotingServiceImpl extends Object implements RemotingService, ServerConnectionLifeCycleListener
| Constructor and Description |
|---|
RemotingServiceImpl(ClusterManager clusterManager,
Configuration config,
ActiveMQServer server,
ManagementService managementService,
ScheduledExecutorService scheduledThreadPool,
List<ProtocolManagerFactory> protocolManagerFactories,
Executor flushExecutor,
ServiceRegistry serviceRegistry) |
| Modifier and Type | Method and Description |
|---|---|
void |
addIncomingInterceptor(BaseInterceptor interceptor) |
void |
addOutgoingInterceptor(BaseInterceptor interceptor) |
void |
allowInvmSecurityOverride(ActiveMQPrincipal principal)
Allow acceptors to use this as their default security Principal if applicable.
|
void |
connectionCreated(ActiveMQComponent component,
Connection connection,
ProtocolManager protocol)
This method is used both by client connector creation and server connection creation through
acceptors.
|
void |
connectionDestroyed(Object connectionID)
Called when a connection is destroyed.
|
void |
connectionException(Object connectionID,
ActiveMQException me)
Called when an error occurs on the connection.
|
void |
connectionReadyForWrites(Object connectionID,
boolean ready) |
Acceptor |
createAcceptor(String name,
String uri) |
Acceptor |
createAcceptor(TransportConfiguration info) |
void |
destroyAcceptor(String name) |
void |
freeze(String scaleDownNodeID,
CoreRemotingConnection connectionToKeepOpen)
Freezes and then disconnects all connections except the given one and tells the client where else
it might connect (only applicable if server is in a cluster and uses scaleDown-on-failover=true).
|
Acceptor |
getAcceptor(String name)
Returns the acceptor identified by its
name or null if it does not exists. |
ReusableLatch |
getConnectionCountLatch() |
ConnectionEntry |
getConnectionEntry(Object remotingConnectionID) |
Set<RemotingConnection> |
getConnections() |
List<BaseInterceptor> |
getIncomingInterceptors() |
List<BaseInterceptor> |
getOutgoinInterceptors() |
long |
getTotalConnectionCount() |
boolean |
isPaused()
Pauses the acceptors so that no more connections can be made to the server
|
boolean |
isStarted() |
void |
pauseAcceptors()
Pauses the acceptors so that no more connections can be made to the server
|
RemotingConnection |
removeConnection(Object remotingConnectionID)
Remove a connection from the connections held by the remoting service.
|
boolean |
removeIncomingInterceptor(BaseInterceptor interceptor) |
boolean |
removeOutgoingInterceptor(BaseInterceptor interceptor) |
void |
start() |
void |
startAcceptors() |
void |
stop(boolean criticalError) |
protected void |
updateProtocols() |
public RemotingServiceImpl(ClusterManager clusterManager, Configuration config, ActiveMQServer server, ManagementService managementService, ScheduledExecutorService scheduledThreadPool, List<ProtocolManagerFactory> protocolManagerFactories, Executor flushExecutor, ServiceRegistry serviceRegistry)
public void start()
throws Exception
start in interface RemotingServiceExceptionpublic Acceptor createAcceptor(String name, String uri) throws Exception
createAcceptor in interface RemotingServiceExceptionpublic Acceptor createAcceptor(TransportConfiguration info)
createAcceptor in interface RemotingServicepublic void destroyAcceptor(String name) throws Exception
destroyAcceptor in interface RemotingServiceExceptionpublic void startAcceptors()
throws Exception
startAcceptors in interface RemotingServiceExceptionpublic void allowInvmSecurityOverride(ActiveMQPrincipal principal)
RemotingServiceUsed by AS7 integration code.
allowInvmSecurityOverride in interface RemotingServicepublic void pauseAcceptors()
RemotingServicepauseAcceptors in interface RemotingServicepublic boolean isPaused()
RemotingServiceisPaused in interface RemotingServicepublic void freeze(String scaleDownNodeID, CoreRemotingConnection connectionToKeepOpen)
RemotingServicefreeze in interface RemotingServicepublic void stop(boolean criticalError)
throws Exception
stop in interface RemotingServiceExceptionpublic Acceptor getAcceptor(String name)
RemotingServicename or null if it does not exists.getAcceptor in interface RemotingServicename - the name of the acceptorpublic boolean isStarted()
isStarted in interface RemotingServicepublic ConnectionEntry getConnectionEntry(Object remotingConnectionID)
public RemotingConnection removeConnection(Object remotingConnectionID)
RemotingServiceremoveConnection in interface RemotingServiceremotingConnectionID - the ID of the RemotingConnection to removedpublic Set<RemotingConnection> getConnections()
getConnections in interface RemotingServicepublic long getTotalConnectionCount()
getTotalConnectionCount in interface RemotingServicepublic ReusableLatch getConnectionCountLatch()
getConnectionCountLatch in interface RemotingServicepublic void connectionCreated(ActiveMQComponent component, Connection connection, ProtocolManager protocol)
BaseConnectionLifeCycleListenercomponent parameter is normally passed as
null.
Leaving this method here and adding a different one at
ServerConnectionLifeCycleListener is a compromise for a reasonable split between the
activemq-server and activemq-client packages while avoiding to pull too much into activemq-core.
The pivotal point keeping us from removing the method is ConnectorFactory and the
usage of it.
connectionCreated in interface BaseConnectionLifeCycleListener<ProtocolManager>component - This will probably be an Acceptor and only used on the server side.connection - the connection that has been createdprotocol - the messaging protocol type this connection usespublic void connectionDestroyed(Object connectionID)
BaseConnectionLifeCycleListenerconnectionDestroyed in interface BaseConnectionLifeCycleListener<ProtocolManager>connectionID - the connection being destroyed.public void connectionException(Object connectionID, ActiveMQException me)
BaseConnectionLifeCycleListenerconnectionException in interface BaseConnectionLifeCycleListener<ProtocolManager>connectionID - the id of the connection.me - the exception.public void connectionReadyForWrites(Object connectionID, boolean ready)
connectionReadyForWrites in interface BaseConnectionLifeCycleListener<ProtocolManager>public void addIncomingInterceptor(BaseInterceptor interceptor)
addIncomingInterceptor in interface RemotingServicepublic List<BaseInterceptor> getIncomingInterceptors()
getIncomingInterceptors in interface RemotingServicepublic boolean removeIncomingInterceptor(BaseInterceptor interceptor)
removeIncomingInterceptor in interface RemotingServicepublic void addOutgoingInterceptor(BaseInterceptor interceptor)
addOutgoingInterceptor in interface RemotingServicepublic List<BaseInterceptor> getOutgoinInterceptors()
getOutgoinInterceptors in interface RemotingServicepublic boolean removeOutgoingInterceptor(BaseInterceptor interceptor)
removeOutgoingInterceptor in interface RemotingServiceprotected void updateProtocols()
Copyright © 2018 JBoss by Red Hat. All rights reserved.