Class AbstractStompSessionManager
java.lang.Object
org.springframework.integration.stomp.AbstractStompSessionManager
- All Implemented Interfaces:
Aware,BeanNameAware,DisposableBean,ApplicationEventPublisherAware,Lifecycle,Phased,SmartLifecycle,StompSessionManager
- Direct Known Subclasses:
ReactorNettyTcpStompSessionManager,WebSocketStompSessionManager
public abstract class AbstractStompSessionManager extends Object implements StompSessionManager, ApplicationEventPublisherAware, SmartLifecycle, DisposableBean, BeanNameAware
Base
StompSessionManager implementation to manage a single StompSession
over its ListenableFuture from the target implementation of this class.
The connection to the StompSession is made during start().
The stop() lifecycle method manages StompSession.disconnect().
The connect(StompSessionHandler) and disconnect(StompSessionHandler) method
implementations populate/remove the provided StompSessionHandler to/from an internal
AbstractStompSessionManager.CompositeStompSessionHandler, which delegates all operations
to the provided StompSessionHandlers.
This AbstractStompSessionManager.CompositeStompSessionHandler is used for the
StompSession connection.
- Since:
- 4.2
- Author:
- Artem Bilan, Gary Russell
-
Field Summary
Fields Modifier and Type Field Description protected Logloggerprotected StompClientSupportstompClient -
Constructor Summary
Constructors Constructor Description AbstractStompSessionManager(StompClientSupport stompClient) -
Method Summary
Modifier and Type Method Description voidconnect(StompSessionHandler handler)voiddestroy()voiddisconnect(StompSessionHandler handler)protected abstract ListenableFuture<StompSession>doConnect(StompSessionHandler handler)protected StompHeadersgetConnectHeaders()intgetPhase()longgetRecoveryInterval()booleanisAutoReceiptEnabled()booleanisAutoStartup()booleanisConnected()booleanisRunning()voidsetApplicationEventPublisher(ApplicationEventPublisher applicationEventPublisher)voidsetAutoReceipt(boolean autoReceipt)voidsetAutoStartup(boolean autoStartup)voidsetBeanName(String name)voidsetConnectHeaders(StompHeaders connectHeaders)voidsetPhase(int phase)voidsetRecoveryInterval(int recoveryInterval)Specify a reconnect interval in milliseconds in case of lost connection.voidstart()voidstop()StringtoString()
-
Field Details
-
Constructor Details
-
Method Details
-
setConnectHeaders
-
setAutoReceipt
public void setAutoReceipt(boolean autoReceipt) -
isAutoReceiptEnabled
public boolean isAutoReceiptEnabled()- Specified by:
isAutoReceiptEnabledin interfaceStompSessionManager
-
isConnected
public boolean isConnected()- Specified by:
isConnectedin interfaceStompSessionManager
-
setApplicationEventPublisher
- Specified by:
setApplicationEventPublisherin interfaceApplicationEventPublisherAware
-
setBeanName
- Specified by:
setBeanNamein interfaceBeanNameAware
-
setRecoveryInterval
public void setRecoveryInterval(int recoveryInterval)Specify a reconnect interval in milliseconds in case of lost connection.- Parameters:
recoveryInterval- the reconnect interval in milliseconds in case of lost connection.- Since:
- 4.2.2
-
setAutoStartup
public void setAutoStartup(boolean autoStartup) -
setPhase
public void setPhase(int phase) -
getRecoveryInterval
public long getRecoveryInterval() -
isAutoStartup
public boolean isAutoStartup()- Specified by:
isAutoStartupin interfaceSmartLifecycle
-
isRunning
public boolean isRunning() -
getPhase
public int getPhase()- Specified by:
getPhasein interfacePhased- Specified by:
getPhasein interfaceSmartLifecycle
-
destroy
public void destroy()- Specified by:
destroyin interfaceDisposableBean
-
start
public void start() -
stop
public void stop() -
connect
- Specified by:
connectin interfaceStompSessionManager
-
disconnect
- Specified by:
disconnectin interfaceStompSessionManager
-
getConnectHeaders
-
toString
-
doConnect
-