Class ActiveMQRAManagedConnectionFactory

java.lang.Object
org.apache.activemq.artemis.ra.ActiveMQRAManagedConnectionFactory
All Implemented Interfaces:
ManagedConnectionFactory, ResourceAdapterAssociation, Serializable

public final class ActiveMQRAManagedConnectionFactory extends Object implements ManagedConnectionFactory, ResourceAdapterAssociation
See Also:
  • Constructor Details

    • ActiveMQRAManagedConnectionFactory

      public ActiveMQRAManagedConnectionFactory()
  • Method Details

    • createConnectionFactory

      public Object createConnectionFactory() throws ResourceException
      Creates a Connection Factory instance. The Connection Factory instance gets initialized with a default ConnectionManager provided by the resource adapter.
      Specified by:
      createConnectionFactory in interface ManagedConnectionFactory
      Returns:
      EIS-specific Connection Factory instance or jakarta.resource.cci.ConnectionFactory instance
      Throws:
      ResourceException - Generic exception
      ResourceAdapterInternalException - Resource adapter related error condition
    • createConnectionFactory

      public Object createConnectionFactory(ConnectionManager cxManager) throws ResourceException
      Creates a Connection Factory instance. The Connection Factory instance gets initialized with the passed ConnectionManager. In the managed scenario, ConnectionManager is provided by the application server.
      Specified by:
      createConnectionFactory in interface ManagedConnectionFactory
      Parameters:
      cxManager - ConnectionManager to be associated with created EIS connection factory instance
      Returns:
      EIS-specific Connection Factory instance or jakarta.resource.cci.ConnectionFactory instance
      Throws:
      ResourceException - Generic exception
      ResourceAdapterInternalException - Resource adapter related error condition
    • createManagedConnection

      public ManagedConnection createManagedConnection(Subject subject, ConnectionRequestInfo cxRequestInfo) throws ResourceException
      Creates a new physical connection to the underlying EIS resource manager.

      ManagedConnectionFactory uses the security information (passed as Subject) and additional ConnectionRequestInfo (which is specific to ResourceAdapter and opaque to application server) to create this new connection.

      Specified by:
      createManagedConnection in interface ManagedConnectionFactory
      Parameters:
      subject - Caller's security information
      cxRequestInfo - Additional resource adapter specific connection request information
      Returns:
      ManagedConnection instance
      Throws:
      ResourceException - generic exception
      SecurityException - security related error
      ResourceAllocationException - failed to allocate system resources for connection request
      ResourceAdapterInternalException - resource adapter related error condition
      EISSystemException - internal error condition in EIS instance
    • getResourceRecovery

      public XARecoveryConfig getResourceRecovery()
    • matchManagedConnections

      public ManagedConnection matchManagedConnections(Set connectionSet, Subject subject, ConnectionRequestInfo cxRequestInfo) throws ResourceException
      Returns a matched connection from the candidate set of connections.

      ManagedConnectionFactory uses the security info (as in Subject) and information provided through ConnectionRequestInfo and additional Resource Adapter specific criteria to do matching. Note that criteria used for matching is specific to a resource adapter and is not prescribed by the Connector specification.

      This method returns a ManagedConnection instance that is the best match for handling the connection allocation request.

      Specified by:
      matchManagedConnections in interface ManagedConnectionFactory
      Parameters:
      connectionSet - candidate connection set
      subject - caller's security information
      cxRequestInfo - additional resource adapter specific connection request information
      Returns:
      ManagedConnection if resource adapter finds an acceptable match otherwise null
      Throws:
      ResourceException - generic exception
      SecurityException - security related error
      ResourceAdapterInternalException - resource adapter related error condition
      NotSupportedException - if operation is not supported
    • setLogWriter

      public void setLogWriter(PrintWriter out) throws ResourceException
      NOT SUPPORTED

      Set the log writer for this ManagedConnectionFactory instance.

      The log writer is a character output stream to which all logging and tracing messages for this ManagedConnectionfactory instance will be printed.

      ApplicationServer manages the association of output stream with the ManagedConnectionFactory. When a ManagedConnectionFactory object is created the log writer is initially null, in other words, logging is disabled. Once a log writer is associated with a ManagedConnectionFactory, logging and tracing for ManagedConnectionFactory instance is enabled.

      The ManagedConnection instances created by ManagedConnectionFactory "inherits" the log writer, which can be overridden by ApplicationServer using ManagedConnection.setLogWriter to set ManagedConnection specific logging and tracing.

      Specified by:
      setLogWriter in interface ManagedConnectionFactory
      Parameters:
      out - PrintWriter - an out stream for error logging and tracing
      Throws:
      ResourceException - generic exception
      ResourceAdapterInternalException - resource adapter related error condition
    • getLogWriter

      public PrintWriter getLogWriter() throws ResourceException
      NOT SUPPORTED

      Get the log writer for this ManagedConnectionFactory instance.

      The log writer is a character output stream to which all logging and tracing messages for this ManagedConnectionFactory instance will be printed

      ApplicationServer manages the association of output stream with the ManagedConnectionFactory. When a ManagedConnectionFactory object is created the log writer is initially null, in other words, logging is disabled.

      Specified by:
      getLogWriter in interface ManagedConnectionFactory
      Returns:
      PrintWriter
      Throws:
      ResourceException - generic exception
    • getResourceAdapter

      public ResourceAdapter getResourceAdapter()
      Get the associated ResourceAdapter object.
      Specified by:
      getResourceAdapter in interface ResourceAdapterAssociation
      Returns:
      the associated ResourceAdapter object.
    • isIgnoreJTA

      public boolean isIgnoreJTA()
    • setResourceAdapter

      public void setResourceAdapter(ResourceAdapter ra) throws ResourceException
      Associate this object with a ResourceAdapter object. Note, this method must be called exactly once. That is, the association must not change during the lifetime of this object.
      Specified by:
      setResourceAdapter in interface ResourceAdapterAssociation
      Parameters:
      ra - ResourceAdapter object to be associated with.
      Throws:
      ResourceException - generic exception.
      ResourceAdapterInternalException - resource adapter related error condition.
      IllegalStateException - indicates that this object is in an illegal state for the method invocation. For example, this occurs when this method is called more than once on the same object.
    • equals

      public boolean equals(Object obj)
      Description copied from interface: ManagedConnectionFactory
      Check if this ManagedConnectionFactory is equal to another ManagedConnectionFactory.
      Specified by:
      equals in interface ManagedConnectionFactory
      Overrides:
      equals in class Object
      Parameters:
      obj - to check
      Returns:
      true if two instances are equal
    • hashCode

      public int hashCode()
      Description copied from interface: ManagedConnectionFactory
      Returns the hash code for the ManagedConnectionFactory
      Specified by:
      hashCode in interface ManagedConnectionFactory
      Overrides:
      hashCode in class Object
      Returns:
      hash code for the ManagedConnectionFactory
    • getSessionDefaultType

      public String getSessionDefaultType()
    • setSessionDefaultType

      public void setSessionDefaultType(String type)
      Set the default session type
      Parameters:
      type - either jakarta.jms.Topic or jakarta.jms.Queue
    • getConnectionParameters

      public String getConnectionParameters()
    • setConnectionParameters

      public void setConnectionParameters(String configuration)
    • getConnectorClassName

      public String getConnectorClassName()
    • setConnectorClassName

      public void setConnectorClassName(String value)
    • getConnectionLoadBalancingPolicyClassName

      public String getConnectionLoadBalancingPolicyClassName()
    • setConnectionLoadBalancingPolicyClassName

      public void setConnectionLoadBalancingPolicyClassName(String connectionLoadBalancingPolicyClassName)
    • getDiscoveryAddress

      public String getDiscoveryAddress()
    • setDiscoveryAddress

      public void setDiscoveryAddress(String discoveryAddress)
    • getDiscoveryPort

      public Integer getDiscoveryPort()
    • setDiscoveryPort

      public void setDiscoveryPort(Integer discoveryPort)
    • getDiscoveryRefreshTimeout

      public Long getDiscoveryRefreshTimeout()
    • setDiscoveryRefreshTimeout

      public void setDiscoveryRefreshTimeout(Long discoveryRefreshTimeout)
    • getDiscoveryInitialWaitTimeout

      public Long getDiscoveryInitialWaitTimeout()
    • setDiscoveryInitialWaitTimeout

      public void setDiscoveryInitialWaitTimeout(Long discoveryInitialWaitTimeout)
    • getClientID

      public String getClientID()
    • setClientID

      public void setClientID(String clientID)
    • getDupsOKBatchSize

      public Integer getDupsOKBatchSize()
    • setDupsOKBatchSize

      public void setDupsOKBatchSize(Integer dupsOKBatchSize)
    • getTransactionBatchSize

      public Integer getTransactionBatchSize()
    • setTransactionBatchSize

      public void setTransactionBatchSize(Integer transactionBatchSize)
    • getClientFailureCheckPeriod

      public Long getClientFailureCheckPeriod()
    • setClientFailureCheckPeriod

      public void setClientFailureCheckPeriod(Long clientFailureCheckPeriod)
    • getConnectionTTL

      public Long getConnectionTTL()
    • setConnectionTTL

      public void setConnectionTTL(Long connectionTTL)
    • getCallTimeout

      public Long getCallTimeout()
    • setCallTimeout

      public void setCallTimeout(Long callTimeout)
    • 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)
    • getMinLargeMessageSize

      public Integer getMinLargeMessageSize()
    • setMinLargeMessageSize

      public void setMinLargeMessageSize(Integer minLargeMessageSize)
    • getBlockOnAcknowledge

      public Boolean getBlockOnAcknowledge()
      A getter as well as a setter for those servers that use introspection
    • isBlockOnAcknowledge

      public Boolean isBlockOnAcknowledge()
    • setBlockOnAcknowledge

      public void setBlockOnAcknowledge(Boolean blockOnAcknowledge)
    • getBlockOnNonDurableSend

      public Boolean getBlockOnNonDurableSend()
      A getter as well as a setter for those servers that use introspection
    • isBlockOnNonDurableSend

      public Boolean isBlockOnNonDurableSend()
    • setBlockOnNonDurableSend

      public void setBlockOnNonDurableSend(Boolean blockOnNonDurableSend)
    • getBlockOnDurableSend

      public Boolean getBlockOnDurableSend()
      A getter as well as a setter for those servers that use introspection
    • isBlockOnDurableSend

      public Boolean isBlockOnDurableSend()
    • setBlockOnDurableSend

      public void setBlockOnDurableSend(Boolean blockOnDurableSend)
    • getAutoGroup

      public Boolean getAutoGroup()
      A getter as well as a setter for those servers that use introspection
    • isAutoGroup

      public Boolean isAutoGroup()
    • setAutoGroup

      public void setAutoGroup(Boolean autoGroup)
    • getPreAcknowledge

      public Boolean getPreAcknowledge()
      A getter as well as a setter for those servers that use introspection
    • isPreAcknowledge

      public Boolean isPreAcknowledge()
    • setPreAcknowledge

      public void setPreAcknowledge(Boolean preAcknowledge)
    • getRetryInterval

      public Long getRetryInterval()
    • setRetryInterval

      public void setRetryInterval(Long retryInterval)
    • getRetryIntervalMultiplier

      public Double getRetryIntervalMultiplier()
    • setRetryIntervalMultiplier

      public void setRetryIntervalMultiplier(Double retryIntervalMultiplier)
    • getReconnectAttempts

      public Integer getReconnectAttempts()
    • setReconnectAttempts

      public void setReconnectAttempts(Integer reconnectAttempts)
    • getUseGlobalPools

      public Boolean getUseGlobalPools()
      A getter as well as a setter for those servers that use introspection
    • isUseGlobalPools

      public Boolean isUseGlobalPools()
    • setUseGlobalPools

      public void setUseGlobalPools(Boolean useGlobalPools)
    • getCacheDestinations

      public Boolean getCacheDestinations()
      A getter as well as a setter for those servers that use introspection
    • isCacheDestinations

      public Boolean isCacheDestinations()
    • setCacheDestinations

      public void setCacheDestinations(Boolean cacheDestinations)
    • getEnable1xPrefixes

      public Boolean getEnable1xPrefixes()
      A getter as well as a setter for those servers that use introspection
    • isEnable1xPrefixes

      public Boolean isEnable1xPrefixes()
    • setEnable1xPrefixes

      public void setEnable1xPrefixes(Boolean enable1xPrefixes)
    • getScheduledThreadPoolMaxSize

      public Integer getScheduledThreadPoolMaxSize()
    • setScheduledThreadPoolMaxSize

      public void setScheduledThreadPoolMaxSize(Integer scheduledThreadPoolMaxSize)
    • getThreadPoolMaxSize

      public Integer getThreadPoolMaxSize()
    • setThreadPoolMaxSize

      public void setThreadPoolMaxSize(Integer threadPoolMaxSize)
    • getHA

      public Boolean getHA()
      A getter as well as a setter for those servers that use introspection
    • isHA

      public Boolean isHA()
    • setAllowLocalTransactions

      public void setAllowLocalTransactions(Boolean allowLocalTransactions)
    • getAllowLocalTransactions

      public Boolean getAllowLocalTransactions()
      A getter as well as a setter for those servers that use introspection
    • isAllowLocalTransactions

      public Boolean isAllowLocalTransactions()
    • getInJtaTransaction

      public Boolean getInJtaTransaction()
      A getter as well as a setter for those servers that use introspection
    • isInJtaTransaction

      public Boolean isInJtaTransaction()
    • setInJtaTransaction

      public void setInJtaTransaction(Boolean inJtaTransaction)
    • setHA

      public void setHA(Boolean ha)
    • isCompressLargeMessage

      public Boolean isCompressLargeMessage()
    • setCompressLargeMessage

      public void setCompressLargeMessage(Boolean compressLargeMessage)
    • getCompressionLevel

      public Integer getCompressionLevel()
    • setCompressionLevel

      public void setCompressionLevel(Integer compressionLevel)
    • getInitialConnectAttempts

      public Integer getInitialConnectAttempts()
    • setInitialConnectAttempts

      public void setInitialConnectAttempts(Integer initialConnectAttempts)
    • getUseTryLock

      public Integer getUseTryLock()
    • setUseTryLock

      public void setUseTryLock(Integer useTryLock)
    • getMetaData

      public ConnectionMetaData getMetaData()
    • getProperties

      protected ActiveMQRAMCFProperties getProperties()
    • stop

      public void stop()