org.apache.activemq.broker.region
Class Topic
java.lang.Object
org.apache.activemq.broker.region.Topic
- All Implemented Interfaces:
- Destination, Service
public class Topic
- extends Object
- implements Destination
The Topic is a destination that sends a copy of a message to every active
Subscription registered.
- Version:
- $Revision: 1.21 $
Method Summary |
void |
acknowledge(ConnectionContext context,
Subscription sub,
MessageAck ack,
MessageReference node)
|
void |
activate(ConnectionContext context,
DurableTopicSubscription subscription)
|
void |
addSubscription(ConnectionContext context,
Subscription sub)
|
Message[] |
browse()
|
void |
deactivate(ConnectionContext context,
DurableTopicSubscription sub)
|
void |
deleteSubscription(ConnectionContext context,
SubscriptionKey key)
|
protected void |
dispatch(ConnectionContext context,
Message message)
|
void |
dispose(ConnectionContext context)
|
void |
gc()
|
ActiveMQDestination |
getActiveMQDestination()
|
DeadLetterStrategy |
getDeadLetterStrategy()
|
String |
getDestination()
|
DestinationStatistics |
getDestinationStatistics()
|
DispatchPolicy |
getDispatchPolicy()
|
MessageStore |
getMessageStore()
|
String |
getName()
|
SubscriptionRecoveryPolicy |
getSubscriptionRecoveryPolicy()
|
UsageManager |
getUsageManager()
|
boolean |
isSendAdvisoryIfNoConsumers()
|
Message |
loadMessage(MessageId messageId)
|
boolean |
lock(MessageReference node,
LockOwner sub)
|
protected void |
onMessageWithNoConsumers(ConnectionContext context,
Message message)
Provides a hook to allow messages with no consumer to be processed in
some way - such as to send to a dead letter queue or something.. |
void |
removeSubscription(ConnectionContext context,
Subscription sub)
|
void |
send(ConnectionContext context,
Message message)
|
void |
setDeadLetterStrategy(DeadLetterStrategy deadLetterStrategy)
|
void |
setDispatchPolicy(DispatchPolicy dispatchPolicy)
|
void |
setSendAdvisoryIfNoConsumers(boolean sendAdvisoryIfNoConsumers)
|
void |
setSubscriptionRecoveryPolicy(SubscriptionRecoveryPolicy subscriptionRecoveryPolicy)
|
void |
start()
|
void |
stop()
|
String |
toString()
|
destination
protected final ActiveMQDestination destination
consumers
protected final edu.emory.mathcs.backport.java.util.concurrent.CopyOnWriteArrayList consumers
dispatchValve
protected final Valve dispatchValve
store
protected final TopicMessageStore store
usageManager
protected final UsageManager usageManager
destinationStatistics
protected final DestinationStatistics destinationStatistics
Topic
public Topic(ActiveMQDestination destination,
TopicMessageStore store,
UsageManager memoryManager,
DestinationStatistics parentStats,
TaskRunnerFactory taskFactory)
lock
public boolean lock(MessageReference node,
LockOwner sub)
- Specified by:
lock
in interface Destination
addSubscription
public void addSubscription(ConnectionContext context,
Subscription sub)
throws Exception
- Specified by:
addSubscription
in interface Destination
- Throws:
Exception
removeSubscription
public void removeSubscription(ConnectionContext context,
Subscription sub)
throws Exception
- Specified by:
removeSubscription
in interface Destination
- Throws:
Exception
deleteSubscription
public void deleteSubscription(ConnectionContext context,
SubscriptionKey key)
throws IOException
- Throws:
IOException
activate
public void activate(ConnectionContext context,
DurableTopicSubscription subscription)
throws Exception
- Throws:
Exception
deactivate
public void deactivate(ConnectionContext context,
DurableTopicSubscription sub)
throws Exception
- Throws:
Exception
send
public void send(ConnectionContext context,
Message message)
throws Exception
- Specified by:
send
in interface Destination
- Throws:
Exception
toString
public String toString()
- Overrides:
toString
in class Object
acknowledge
public void acknowledge(ConnectionContext context,
Subscription sub,
MessageAck ack,
MessageReference node)
throws IOException
- Specified by:
acknowledge
in interface Destination
- Throws:
IOException
dispose
public void dispose(ConnectionContext context)
throws IOException
- Specified by:
dispose
in interface Destination
- Throws:
IOException
gc
public void gc()
- Specified by:
gc
in interface Destination
loadMessage
public Message loadMessage(MessageId messageId)
throws IOException
- Throws:
IOException
start
public void start()
throws Exception
- Specified by:
start
in interface Service
- Throws:
Exception
stop
public void stop()
throws Exception
- Specified by:
stop
in interface Service
- Throws:
Exception
browse
public Message[] browse()
- Specified by:
browse
in interface Destination
getUsageManager
public UsageManager getUsageManager()
- Specified by:
getUsageManager
in interface Destination
getDestinationStatistics
public DestinationStatistics getDestinationStatistics()
- Specified by:
getDestinationStatistics
in interface Destination
getActiveMQDestination
public ActiveMQDestination getActiveMQDestination()
- Specified by:
getActiveMQDestination
in interface Destination
getDestination
public String getDestination()
getDispatchPolicy
public DispatchPolicy getDispatchPolicy()
setDispatchPolicy
public void setDispatchPolicy(DispatchPolicy dispatchPolicy)
getSubscriptionRecoveryPolicy
public SubscriptionRecoveryPolicy getSubscriptionRecoveryPolicy()
setSubscriptionRecoveryPolicy
public void setSubscriptionRecoveryPolicy(SubscriptionRecoveryPolicy subscriptionRecoveryPolicy)
isSendAdvisoryIfNoConsumers
public boolean isSendAdvisoryIfNoConsumers()
setSendAdvisoryIfNoConsumers
public void setSendAdvisoryIfNoConsumers(boolean sendAdvisoryIfNoConsumers)
getMessageStore
public MessageStore getMessageStore()
getDeadLetterStrategy
public DeadLetterStrategy getDeadLetterStrategy()
- Specified by:
getDeadLetterStrategy
in interface Destination
setDeadLetterStrategy
public void setDeadLetterStrategy(DeadLetterStrategy deadLetterStrategy)
getName
public String getName()
- Specified by:
getName
in interface Destination
dispatch
protected void dispatch(ConnectionContext context,
Message message)
throws Exception
- Throws:
Exception
onMessageWithNoConsumers
protected void onMessageWithNoConsumers(ConnectionContext context,
Message message)
throws Exception
- Provides a hook to allow messages with no consumer to be processed in
some way - such as to send to a dead letter queue or something..
- Throws:
Exception
Copyright © 2011 Apache Software Foundation. All Rights Reserved.