|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface Broker
The Message Broker which routes messages, maintains subscriptions and connections, acknowledges messages and handles transactions.
Method Summary | |
---|---|
void |
addBroker(Connection connection,
BrokerInfo info)
A remote Broker connects |
void |
addConnection(ConnectionContext context,
ConnectionInfo info)
A client is establishing a connection with the broker. |
void |
addDestinationInfo(ConnectionContext context,
DestinationInfo info)
Add and process a DestinationInfo object |
void |
addProducer(ConnectionContext context,
ProducerInfo info)
Adds a producer. |
void |
addSession(ConnectionContext context,
SessionInfo info)
Adds a session. |
void |
beginTransaction(ConnectionContext context,
TransactionId xid)
Starts a transaction. |
void |
brokerServiceStarted()
called when the brokerService starts |
void |
commitTransaction(ConnectionContext context,
TransactionId xid,
boolean onePhase)
Commits a transaction. |
void |
fastProducer(ConnectionContext context,
ProducerInfo producerInfo)
Called to notify a producer is too fast |
void |
forgetTransaction(ConnectionContext context,
TransactionId transactionId)
Forgets a transaction. |
Broker |
getAdaptor(Class type)
Get a Broker from the Broker Stack that is a particular class |
ConnectionContext |
getAdminConnectionContext()
|
BrokerId |
getBrokerId()
Get the id of the broker |
String |
getBrokerName()
Get the name of the broker |
long |
getBrokerSequenceId()
|
BrokerService |
getBrokerService()
|
Connection[] |
getClients()
|
ActiveMQDestination[] |
getDestinations()
|
Set<ActiveMQDestination> |
getDurableDestinations()
|
BrokerInfo[] |
getPeerBrokerInfos()
Get the BrokerInfo's of any connected Brokers |
TransactionId[] |
getPreparedTransactions(ConnectionContext context)
Gets a list of all the prepared xa transactions. |
Broker |
getRoot()
Ensure we get the Broker at the top of the Stack |
Store |
getTempDataStore()
|
URI |
getVmConnectorURI()
|
boolean |
isExpired(MessageReference messageReference)
Determine if a message has expired -allows default behaviour to be overriden - as the timestamp set by the producer can be out of sync with the broker |
boolean |
isFaultTolerantConfiguration()
|
void |
isFull(ConnectionContext context,
Destination destination,
Usage usage)
Called when a Usage reaches a limit |
boolean |
isStopped()
|
void |
messageConsumed(ConnectionContext context,
MessageReference messageReference)
called when message is consumed |
void |
messageDelivered(ConnectionContext context,
MessageReference messageReference)
Called when message is delivered to the broker |
void |
messageDiscarded(ConnectionContext context,
MessageReference messageReference)
Called when a message is discarded - e.g. |
void |
messageExpired(ConnectionContext context,
MessageReference messageReference)
A Message has Expired |
void |
nowMasterBroker()
called when the broker becomes the master in a master/slave configuration |
void |
postProcessDispatch(MessageDispatch messageDispatch)
Notify the Broker that a dispatch has happened |
int |
prepareTransaction(ConnectionContext context,
TransactionId xid)
Prepares a transaction. |
void |
preProcessDispatch(MessageDispatch messageDispatch)
Notify the Broker that a dispatch is going to happen |
void |
removeBroker(Connection connection,
BrokerInfo info)
Remove a BrokerInfo |
void |
removeConnection(ConnectionContext context,
ConnectionInfo info,
Throwable error)
A client is disconnecting from the broker. |
void |
removeDestinationInfo(ConnectionContext context,
DestinationInfo info)
Remove and process a DestinationInfo object |
void |
removeProducer(ConnectionContext context,
ProducerInfo info)
Removes a producer. |
void |
removeSession(ConnectionContext context,
SessionInfo info)
Removes a session. |
void |
rollbackTransaction(ConnectionContext context,
TransactionId xid)
Rollsback a transaction. |
void |
sendToDeadLetterQueue(ConnectionContext context,
MessageReference messageReference)
A message needs to go the a DLQ |
void |
setAdminConnectionContext(ConnectionContext adminConnectionContext)
Sets the default administration connection context used when configuring the broker on startup or via JMX |
void |
slowConsumer(ConnectionContext context,
Destination destination,
Subscription subs)
Called when there is a slow consumer |
Methods inherited from interface org.apache.activemq.broker.region.Region |
---|
acknowledge, addConsumer, addDestination, gc, getDestinationMap, getDestinations, messagePull, processDispatchNotification, removeConsumer, removeDestination, removeSubscription, send |
Methods inherited from interface org.apache.activemq.Service |
---|
start, stop |
Method Detail |
---|
Broker getAdaptor(Class type)
type
-
BrokerId getBrokerId()
String getBrokerName()
void addBroker(Connection connection, BrokerInfo info)
void removeBroker(Connection connection, BrokerInfo info)
connection
- info
- void addConnection(ConnectionContext context, ConnectionInfo info) throws Exception
Exception
- TODOvoid removeConnection(ConnectionContext context, ConnectionInfo info, Throwable error) throws Exception
context
- the environment the operation is being executed under.info
- error
- null if the client requested the disconnect or the error
that caused the client to disconnect.
Exception
- TODOvoid addSession(ConnectionContext context, SessionInfo info) throws Exception
context
- info
-
Exception
- TODOvoid removeSession(ConnectionContext context, SessionInfo info) throws Exception
context
- info
-
Exception
- TODOvoid addProducer(ConnectionContext context, ProducerInfo info) throws Exception
addProducer
in interface Region
context
- the enviorment the operation is being executed under.
Exception
- TODOvoid removeProducer(ConnectionContext context, ProducerInfo info) throws Exception
removeProducer
in interface Region
context
- the enviorment the operation is being executed under.
Exception
- TODOConnection[] getClients() throws Exception
Exception
- TODOActiveMQDestination[] getDestinations() throws Exception
Exception
- TODOTransactionId[] getPreparedTransactions(ConnectionContext context) throws Exception
context
- transaction ids
Exception
- TODOvoid beginTransaction(ConnectionContext context, TransactionId xid) throws Exception
context
- xid
-
Exception
- TODOint prepareTransaction(ConnectionContext context, TransactionId xid) throws Exception
context
- xid
-
Exception
- TODOvoid rollbackTransaction(ConnectionContext context, TransactionId xid) throws Exception
context
- xid
-
Exception
- TODOvoid commitTransaction(ConnectionContext context, TransactionId xid, boolean onePhase) throws Exception
context
- xid
- onePhase
-
Exception
- TODOvoid forgetTransaction(ConnectionContext context, TransactionId transactionId) throws Exception
context
- transactionId
-
Exception
BrokerInfo[] getPeerBrokerInfos()
void preProcessDispatch(MessageDispatch messageDispatch)
messageDispatch
- void postProcessDispatch(MessageDispatch messageDispatch)
messageDispatch
- boolean isStopped()
Set<ActiveMQDestination> getDurableDestinations()
void addDestinationInfo(ConnectionContext context, DestinationInfo info) throws Exception
context
- info
-
Exception
void removeDestinationInfo(ConnectionContext context, DestinationInfo info) throws Exception
context
- info
-
Exception
boolean isFaultTolerantConfiguration()
ConnectionContext getAdminConnectionContext()
void setAdminConnectionContext(ConnectionContext adminConnectionContext)
adminConnectionContext
- Store getTempDataStore()
URI getVmConnectorURI()
void brokerServiceStarted()
BrokerService getBrokerService()
Broker getRoot()
boolean isExpired(MessageReference messageReference)
messageReference
-
void messageExpired(ConnectionContext context, MessageReference messageReference)
context
- messageReference
- void sendToDeadLetterQueue(ConnectionContext context, MessageReference messageReference)
context
- messageReference
- long getBrokerSequenceId()
void messageConsumed(ConnectionContext context, MessageReference messageReference)
context
- messageReference
- void messageDelivered(ConnectionContext context, MessageReference messageReference)
context
- messageReference
- void messageDiscarded(ConnectionContext context, MessageReference messageReference)
context
- messageReference
- void slowConsumer(ConnectionContext context, Destination destination, Subscription subs)
context
- destination
- subs
- void fastProducer(ConnectionContext context, ProducerInfo producerInfo)
context
- producerInfo
- void isFull(ConnectionContext context, Destination destination, Usage usage)
context
- destination
- usage
- void nowMasterBroker()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |