public class RemotingServiceImpl extends Object implements RemotingService, ConnectionLifeCycleListener
Modifier and Type | Field and Description |
---|---|
static long |
CONNECTION_TTL_CHECK_INTERVAL |
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(Interceptor interceptor) |
void |
addOutgoingInterceptor(Interceptor interceptor) |
void |
allowInvmSecurityOverride(ActiveMQPrincipal principal)
Allow acceptors to use this as their default security Principal if applicable.
|
void |
connectionCreated(ActiveMQComponent component,
Connection connection,
String 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) |
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() |
Set<RemotingConnection> |
getConnections() |
List<BaseInterceptor> |
getIncomingInterceptors() |
List<BaseInterceptor> |
getOutgoinInterceptors() |
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(Interceptor interceptor) |
boolean |
removeOutgoingInterceptor(Interceptor interceptor) |
void |
start() |
void |
startAcceptors() |
void |
stop(boolean criticalError) |
protected void |
updateProtocols() |
public static final long CONNECTION_TTL_CHECK_INTERVAL
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 RemotingService
Exception
public void startAcceptors() throws Exception
startAcceptors
in interface RemotingService
Exception
public void allowInvmSecurityOverride(ActiveMQPrincipal principal)
RemotingService
Used by AS7 integration code.
allowInvmSecurityOverride
in interface RemotingService
public void pauseAcceptors()
RemotingService
pauseAcceptors
in interface RemotingService
public boolean isPaused()
RemotingService
isPaused
in interface RemotingService
public void freeze(String scaleDownNodeID, CoreRemotingConnection connectionToKeepOpen)
RemotingService
freeze
in interface RemotingService
public void stop(boolean criticalError) throws Exception
stop
in interface RemotingService
Exception
public Acceptor getAcceptor(String name)
RemotingService
name
or null
if it does not exists.getAcceptor
in interface RemotingService
name
- the name of the acceptorpublic boolean isStarted()
isStarted
in interface RemotingService
public RemotingConnection removeConnection(Object remotingConnectionID)
RemotingService
removeConnection
in interface RemotingService
remotingConnectionID
- the ID of the RemotingConnection to removedpublic Set<RemotingConnection> getConnections()
getConnections
in interface RemotingService
public ReusableLatch getConnectionCountLatch()
getConnectionCountLatch
in interface RemotingService
public void connectionCreated(ActiveMQComponent component, Connection connection, String protocol)
ConnectionLifeCycleListener
component
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 ConnectionLifeCycleListener
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)
ConnectionLifeCycleListener
connectionDestroyed
in interface ConnectionLifeCycleListener
connectionID
- the connection being destroyed.public void connectionException(Object connectionID, ActiveMQException me)
ConnectionLifeCycleListener
connectionException
in interface ConnectionLifeCycleListener
connectionID
- the id of the connection.me
- the exception.public void connectionReadyForWrites(Object connectionID, boolean ready)
connectionReadyForWrites
in interface ConnectionLifeCycleListener
public void addIncomingInterceptor(Interceptor interceptor)
addIncomingInterceptor
in interface RemotingService
public List<BaseInterceptor> getIncomingInterceptors()
getIncomingInterceptors
in interface RemotingService
public boolean removeIncomingInterceptor(Interceptor interceptor)
removeIncomingInterceptor
in interface RemotingService
public void addOutgoingInterceptor(Interceptor interceptor)
addOutgoingInterceptor
in interface RemotingService
public List<BaseInterceptor> getOutgoinInterceptors()
getOutgoinInterceptors
in interface RemotingService
public boolean removeOutgoingInterceptor(Interceptor interceptor)
removeOutgoingInterceptor
in interface RemotingService
protected void updateProtocols()
Copyright © 2016 JBoss by Red Hat. All rights reserved.