org.activemq.broker
Interface Broker

All Superinterfaces:
CapacityMonitor, Service
All Known Implementing Classes:
DefaultBroker

public interface Broker
extends Service, CapacityMonitor

The Message Broker which routes messages, maintains subscriptions and connections, acknowlegdges messages and handles transactions.

Version:
$Revision: 1.1.1.1 $

Nested Class Summary
 
Nested classes/interfaces inherited from interface org.activemq.capacity.CapacityMonitor
CapacityMonitor.BasicCapacityMonitor
 
Method Summary
 void acknowledgeMessage(BrokerClient client, MessageAck ack)
          Acknowledge positively or negatively, the consumption of a message by the Message Consumer
 void addClient(BrokerClient client, ConnectionInfo info)
          Notification of a new client attempting to connect, which can be rejected if authentication or authorization fails.
 void addConsumerInfoListener(ConsumerInfoListener l)
          Add a ConsumerInfoListener to the Broker
 void addMessageConsumer(BrokerClient client, ConsumerInfo info)
          Add an active message consumer, which could be rejected due to authorization
 void addMessageProducer(BrokerClient client, ProducerInfo info)
          Adds a new message producer, which could be rejected due to authorization
 void commitTransaction(BrokerClient client, ActiveMQXid xid, boolean onePhase)
           
 void commitTransaction(BrokerClient client, String transactionId)
          commit a transaction
 void deleteSubscription(String clientId, String subscriberName)
          Delete a durable subscriber
 BrokerAdmin getBrokerAdmin()
          Get's the admin interface of the broker.
 String getBrokerClusterName()
           
 BrokerInfo getBrokerInfo()
           
 String getBrokerName()
           
 Map getContainerManagerMap()
           
 DeadLetterPolicy getDeadLetterPolicy()
           
 Context getDestinationContext(Hashtable environment)
          Returns the naming context of the destinations available in this broker
 PersistenceAdapter getPersistenceAdapter()
           
 MessageContainerManager getPersistentQueueContainerManager()
           
 MessageContainerManager getPersistentTopicContainerManager()
           
 ActiveMQXid[] getPreparedTransactions(BrokerClient client)
          gets a list of all the prepared xa transactions.
 RedeliveryPolicy getRedeliveryPolicy()
           
 SecurityAdapter getSecurityAdapter()
          Returns the security adapter used to authenticate and authorize access to JMS resources
 File getTempDir()
          Get a temp directory - used for spooling
 MessageContainerManager getTransientQueueContainerManager()
           
 MessageContainerManager getTransientTopicContainerManager()
           
 int prepareTransaction(BrokerClient client, ActiveMQXid xid)
           
 void removeClient(BrokerClient client, ConnectionInfo info)
          A hint to the broker that an BrokerClient has stopped This enables the broker to clean-up any outstanding processing that may be outstanding
 void removeConsumerInfoListener(ConsumerInfoListener l)
          Remove a ConsumerInfoListener from the Broker
 void removeMessageConsumer(BrokerClient client, ConsumerInfo info)
          remove an active message consumer
 void removeMessageProducer(BrokerClient client, ProducerInfo info)
          Removes a producer
 void rollbackTransaction(BrokerClient client, ActiveMQXid xid)
           
 void rollbackTransaction(BrokerClient client, String transactionId)
          rollback a transaction
 void sendMessage(BrokerClient client, ActiveMQMessage message)
          send a message to the broker
 void sendToDeadLetterQueue(String deadLetterName, ActiveMQMessage message)
          Add a message to a dead letter queue
 void setDeadLetterPolicy(DeadLetterPolicy deadLetterPolicy)
          set the dead letter policy
 void setPersistenceAdapter(PersistenceAdapter persistenceAdapter)
          set the persistence adaptor
 void setRedeliveryPolicy(RedeliveryPolicy redeliveryPolicy)
          set the redelivery policy
 void setSecurityAdapter(SecurityAdapter securityAdapter)
          Sets the security adapter used to authenticate and authorize access to JMS resources
 void startTransaction(BrokerClient client, ActiveMQXid xid)
           
 void startTransaction(BrokerClient client, String transactionId)
          start a transaction
 
Methods inherited from interface org.activemq.service.Service
start, stop
 
Methods inherited from interface org.activemq.capacity.CapacityMonitor
addCapacityEventListener, generateCapacityMonitorEvent, getCurrentCapacity, getCurrentValue, getName, getRoundedCapacity, getRoundingFactor, getValueLimit, removeCapacityEventListener, setCurrentValue, setName, setRoundingFactor, setValueLimit
 

Method Detail

getBrokerAdmin

BrokerAdmin getBrokerAdmin()
Get's the admin interface of the broker.

Returns:
the admin interface of the broker.

getBrokerInfo

BrokerInfo getBrokerInfo()

addClient

void addClient(BrokerClient client,
               ConnectionInfo info)
               throws JMSException
Notification of a new client attempting to connect, which can be rejected if authentication or authorization fails.

Throws:
JMSException

removeClient

void removeClient(BrokerClient client,
                  ConnectionInfo info)
                  throws JMSException
A hint to the broker that an BrokerClient has stopped This enables the broker to clean-up any outstanding processing that may be outstanding

Throws:
JMSException

addMessageProducer

void addMessageProducer(BrokerClient client,
                        ProducerInfo info)
                        throws JMSException
Adds a new message producer, which could be rejected due to authorization

Throws:
JMSException

removeMessageProducer

void removeMessageProducer(BrokerClient client,
                           ProducerInfo info)
                           throws JMSException
