Class WildFlyActiveMQRecoveryRegistry

java.lang.Object
org.jboss.activemq.artemis.wildfly.integration.recovery.WildFlyActiveMQRecoveryRegistry
All Implemented Interfaces:
org.jboss.tm.XAResourceRecovery

public class WildFlyActiveMQRecoveryRegistry extends Object implements org.jboss.tm.XAResourceRecovery

This class is used by the Resource Adapter to register RecoveryDiscovery, which is based on the org.apache.activemq.wildfly.integration.recovery.XARecoveryConfig

Each outbound or inboud connection will pass the configuration here through by calling the method register(org.apache.activemq.wildfly.integration.recovery.XARecoveryConfig)

Later the WildFlyRecoveryDiscovery will call WildFlyActiveMQRecoveryRegistry#nodeUp(String, org.apache.activemq.api.core.Pair, String, String) so we will keep a track of nodes on the cluster or nodes where this server is connected to.

Author:
clebertsuconic
  • Method Details

    • getXAResources

      public XAResource[] getXAResources()
      This will be called periodically by the Transaction Manager
      Specified by:
      getXAResources in interface org.jboss.tm.XAResourceRecovery
      Returns:
      the XAResources managed by this registry
    • getInstance

      public static WildFlyActiveMQRecoveryRegistry getInstance()
    • register

      public void register(XARecoveryConfig resourceConfig)
      This will be called by then resource adapters, to register a new discovery
      Parameters:
      resourceConfig -
    • unRegister

      public void unRegister(XARecoveryConfig resourceConfig)
      Reference counts and deactivate a configuration Notice: this won't remove the servers since a server may have previous XIDs
      Parameters:
      resourceConfig -
    • stop

      public void stop()
      We need to make sure that all resources are closed, we don't actually do this when a resourceConfig is closed but maybe we should.
    • failedDiscovery

      public void failedDiscovery(WildFlyRecoveryDiscovery failedDiscovery)
      in case of a failure the Discovery will register itself to retry
      Parameters:
      failedDiscovery -
    • nodeUp

      public void nodeUp(XARecoveryConfig listeningConfig, String nodeID, TransportConfiguration[] networkConfiguration, String username, String password, Map<String,String> properties)
      Parameters:
      listeningConfig - the connection factory where we are listening topology updates.
      nodeID - the node id coming from the topology update
      networkConfiguration - the network configuration
      username - the user name
      password - the password
      properties - the properties passed to the configuration
    • nodeDown

      public void nodeDown(String nodeID)
    • toString

      public String toString()
      Overrides:
      toString in class Object