public class LoggingBrokerPlugin extends BrokerPluginSupport
next
Constructor and Description |
---|
LoggingBrokerPlugin() |
Modifier and Type | Method and Description |
---|---|
void |
acknowledge(ConsumerBrokerExchange consumerExchange,
MessageAck ack)
Used to acknowledge the receipt of a message by a client.
|
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.
|
Subscription |
addConsumer(ConnectionContext context,
ConsumerInfo info)
Adds a consumer.
|
Destination |
addDestination(ConnectionContext context,
ActiveMQDestination destination,
boolean create)
Used to create a destination.
|
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 |
afterPropertiesSet() |
void |
beginTransaction(ConnectionContext context,
TransactionId xid)
Starts a transaction.
|
void |
commitTransaction(ConnectionContext context,
TransactionId xid,
boolean onePhase)
Commits a transaction.
|
void |
fastProducer(ConnectionContext context,
ProducerInfo producerInfo,
ActiveMQDestination destination)
Called to notify a producer is too fast
|
void |
forgetTransaction(ConnectionContext context,
TransactionId transactionId)
Forgets a transaction.
|
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.
|
void |
isFull(ConnectionContext context,
Destination destination,
Usage usage)
Called when a Usage reaches a limit
|
boolean |
isLogAll() |
boolean |
isLogConnectionEvents() |
boolean |
isLogConsumerEvents() |
boolean |
isLogInternalEvents() |
boolean |
isLogProducerEvents() |
boolean |
isLogSessionEvents() |
boolean |
isLogTransactionEvents() |
boolean |
isPerDestinationLogger() |
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,
Subscription sub,
MessageReference messageReference)
Called when a message is discarded - e.g.
|
void |
messageExpired(ConnectionContext context,
MessageReference message,
Subscription subscription)
A Message has Expired
|
Response |
messagePull(ConnectionContext context,
MessagePull pull)
Allows a consumer to pull a message from a queue
|
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 |
processDispatchNotification(MessageDispatchNotification messageDispatchNotification)
Process a notification of a dispatch - used by a Slave Broker
|
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 |
removeConsumer(ConnectionContext context,
ConsumerInfo info)
Removes a consumer.
|
void |
removeDestination(ConnectionContext context,
ActiveMQDestination destination,
long timeout)
Used to destroy a destination.
|
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 |
removeSubscription(ConnectionContext context,
RemoveSubscriptionInfo info)
Deletes a durable subscription.
|
void |
rollbackTransaction(ConnectionContext context,
TransactionId xid)
Rollsback a transaction.
|
void |
send(ProducerBrokerExchange producerExchange,
Message messageSend)
Send a message to the broker to using the specified destination.
|
boolean |
sendToDeadLetterQueue(ConnectionContext context,
MessageReference messageReference,
Subscription subscription,
Throwable poisonCause)
A message needs to go the a DLQ
|
void |
setLogAll(boolean logAll)
Logger all Events that go through the Plugin
|
void |
setLogConnectionEvents(boolean logConnectionEvents)
Logger Events that are related to connections
|
void |
setLogConsumerEvents(boolean logConsumerEvents)
Logger Events that are related to Consumers
|
void |
setLogInternalEvents(boolean logInternalEvents)
Logger Events that are normally internal to the broker
|
void |
setLogProducerEvents(boolean logProducerEvents)
Logger Events that are related to Producers
|
void |
setLogSessionEvents(boolean logSessionEvents)
Logger Events that are related to sessions
|
void |
setLogTransactionEvents(boolean logTransactionEvents)
Logger Events that are related to transaction processing
|
void |
setPerDestinationLogger(boolean perDestinationLogger) |
void |
slowConsumer(ConnectionContext context,
Destination destination,
Subscription subs)
Called when there is a slow consumer
|
void |
start() |
void |
stop() |
String |
toString() |
installPlugin
brokerServiceStarted, gc, getAdaptor, getAdminConnectionContext, getBrokerId, getBrokerName, getBrokerSequenceId, getBrokerService, getDestinationMap, getDestinationMap, getDestinations, getExecutor, getNext, getRoot, getScheduler, getTempDataStore, getVmConnectorURI, isExpired, isFaultTolerantConfiguration, isStopped, networkBridgeStarted, networkBridgeStopped, processConsumerControl, reapplyInterceptor, setAdminConnectionContext, setNext, virtualDestinationAdded, virtualDestinationRemoved
public LoggingBrokerPlugin()
public void afterPropertiesSet() throws Exception
Exception
public boolean isLogAll()
public void setLogAll(boolean logAll)
public boolean isLogConnectionEvents()
public void setLogConnectionEvents(boolean logConnectionEvents)
public boolean isLogSessionEvents()
public void setLogSessionEvents(boolean logSessionEvents)
public boolean isLogTransactionEvents()
public void setLogTransactionEvents(boolean logTransactionEvents)
public boolean isLogConsumerEvents()
public void setLogConsumerEvents(boolean logConsumerEvents)
public boolean isLogProducerEvents()
public void setLogProducerEvents(boolean logProducerEvents)
public boolean isLogInternalEvents()
public void setLogInternalEvents(boolean logInternalEvents)
public void acknowledge(ConsumerBrokerExchange consumerExchange, MessageAck ack) throws Exception
Region
acknowledge
in interface Region
acknowledge
in class MutableBrokerFilter
consumerExchange
- the environment the operation is being executed under.Exception
- TODOpublic Response messagePull(ConnectionContext context, MessagePull pull) throws Exception
Region
messagePull
in interface Region
messagePull
in class MutableBrokerFilter
Exception
public void addConnection(ConnectionContext context, ConnectionInfo info) throws Exception
Broker
addConnection
in interface Broker
addConnection
in class MutableBrokerFilter
Exception
- TODOpublic Subscription addConsumer(ConnectionContext context, ConsumerInfo info) throws Exception
Region
addConsumer
in interface Region
addConsumer
in class MutableBrokerFilter
context
- the environment the operation is being executed under.Exception
- TODOpublic void addProducer(ConnectionContext context, ProducerInfo info) throws Exception
Broker
addProducer
in interface Broker
addProducer
in interface Region
addProducer
in class MutableBrokerFilter
context
- the environment the operation is being executed under.Exception
- TODOpublic void commitTransaction(ConnectionContext context, TransactionId xid, boolean onePhase) throws Exception
Broker
commitTransaction
in interface Broker
commitTransaction
in class MutableBrokerFilter
Exception
- TODOpublic void removeSubscription(ConnectionContext context, RemoveSubscriptionInfo info) throws Exception
Region
removeSubscription
in interface Region
removeSubscription
in class MutableBrokerFilter
context
- the environment the operation is being executed under.info
- TODOException
- TODOpublic TransactionId[] getPreparedTransactions(ConnectionContext context) throws Exception
Broker
getPreparedTransactions
in interface Broker
getPreparedTransactions
in class MutableBrokerFilter
context
- transaction idsException
- TODOpublic int prepareTransaction(ConnectionContext context, TransactionId xid) throws Exception
Broker
prepareTransaction
in interface Broker
prepareTransaction
in class MutableBrokerFilter
Exception
- TODOpublic void removeConnection(ConnectionContext context, ConnectionInfo info, Throwable error) throws Exception
Broker
removeConnection
in interface Broker
removeConnection
in class MutableBrokerFilter
context
- the environment the operation is being executed under.error
- null if the client requested the disconnect or the error
that caused the client to disconnect.Exception
- TODOpublic void removeConsumer(ConnectionContext context, ConsumerInfo info) throws Exception
Region
removeConsumer
in interface Region
removeConsumer
in class MutableBrokerFilter
context
- the environment the operation is being executed under.Exception
- TODOpublic void removeProducer(ConnectionContext context, ProducerInfo info) throws Exception
Broker
removeProducer
in interface Broker
removeProducer
in interface Region
removeProducer
in class MutableBrokerFilter
context
- the environment the operation is being executed under.Exception
- TODOpublic void rollbackTransaction(ConnectionContext context, TransactionId xid) throws Exception
Broker
rollbackTransaction
in interface Broker
rollbackTransaction
in class MutableBrokerFilter
Exception
- TODOpublic void send(ProducerBrokerExchange producerExchange, Message messageSend) throws Exception
Region
send
in interface Region
send
in class MutableBrokerFilter
producerExchange
- the environment the operation is being executed under.Exception
- TODOpublic void beginTransaction(ConnectionContext context, TransactionId xid) throws Exception
Broker
beginTransaction
in interface Broker
beginTransaction
in class MutableBrokerFilter
Exception
- TODOpublic void forgetTransaction(ConnectionContext context, TransactionId transactionId) throws Exception
Broker
forgetTransaction
in interface Broker
forgetTransaction
in class MutableBrokerFilter
Exception
public Connection[] getClients() throws Exception
getClients
in interface Broker
getClients
in class MutableBrokerFilter
Exception
- TODOpublic Destination addDestination(ConnectionContext context, ActiveMQDestination destination, boolean create) throws Exception
Region
addDestination
in interface Region
addDestination
in class MutableBrokerFilter
destination
- the destination to create.Exception
- TODOpublic void removeDestination(ConnectionContext context, ActiveMQDestination destination, long timeout) throws Exception
Region
removeDestination
in interface Region
removeDestination
in class MutableBrokerFilter
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 quiesceException
- TODOpublic ActiveMQDestination[] getDestinations() throws Exception
getDestinations
in interface Broker
getDestinations
in class MutableBrokerFilter
Exception
- TODOpublic void start() throws Exception
start
in interface Service
start
in class BrokerPluginSupport
Exception
public void stop() throws Exception
stop
in interface Service
stop
in class BrokerPluginSupport
Exception
public void addSession(ConnectionContext context, SessionInfo info) throws Exception
Broker
addSession
in interface Broker
addSession
in class MutableBrokerFilter
Exception
- TODOpublic void removeSession(ConnectionContext context, SessionInfo info) throws Exception
Broker
removeSession
in interface Broker
removeSession
in class MutableBrokerFilter
Exception
- TODOpublic void addBroker(Connection connection, BrokerInfo info)
Broker
addBroker
in interface Broker
addBroker
in class MutableBrokerFilter
public void removeBroker(Connection connection, BrokerInfo info)
Broker
removeBroker
in interface Broker
removeBroker
in class MutableBrokerFilter
public BrokerInfo[] getPeerBrokerInfos()
Broker
getPeerBrokerInfos
in interface Broker
getPeerBrokerInfos
in class MutableBrokerFilter
public void preProcessDispatch(MessageDispatch messageDispatch)
Broker
preProcessDispatch
in interface Broker
preProcessDispatch
in class MutableBrokerFilter
public void postProcessDispatch(MessageDispatch messageDispatch)
Broker
postProcessDispatch
in interface Broker
postProcessDispatch
in class MutableBrokerFilter
public void processDispatchNotification(MessageDispatchNotification messageDispatchNotification) throws Exception
Region
processDispatchNotification
in interface Region
processDispatchNotification
in class MutableBrokerFilter
Exception
- TODOpublic Set<ActiveMQDestination> getDurableDestinations()
getDurableDestinations
in interface Broker
getDurableDestinations
in class MutableBrokerFilter
public void addDestinationInfo(ConnectionContext context, DestinationInfo info) throws Exception
Broker
addDestinationInfo
in interface Broker
addDestinationInfo
in class MutableBrokerFilter
Exception
public void removeDestinationInfo(ConnectionContext context, DestinationInfo info) throws Exception
Broker
removeDestinationInfo
in interface Broker
removeDestinationInfo
in class MutableBrokerFilter
Exception
public void messageExpired(ConnectionContext context, MessageReference message, Subscription subscription)
Broker
messageExpired
in interface Broker
messageExpired
in class MutableBrokerFilter
subscription
- (may be null)public boolean sendToDeadLetterQueue(ConnectionContext context, MessageReference messageReference, Subscription subscription, Throwable poisonCause)
Broker
sendToDeadLetterQueue
in interface Broker
sendToDeadLetterQueue
in class MutableBrokerFilter
poisonCause
- reason for dlq submission, may be nullpublic void fastProducer(ConnectionContext context, ProducerInfo producerInfo, ActiveMQDestination destination)
Broker
fastProducer
in interface Broker
fastProducer
in class MutableBrokerFilter
public void isFull(ConnectionContext context, Destination destination, Usage usage)
Broker
isFull
in interface Broker
isFull
in class MutableBrokerFilter
public void messageConsumed(ConnectionContext context, MessageReference messageReference)
Broker
messageConsumed
in interface Broker
messageConsumed
in class MutableBrokerFilter
public void messageDelivered(ConnectionContext context, MessageReference messageReference)
Broker
messageDelivered
in interface Broker
messageDelivered
in class MutableBrokerFilter
public void messageDiscarded(ConnectionContext context, Subscription sub, MessageReference messageReference)
Broker
messageDiscarded
in interface Broker
messageDiscarded
in class MutableBrokerFilter
public void slowConsumer(ConnectionContext context, Destination destination, Subscription subs)
Broker
slowConsumer
in interface Broker
slowConsumer
in class MutableBrokerFilter
public void nowMasterBroker()
Broker
nowMasterBroker
in interface Broker
nowMasterBroker
in class MutableBrokerFilter
public void setPerDestinationLogger(boolean perDestinationLogger)
public boolean isPerDestinationLogger()
Copyright © 2005–2024 The Apache Software Foundation. All rights reserved.