Interface Broker

    • Method Detail

      • getAdaptor

        Broker getAdaptor​(Class<?> type)
        Get a Broker from the Broker Stack that is a particular class
        Parameters:
        type -
        Returns:
        a Broker instance.
      • getBrokerId

        BrokerId getBrokerId()
        Get the id of the broker
      • getBrokerName

        String getBrokerName()
        Get the name of the broker
      • removeBroker

        void removeBroker​(Connection connection,
                          BrokerInfo info)
        Remove a BrokerInfo
        Parameters:
        connection -
        info -
      • removeConnection

        void removeConnection​(ConnectionContext context,
                              ConnectionInfo info,
                              Throwable error)
                       throws Exception
        A client is disconnecting from the broker.
        Parameters:
        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.
        Throws:
        Exception - TODO
      • getPreparedTransactions

        TransactionId[] getPreparedTransactions​(ConnectionContext context)
                                         throws Exception
        Gets a list of all the prepared xa transactions.
        Parameters:
        context - transaction ids
        Returns:
        array of TransactionId values
        Throws:
        Exception - TODO
      • getPeerBrokerInfos

        BrokerInfo[] getPeerBrokerInfos()
        Get the BrokerInfo's of any connected Brokers
        Returns:
        array of peer BrokerInfos
      • preProcessDispatch

        void preProcessDispatch​(MessageDispatch messageDispatch)
        Notify the Broker that a dispatch is going to happen
        Parameters:
        messageDispatch -
      • postProcessDispatch

        void postProcessDispatch​(MessageDispatch messageDispatch)
        Notify the Broker that a dispatch has happened
        Parameters:
        messageDispatch -
      • isStopped

        boolean isStopped()
        Returns:
        true if the broker has stopped
      • getDurableDestinations

        Set<ActiveMQDestination> getDurableDestinations()
        Returns:
        a Set of all durable destinations
      • isFaultTolerantConfiguration

        boolean isFaultTolerantConfiguration()
        Returns:
        true if fault tolerant
      • getAdminConnectionContext

        ConnectionContext getAdminConnectionContext()
        Returns:
        the connection context used to make administration operations on startup or via JMX MBeans
      • setAdminConnectionContext

        void setAdminConnectionContext​(ConnectionContext adminConnectionContext)
        Sets the default administration connection context used when configuring the broker on startup or via JMX
        Parameters:
        adminConnectionContext -
      • getTempDataStore

        PListStore getTempDataStore()
        Returns:
        the temp data store
      • getVmConnectorURI

        URI getVmConnectorURI()
        Returns:
        the URI that can be used to connect to the local Broker
      • brokerServiceStarted

        void brokerServiceStarted()
        called when the brokerService starts
      • getBrokerService

        BrokerService getBrokerService()
        Returns:
        the BrokerService
      • getRoot

        Broker getRoot()
        Ensure we get the Broker at the top of the Stack
        Returns:
        the broker at the top of the Stack
      • isExpired

        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
        Parameters:
        messageReference -
        Returns:
        true if the message is expired
      • sendToDeadLetterQueue

        boolean sendToDeadLetterQueue​(ConnectionContext context,
                                      MessageReference messageReference,
                                      Subscription subscription,
                                      Throwable poisonCause)
        A message needs to go the a DLQ
        Parameters:
        context -
        messageReference -
        poisonCause - reason for dlq submission, may be null
        Returns:
        true if Message was placed in a DLQ false if discarded.
      • getBrokerSequenceId

        long getBrokerSequenceId()
        Returns:
        the broker sequence id
      • messageConsumed

        void messageConsumed​(ConnectionContext context,
                             MessageReference messageReference)
        called when message is consumed
        Parameters:
        context -
        messageReference -
      • messageDelivered

        void messageDelivered​(ConnectionContext context,
                              MessageReference messageReference)
        Called when message is delivered to the broker
        Parameters:
        context -
        messageReference -
      • messageDiscarded

        void messageDiscarded​(ConnectionContext context,
                              Subscription sub,
                              MessageReference messageReference)
        Called when a message is discarded - e.g. running low on memory This will happen only if the policy is enabled - e.g. non durable topics
        Parameters:
        context -
        sub -
        messageReference -
      • isFull

        void isFull​(ConnectionContext context,
                    Destination destination,
                    Usage<?> usage)
        Called when a Usage reaches a limit
        Parameters:
        context -
        destination -
        usage -
      • nowMasterBroker

        void nowMasterBroker()
        called when the broker becomes the master in a master/slave configuration
      • networkBridgeStarted

        void networkBridgeStarted​(BrokerInfo brokerInfo,
                                  boolean createdByDuplex,
                                  String remoteIp)
      • networkBridgeStopped

        void networkBridgeStopped​(BrokerInfo brokerInfo)