public abstract class AbstractStompSessionManager extends Object implements StompSessionManager, ApplicationEventPublisherAware, SmartLifecycle, DisposableBean, BeanNameAware
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.
| Modifier and Type | Field and Description |
|---|---|
protected Log |
logger |
protected StompClientSupport |
stompClient |
DEFAULT_PHASE| Constructor and Description |
|---|
AbstractStompSessionManager(StompClientSupport stompClient) |
| Modifier and Type | Method and Description |
|---|---|
void |
connect(StompSessionHandler handler) |
void |
destroy() |
void |
disconnect(StompSessionHandler handler) |
protected abstract ListenableFuture<StompSession> |
doConnect(StompSessionHandler handler) |
protected StompHeaders |
getConnectHeaders() |
int |
getPhase() |
long |
getRecoveryInterval() |
boolean |
isAutoReceiptEnabled() |
boolean |
isAutoStartup() |
boolean |
isConnected() |
boolean |
isRunning() |
void |
setApplicationEventPublisher(ApplicationEventPublisher applicationEventPublisher) |
void |
setAutoReceipt(boolean autoReceipt) |
void |
setAutoStartup(boolean autoStartup) |
void |
setBeanName(String name) |
void |
setConnectHeaders(StompHeaders connectHeaders) |
void |
setPhase(int phase) |
void |
setRecoveryInterval(int recoveryInterval)
Specify a reconnect interval in milliseconds in case of lost connection.
|
void |
start() |
void |
stop() |
String |
toString() |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitstopprotected final Log logger
protected final StompClientSupport stompClient
public AbstractStompSessionManager(StompClientSupport stompClient)
public void setConnectHeaders(StompHeaders connectHeaders)
public void setAutoReceipt(boolean autoReceipt)
public boolean isAutoReceiptEnabled()
isAutoReceiptEnabled in interface StompSessionManagerpublic boolean isConnected()
isConnected in interface StompSessionManagerpublic void setApplicationEventPublisher(ApplicationEventPublisher applicationEventPublisher)
setApplicationEventPublisher in interface ApplicationEventPublisherAwarepublic void setBeanName(String name)
setBeanName in interface BeanNameAwarepublic void setRecoveryInterval(int recoveryInterval)
recoveryInterval - the reconnect interval in milliseconds in case of lost connection.public void setAutoStartup(boolean autoStartup)
public void setPhase(int phase)
public long getRecoveryInterval()
public boolean isAutoStartup()
isAutoStartup in interface SmartLifecyclepublic int getPhase()
getPhase in interface PhasedgetPhase in interface SmartLifecyclepublic void destroy()
destroy in interface DisposableBeanpublic void connect(StompSessionHandler handler)
connect in interface StompSessionManagerpublic void disconnect(StompSessionHandler handler)
disconnect in interface StompSessionManagerprotected StompHeaders getConnectHeaders()
protected abstract ListenableFuture<StompSession> doConnect(StompSessionHandler handler)