Class AMQPFederationPolicyManager

java.lang.Object
org.apache.activemq.artemis.protocol.amqp.connect.federation.AMQPFederationPolicyManager
Direct Known Subclasses:
AMQPFederationLocalPolicyManager, AMQPFederationRemotePolicyManager

public abstract class AMQPFederationPolicyManager extends Object
Base Federation policy manager that declares some common APIs that address or queue policy managers must provide implementations for.
  • Nested Class Summary

    Nested Classes
    Modifier and Type
    Class
    Description
    static enum 
     
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    protected boolean
     
    protected final AMQPFederation
     
    protected final AMQPFederationMetrics
     
    protected final String
     
    protected final FederationType
     
    protected final org.apache.activemq.artemis.core.server.ActiveMQServer
     
     
     
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    final void
    Called by the parent federation instance when the connection has failed and this federation should tear down any active resources and await a reconnect if one is allowed.
    final void
    Called by the parent federation instance when the connection has been established and this policy manager should build up its active state based on the configuration.
    protected final void
    Checks if shut down already and throws an IllegalStateException if so.
    Returns the AMQPFederation instance that owns this policy manager.
    Returns the metrics instance tied to this federation policy manager instance.
    final String
    Returns the assigned name of the policy that is being managed.
    Returns the federation type this policy manager implements.
    protected abstract void
    On connection interrupted a federation policy manager needs to perform any specific actions to pause of cleanup current resources based on the connection being closed.
    protected abstract void
    On connection restoration a federation policy manager needs to perform any specific actions to resume service based on a new connection having been established.
    protected abstract void
    On initialize a federation policy manager needs to perform any specific initialization actions it requires to begin tracking broker resources.
    protected abstract void
    On shutdown a federation policy manager needs to perform any specific shutdown actions it requires to cease tracking broker resources.
    protected abstract void
    On start a federation policy manager needs to perform any specific startup actions it requires to begin tracking broker resources.
    protected abstract void
    On stop a federation policy manager needs to perform any specific stopped actions it requires to cease tracking broker resources and cleanup.
    final void
     
    protected final boolean
    This method must always be called under lock to ensure the state returned is accurate.
    protected final boolean
    This method must be called under lock to ensure the returned state is accurate.
    final boolean
    Returns true if the policy is started at the time this method was called.
    final void
    Shutdown the manager and cleanup any in use resources.
    final void
    Start the federation policy manager which will initiate a scan of all broker bindings and create and matching remote receivers.
    final void
    Stops the queue policy manager which will close any open remote receivers that are active for local queue demand.

    Methods inherited from class Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

  • Constructor Details

  • Method Details

    • initialize

      public final void initialize()
    • start

      public final void start()
      Start the federation policy manager which will initiate a scan of all broker bindings and create and matching remote receivers. Start on a policy manager should only be called after its parent Federation is started and the federation connection has been established.
    • stop

      public final void stop()
      Stops the queue policy manager which will close any open remote receivers that are active for local queue demand. Stop should generally be called whenever the parent Federation loses its connection to the remote.
    • shutdown

      public final void shutdown()
      Shutdown the manager and cleanup any in use resources.
    • isStarted

      public final boolean isStarted()
      Returns true if the policy is started at the time this method was called.
      Returns:
      true if the policy is started at the time this method was called
    • getMetrics

      public AMQPFederationMetrics getMetrics()
      Returns the metrics instance tied to this federation policy manager instance.
      Returns:
      the metrics instance tied to this federation policy manager instance
    • getPolicyType

      public final FederationType getPolicyType()
      Returns the federation type this policy manager implements.
      Returns:
      the federation type this policy manager implements
    • getPolicyName

      public final String getPolicyName()
      Returns the assigned name of the policy that is being managed.
      Returns:
      the assigned name of the policy that is being managed
    • getFederation

      public AMQPFederation getFederation()
      Returns the AMQPFederation instance that owns this policy manager.
      Returns:
      the AMQPFederation instance that owns this policy manager
    • connectionInterrupted

      public final void connectionInterrupted()
      Called by the parent federation instance when the connection has failed and this federation should tear down any active resources and await a reconnect if one is allowed.
    • connectionRestored

      public final void connectionRestored()
      Called by the parent federation instance when the connection has been established and this policy manager should build up its active state based on the configuration.
    • failIfShutdown

      protected final void failIfShutdown() throws IllegalStateException
      Checks if shut down already and throws an IllegalStateException if so.
      Throws:
      IllegalStateException
    • isActive

      protected final boolean isActive()
      This method must always be called under lock to ensure the state returned is accurate.
      Returns:
      true if the policy manager is both started and the connected state is true
    • isConnected

      protected final boolean isConnected()
      This method must be called under lock to ensure the returned state is accurate.
      Returns:
      the state of the connected flag based on the last update from the connection APIs
    • handleManagerInitialized

      protected abstract void handleManagerInitialized()
      On initialize a federation policy manager needs to perform any specific initialization actions it requires to begin tracking broker resources.
    • handleManagerStarted

      protected abstract void handleManagerStarted()
      On start a federation policy manager needs to perform any specific startup actions it requires to begin tracking broker resources.
    • handleManagerStopped

      protected abstract void handleManagerStopped()
      On stop a federation policy manager needs to perform any specific stopped actions it requires to cease tracking broker resources and cleanup.
    • handleManagerShutdown

      protected abstract void handleManagerShutdown()
      On shutdown a federation policy manager needs to perform any specific shutdown actions it requires to cease tracking broker resources.
    • handleConnectionInterrupted

      protected abstract void handleConnectionInterrupted()
      On connection interrupted a federation policy manager needs to perform any specific actions to pause of cleanup current resources based on the connection being closed.
    • handleConnectionRestored

      protected abstract void handleConnectionRestored()
      On connection restoration a federation policy manager needs to perform any specific actions to resume service based on a new connection having been established.