Class ActiveMQResourceAdapter

  • All Implemented Interfaces:
    java.io.Serializable, javax.resource.spi.ResourceAdapter

    public class ActiveMQResourceAdapter
    extends java.lang.Object
    implements javax.resource.spi.ResourceAdapter, java.io.Serializable
    The resource adapter for ActiveMQ
    See Also:
    Serialized Form
    • Field Detail

      • PRODUCT_NAME

        public static final java.lang.String PRODUCT_NAME
        The Name of the product that this resource adapter represents.
        See Also:
        Constant Field Values
    • Constructor Detail

      • ActiveMQResourceAdapter

        public ActiveMQResourceAdapter()
        Constructor
    • Method Detail

      • getTM

        public javax.transaction.TransactionManager getTM()
      • endpointActivation

        public void endpointActivation​(javax.resource.spi.endpoint.MessageEndpointFactory endpointFactory,
                                       javax.resource.spi.ActivationSpec spec)
                                throws javax.resource.ResourceException
        Endpoint activation
        Specified by:
        endpointActivation in interface javax.resource.spi.ResourceAdapter
        Parameters:
        endpointFactory - The endpoint factory
        spec - The activation spec
        Throws:
        javax.resource.ResourceException - Thrown if an error occurs
      • endpointDeactivation

        public void endpointDeactivation​(javax.resource.spi.endpoint.MessageEndpointFactory endpointFactory,
                                         javax.resource.spi.ActivationSpec spec)
        Endpoint deactivation
        Specified by:
        endpointDeactivation in interface javax.resource.spi.ResourceAdapter
        Parameters:
        endpointFactory - The endpoint factory
        spec - The activation spec
      • getXAResources

        public javax.transaction.xa.XAResource[] getXAResources​(javax.resource.spi.ActivationSpec[] specs)
                                                         throws javax.resource.ResourceException
        Get XA resources
        Specified by:
        getXAResources in interface javax.resource.spi.ResourceAdapter
        Parameters:
        specs - The activation specs
        Returns:
        The XA resources
        Throws:
        javax.resource.ResourceException - Thrown if an error occurs or unsupported
      • start

        public void start​(javax.resource.spi.BootstrapContext ctx)
                   throws javax.resource.spi.ResourceAdapterInternalException
        Start
        Specified by:
        start in interface javax.resource.spi.ResourceAdapter
        Parameters:
        ctx - The bootstrap context
        Throws:
        javax.resource.spi.ResourceAdapterInternalException - Thrown if an error occurs
      • stop

        public void stop()
        Stop
        Specified by:
        stop in interface javax.resource.spi.ResourceAdapter
      • setUseAutoRecovery

        public void setUseAutoRecovery​(java.lang.Boolean useAutoRecovery)
      • isUseAutoRecovery

        public java.lang.Boolean isUseAutoRecovery()
      • isUseMaskedPassword

        public java.lang.Boolean isUseMaskedPassword()
      • setUseMaskedPassword

        public void setUseMaskedPassword​(java.lang.Boolean useMaskedPassword)
      • setPasswordCodec

        public void setPasswordCodec​(java.lang.String passwordCodec)
      • getPasswordCodec

        public java.lang.String getPasswordCodec()
      • setConnectorClassName

        public void setConnectorClassName​(java.lang.String connectorClassName)
      • getConnectorClassName

        public java.lang.String getConnectorClassName()
      • getConnectionParameters

        public java.lang.String getConnectionParameters()
      • setConnectionParameters

        public void setConnectionParameters​(java.lang.String config)
      • getHA

        public java.lang.Boolean getHA()
      • setHA

        public void setHA​(java.lang.Boolean ha)
      • getEntries

        public java.lang.String getEntries()
      • getJndiName

        public java.lang.String getJndiName()
      • setEntries

        public void setEntries​(java.lang.String entries)
      • getDiscoveryAddress

        public java.lang.String getDiscoveryAddress()
        Get the discovery group name
        Returns:
        The value
      • setJgroupsFile

        public void setJgroupsFile​(java.lang.String jgroupsFile)
      • getJgroupsFile

        public java.lang.String getJgroupsFile()
      • getJgroupsChannelName

        public java.lang.String getJgroupsChannelName()
      • setJgroupsChannelName

        public void setJgroupsChannelName​(java.lang.String jgroupsChannelName)
      • setDiscoveryAddress

        public void setDiscoveryAddress​(java.lang.String dgn)
        Set the discovery group name
        Parameters:
        dgn - The value
      • getDiscoveryPort

        public java.lang.Integer getDiscoveryPort()
        Get the discovery group port
        Returns:
        The value
      • setDiscoveryLocalBindAddress

        public void setDiscoveryLocalBindAddress​(java.lang.String discoveryLocalBindAddress)
        set the discovery local bind address
        Parameters:
        discoveryLocalBindAddress - the address value
      • getDiscoveryLocalBindAddress

        public java.lang.String getDiscoveryLocalBindAddress()
        get the discovery local bind address
        Returns:
        the address value
      • setDiscoveryPort

        public void setDiscoveryPort​(java.lang.Integer dgp)
        Set the discovery group port
        Parameters:
        dgp - The value
      • getDiscoveryRefreshTimeout

        public java.lang.Long getDiscoveryRefreshTimeout()
        Get discovery refresh timeout
        Returns:
        The value
      • setDiscoveryRefreshTimeout

        public void setDiscoveryRefreshTimeout​(java.lang.Long discoveryRefreshTimeout)
        Set discovery refresh timeout
        Parameters:
        discoveryRefreshTimeout - The value
      • getDiscoveryInitialWaitTimeout

        public java.lang.Long getDiscoveryInitialWaitTimeout()
        Get discovery initial wait timeout
        Returns:
        The value
      • setDiscoveryInitialWaitTimeout

        public void setDiscoveryInitialWaitTimeout​(java.lang.Long discoveryInitialWaitTimeout)
        Set discovery initial wait timeout
        Parameters:
        discoveryInitialWaitTimeout - The value
      • getClientFailureCheckPeriod

        public java.lang.Long getClientFailureCheckPeriod()
        Get client failure check period
        Returns:
        The value
      • setClientFailureCheckPeriod

        public void setClientFailureCheckPeriod​(java.lang.Long clientFailureCheckPeriod)
        Set client failure check period
        Parameters:
        clientFailureCheckPeriod - The value
      • getConnectionTTL

        public java.lang.Long getConnectionTTL()
        Get connection TTL
        Returns:
        The value
      • setConnectionTTL

        public void setConnectionTTL​(java.lang.Long connectionTTL)
        Set connection TTL
        Parameters:
        connectionTTL - The value
      • isCacheLargeMessagesClient

        public java.lang.Boolean isCacheLargeMessagesClient()
        Get cacheLargeMessagesClient
        Returns:
        The value
      • setCacheLargeMessagesClient

        public void setCacheLargeMessagesClient​(java.lang.Boolean cacheLargeMessagesClient)
        Set cacheLargeMessagesClient
        Parameters:
        cacheLargeMessagesClient - The value
      • isCompressLargeMessage

        public java.lang.Boolean isCompressLargeMessage()
        Get compressLargeMessage
        Returns:
        The value
      • setFailoverOnInitialConnection

        @Deprecated
        public void setFailoverOnInitialConnection​(java.lang.Boolean failoverOnInitialConnection)
        Deprecated.
        Set failoverOnInitialConnection
        Parameters:
        failoverOnInitialConnection - The value
      • isFailoverOnInitialConnection

        @Deprecated
        public java.lang.Boolean isFailoverOnInitialConnection()
        Deprecated.
        Get isFailoverOnInitialConnection
        Returns:
        The value
      • setCacheDestinations

        public void setCacheDestinations​(java.lang.Boolean cacheDestinations)
        Set cacheDestinations
        Parameters:
        cacheDestinations - The value
      • isCacheDestinations

        public java.lang.Boolean isCacheDestinations()
        Get isCacheDestinations
        Returns:
        The value
      • setEnable1xPrefixes

        public void setEnable1xPrefixes​(java.lang.Boolean enable1xPrefixes)
        Set enable1xPrefixes
        Parameters:
        enable1xPrefixes - The value
      • isEnable1xPrefixes

        public java.lang.Boolean isEnable1xPrefixes()
        Get isCacheDestinations
        Returns:
        The value
      • setCompressLargeMessage

        public void setCompressLargeMessage​(java.lang.Boolean compressLargeMessage)
        Set compressLargeMessage
        Parameters:
        compressLargeMessage - The value
      • getCallTimeout

        public java.lang.Long getCallTimeout()
        Get call timeout
        Returns:
        The value
      • setCallTimeout

        public void setCallTimeout​(java.lang.Long callTimeout)
        Set call timeout
        Parameters:
        callTimeout - The value
      • getCallFailoverTimeout

        public java.lang.Long getCallFailoverTimeout()
        Get call failover timeout
        Returns:
        The value
      • setCallFailoverTimeout

        public void setCallFailoverTimeout​(java.lang.Long callFailoverTimeout)
        Set call failover timeout
        Parameters:
        callFailoverTimeout - The value
      • getDupsOKBatchSize

        public java.lang.Integer getDupsOKBatchSize()
        Get dups ok batch size
        Returns:
        The value
      • setDupsOKBatchSize

        public void setDupsOKBatchSize​(java.lang.Integer dupsOKBatchSize)
        Set dups ok batch size
        Parameters:
        dupsOKBatchSize - The value
      • getTransactionBatchSize

        public java.lang.Integer getTransactionBatchSize()
        Get transaction batch size
        Returns:
        The value
      • setTransactionBatchSize

        public void setTransactionBatchSize​(java.lang.Integer transactionBatchSize)
        Set transaction batch size
        Parameters:
        transactionBatchSize - The value
      • getConsumerWindowSize

        public java.lang.Integer getConsumerWindowSize()
        Get consumer window size
        Returns:
        The value
      • setConsumerWindowSize

        public void setConsumerWindowSize​(java.lang.Integer consumerWindowSize)
        Set consumer window size
        Parameters:
        consumerWindowSize - The value
      • getConsumerMaxRate

        public java.lang.Integer getConsumerMaxRate()
        Get consumer max rate
        Returns:
        The value
      • setConsumerMaxRate

        public void setConsumerMaxRate​(java.lang.Integer consumerMaxRate)
        Set consumer max rate
        Parameters:
        consumerMaxRate - The value
      • getConfirmationWindowSize

        public java.lang.Integer getConfirmationWindowSize()
        Get confirmation window size
        Returns:
        The value
      • setConfirmationWindowSize

        public void setConfirmationWindowSize​(java.lang.Integer confirmationWindowSize)
        Set confirmation window size
        Parameters:
        confirmationWindowSize - The value
      • getProducerMaxRate

        public java.lang.Integer getProducerMaxRate()
        Get producer max rate
        Returns:
        The value
      • setProducerMaxRate

        public void setProducerMaxRate​(java.lang.Integer producerMaxRate)
        Set producer max rate
        Parameters:
        producerMaxRate - The value
      • setUseTopologyForLoadBalancing

        public void setUseTopologyForLoadBalancing​(java.lang.Boolean useTopologyForLoadBalancing)
      • isUseTopologyForLoadBalancing

        public java.lang.Boolean isUseTopologyForLoadBalancing()
      • getProducerWindowSize

        public java.lang.Integer getProducerWindowSize()
        Get producer window size
        Returns:
        The value
      • setProducerWindowSize

        public void setProducerWindowSize​(java.lang.Integer producerWindowSize)
        Set producer window size
        Parameters:
        producerWindowSize - The value
      • getProtocolManagerFactoryStr

        public java.lang.String getProtocolManagerFactoryStr()
      • setProtocolManagerFactoryStr

        public void setProtocolManagerFactoryStr​(java.lang.String protocolManagerFactoryStr)
      • getDeserializationBlackList

        public java.lang.String getDeserializationBlackList()
      • setDeserializationBlackList

        public void setDeserializationBlackList​(java.lang.String deserializationBlackList)
      • getDeserializationWhiteList

        public java.lang.String getDeserializationWhiteList()
      • setDeserializationWhiteList

        public void setDeserializationWhiteList​(java.lang.String deserializationWhiteList)
      • getMinLargeMessageSize

        public java.lang.Integer getMinLargeMessageSize()
        Get min large message size
        Returns:
        The value
      • setMinLargeMessageSize

        public void setMinLargeMessageSize​(java.lang.Integer minLargeMessageSize)
        Set min large message size
        Parameters:
        minLargeMessageSize - The value
      • getBlockOnAcknowledge

        public java.lang.Boolean getBlockOnAcknowledge()
        Get block on acknowledge
        Returns:
        The value
      • setBlockOnAcknowledge

        public void setBlockOnAcknowledge​(java.lang.Boolean blockOnAcknowledge)
        Set block on acknowledge
        Parameters:
        blockOnAcknowledge - The value
      • getBlockOnNonDurableSend

        public java.lang.Boolean getBlockOnNonDurableSend()
        Get block on non durable send
        Returns:
        The value
      • setBlockOnNonDurableSend

        public void setBlockOnNonDurableSend​(java.lang.Boolean blockOnNonDurableSend)
        Set block on non durable send
        Parameters:
        blockOnNonDurableSend - The value
      • getBlockOnDurableSend

        public java.lang.Boolean getBlockOnDurableSend()
        Get block on durable send
        Returns:
        The value
      • setBlockOnDurableSend

        public void setBlockOnDurableSend​(java.lang.Boolean blockOnDurableSend)
        Set block on durable send
        Parameters:
        blockOnDurableSend - The value
      • getAutoGroup

        public java.lang.Boolean getAutoGroup()
        Get auto group
        Returns:
        The value
      • setAutoGroup

        public void setAutoGroup​(java.lang.Boolean autoGroup)
        Set auto group
        Parameters:
        autoGroup - The value
      • getPreAcknowledge

        public java.lang.Boolean getPreAcknowledge()
        Get pre acknowledge
        Returns:
        The value
      • setPreAcknowledge

        public void setPreAcknowledge​(java.lang.Boolean preAcknowledge)
        Set pre acknowledge
        Parameters:
        preAcknowledge - The value
      • getInitialConnectAttempts

        public java.lang.Integer getInitialConnectAttempts()
        Get number of initial connect attempts
        Returns:
        The value
      • setInitialConnectAttempts

        public void setInitialConnectAttempts​(java.lang.Integer initialConnectAttempts)
        Set number of initial connect attempts
        Parameters:
        initialConnectAttempts - The value
      • getInitialMessagePacketSize

        public java.lang.Integer getInitialMessagePacketSize()
        Get initial message packet size
        Returns:
        The value
      • setInitialMessagePacketSize

        public void setInitialMessagePacketSize​(java.lang.Integer initialMessagePacketSize)
        Set initial message packet size
        Parameters:
        initialMessagePacketSize - The value
      • getRetryInterval

        public java.lang.Long getRetryInterval()
        Get retry interval
        Returns:
        The value
      • setRetryInterval

        public void setRetryInterval​(java.lang.Long retryInterval)
        Set retry interval
        Parameters:
        retryInterval - The value
      • getRetryIntervalMultiplier

        public java.lang.Double getRetryIntervalMultiplier()
        Get retry interval multiplier
        Returns:
        The value
      • setRetryIntervalMultiplier

        public void setRetryIntervalMultiplier​(java.lang.Double retryIntervalMultiplier)
        Set retry interval multiplier
        Parameters:
        retryIntervalMultiplier - The value
      • getMaxRetryInterval

        public java.lang.Long getMaxRetryInterval()
        Get maximum time for retry interval
        Returns:
        The value
      • setMaxRetryInterval

        public void setMaxRetryInterval​(java.lang.Long maxRetryInterval)
        Set maximum time for retry interval
        Parameters:
        maxRetryInterval - The value
      • getReconnectAttempts

        public java.lang.Integer getReconnectAttempts()
        Get number of reconnect attempts
        Returns:
        The value
      • setReconnectAttempts

        public void setReconnectAttempts​(java.lang.Integer reconnectAttempts)
        Set number of reconnect attempts
        Parameters:
        reconnectAttempts - The value
      • getConnectionLoadBalancingPolicyClassName

        public java.lang.String getConnectionLoadBalancingPolicyClassName()
      • setConnectionLoadBalancingPolicyClassName

        public void setConnectionLoadBalancingPolicyClassName​(java.lang.String connectionLoadBalancingPolicyClassName)
      • getScheduledThreadPoolMaxSize

        public java.lang.Integer getScheduledThreadPoolMaxSize()
      • setScheduledThreadPoolMaxSize

        public void setScheduledThreadPoolMaxSize​(java.lang.Integer scheduledThreadPoolMaxSize)
      • getThreadPoolMaxSize

        public java.lang.Integer getThreadPoolMaxSize()
      • setThreadPoolMaxSize

        public void setThreadPoolMaxSize​(java.lang.Integer threadPoolMaxSize)
      • getUseGlobalPools

        public java.lang.Boolean getUseGlobalPools()
      • setUseGlobalPools

        public void setUseGlobalPools​(java.lang.Boolean useGlobalPools)
      • getUserName

        public java.lang.String getUserName()
        Get the user name
        Returns:
        The value
      • setUserName

        public void setUserName​(java.lang.String userName)
        Set the user name
        Parameters:
        userName - The value
      • getPassword

        public java.lang.String getPassword()
        Get the password
        Returns:
        The value
      • setPassword

        public void setPassword​(java.lang.String password)
        Set the password
        Parameters:
        password - The value
      • isUseJNDI

        public boolean isUseJNDI()
        Returns:
        the useJNDI
      • setUseJNDI

        public void setUseJNDI​(java.lang.Boolean value)
        Parameters:
        value - the useJNDI to set
      • getJndiParams

        public java.lang.String getJndiParams()
        Returns:
        return the jndi params to use
      • setJndiParams

        public void setJndiParams​(java.lang.String jndiParams)
      • getParsedJndiParams

        public java.util.Hashtable<?,​?> getParsedJndiParams()
      • getClientID

        public java.lang.String getClientID()
        Get the client ID
        Returns:
        The value
      • setClientID

        public void setClientID​(java.lang.String clientID)
        Set the client ID
        Parameters:
        clientID - The client id
      • getGroupID

        public java.lang.String getGroupID()
        Get the group ID
        Returns:
        The value
      • setGroupID

        public void setGroupID​(java.lang.String groupID)
        Set the group ID
        Parameters:
        groupID - The group id
      • getUseLocalTx

        public java.lang.Boolean getUseLocalTx()
        Get the use XA flag
        Returns:
        The value
      • setUseLocalTx

        public void setUseLocalTx​(java.lang.Boolean localTx)
        Set the use XA flag
        Parameters:
        localTx - The value
      • getSetupAttempts

        public int getSetupAttempts()
      • setSetupAttempts

        public void setSetupAttempts​(java.lang.Integer setupAttempts)
      • getSetupInterval

        public long getSetupInterval()
      • setSetupInterval

        public void setSetupInterval​(java.lang.Long interval)
      • equals

        public boolean equals​(java.lang.Object obj)
        Indicates whether some other object is "equal to" this one.
        Overrides:
        equals in class java.lang.Object
        Parameters:
        obj - Object with which to compare
        Returns:
        True if this object is the same as the obj argument; false otherwise.
      • hashCode

        public int hashCode()
        Return the hash code for the object
        Overrides:
        hashCode in class java.lang.Object
        Returns:
        The hash code
      • getWorkManager

        public javax.resource.spi.work.WorkManager getWorkManager()
        Get the work manager
        Returns:
        The manager
      • createSession

        public org.apache.activemq.artemis.api.core.client.ClientSession createSession​(org.apache.activemq.artemis.api.core.client.ClientSessionFactory parameterFactory,
                                                                                       int ackMode,
                                                                                       java.lang.String user,
                                                                                       java.lang.String pass,
                                                                                       java.lang.Boolean preAck,
                                                                                       java.lang.Integer dupsOkBatchSize,
                                                                                       java.lang.Integer transactionBatchSize,
                                                                                       boolean deliveryTransacted,
                                                                                       boolean useLocalTx,
                                                                                       java.lang.Integer txTimeout)
                                                                                throws java.lang.Exception
        Throws:
        java.lang.Exception
      • getProperties

        public ActiveMQRAProperties getProperties()
        Get the resource adapter properties
        Returns:
        The properties
      • setup

        protected void setup()
                      throws org.apache.activemq.artemis.api.core.ActiveMQException
        Setup the factory
        Throws:
        org.apache.activemq.artemis.api.core.ActiveMQException
      • getActivations

        public java.util.Map<javax.resource.spi.ActivationSpec,​ActiveMQActivation> getActivations()
      • getDefaultActiveMQConnectionFactory

        public org.apache.activemq.artemis.jms.client.ActiveMQConnectionFactory getDefaultActiveMQConnectionFactory()
                                                                                                             throws javax.resource.ResourceException
        Throws:
        javax.resource.ResourceException
      • getConnectionFactory

        public org.apache.activemq.artemis.jms.client.ActiveMQConnectionFactory getConnectionFactory​(ConnectionFactoryProperties overrideProperties)
      • newConnectionFactory

        public org.apache.activemq.artemis.jms.client.ActiveMQConnectionFactory newConnectionFactory​(ConnectionFactoryProperties overrideProperties)
      • createRecoveryActiveMQConnectionFactory

        public org.apache.activemq.artemis.jms.client.ActiveMQConnectionFactory createRecoveryActiveMQConnectionFactory​(ConnectionFactoryProperties overrideProperties)
      • createBroadcastEndpointFactory

        protected org.apache.activemq.artemis.api.core.BroadcastEndpointFactory createBroadcastEndpointFactory​(ConnectionFactoryProperties overrideProperties)
      • overrideConnectionParameters

        public java.util.Map<java.lang.String,​java.lang.Object> overrideConnectionParameters​(java.util.Map<java.lang.String,​java.lang.Object> connectionParams,
                                                                                                   java.util.Map<java.lang.String,​java.lang.Object> overrideConnectionParams)
      • getCodec

        public java.lang.String getCodec()
      • isIgnoreJTA

        public java.lang.Boolean isIgnoreJTA()
      • setIgnoreJTA

        public void setIgnoreJTA​(java.lang.Boolean ignoreJTA)