org.apache.activemq.broker.region
Interface Region

All Superinterfaces:
Service
All Known Subinterfaces:
Broker
All Known Implementing Classes:
AbstractRegion, AdvisoryBroker, AuthorizationBroker, BrokerBroadcaster, BrokerFilter, BrokerPluginSupport, CompositeDestinationBroker, ConnectionDotFileInterceptor, DestinationDotFileInterceptor, DotFileInterceptorSupport, EmptyBroker, ErrorBroker, InsertableMutableBrokerFilter, JaasAuthenticationBroker, JaasCertificateAuthenticationBroker, LoggingBrokerPlugin, ManagedQueueRegion, ManagedRegionBroker, ManagedTempQueueRegion, ManagedTempTopicRegion, ManagedTopicRegion, MasterBroker, MulticastTraceBrokerPlugin, MutableBrokerFilter, QueueRegion, RegionBroker, SimpleAuthenticationBroker, TempQueueRegion, TempTopicRegion, TimeStampingBrokerPlugin, TopicRegion, TransactionBroker, UDPTraceBrokerPlugin, UserIDBroker

public interface Region
extends Service

A Region is used to implement the different QOS options available to a broker. A Broker is composed of multiple message processing Regions that provide different QOS options.

Version:
$Revision$

Method Summary
 void acknowledge(ConnectionContext context, MessageAck ack)
          Used to acknowledge the receipt of a message by a client.
 Subscription addConsumer(ConnectionContext context, ConsumerInfo info)
          Adds a consumer.
 Destination addDestination(ConnectionContext context, ActiveMQDestination destination)
          Used to create a destination.
 void gc()
           
 java.util.Map getDestinationMap()
          Returns a copy of the current destinations available in the region
 java.util.Set getDestinations(ActiveMQDestination destination)
          Provide an exact or wildcard lookup of destinations in the region
 Response messagePull(ConnectionContext context, MessagePull pull)
          Allows a consumer to pull a message from a queue
 void processDispatchNotification(MessageDispatchNotification messageDispatchNotification)
          Process a notification of a dispatch - used by a Slave Broker
 void removeConsumer(ConnectionContext context, ConsumerInfo info)
          Removes a consumer.
 void removeDestination(ConnectionContext context, ActiveMQDestination destination, long timeout)
          Used to destroy a destination.
 void removeSubscription(ConnectionContext context, RemoveSubscriptionInfo info)
          Deletes a durable subscription.
 void send(ConnectionContext context, Message message)
          Send a message to the broker to using the specified destination.
 
Methods inherited from interface org.apache.activemq.Service
start, stop
 

Method Detail

addDestination

Destination addDestination(ConnectionContext context,
                           ActiveMQDestination destination)
                           throws java.lang.Exception
Used to create a destination. Usually, this method is invoked as a side-effect of sending a message to a destination that does not exist yet.

Parameters:
context -
destination - the destination to create.
Returns:
TODO
Throws:
java.lang.Exception - TODO

removeDestination

void removeDestination(ConnectionContext context,
                       ActiveMQDestination destination,
                       long timeout)
                       throws java.lang.Exception
Used to destroy a destination. This should try to quiesce use of the destination up to the timeout allotted time before removing the destination. This will remove all persistent messages associated with the destination.

Parameters:
context - the environment the operation is being executed under.
destination - what is being removed from the broker.
timeout - the max amount of time to wait for the destination to quiesce
Throws:
java.lang.Exception - TODO

getDestinationMap

java.util.Map getDestinationMap()
Returns a copy of the current destinations available in the region

Returns:
a copy of the regions currently active at the time of the call with the key the destination and the value the Destination.

addConsumer

Subscription addConsumer(ConnectionContext context,
                         ConsumerInfo info)
                         throws java.lang.Exception
Adds a consumer.

Parameters:
context - the environment the operation is being executed under.
Returns:
TODO
Throws:
java.lang.Exception - TODO

removeConsumer

void removeConsumer(ConnectionContext context,
                    ConsumerInfo info)
                    throws java.lang.Exception
Removes a consumer.

Parameters:
context - the environment the operation is being executed under.
Throws:
java.lang.Exception - TODO

removeSubscription

void removeSubscription(ConnectionContext context,
                        RemoveSubscriptionInfo info)
                        throws java.lang.Exception
Deletes a durable subscription.

Parameters:
context - the environment the operation is being executed under.
info - TODO
Throws:
java.lang.Exception - TODO

send

void send(ConnectionContext context,
          Message message)
          throws java.lang.Exception
Send a message to the broker to using the specified destination. The destination specified in the message does not need to match the destination the message is sent to. This is handy in case the message is being sent to a dead letter destination.

Parameters:
context - the environment the operation is being executed under.
Throws:
java.lang.Exception - TODO

acknowledge

void acknowledge(ConnectionContext context,
                 MessageAck ack)
                 throws java.lang.Exception
Used to acknowledge the receipt of a message by a client.

Parameters:
context - the environment the operation is being executed under.
Throws:
java.lang.Exception - TODO

messagePull

Response messagePull(ConnectionContext context,
                     MessagePull pull)
                     throws java.lang.Exception
Allows a consumer to pull a message from a queue

Throws:
java.lang.Exception

processDispatchNotification

void processDispatchNotification(MessageDispatchNotification messageDispatchNotification)
                                 throws java.lang.Exception
Process a notification of a dispatch - used by a Slave Broker

Parameters:
messageDispatchNotification -
Throws:
java.lang.Exception - TODO

gc

void gc()

getDestinations

java.util.Set getDestinations(ActiveMQDestination destination)
Provide an exact or wildcard lookup of destinations in the region

Returns:
a set of matching destination objects.


Copyright © 2010 Apache Software Foundation. All Rights Reserved.