Class ActiveMQResourceAdapter

java.lang.Object
org.apache.activemq.artemis.ra.ActiveMQResourceAdapter
All Implemented Interfaces:
ResourceAdapter, Serializable
Direct Known Subclasses:
ActiveMQResourceAdapter

public class ActiveMQResourceAdapter extends Object implements ResourceAdapter, Serializable
The resource adapter for ActiveMQ
See Also:
  • Field Details

  • Constructor Details

    • ActiveMQResourceAdapter

      public ActiveMQResourceAdapter()
  • Method Details

    • getTSR

    • endpointActivation

      public void endpointActivation(MessageEndpointFactory endpointFactory, ActivationSpec spec) throws ResourceException
      This is called during the activation of a message endpoint. This causes the resource adapter instance to do the necessary setup (ie., setup message delivery for the message endpoint with a message provider). Note that message delivery to the message endpoint might start even before this method returns.

      Endpoint activation is deemed successful only when this method completes successfully without throwing any exceptions.

      Specified by:
      endpointActivation in interface ResourceAdapter
      Parameters:
      endpointFactory - a message endpoint factory instance.
      spec - an activation spec JavaBean instance.
      Throws:
      NotSupportedException - indicates message endpoint activation rejection due to incorrect activation setup information.
      ResourceException
    • endpointDeactivation

      public void endpointDeactivation(MessageEndpointFactory endpointFactory, ActivationSpec spec)
      This is called when a message endpoint is deactivated. The instances passed as arguments to this method call should be identical to those passed in for the corresponding endpointActivation call. This causes the resource adapter to stop delivering messages to the message endpoint.

      Any exception thrown by this method is ignored. After this method call, the endpoint is deemed inactive.

      Specified by:
      endpointDeactivation in interface ResourceAdapter
      Parameters:
      endpointFactory - a message endpoint factory instance.
      spec - an activation spec JavaBean instance.
    • getXAResources

      public XAResource[] getXAResources(ActivationSpec[] specs) throws ResourceException
      This method is called by the application server during crash recovery. This method takes in an array of ActivationSpec JavaBeans and returns an array of XAResource objects each of which represents a unique resource manager. The resource adapter may return null if it does not implement the XAResource interface. Otherwise, it must return an array of XAResource objects, each of which represents a unique resource manager that was used by the endpoint applications. The application server uses the XAResource objects to query each resource manager for a list of in-doubt transactions. It then completes each pending transaction by sending the commit decision to the participating resource managers.
      Specified by:
      getXAResources in interface ResourceAdapter
      Parameters:
      specs - an array of ActivationSpec JavaBeans each of which corresponds to an deployed endpoint application that was active prior to the system crash.
      Returns:
      an array of XAResource objects each of which represents a unique resource manager.
      Throws:
      ResourceException - generic exception if operation fails due to an error condition.
    • start

      public void start(BootstrapContext ctx) throws ResourceAdapterInternalException
      This is called when a resource adapter instance is bootstrapped. This may be during resource adapter deployment or application server startup. This is a startup notification from the application server, and this method is called by an application server thread. The application server thread executes in an unspecified context.

      During this method call a ResourceAdapter JavaBean is responsible for initializing the resource adapter instance. Any exception thrown during this method call causes the application server to abort the bootstrap procedure for this specific resource adapter instance.

      Specified by:
      start in interface ResourceAdapter
      Parameters:
      ctx - a bootstrap context containing references to useful facilities that could be used by a resource adapter instance.
      Throws:
      ResourceAdapterInternalException - indicates bootstrap failure. The resource adapter instance is unusable and must be discarded.
    • stop

      public void stop()
      This is called when a resource adapter instance is undeployed or during application server shutdown. This is a shutdown notification from the application server, and this method is called by an application server thread. The application server thread executes in an unspecified context.

      During this method call, a ResourceAdapter JavaBean is responsible for performing an orderly shutdown of the resource adapter instance. Any exception thrown by this method call does not alter the processing of the application server shutdown or resource adapter undeployment that caused this method call. The application server may log the exception information for error reporting purposes.

      Specified by:
      stop in interface ResourceAdapter
    • setUseAutoRecovery

      public void setUseAutoRecovery(Boolean useAutoRecovery)
    • isUseAutoRecovery

      public Boolean isUseAutoRecovery()
    • isUseMaskedPassword

      public Boolean isUseMaskedPassword()
    • setUseMaskedPassword

      public void setUseMaskedPassword(Boolean useMaskedPassword)
    • setPasswordCodec

      public void setPasswordCodec(String passwordCodec)
    • getPasswordCodec

      public String getPasswordCodec()
    • setConnectorClassName

      public void setConnectorClassName(String connectorClassName)
    • getConnectorClassName

      public String getConnectorClassName()
    • getConnectionParameters

      public String getConnectionParameters()
    • setConnectionParameters

      public void setConnectionParameters(String config)
    • getHA

      public Boolean getHA()
    • setHA

      public void setHA(Boolean ha)
    • getEntries

      public String getEntries()
    • getJndiName

      public String getJndiName()
    • setEntries

      public void setEntries(String entries)
    • getDiscoveryAddress

      public String getDiscoveryAddress()
    • setJgroupsFile

      public void setJgroupsFile(String jgroupsFile)
    • getJgroupsFile

      public String getJgroupsFile()
    • getJgroupsChannelName

      public String getJgroupsChannelName()
    • setJgroupsChannelName

      public void setJgroupsChannelName(String jgroupsChannelName)
    • setDiscoveryAddress

      public void setDiscoveryAddress(String dgn)
    • getDiscoveryPort

      public Integer getDiscoveryPort()
    • setDiscoveryLocalBindAddress

      public void setDiscoveryLocalBindAddress(String discoveryLocalBindAddress)
    • getDiscoveryLocalBindAddress

      public String getDiscoveryLocalBindAddress()
    • setDiscoveryPort

      public void setDiscoveryPort(Integer dgp)
    • getDiscoveryRefreshTimeout

      public Long getDiscoveryRefreshTimeout()
    • setDiscoveryRefreshTimeout

      public void setDiscoveryRefreshTimeout(Long discoveryRefreshTimeout)
    • getDiscoveryInitialWaitTimeout

      public Long getDiscoveryInitialWaitTimeout()
    • setDiscoveryInitialWaitTimeout

      public void setDiscoveryInitialWaitTimeout(Long discoveryInitialWaitTimeout)
    • getClientFailureCheckPeriod

      public Long getClientFailureCheckPeriod()
    • setClientFailureCheckPeriod

      public void setClientFailureCheckPeriod(Long clientFailureCheckPeriod)
    • getConnectionTTL

      public Long getConnectionTTL()
    • setConnectionTTL

      public void setConnectionTTL(Long connectionTTL)
    • isCacheLargeMessagesClient

      public Boolean isCacheLargeMessagesClient()
    • setCacheLargeMessagesClient

      public void setCacheLargeMessagesClient(Boolean cacheLargeMessagesClient)
    • isCompressLargeMessage

      public Boolean isCompressLargeMessage()
    • setFailoverOnInitialConnection

      @Deprecated public void setFailoverOnInitialConnection(Boolean failoverOnInitialConnection)
      Deprecated.
    • isFailoverOnInitialConnection

      @Deprecated public Boolean isFailoverOnInitialConnection()
      Deprecated.
    • setCacheDestinations

      public void setCacheDestinations(Boolean cacheDestinations)
    • isCacheDestinations

      public Boolean isCacheDestinations()
    • setEnable1xPrefixes

      public void setEnable1xPrefixes(Boolean enable1xPrefixes)
    • isEnable1xPrefixes

      public Boolean isEnable1xPrefixes()
    • setCompressLargeMessage

      public void setCompressLargeMessage(Boolean compressLargeMessage)
    • getCompressionLevel

      public Integer getCompressionLevel()
    • setCompressionLevel

      public void setCompressionLevel(Integer compressionLevel)
      Sets what compressionLevel to use when compressing messages
      Parameters:
      compressionLevel - must be -1 (default) or 0-9
    • getCallTimeout

      public Long getCallTimeout()
    • setCallTimeout

      public void setCallTimeout(Long callTimeout)
    • getCallFailoverTimeout

      public Long getCallFailoverTimeout()
    • setCallFailoverTimeout

      public void setCallFailoverTimeout(Long callFailoverTimeout)
    • getDupsOKBatchSize

      public Integer getDupsOKBatchSize()
    • setDupsOKBatchSize

      public void setDupsOKBatchSize(Integer dupsOKBatchSize)
    • getTransactionBatchSize

      public Integer getTransactionBatchSize()
    • setTransactionBatchSize

      public void setTransactionBatchSize(Integer transactionBatchSize)
    • getConsumerWindowSize

      public Integer getConsumerWindowSize()
    • setConsumerWindowSize

      public void setConsumerWindowSize(Integer consumerWindowSize)
    • getConsumerMaxRate

      public Integer getConsumerMaxRate()
    • setConsumerMaxRate

      public void setConsumerMaxRate(Integer consumerMaxRate)
    • getConfirmationWindowSize

      public Integer getConfirmationWindowSize()
    • setConfirmationWindowSize

      public void setConfirmationWindowSize(Integer confirmationWindowSize)
    • getProducerMaxRate

      public Integer getProducerMaxRate()
    • setProducerMaxRate

      public void setProducerMaxRate(Integer producerMaxRate)
    • setUseTopologyForLoadBalancing

      public void setUseTopologyForLoadBalancing(Boolean useTopologyForLoadBalancing)
    • getUseTopologyForLoadBalancing

      public Boolean getUseTopologyForLoadBalancing()
    • isUseTopologyForLoadBalancing

      public Boolean isUseTopologyForLoadBalancing()
    • getProducerWindowSize

      public Integer getProducerWindowSize()
    • setProducerWindowSize

      public void setProducerWindowSize(Integer producerWindowSize)
    • getProtocolManagerFactoryStr

      public String getProtocolManagerFactoryStr()
    • setProtocolManagerFactoryStr

      public void setProtocolManagerFactoryStr(String protocolManagerFactoryStr)
    • getDeserializationBlackList

      @Deprecated(forRemoval=true) public String getDeserializationBlackList()
      Deprecated, for removal: This API element is subject to removal in a future version.
    • setDeserializationBlackList

      @Deprecated(forRemoval=true) public void setDeserializationBlackList(String deserializationDenyList)
      Deprecated, for removal: This API element is subject to removal in a future version.
    • getDeserializationWhiteList

      @Deprecated(forRemoval=true) public String getDeserializationWhiteList()
      Deprecated, for removal: This API element is subject to removal in a future version.
    • setDeserializationWhiteList

      @Deprecated(forRemoval=true) public void setDeserializationWhiteList(String deserializationAllowList)
      Deprecated, for removal: This API element is subject to removal in a future version.
    • getDeserializationDenyList

      public String getDeserializationDenyList()
    • setDeserializationDenyList

      public void setDeserializationDenyList(String deserializationDenyList)
    • getDeserializationAllowList

      public String getDeserializationAllowList()
    • setDeserializationAllowList

      public void setDeserializationAllowList(String deserializationAllowList)
    • getMinLargeMessageSize

      public Integer getMinLargeMessageSize()
    • setMinLargeMessageSize

      public void setMinLargeMessageSize(Integer minLargeMessageSize)
    • getBlockOnAcknowledge

      public Boolean getBlockOnAcknowledge()
    • setBlockOnAcknowledge

      public void setBlockOnAcknowledge(Boolean blockOnAcknowledge)
    • getBlockOnNonDurableSend

      public Boolean getBlockOnNonDurableSend()
    • setBlockOnNonDurableSend

      public void setBlockOnNonDurableSend(Boolean blockOnNonDurableSend)
    • getBlockOnDurableSend

      public Boolean getBlockOnDurableSend()
    • setBlockOnDurableSend

      public void setBlockOnDurableSend(Boolean blockOnDurableSend)
    • getAutoGroup

      public Boolean getAutoGroup()
    • setAutoGroup

      public void setAutoGroup(Boolean autoGroup)
    • getPreAcknowledge

      public Boolean getPreAcknowledge()
    • setPreAcknowledge

      public void setPreAcknowledge(Boolean preAcknowledge)
    • getInitialConnectAttempts

      public Integer getInitialConnectAttempts()
    • setInitialConnectAttempts

      public void setInitialConnectAttempts(Integer initialConnectAttempts)
    • getInitialMessagePacketSize

      public Integer getInitialMessagePacketSize()
    • setInitialMessagePacketSize

      public void setInitialMessagePacketSize(Integer initialMessagePacketSize)
    • getRetryInterval

      public Long getRetryInterval()
    • setRetryInterval

      public void setRetryInterval(Long retryInterval)
    • getRetryIntervalMultiplier

      public Double getRetryIntervalMultiplier()
    • setRetryIntervalMultiplier

      public void setRetryIntervalMultiplier(Double retryIntervalMultiplier)
    • getMaxRetryInterval

      public Long getMaxRetryInterval()
    • setMaxRetryInterval

      public void setMaxRetryInterval(Long maxRetryInterval)
    • getReconnectAttempts

      public Integer getReconnectAttempts()
    • setReconnectAttempts

      public void setReconnectAttempts(Integer reconnectAttempts)
    • getConnectionLoadBalancingPolicyClassName

      public String getConnectionLoadBalancingPolicyClassName()
    • setConnectionLoadBalancingPolicyClassName

      public void setConnectionLoadBalancingPolicyClassName(String connectionLoadBalancingPolicyClassName)
    • getScheduledThreadPoolMaxSize

      public Integer getScheduledThreadPoolMaxSize()
    • setScheduledThreadPoolMaxSize

      public void setScheduledThreadPoolMaxSize(Integer scheduledThreadPoolMaxSize)
    • getThreadPoolMaxSize

      public Integer getThreadPoolMaxSize()
    • setThreadPoolMaxSize

      public void setThreadPoolMaxSize(Integer threadPoolMaxSize)
    • getUseGlobalPools

      public Boolean getUseGlobalPools()
    • setUseGlobalPools

      public void setUseGlobalPools(Boolean useGlobalPools)
    • getUserName

      public String getUserName()
    • setUserName

      public void setUserName(String userName)
    • getPassword

      public String getPassword()
    • setPassword

      public void setPassword(String password)
    • isUseJNDI

      public boolean isUseJNDI()
    • setUseJNDI

      public void setUseJNDI(Boolean value)
    • getJndiParams

      public String getJndiParams()
    • setJndiParams

      public void setJndiParams(String jndiParams)
    • getParsedJndiParams

      public Hashtable<?,?> getParsedJndiParams()
    • getClientID

      public String getClientID()
    • setClientID

      public void setClientID(String clientID)
    • getGroupID

      public String getGroupID()
    • setGroupID

      public void setGroupID(String groupID)
    • getUseLocalTx

      public Boolean getUseLocalTx()
    • setUseLocalTx

      public void setUseLocalTx(Boolean localTx)
    • getSetupAttempts

      public int getSetupAttempts()
    • setSetupAttempts

      public void setSetupAttempts(Integer setupAttempts)
    • getSetupInterval

      public long getSetupInterval()
    • setSetupInterval

      public void setSetupInterval(Long interval)
    • equals

      public boolean equals(Object obj)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • getWorkManager

      public WorkManager getWorkManager()
    • createSession

      public ClientSession createSession(ClientSessionFactory parameterFactory, int ackMode, String user, String pass, Boolean preAck, Integer dupsOkBatchSize, Integer transactionBatchSize, boolean deliveryTransacted, boolean useLocalTx, Integer txTimeout) throws Exception
      Throws:
      Exception
    • getRecoveryManager

      public RecoveryManager getRecoveryManager()
    • getProperties

      public ActiveMQRAProperties getProperties()
    • setup

      protected void setup() throws ActiveMQException
      Throws:
      ActiveMQException
    • getActivations

      public Map<ActivationSpec,ActiveMQActivation> getActivations()
    • getDefaultActiveMQConnectionFactory

      public ActiveMQConnectionFactory getDefaultActiveMQConnectionFactory() throws ResourceException
      Throws:
      ResourceException
    • getJgroupsChannelLocatorClass

      public String getJgroupsChannelLocatorClass()
    • setJgroupsChannelLocatorClass

      public void setJgroupsChannelLocatorClass(String jgroupsChannelLocatorClass)
    • getJgroupsChannelRefName

      public String getJgroupsChannelRefName()
    • setJgroupsChannelRefName

      public void setJgroupsChannelRefName(String jgroupsChannelRefName)
    • getConnectionFactory

      public ActiveMQConnectionFactory getConnectionFactory(ConnectionFactoryProperties overrideProperties)
    • newConnectionFactory

      public ActiveMQConnectionFactory newConnectionFactory(ConnectionFactoryProperties overrideProperties)
    • createRecoveryActiveMQConnectionFactory

      public ActiveMQConnectionFactory createRecoveryActiveMQConnectionFactory(ConnectionFactoryProperties overrideProperties)
    • createBroadcastEndpointFactory

      protected BroadcastEndpointFactory createBroadcastEndpointFactory(ConnectionFactoryProperties overrideProperties)
    • overrideConnectionParameters

      public Map<String,Object> overrideConnectionParameters(Map<String,Object> connectionParams, Map<String,Object> overrideConnectionParams)
    • setManagedConnectionFactory

      public void setManagedConnectionFactory(ActiveMQRAManagedConnectionFactory activeMQRAManagedConnectionFactory)
    • getCodec

      public String getCodec()
    • closeConnectionFactory

      public void closeConnectionFactory(ConnectionFactoryProperties properties)
    • isIgnoreJTA

      public Boolean isIgnoreJTA()
    • setIgnoreJTA

      public void setIgnoreJTA(Boolean ignoreJTA)