Class RemotingServiceImpl
- java.lang.Object
-
- org.apache.activemq.artemis.core.remoting.server.impl.RemotingServiceImpl
-
- All Implemented Interfaces:
RemotingService,BaseConnectionLifeCycleListener<ProtocolManager>,ServerConnectionLifeCycleListener
public class RemotingServiceImpl extends Object implements RemotingService, ServerConnectionLifeCycleListener
-
-
Constructor Summary
Constructors Constructor Description RemotingServiceImpl(ClusterManager clusterManager, Configuration config, ActiveMQServer server, ManagementService managementService, ScheduledExecutorService scheduledThreadPool, List<ProtocolManagerFactory> protocolManagerFactories, Executor flushExecutor, ServiceRegistry serviceRegistry)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddConnectionEntry(Connection connection, ConnectionEntry entry)voidaddIncomingInterceptor(BaseInterceptor interceptor)voidaddOutgoingInterceptor(BaseInterceptor interceptor)voidallowInvmSecurityOverride(ActiveMQPrincipal principal)Allow acceptors to use this as their default security Principal if applicable.voidconnectionCreated(ActiveMQComponent component, Connection connection, ProtocolManager protocol)voidconnectionDestroyed(Object connectionID)voidconnectionException(Object connectionID, ActiveMQException me)voidconnectionReadyForWrites(Object connectionID, boolean ready)AcceptorcreateAcceptor(String name, String uri)AcceptorcreateAcceptor(TransportConfiguration info)voiddestroyAcceptor(String name)voidfreeze(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).AcceptorgetAcceptor(String name)Returns the acceptor identified by itsnameornullif it does not exists.Map<String,Acceptor>getAcceptors()intgetConnectionCount()ReusableLatchgetConnectionCountLatch()Set<ConnectionEntry>getConnectionEntries()ConnectionEntrygetConnectionEntry(Object remotingConnectionID)Set<RemotingConnection>getConnections()List<BaseInterceptor>getIncomingInterceptors()List<BaseInterceptor>getOutgoinInterceptors()Map<String,ProtocolManagerFactory>getProtocolFactoryMap()longgetTotalConnectionCount()booleanisPaused()Pauses the acceptors so that no more connections can be made to the serverbooleanisStarted()voidloadProtocolServices(List<ActiveMQComponent> protocolServices)voidpauseAcceptors()Pauses the acceptors so that no more connections can be made to the serverRemotingConnectionremoveConnection(Object remotingConnectionID)Remove a connection from the connections held by the remoting service.booleanremoveIncomingInterceptor(BaseInterceptor interceptor)booleanremoveOutgoingInterceptor(BaseInterceptor interceptor)voidstart()voidstartAcceptors()voidstop(boolean criticalError)protected voidupdateProtocols()
-
-
-
Constructor Detail
-
RemotingServiceImpl
public RemotingServiceImpl(ClusterManager clusterManager, Configuration config, ActiveMQServer server, ManagementService managementService, ScheduledExecutorService scheduledThreadPool, List<ProtocolManagerFactory> protocolManagerFactories, Executor flushExecutor, ServiceRegistry serviceRegistry)
-
-
Method Detail
-
getProtocolFactoryMap
public Map<String,ProtocolManagerFactory> getProtocolFactoryMap()
- Specified by:
getProtocolFactoryMapin interfaceRemotingService
-
start
public void start() throws Exception- Specified by:
startin interfaceRemotingService- Throws:
Exception
-
createAcceptor
public Acceptor createAcceptor(String name, String uri) throws Exception
- Specified by:
createAcceptorin interfaceRemotingService- Throws:
Exception
-
createAcceptor
public Acceptor createAcceptor(TransportConfiguration info)
- Specified by:
createAcceptorin interfaceRemotingService
-
getAcceptors
public Map<String,Acceptor> getAcceptors()
- Specified by:
getAcceptorsin interfaceRemotingService
-
destroyAcceptor
public void destroyAcceptor(String name) throws Exception
- Specified by:
destroyAcceptorin interfaceRemotingService- Throws:
Exception
-
startAcceptors
public void startAcceptors() throws Exception- Specified by:
startAcceptorsin interfaceRemotingService- Throws:
Exception
-
allowInvmSecurityOverride
public void allowInvmSecurityOverride(ActiveMQPrincipal principal)
Description copied from interface:RemotingServiceAllow acceptors to use this as their default security Principal if applicable.Used by AS7 integration code.
- Specified by:
allowInvmSecurityOverridein interfaceRemotingService
-
pauseAcceptors
public void pauseAcceptors()
Description copied from interface:RemotingServicePauses the acceptors so that no more connections can be made to the server- Specified by:
pauseAcceptorsin interfaceRemotingService
-
isPaused
public boolean isPaused()
Description copied from interface:RemotingServicePauses the acceptors so that no more connections can be made to the server- Specified by:
isPausedin interfaceRemotingService
-
freeze
public void freeze(String scaleDownNodeID, CoreRemotingConnection connectionToKeepOpen)
Description copied from interface:RemotingServiceFreezes 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).- Specified by:
freezein interfaceRemotingService
-
stop
public void stop(boolean criticalError) throws Exception- Specified by:
stopin interfaceRemotingService- Throws:
Exception
-
getAcceptor
public Acceptor getAcceptor(String name)
Description copied from interface:RemotingServiceReturns the acceptor identified by itsnameornullif it does not exists.- Specified by:
getAcceptorin interfaceRemotingService- Parameters:
name- the name of the acceptor
-
isStarted
public boolean isStarted()
- Specified by:
isStartedin interfaceRemotingService
-
getConnectionEntry
public ConnectionEntry getConnectionEntry(Object remotingConnectionID)
-
removeConnection
public RemotingConnection removeConnection(Object remotingConnectionID)
Description copied from interface:RemotingServiceRemove a connection from the connections held by the remoting service. This method must be used only from the management API. RemotingConnections are removed from the remoting service when their connectionTTL is hit.- Specified by:
removeConnectionin interfaceRemotingService- Parameters:
remotingConnectionID- the ID of the RemotingConnection to removed- Returns:
- the removed RemotingConnection
-
getConnections
public Set<RemotingConnection> getConnections()
- Specified by:
getConnectionsin interfaceRemotingService
-
getConnectionEntries
public Set<ConnectionEntry> getConnectionEntries()
-
getConnectionCount
public int getConnectionCount()
- Specified by:
getConnectionCountin interfaceRemotingService- Returns:
- the number of clients connected to this server.
-
getTotalConnectionCount
public long getTotalConnectionCount()
- Specified by:
getTotalConnectionCountin interfaceRemotingService- Returns:
- the number of clients which have connected to this server since it was started.
-
getConnectionCountLatch
public ReusableLatch getConnectionCountLatch()
- Specified by:
getConnectionCountLatchin interfaceRemotingService
-
loadProtocolServices
public void loadProtocolServices(List<ActiveMQComponent> protocolServices)
- Specified by:
loadProtocolServicesin interfaceRemotingService
-
connectionCreated
public void connectionCreated(ActiveMQComponent component, Connection connection, ProtocolManager protocol)
- Specified by:
connectionCreatedin interfaceBaseConnectionLifeCycleListener<ProtocolManager>
-
addConnectionEntry
public void addConnectionEntry(Connection connection, ConnectionEntry entry)
- Specified by:
addConnectionEntryin interfaceRemotingService
-
connectionDestroyed
public void connectionDestroyed(Object connectionID)
- Specified by:
connectionDestroyedin interfaceBaseConnectionLifeCycleListener<ProtocolManager>
-
connectionException
public void connectionException(Object connectionID, ActiveMQException me)
- Specified by:
connectionExceptionin interfaceBaseConnectionLifeCycleListener<ProtocolManager>
-
connectionReadyForWrites
public void connectionReadyForWrites(Object connectionID, boolean ready)
- Specified by:
connectionReadyForWritesin interfaceBaseConnectionLifeCycleListener<ProtocolManager>
-
addIncomingInterceptor
public void addIncomingInterceptor(BaseInterceptor interceptor)
- Specified by:
addIncomingInterceptorin interfaceRemotingService
-
getIncomingInterceptors
public List<BaseInterceptor> getIncomingInterceptors()
- Specified by:
getIncomingInterceptorsin interfaceRemotingService
-
removeIncomingInterceptor
public boolean removeIncomingInterceptor(BaseInterceptor interceptor)
- Specified by:
removeIncomingInterceptorin interfaceRemotingService
-
addOutgoingInterceptor
public void addOutgoingInterceptor(BaseInterceptor interceptor)
- Specified by:
addOutgoingInterceptorin interfaceRemotingService
-
getOutgoinInterceptors
public List<BaseInterceptor> getOutgoinInterceptors()
- Specified by:
getOutgoinInterceptorsin interfaceRemotingService
-
removeOutgoingInterceptor
public boolean removeOutgoingInterceptor(BaseInterceptor interceptor)
- Specified by:
removeOutgoingInterceptorin interfaceRemotingService
-
updateProtocols
protected void updateProtocols()
-
-