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() |
Map<String,ProtocolManagerFactory> |
getProtocolFactoryMap() |
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 Map<String,ProtocolManagerFactory> getProtocolFactoryMap()
getProtocolFactoryMap
in interface RemotingService
public void start() throws Exception
start
in interface RemotingService
Exception
public Acceptor createAcceptor(String name, String uri) throws Exception
createAcceptor
in interface RemotingService
Exception
public Acceptor createAcceptor(TransportConfiguration info)
createAcceptor
in interface RemotingService
public void destroyAcceptor(String name) throws Exception
destroyAcceptor
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 ConnectionEntry getConnectionEntry(Object remotingConnectionID)
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 long getTotalConnectionCount()
getTotalConnectionCount
in interface RemotingService
public ReusableLatch getConnectionCountLatch()
getConnectionCountLatch
in interface RemotingService
public void connectionCreated(ActiveMQComponent component, Connection connection, ProtocolManager protocol)
BaseConnectionLifeCycleListener
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 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)
BaseConnectionLifeCycleListener
connectionDestroyed
in interface BaseConnectionLifeCycleListener<ProtocolManager>
connectionID
- the connection being destroyed.public void connectionException(Object connectionID, ActiveMQException me)
BaseConnectionLifeCycleListener
connectionException
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 RemotingService
public List<BaseInterceptor> getIncomingInterceptors()
getIncomingInterceptors
in interface RemotingService
public boolean removeIncomingInterceptor(BaseInterceptor interceptor)
removeIncomingInterceptor
in interface RemotingService
public void addOutgoingInterceptor(BaseInterceptor interceptor)
addOutgoingInterceptor
in interface RemotingService
public List<BaseInterceptor> getOutgoinInterceptors()
getOutgoinInterceptors
in interface RemotingService
public boolean removeOutgoingInterceptor(BaseInterceptor interceptor)
removeOutgoingInterceptor
in interface RemotingService
protected void updateProtocols()
Copyright © 2018 JBoss by Red Hat. All rights reserved.