Removes a producer

Throws:
JMSException

addMessageConsumer

void addMessageConsumer(BrokerClient client,
                        ConsumerInfo info)
                        throws JMSException
Add an active message consumer, which could be rejected due to authorization

Throws:
JMSException

removeMessageConsumer

void removeMessageConsumer(BrokerClient client,
                           ConsumerInfo info)
                           throws JMSException
remove an active message consumer

Throws:
JMSException

sendMessage

void sendMessage(BrokerClient client,
                 ActiveMQMessage message)
                 throws JMSException
send a message to the broker

Throws:
JMSException

acknowledgeMessage

void acknowledgeMessage(BrokerClient client,
                        MessageAck ack)
                        throws JMSException
Acknowledge positively or negatively, the consumption of a message by the Message Consumer

Throws:
JMSException

getPreparedTransactions

ActiveMQXid[] getPreparedTransactions(BrokerClient client)
                                      throws XAException
gets a list of all the prepared xa transactions.

Parameters:
client -
Throws:
XAException

deleteSubscription

void deleteSubscription(String clientId,
                        String subscriberName)
                        throws JMSException
Delete a durable subscriber

Parameters:
clientId -
subscriberName -
Throws:
JMSException - if the subscriber doesn't exist or is still active

startTransaction

void startTransaction(BrokerClient client,
                      String transactionId)
                      throws JMSException
start a transaction

Parameters:
client -
transactionId -
Throws:
JMSException

commitTransaction

void commitTransaction(BrokerClient client,
                       String transactionId)
                       throws JMSException
commit a transaction

Parameters:
client -
transactionId -
Throws:
JMSException

rollbackTransaction

void rollbackTransaction(BrokerClient client,
                         String transactionId)
                         throws JMSException
rollback a transaction

Parameters:
client -
transactionId -
Throws:
JMSException

startTransaction

void startTransaction(BrokerClient client,
                      ActiveMQXid xid)
                      throws XAException
Parameters:
client -
xid -
Throws:
XAException

prepareTransaction

int prepareTransaction(BrokerClient client,
                       ActiveMQXid xid)
                       throws XAException
Parameters:
client -
xid -
Returns:
Throws:
XAException

rollbackTransaction

void rollbackTransaction(BrokerClient client,
                         ActiveMQXid xid)
                         throws XAException
Parameters:
client -
xid -
Throws:
XAException

commitTransaction

void commitTransaction(BrokerClient client,
                       ActiveMQXid xid,
                       boolean onePhase)
                       throws XAException
Parameters:
client -
xid -
onePhase -
Throws:
XAException

getTempDir

File getTempDir()
Get a temp directory - used for spooling

Returns:
a File ptr to the directory

getBrokerName

String getBrokerName()
Returns:
the name of the Broker

getBrokerClusterName

String getBrokerClusterName()
Returns:
the name of the cluster the broker belongs to

getPersistenceAdapter

PersistenceAdapter getPersistenceAdapter()
Returns:
the PersistenceAdaptor

setPersistenceAdapter

void setPersistenceAdapter(PersistenceAdapter persistenceAdapter)
set the persistence adaptor

Parameters:
persistenceAdapter -

getContainerManagerMap

Map getContainerManagerMap()
Returns:
a map, indexed by name of the container managers

getDestinationContext

Context getDestinationContext(Hashtable environment)
Returns the naming context of the destinations available in this broker

Parameters:
environment -
Returns:
the context

addConsumerInfoListener

void addConsumerInfoListener(ConsumerInfoListener l)
Add a ConsumerInfoListener to the Broker

Parameters:
l -

removeConsumerInfoListener

void removeConsumerInfoListener(ConsumerInfoListener l)
Remove a ConsumerInfoListener from the Broker

Parameters:
l -

getPersistentTopicContainerManager

MessageContainerManager getPersistentTopicContainerManager()
Returns:
the MessageContainerManager for durable topics

getTransientTopicContainerManager

MessageContainerManager getTransientTopicContainerManager()
Returns:
the MessageContainerManager for transient topics

getPersistentQueueContainerManager

MessageContainerManager getPersistentQueueContainerManager()
Returns:
the MessageContainerManager for persistent queues

getTransientQueueContainerManager

MessageContainerManager getTransientQueueContainerManager()
Returns:
the MessageContainerManager for transient queues

getSecurityAdapter

SecurityAdapter getSecurityAdapter()
Returns the security adapter used to authenticate and authorize access to JMS resources


setSecurityAdapter

void setSecurityAdapter(SecurityAdapter securityAdapter)
Sets the security adapter used to authenticate and authorize access to JMS resources


getRedeliveryPolicy

RedeliveryPolicy getRedeliveryPolicy()
Returns:
the RedeliveryPolicy

setRedeliveryPolicy

void setRedeliveryPolicy(RedeliveryPolicy redeliveryPolicy)
set the redelivery policy

Parameters:
redeliveryPolicy -

getDeadLetterPolicy

DeadLetterPolicy getDeadLetterPolicy()
Returns:
the DeadLetterPolicy

setDeadLetterPolicy

void setDeadLetterPolicy(DeadLetterPolicy deadLetterPolicy)
set the dead letter policy

Parameters:
deadLetterPolicy -

sendToDeadLetterQueue

void sendToDeadLetterQueue(String deadLetterName,
                           ActiveMQMessage message)
                           throws JMSException
Add a message to a dead letter queue

Parameters:
deadLetterName -
message -
Throws:
JMSException


Copyright © 2004-2008 Protique, Ltd.. All Rights Reserved.