Class UDPTraceBrokerPlugin

All Implemented Interfaces:
Broker, BrokerPlugin, Region, org.apache.activemq.Service
Direct Known Subclasses:
MulticastTraceBrokerPlugin

public class UDPTraceBrokerPlugin extends BrokerPluginSupport
A Broker interceptor which allows you to trace all operations to a UDP socket.
  • Field Details

    • wireFormat

      protected org.apache.activemq.wireformat.WireFormat wireFormat
    • wireFormatFactory

      protected org.apache.activemq.wireformat.WireFormatFactory wireFormatFactory
    • maxTraceDatagramSize

      protected int maxTraceDatagramSize
    • destination

      protected URI destination
    • socket

      protected DatagramSocket socket
    • brokerId

      protected org.apache.activemq.command.BrokerId brokerId
    • address

      protected SocketAddress address
    • broadcast

      protected boolean broadcast
  • Constructor Details

    • UDPTraceBrokerPlugin

      public UDPTraceBrokerPlugin()
  • Method Details

    • start

      public void start() throws Exception
      Specified by:
      start in interface org.apache.activemq.Service
      Overrides:
      start in class BrokerPluginSupport
      Throws:
      Exception
    • createSocket

      protected DatagramSocket createSocket() throws IOException
      Throws:
      IOException
    • stop

      public void stop() throws Exception
      Specified by:
      stop in interface org.apache.activemq.Service
      Overrides:
      stop in class BrokerPluginSupport
      Throws:
      Exception
    • send

      public void send(ProducerBrokerExchange producerExchange, org.apache.activemq.command.Message messageSend) throws Exception
      Description copied from interface: Region
      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.
      Specified by:
      send in interface Region
      Overrides:
      send in class BrokerFilter
      Parameters:
      producerExchange - the environment the operation is being executed under.
      Throws:
      Exception - TODO
    • acknowledge

      public void acknowledge(ConsumerBrokerExchange consumerExchange, org.apache.activemq.command.MessageAck ack) throws Exception
      Description copied from interface: Region
      Used to acknowledge the receipt of a message by a client.
      Specified by:
      acknowledge in interface Region
      Overrides:
      acknowledge in class BrokerFilter
      Parameters:
      consumerExchange - the environment the operation is being executed under.
      Throws:
      Exception - TODO
    • addConnection

      public void addConnection(ConnectionContext context, org.apache.activemq.command.ConnectionInfo info) throws Exception
      Description copied from interface: Broker
      A client is establishing a connection with the broker.
      Specified by:
      addConnection in interface Broker
      Overrides:
      addConnection in class BrokerFilter
      Throws:
      Exception - TODO
    • addConsumer

      public Subscription addConsumer(ConnectionContext context, org.apache.activemq.command.ConsumerInfo info) throws Exception
      Description copied from interface: Region
      Adds a consumer.
      Specified by:
      addConsumer in interface Region
      Overrides:
      addConsumer in class BrokerFilter
      Parameters:
      context - the environment the operation is being executed under.
      Returns:
      TODO
      Throws:
      Exception - TODO
    • addDestinationInfo

      public void addDestinationInfo(ConnectionContext context, org.apache.activemq.command.DestinationInfo info) throws Exception
      Description copied from interface: Broker
      Add and process a DestinationInfo object
      Specified by:
      addDestinationInfo in interface Broker
      Overrides:
      addDestinationInfo in class BrokerFilter
      Parameters:
      context - connection context
      info - destination info
      Throws:
      Exception - TODO
    • addProducer

      public void addProducer(ConnectionContext context, org.apache.activemq.command.ProducerInfo info) throws Exception
      Description copied from interface: Broker
      Adds a producer.
      Specified by:
      addProducer in interface Broker
      Specified by:
      addProducer in interface Region
      Overrides:
      addProducer in class BrokerFilter
      Parameters:
      context - the environment the operation is being executed under.
      Throws:
      Exception - TODO
    • addSession

      public void addSession(ConnectionContext context, org.apache.activemq.command.SessionInfo info) throws Exception
      Description copied from interface: Broker
      Adds a session.
      Specified by:
      addSession in interface Broker
      Overrides:
      addSession in class BrokerFilter
      Parameters:
      context - connection context
      info - metadata about the Broker
      Throws:
      Exception - TODO
    • beginTransaction

      public void beginTransaction(ConnectionContext context, org.apache.activemq.command.TransactionId xid) throws Exception
      Description copied from interface: Broker
      Starts a transaction.
      Specified by:
      beginTransaction in interface Broker
      Overrides:
      beginTransaction in class BrokerFilter
      Parameters:
      context - connection context
      xid - transaction id
      Throws:
      Exception - TODO
    • commitTransaction

      public void commitTransaction(ConnectionContext context, org.apache.activemq.command.TransactionId xid, boolean onePhase) throws Exception
      Description copied from interface: Broker
      Commits a transaction.
      Specified by:
      commitTransaction in interface Broker
      Overrides:
      commitTransaction in class BrokerFilter
      Parameters:
      context - connection context
      xid - transaction id
      onePhase - is COMMIT_ONE_PHASE
      Throws:
      Exception - TODO
    • forgetTransaction

      public void forgetTransaction(ConnectionContext context, org.apache.activemq.command.TransactionId xid) throws Exception
      Description copied from interface: Broker
      Forgets a transaction.
      Specified by:
      forgetTransaction in interface Broker
      Overrides:
      forgetTransaction in class BrokerFilter
      Parameters:
      context - connection context
      xid - transaction id
      Throws:
      Exception - TODO
    • messagePull

      public org.apache.activemq.command.Response messagePull(ConnectionContext context, org.apache.activemq.command.MessagePull pull) throws Exception
      Description copied from interface: Region
      Allows a consumer to pull a message from a queue
      Specified by:
      messagePull in interface Region
      Overrides:
      messagePull in class BrokerFilter
      Throws:
      Exception
    • prepareTransaction

      public int prepareTransaction(ConnectionContext context, org.apache.activemq.command.TransactionId xid) throws Exception
      Description copied from interface: Broker
      Prepares a transaction. Only valid for xa transactions.
      Specified by:
      prepareTransaction in interface Broker
      Overrides:
      prepareTransaction in class BrokerFilter
      Parameters:
      context - connection context
      xid - transaction id
      Returns:
      id
      Throws:
      Exception - TODO
    • postProcessDispatch

      public void postProcessDispatch(org.apache.activemq.command.MessageDispatch messageDispatch)
      Description copied from interface: Broker
      Notify the Broker that a dispatch has happened
      Specified by:
      postProcessDispatch in interface Broker
      Overrides:
      postProcessDispatch in class BrokerFilter
      Parameters:
      messageDispatch - MessageDispatch that has dispatched
    • processDispatchNotification

      public void processDispatchNotification(org.apache.activemq.command.MessageDispatchNotification messageDispatchNotification) throws Exception
      Description copied from interface: Region
      Process a notification of a dispatch - used by a Slave Broker
      Specified by:
      processDispatchNotification in interface Region
      Overrides:
      processDispatchNotification in class BrokerFilter
      Throws:
      Exception - TODO
    • removeConnection

      public void removeConnection(ConnectionContext context, org.apache.activemq.command.ConnectionInfo info, Throwable error) throws Exception
      Description copied from interface: Broker
      A client is disconnecting from the broker.
      Specified by:
      removeConnection in interface Broker
      Overrides:
      removeConnection in class BrokerFilter
      Parameters:
      context - the environment the operation is being executed under.
      info - metadata about the Broker
      error - null if the client requested the disconnect or the error that caused the client to disconnect.
      Throws:
      Exception - TODO
    • removeConsumer

      public void removeConsumer(ConnectionContext context, org.apache.activemq.command.ConsumerInfo info) throws Exception
      Description copied from interface: Region
      Removes a consumer.
      Specified by:
      removeConsumer in interface Region
      Overrides:
      removeConsumer in class BrokerFilter
      Parameters:
      context - the environment the operation is being executed under.
      Throws:
      Exception - TODO
    • removeDestination

      public void removeDestination(ConnectionContext context, org.apache.activemq.command.ActiveMQDestination destination, long timeout) throws Exception
      Description copied from interface: Region
      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.
      Specified by:
      removeDestination in interface Region
      Overrides:
      removeDestination in class BrokerFilter
      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:
      Exception - TODO
    • removeDestinationInfo

      public void removeDestinationInfo(ConnectionContext context, org.apache.activemq.command.DestinationInfo info) throws Exception
      Description copied from interface: Broker
      Remove and process a DestinationInfo object
      Specified by:
      removeDestinationInfo in interface Broker
      Overrides:
      removeDestinationInfo in class BrokerFilter
      Parameters:
      context - connection context
      info - destination info
      Throws:
      Exception - TODO
    • removeProducer

      public void removeProducer(ConnectionContext context, org.apache.activemq.command.ProducerInfo info) throws Exception
      Description copied from interface: Broker
      Removes a producer.
      Specified by:
      removeProducer in interface Broker
      Specified by:
      removeProducer in interface Region
      Overrides:
      removeProducer in class BrokerFilter
      Parameters:
      context - the environment the operation is being executed under.
      Throws:
      Exception - TODO
    • removeSession

      public void removeSession(ConnectionContext context, org.apache.activemq.command.SessionInfo info) throws Exception
      Description copied from interface: Broker
      Removes a session.
      Specified by:
      removeSession in interface Broker
      Overrides:
      removeSession in class BrokerFilter
      Parameters:
      context - connection context
      info - metadata about the Broker
      Throws:
      Exception - TODO
    • removeSubscription

      public void removeSubscription(ConnectionContext context, org.apache.activemq.command.RemoveSubscriptionInfo info) throws Exception
      Description copied from interface: Region
      Deletes a durable subscription.
      Specified by:
      removeSubscription in interface Region
      Overrides:
      removeSubscription in class BrokerFilter
      Parameters:
      context - the environment the operation is being executed under.
      info - TODO
      Throws:
      Exception - TODO
    • rollbackTransaction

      public void rollbackTransaction(ConnectionContext context, org.apache.activemq.command.TransactionId xid) throws Exception
      Description copied from interface: Broker
      Rollback a transaction.
      Specified by:
      rollbackTransaction in interface Broker
      Overrides:
      rollbackTransaction in class BrokerFilter
      Parameters:
      context - connection context
      xid - transaction id
      Throws:
      Exception - TODO
    • getWireFormat

      public org.apache.activemq.wireformat.WireFormat getWireFormat()
    • createWireFormat

      protected org.apache.activemq.wireformat.WireFormat createWireFormat()
    • setWireFormat

      public void setWireFormat(org.apache.activemq.wireformat.WireFormat wireFormat)
    • getWireFormatFactory

      public org.apache.activemq.wireformat.WireFormatFactory getWireFormatFactory()
    • createWireFormatFactory

      protected org.apache.activemq.openwire.OpenWireFormatFactory createWireFormatFactory()
    • setWireFormatFactory

      public void setWireFormatFactory(org.apache.activemq.wireformat.WireFormatFactory wireFormatFactory)
    • createSocketAddress

      protected SocketAddress createSocketAddress(URI location) throws UnknownHostException
      Throws:
      UnknownHostException
    • getDestination

      public URI getDestination()
    • setDestination

      public void setDestination(URI destination)
    • getMaxTraceDatagramSize

      public int getMaxTraceDatagramSize()
    • setMaxTraceDatagramSize

      public void setMaxTraceDatagramSize(int maxTraceDatagramSize)
    • isBroadcast

      public boolean isBroadcast()
    • setBroadcast

      public void setBroadcast(boolean broadcast)
    • getAddress

      public SocketAddress getAddress()
    • setAddress

      public void setAddress(SocketAddress address)