public abstract class AbstractBrokerMessageHandler extends Object implements MessageHandler, org.springframework.context.SmartLifecycle, org.springframework.context.ApplicationEventPublisherAware
MessageHandler
that manages subscriptions and
propagates messages to subscribers.Constructor and Description |
---|
AbstractBrokerMessageHandler(Collection<String> destinationPrefixes) |
Modifier and Type | Method and Description |
---|---|
protected boolean |
checkDestinationPrefix(String destination) |
org.springframework.context.ApplicationEventPublisher |
getApplicationEventPublisher() |
Collection<String> |
getDestinationPrefixes() |
int |
getPhase() |
void |
handleMessage(Message<?> message)
Handle the given message.
|
protected abstract void |
handleMessageInternal(Message<?> message) |
boolean |
isAutoStartup() |
boolean |
isRunning() |
protected void |
publishBrokerAvailableEvent() |
protected void |
publishBrokerUnavailableEvent() |
void |
setApplicationEventPublisher(org.springframework.context.ApplicationEventPublisher publisher) |
void |
setAutoStartup(boolean autoStartup) |
void |
start() |
protected void |
startInternal() |
void |
stop() |
void |
stop(Runnable callback) |
protected void |
stopInternal() |
protected final Log logger
public AbstractBrokerMessageHandler(Collection<String> destinationPrefixes)
public Collection<String> getDestinationPrefixes()
public void setApplicationEventPublisher(org.springframework.context.ApplicationEventPublisher publisher)
setApplicationEventPublisher
in interface org.springframework.context.ApplicationEventPublisherAware
public org.springframework.context.ApplicationEventPublisher getApplicationEventPublisher()
public void setAutoStartup(boolean autoStartup)
public boolean isAutoStartup()
isAutoStartup
in interface org.springframework.context.SmartLifecycle
public int getPhase()
getPhase
in interface org.springframework.context.Phased
public final boolean isRunning()
isRunning
in interface org.springframework.context.Lifecycle
public final void start()
start
in interface org.springframework.context.Lifecycle
protected void startInternal()
public final void stop()
stop
in interface org.springframework.context.Lifecycle
protected void stopInternal()
public final void stop(Runnable callback)
stop
in interface org.springframework.context.SmartLifecycle
public final void handleMessage(Message<?> message)
MessageHandler
handleMessage
in interface MessageHandler
message
- the message to be handledprotected abstract void handleMessageInternal(Message<?> message)
protected boolean checkDestinationPrefix(String destination)
protected void publishBrokerAvailableEvent()
protected void publishBrokerUnavailableEvent()