diff --git a/artemis-ra/src/main/java/org/apache/activemq/artemis/ra/ActiveMQResourceAdapter.java b/artemis-ra/src/main/java/org/apache/activemq/artemis/ra/ActiveMQResourceAdapter.java index a85234e489..aa2a09935e 100644 --- a/artemis-ra/src/main/java/org/apache/activemq/artemis/ra/ActiveMQResourceAdapter.java +++ b/artemis-ra/src/main/java/org/apache/activemq/artemis/ra/ActiveMQResourceAdapter.java @@ -60,6 +60,7 @@ import org.apache.activemq.artemis.ra.recovery.RecoveryManager; import org.apache.activemq.artemis.service.extensions.ServiceUtils; import org.apache.activemq.artemis.service.extensions.xa.recovery.XARecoveryConfig; import org.apache.activemq.artemis.utils.SensitiveDataCodec; +import org.jboss.logging.Logger; import org.jgroups.JChannel; /** @@ -67,6 +68,8 @@ import org.jgroups.JChannel; */ public class ActiveMQResourceAdapter implements ResourceAdapter, Serializable { + private static final Logger logger = Logger.getLogger(ActiveMQResourceAdapter.class); + private static final long serialVersionUID = 4756893709825838770L; /** @@ -74,11 +77,6 @@ public class ActiveMQResourceAdapter implements ResourceAdapter, Serializable { */ public static final String PRODUCT_NAME = "ActiveMQ Artemis"; - /** - * Trace enabled - */ - private static boolean trace = ActiveMQRALogger.LOGGER.isTraceEnabled(); - /** * The bootstrap context */ @@ -136,8 +134,8 @@ public class ActiveMQResourceAdapter implements ResourceAdapter, Serializable { * Constructor */ public ActiveMQResourceAdapter() { - if (ActiveMQResourceAdapter.trace) { - ActiveMQRALogger.LOGGER.trace("constructor()"); + if (logger.isTraceEnabled()) { + logger.trace("constructor()"); } raProperties = new ActiveMQRAProperties(); @@ -170,8 +168,8 @@ public class ActiveMQResourceAdapter implements ResourceAdapter, Serializable { throw new ResourceException("Unable to create activation", e); } } - if (ActiveMQResourceAdapter.trace) { - ActiveMQRALogger.LOGGER.trace("endpointActivation(" + endpointFactory + ", " + spec + ")"); + if (logger.isTraceEnabled()) { + logger.trace("endpointActivation(" + endpointFactory + ", " + spec + ")"); } ActiveMQActivation activation = new ActiveMQActivation(this, endpointFactory, (ActiveMQActivationSpec) spec); @@ -187,8 +185,8 @@ public class ActiveMQResourceAdapter implements ResourceAdapter, Serializable { */ @Override public void endpointDeactivation(final MessageEndpointFactory endpointFactory, final ActivationSpec spec) { - if (ActiveMQResourceAdapter.trace) { - ActiveMQRALogger.LOGGER.trace("endpointDeactivation(" + endpointFactory + ", " + spec + ")"); + if (logger.isTraceEnabled()) { + logger.trace("endpointDeactivation(" + endpointFactory + ", " + spec + ")"); } ActiveMQActivation activation = activations.remove(spec); @@ -206,8 +204,8 @@ public class ActiveMQResourceAdapter implements ResourceAdapter, Serializable { */ @Override public XAResource[] getXAResources(final ActivationSpec[] specs) throws ResourceException { - if (ActiveMQResourceAdapter.trace) { - ActiveMQRALogger.LOGGER.trace("getXAResources(" + Arrays.toString(specs) + ")"); + if (logger.isTraceEnabled()) { + logger.trace("getXAResources(" + Arrays.toString(specs) + ")"); } if (useAutoRecovery) { @@ -233,8 +231,8 @@ public class ActiveMQResourceAdapter implements ResourceAdapter, Serializable { */ @Override public void start(final BootstrapContext ctx) throws ResourceAdapterInternalException { - if (ActiveMQResourceAdapter.trace) { - ActiveMQRALogger.LOGGER.trace("start(" + ctx + ")"); + if (logger.isTraceEnabled()) { + logger.trace("start(" + ctx + ")"); } tm = ServiceUtils.getTransactionManager(); @@ -259,8 +257,8 @@ public class ActiveMQResourceAdapter implements ResourceAdapter, Serializable { */ @Override public void stop() { - if (ActiveMQResourceAdapter.trace) { - ActiveMQRALogger.LOGGER.trace("stop()"); + if (logger.isTraceEnabled()) { + logger.trace("stop()"); } for (Map.Entry entry : activations.entrySet()) { @@ -322,8 +320,8 @@ public class ActiveMQResourceAdapter implements ResourceAdapter, Serializable { } public void setConnectorClassName(final String connectorClassName) { - if (ActiveMQResourceAdapter.trace) { - ActiveMQRALogger.LOGGER.trace("setTransportType(" + connectorClassName + ")"); + if (logger.isTraceEnabled()) { + logger.trace("setTransportType(" + connectorClassName + ")"); } unparsedConnectors = connectorClassName; @@ -377,8 +375,8 @@ public class ActiveMQResourceAdapter implements ResourceAdapter, Serializable { * @return The value */ public String getDiscoveryAddress() { - if (ActiveMQResourceAdapter.trace) { - ActiveMQRALogger.LOGGER.trace("getDiscoveryGroupAddress()"); + if (logger.isTraceEnabled()) { + logger.trace("getDiscoveryGroupAddress()"); } return raProperties.getDiscoveryAddress(); @@ -406,8 +404,8 @@ public class ActiveMQResourceAdapter implements ResourceAdapter, Serializable { * @param dgn The value */ public void setDiscoveryAddress(final String dgn) { - if (ActiveMQResourceAdapter.trace) { - ActiveMQRALogger.LOGGER.trace("setDiscoveryGroupAddress(" + dgn + ")"); + if (logger.isTraceEnabled()) { + logger.trace("setDiscoveryGroupAddress(" + dgn + ")"); } raProperties.setDiscoveryAddress(dgn); @@ -419,8 +417,8 @@ public class ActiveMQResourceAdapter implements ResourceAdapter, Serializable { * @return The value */ public Integer getDiscoveryPort() { - if (ActiveMQResourceAdapter.trace) { - ActiveMQRALogger.LOGGER.trace("getDiscoveryGroupPort()"); + if (logger.isTraceEnabled()) { + logger.trace("getDiscoveryGroupPort()"); } return raProperties.getDiscoveryPort(); @@ -432,8 +430,8 @@ public class ActiveMQResourceAdapter implements ResourceAdapter, Serializable { * @param discoveryLocalBindAddress the address value */ public void setDiscoveryLocalBindAddress(final String discoveryLocalBindAddress) { - if (ActiveMQResourceAdapter.trace) { - ActiveMQRALogger.LOGGER.trace("setDiscoveryLocalBindAddress(" + discoveryLocalBindAddress + ")"); + if (logger.isTraceEnabled()) { + logger.trace("setDiscoveryLocalBindAddress(" + discoveryLocalBindAddress + ")"); } raProperties.setDiscoveryLocalBindAddress(discoveryLocalBindAddress); @@ -445,8 +443,8 @@ public class ActiveMQResourceAdapter implements ResourceAdapter, Serializable { * @return the address value */ public String getDiscoveryLocalBindAddress() { - if (ActiveMQResourceAdapter.trace) { - ActiveMQRALogger.LOGGER.trace("getDiscoveryLocalBindAddress()"); + if (logger.isTraceEnabled()) { + logger.trace("getDiscoveryLocalBindAddress()"); } return raProperties.getDiscoveryLocalBindAddress(); @@ -458,8 +456,8 @@ public class ActiveMQResourceAdapter implements ResourceAdapter, Serializable { * @param dgp The value */ public void setDiscoveryPort(final Integer dgp) { - if (ActiveMQResourceAdapter.trace) { - ActiveMQRALogger.LOGGER.trace("setDiscoveryGroupPort(" + dgp + ")"); + if (logger.isTraceEnabled()) { + logger.trace("setDiscoveryGroupPort(" + dgp + ")"); } raProperties.setDiscoveryPort(dgp); @@ -471,8 +469,8 @@ public class ActiveMQResourceAdapter implements ResourceAdapter, Serializable { * @return The value */ public Long getDiscoveryRefreshTimeout() { - if (ActiveMQResourceAdapter.trace) { - ActiveMQRALogger.LOGGER.trace("getDiscoveryRefreshTimeout()"); + if (logger.isTraceEnabled()) { + logger.trace("getDiscoveryRefreshTimeout()"); } return raProperties.getDiscoveryRefreshTimeout(); @@ -484,8 +482,8 @@ public class ActiveMQResourceAdapter implements ResourceAdapter, Serializable { * @param discoveryRefreshTimeout The value */ public void setDiscoveryRefreshTimeout(final Long discoveryRefreshTimeout) { - if (ActiveMQResourceAdapter.trace) { - ActiveMQRALogger.LOGGER.trace("setDiscoveryRefreshTimeout(" + discoveryRefreshTimeout + ")"); + if (logger.isTraceEnabled()) { + logger.trace("setDiscoveryRefreshTimeout(" + discoveryRefreshTimeout + ")"); } raProperties.setDiscoveryRefreshTimeout(discoveryRefreshTimeout); @@ -497,8 +495,8 @@ public class ActiveMQResourceAdapter implements ResourceAdapter, Serializable { * @return The value */ public Long getDiscoveryInitialWaitTimeout() { - if (ActiveMQResourceAdapter.trace) { - ActiveMQRALogger.LOGGER.trace("getDiscoveryInitialWaitTimeout()"); + if (logger.isTraceEnabled()) { + logger.trace("getDiscoveryInitialWaitTimeout()"); } return raProperties.getDiscoveryInitialWaitTimeout(); @@ -510,8 +508,8 @@ public class ActiveMQResourceAdapter implements ResourceAdapter, Serializable { * @param discoveryInitialWaitTimeout The value */ public void setDiscoveryInitialWaitTimeout(final Long discoveryInitialWaitTimeout) { - if (ActiveMQResourceAdapter.trace) { - ActiveMQRALogger.LOGGER.trace("setDiscoveryInitialWaitTimeout(" + discoveryInitialWaitTimeout + ")"); + if (logger.isTraceEnabled()) { + logger.trace("setDiscoveryInitialWaitTimeout(" + discoveryInitialWaitTimeout + ")"); } raProperties.setDiscoveryInitialWaitTimeout(discoveryInitialWaitTimeout); @@ -523,8 +521,8 @@ public class ActiveMQResourceAdapter implements ResourceAdapter, Serializable { * @return The value */ public Long getClientFailureCheckPeriod() { - if (ActiveMQResourceAdapter.trace) { - ActiveMQRALogger.LOGGER.trace("getClientFailureCheckPeriod()"); + if (logger.isTraceEnabled()) { + logger.trace("getClientFailureCheckPeriod()"); } return raProperties.getClientFailureCheckPeriod(); @@ -536,8 +534,8 @@ public class ActiveMQResourceAdapter implements ResourceAdapter, Serializable { * @param clientFailureCheckPeriod The value */ public void setClientFailureCheckPeriod(final Long clientFailureCheckPeriod) { - if (ActiveMQResourceAdapter.trace) { - ActiveMQRALogger.LOGGER.trace("setClientFailureCheckPeriod(" + clientFailureCheckPeriod + ")"); + if (logger.isTraceEnabled()) { + logger.trace("setClientFailureCheckPeriod(" + clientFailureCheckPeriod + ")"); } raProperties.setClientFailureCheckPeriod(clientFailureCheckPeriod); @@ -549,8 +547,8 @@ public class ActiveMQResourceAdapter implements ResourceAdapter, Serializable { * @return The value */ public Long getConnectionTTL() { - if (ActiveMQResourceAdapter.trace) { - ActiveMQRALogger.LOGGER.trace("getConnectionTTL()"); + if (logger.isTraceEnabled()) { + logger.trace("getConnectionTTL()"); } return raProperties.getConnectionTTL(); @@ -562,8 +560,8 @@ public class ActiveMQResourceAdapter implements ResourceAdapter, Serializable { * @param connectionTTL The value */ public void setConnectionTTL(final Long connectionTTL) { - if (ActiveMQResourceAdapter.trace) { - ActiveMQRALogger.LOGGER.trace("setConnectionTTL(" + connectionTTL + ")"); + if (logger.isTraceEnabled()) { + logger.trace("setConnectionTTL(" + connectionTTL + ")"); } raProperties.setConnectionTTL(connectionTTL); @@ -575,8 +573,8 @@ public class ActiveMQResourceAdapter implements ResourceAdapter, Serializable { * @return The value */ public Boolean isCacheLargeMessagesClient() { - if (ActiveMQResourceAdapter.trace) { - ActiveMQRALogger.LOGGER.trace("isCacheLargeMessagesClient()"); + if (logger.isTraceEnabled()) { + logger.trace("isCacheLargeMessagesClient()"); } return raProperties.isCacheLargeMessagesClient(); @@ -588,8 +586,8 @@ public class ActiveMQResourceAdapter implements ResourceAdapter, Serializable { * @param cacheLargeMessagesClient The value */ public void setCacheLargeMessagesClient(final Boolean cacheLargeMessagesClient) { - if (ActiveMQResourceAdapter.trace) { - ActiveMQRALogger.LOGGER.trace("setCacheLargeMessagesClient(" + cacheLargeMessagesClient + ")"); + if (logger.isTraceEnabled()) { + logger.trace("setCacheLargeMessagesClient(" + cacheLargeMessagesClient + ")"); } raProperties.setCacheLargeMessagesClient(cacheLargeMessagesClient); @@ -601,8 +599,8 @@ public class ActiveMQResourceAdapter implements ResourceAdapter, Serializable { * @return The value */ public Boolean isCompressLargeMessage() { - if (ActiveMQResourceAdapter.trace) { - ActiveMQRALogger.LOGGER.trace("isCompressLargeMessage()"); + if (logger.isTraceEnabled()) { + logger.trace("isCompressLargeMessage()"); } return raProperties.isCompressLargeMessage(); @@ -614,8 +612,8 @@ public class ActiveMQResourceAdapter implements ResourceAdapter, Serializable { * @param failoverOnInitialConnection The value */ public void setFailoverOnInitialConnection(final Boolean failoverOnInitialConnection) { - if (ActiveMQResourceAdapter.trace) { - ActiveMQRALogger.LOGGER.trace("setFailoverOnInitialConnection(" + failoverOnInitialConnection + ")"); + if (logger.isTraceEnabled()) { + logger.trace("setFailoverOnInitialConnection(" + failoverOnInitialConnection + ")"); } raProperties.setFailoverOnInitialConnection(failoverOnInitialConnection); @@ -627,8 +625,8 @@ public class ActiveMQResourceAdapter implements ResourceAdapter, Serializable { * @return The value */ public Boolean isFailoverOnInitialConnection() { - if (ActiveMQResourceAdapter.trace) { - ActiveMQRALogger.LOGGER.trace("isFailoverOnInitialConnection()"); + if (logger.isTraceEnabled()) { + logger.trace("isFailoverOnInitialConnection()"); } return raProperties.isFailoverOnInitialConnection(); @@ -666,8 +664,8 @@ public class ActiveMQResourceAdapter implements ResourceAdapter, Serializable { * @param compressLargeMessage The value */ public void setCompressLargeMessage(final Boolean compressLargeMessage) { - if (ActiveMQResourceAdapter.trace) { - ActiveMQRALogger.LOGGER.trace("setCompressLargeMessage(" + compressLargeMessage + ")"); + if (logger.isTraceEnabled()) { + logger.trace("setCompressLargeMessage(" + compressLargeMessage + ")"); } raProperties.setCompressLargeMessage(compressLargeMessage); @@ -679,8 +677,8 @@ public class ActiveMQResourceAdapter implements ResourceAdapter, Serializable { * @return The value */ public Long getCallTimeout() { - if (ActiveMQResourceAdapter.trace) { - ActiveMQRALogger.LOGGER.trace("getCallTimeout()"); + if (logger.isTraceEnabled()) { + logger.trace("getCallTimeout()"); } return raProperties.getCallTimeout(); @@ -692,8 +690,8 @@ public class ActiveMQResourceAdapter implements ResourceAdapter, Serializable { * @param callTimeout The value */ public void setCallTimeout(final Long callTimeout) { - if (ActiveMQResourceAdapter.trace) { - ActiveMQRALogger.LOGGER.trace("setCallTimeout(" + callTimeout + ")"); + if (logger.isTraceEnabled()) { + logger.trace("setCallTimeout(" + callTimeout + ")"); } raProperties.setCallTimeout(callTimeout); @@ -705,8 +703,8 @@ public class ActiveMQResourceAdapter implements ResourceAdapter, Serializable { * @return The value */ public Long getCallFailoverTimeout() { - if (ActiveMQResourceAdapter.trace) { - ActiveMQRALogger.LOGGER.trace("getCallFailoverTimeout()"); + if (logger.isTraceEnabled()) { + logger.trace("getCallFailoverTimeout()"); } return raProperties.getCallFailoverTimeout(); @@ -718,8 +716,8 @@ public class ActiveMQResourceAdapter implements ResourceAdapter, Serializable { * @param callFailoverTimeout The value */ public void setCallFailoverTimeout(final Long callFailoverTimeout) { - if (ActiveMQResourceAdapter.trace) { - ActiveMQRALogger.LOGGER.trace("setCallFailoverTimeout(" + callFailoverTimeout + ")"); + if (logger.isTraceEnabled()) { + logger.trace("setCallFailoverTimeout(" + callFailoverTimeout + ")"); } raProperties.setCallFailoverTimeout(callFailoverTimeout); @@ -731,8 +729,8 @@ public class ActiveMQResourceAdapter implements ResourceAdapter, Serializable { * @return The value */ public Integer getDupsOKBatchSize() { - if (ActiveMQResourceAdapter.trace) { - ActiveMQRALogger.LOGGER.trace("getDupsOKBatchSize()"); + if (logger.isTraceEnabled()) { + logger.trace("getDupsOKBatchSize()"); } return raProperties.getDupsOKBatchSize(); @@ -744,8 +742,8 @@ public class ActiveMQResourceAdapter implements ResourceAdapter, Serializable { * @param dupsOKBatchSize The value */ public void setDupsOKBatchSize(final Integer dupsOKBatchSize) { - if (ActiveMQResourceAdapter.trace) { - ActiveMQRALogger.LOGGER.trace("setDupsOKBatchSize(" + dupsOKBatchSize + ")"); + if (logger.isTraceEnabled()) { + logger.trace("setDupsOKBatchSize(" + dupsOKBatchSize + ")"); } raProperties.setDupsOKBatchSize(dupsOKBatchSize); @@ -757,8 +755,8 @@ public class ActiveMQResourceAdapter implements ResourceAdapter, Serializable { * @return The value */ public Integer getTransactionBatchSize() { - if (ActiveMQResourceAdapter.trace) { - ActiveMQRALogger.LOGGER.trace("getTransactionBatchSize()"); + if (logger.isTraceEnabled()) { + logger.trace("getTransactionBatchSize()"); } return raProperties.getTransactionBatchSize(); @@ -770,8 +768,8 @@ public class ActiveMQResourceAdapter implements ResourceAdapter, Serializable { * @param transactionBatchSize The value */ public void setTransactionBatchSize(final Integer transactionBatchSize) { - if (ActiveMQResourceAdapter.trace) { - ActiveMQRALogger.LOGGER.trace("setTransactionBatchSize(" + transactionBatchSize + ")"); + if (logger.isTraceEnabled()) { + logger.trace("setTransactionBatchSize(" + transactionBatchSize + ")"); } raProperties.setTransactionBatchSize(transactionBatchSize); @@ -783,8 +781,8 @@ public class ActiveMQResourceAdapter implements ResourceAdapter, Serializable { * @return The value */ public Integer getConsumerWindowSize() { - if (ActiveMQResourceAdapter.trace) { - ActiveMQRALogger.LOGGER.trace("getConsumerWindowSize()"); + if (logger.isTraceEnabled()) { + logger.trace("getConsumerWindowSize()"); } return raProperties.getConsumerWindowSize(); @@ -796,8 +794,8 @@ public class ActiveMQResourceAdapter implements ResourceAdapter, Serializable { * @param consumerWindowSize The value */ public void setConsumerWindowSize(final Integer consumerWindowSize) { - if (ActiveMQResourceAdapter.trace) { - ActiveMQRALogger.LOGGER.trace("setConsumerWindowSize(" + consumerWindowSize + ")"); + if (logger.isTraceEnabled()) { + logger.trace("setConsumerWindowSize(" + consumerWindowSize + ")"); } raProperties.setConsumerWindowSize(consumerWindowSize); @@ -809,8 +807,8 @@ public class ActiveMQResourceAdapter implements ResourceAdapter, Serializable { * @return The value */ public Integer getConsumerMaxRate() { - if (ActiveMQResourceAdapter.trace) { - ActiveMQRALogger.LOGGER.trace("getConsumerMaxRate()"); + if (logger.isTraceEnabled()) { + logger.trace("getConsumerMaxRate()"); } return raProperties.getConsumerMaxRate(); @@ -822,8 +820,8 @@ public class ActiveMQResourceAdapter implements ResourceAdapter, Serializable { * @param consumerMaxRate The value */ public void setConsumerMaxRate(final Integer consumerMaxRate) { - if (ActiveMQResourceAdapter.trace) { - ActiveMQRALogger.LOGGER.trace("setConsumerMaxRate(" + consumerMaxRate + ")"); + if (logger.isTraceEnabled()) { + logger.trace("setConsumerMaxRate(" + consumerMaxRate + ")"); } raProperties.setConsumerMaxRate(consumerMaxRate); @@ -835,8 +833,8 @@ public class ActiveMQResourceAdapter implements ResourceAdapter, Serializable { * @return The value */ public Integer getConfirmationWindowSize() { - if (ActiveMQResourceAdapter.trace) { - ActiveMQRALogger.LOGGER.trace("getConfirmationWindowSize()"); + if (logger.isTraceEnabled()) { + logger.trace("getConfirmationWindowSize()"); } return raProperties.getConfirmationWindowSize(); @@ -848,8 +846,8 @@ public class ActiveMQResourceAdapter implements ResourceAdapter, Serializable { * @param confirmationWindowSize The value */ public void setConfirmationWindowSize(final Integer confirmationWindowSize) { - if (ActiveMQResourceAdapter.trace) { - ActiveMQRALogger.LOGGER.trace("setConfirmationWindowSize(" + confirmationWindowSize + ")"); + if (logger.isTraceEnabled()) { + logger.trace("setConfirmationWindowSize(" + confirmationWindowSize + ")"); } raProperties.setConfirmationWindowSize(confirmationWindowSize); @@ -861,8 +859,8 @@ public class ActiveMQResourceAdapter implements ResourceAdapter, Serializable { * @return The value */ public Integer getProducerMaxRate() { - if (ActiveMQResourceAdapter.trace) { - ActiveMQRALogger.LOGGER.trace("getProducerMaxRate()"); + if (logger.isTraceEnabled()) { + logger.trace("getProducerMaxRate()"); } return raProperties.getProducerMaxRate(); @@ -874,8 +872,8 @@ public class ActiveMQResourceAdapter implements ResourceAdapter, Serializable { * @param producerMaxRate The value */ public void setProducerMaxRate(final Integer producerMaxRate) { - if (ActiveMQResourceAdapter.trace) { - ActiveMQRALogger.LOGGER.trace("setProducerMaxRate(" + producerMaxRate + ")"); + if (logger.isTraceEnabled()) { + logger.trace("setProducerMaxRate(" + producerMaxRate + ")"); } raProperties.setProducerMaxRate(producerMaxRate); @@ -887,8 +885,8 @@ public class ActiveMQResourceAdapter implements ResourceAdapter, Serializable { * @return The value */ public Integer getProducerWindowSize() { - if (ActiveMQResourceAdapter.trace) { - ActiveMQRALogger.LOGGER.trace("getProducerWindowSize()"); + if (logger.isTraceEnabled()) { + logger.trace("getProducerWindowSize()"); } return raProperties.getProducerWindowSize(); @@ -900,54 +898,54 @@ public class ActiveMQResourceAdapter implements ResourceAdapter, Serializable { * @param producerWindowSize The value */ public void setProducerWindowSize(final Integer producerWindowSize) { - if (ActiveMQResourceAdapter.trace) { - ActiveMQRALogger.LOGGER.trace("setProducerWindowSize(" + producerWindowSize + ")"); + if (logger.isTraceEnabled()) { + logger.trace("setProducerWindowSize(" + producerWindowSize + ")"); } raProperties.setProducerWindowSize(producerWindowSize); } public String getProtocolManagerFactoryStr() { - if (ActiveMQResourceAdapter.trace) { - ActiveMQRALogger.LOGGER.trace("getProtocolManagerFactoryStr()"); + if (logger.isTraceEnabled()) { + logger.trace("getProtocolManagerFactoryStr()"); } return raProperties.getProtocolManagerFactoryStr(); } public void setProtocolManagerFactoryStr(final String protocolManagerFactoryStr) { - if (ActiveMQResourceAdapter.trace) { - ActiveMQRALogger.LOGGER.trace("setProtocolManagerFactoryStr(" + protocolManagerFactoryStr + ")"); + if (logger.isTraceEnabled()) { + logger.trace("setProtocolManagerFactoryStr(" + protocolManagerFactoryStr + ")"); } raProperties.setProtocolManagerFactoryStr(protocolManagerFactoryStr); } public String getDeserializationBlackList() { - if (ActiveMQResourceAdapter.trace) { - ActiveMQRALogger.LOGGER.trace("getDeserializationBlackList()"); + if (logger.isTraceEnabled()) { + logger.trace("getDeserializationBlackList()"); } return raProperties.getDeserializationBlackList(); } public void setDeserializationBlackList(String deserializationBlackList) { - if (ActiveMQResourceAdapter.trace) { - ActiveMQRALogger.LOGGER.trace("setDeserializationBlackList(" + deserializationBlackList + ")"); + if (logger.isTraceEnabled()) { + logger.trace("setDeserializationBlackList(" + deserializationBlackList + ")"); } raProperties.setDeserializationBlackList(deserializationBlackList); } public String getDeserializationWhiteList() { - if (ActiveMQResourceAdapter.trace) { - ActiveMQRALogger.LOGGER.trace("getDeserializationWhiteList()"); + if (logger.isTraceEnabled()) { + logger.trace("getDeserializationWhiteList()"); } return raProperties.getDeserializationWhiteList(); } public void setDeserializationWhiteList(String deserializationWhiteList) { - if (ActiveMQResourceAdapter.trace) { - ActiveMQRALogger.LOGGER.trace("setDeserializationWhiteList(" + deserializationWhiteList + ")"); + if (logger.isTraceEnabled()) { + logger.trace("setDeserializationWhiteList(" + deserializationWhiteList + ")"); } raProperties.setDeserializationWhiteList(deserializationWhiteList); @@ -959,8 +957,8 @@ public class ActiveMQResourceAdapter implements ResourceAdapter, Serializable { * @return The value */ public Integer getMinLargeMessageSize() { - if (ActiveMQResourceAdapter.trace) { - ActiveMQRALogger.LOGGER.trace("getMinLargeMessageSize()"); + if (logger.isTraceEnabled()) { + logger.trace("getMinLargeMessageSize()"); } return raProperties.getMinLargeMessageSize(); @@ -972,8 +970,8 @@ public class ActiveMQResourceAdapter implements ResourceAdapter, Serializable { * @param minLargeMessageSize The value */ public void setMinLargeMessageSize(final Integer minLargeMessageSize) { - if (ActiveMQResourceAdapter.trace) { - ActiveMQRALogger.LOGGER.trace("setMinLargeMessageSize(" + minLargeMessageSize + ")"); + if (logger.isTraceEnabled()) { + logger.trace("setMinLargeMessageSize(" + minLargeMessageSize + ")"); } raProperties.setMinLargeMessageSize(minLargeMessageSize); @@ -985,8 +983,8 @@ public class ActiveMQResourceAdapter implements ResourceAdapter, Serializable { * @return The value */ public Boolean getBlockOnAcknowledge() { - if (ActiveMQResourceAdapter.trace) { - ActiveMQRALogger.LOGGER.trace("getBlockOnAcknowledge()"); + if (logger.isTraceEnabled()) { + logger.trace("getBlockOnAcknowledge()"); } return raProperties.isBlockOnAcknowledge(); @@ -998,8 +996,8 @@ public class ActiveMQResourceAdapter implements ResourceAdapter, Serializable { * @param blockOnAcknowledge The value */ public void setBlockOnAcknowledge(final Boolean blockOnAcknowledge) { - if (ActiveMQResourceAdapter.trace) { - ActiveMQRALogger.LOGGER.trace("setBlockOnAcknowledge(" + blockOnAcknowledge + ")"); + if (logger.isTraceEnabled()) { + logger.trace("setBlockOnAcknowledge(" + blockOnAcknowledge + ")"); } raProperties.setBlockOnAcknowledge(blockOnAcknowledge); @@ -1011,8 +1009,8 @@ public class ActiveMQResourceAdapter implements ResourceAdapter, Serializable { * @return The value */ public Boolean getBlockOnNonDurableSend() { - if (ActiveMQResourceAdapter.trace) { - ActiveMQRALogger.LOGGER.trace("getBlockOnNonDurableSend()"); + if (logger.isTraceEnabled()) { + logger.trace("getBlockOnNonDurableSend()"); } return raProperties.isBlockOnNonDurableSend(); @@ -1024,8 +1022,8 @@ public class ActiveMQResourceAdapter implements ResourceAdapter, Serializable { * @param blockOnNonDurableSend The value */ public void setBlockOnNonDurableSend(final Boolean blockOnNonDurableSend) { - if (ActiveMQResourceAdapter.trace) { - ActiveMQRALogger.LOGGER.trace("setBlockOnNonDurableSend(" + blockOnNonDurableSend + ")"); + if (logger.isTraceEnabled()) { + logger.trace("setBlockOnNonDurableSend(" + blockOnNonDurableSend + ")"); } raProperties.setBlockOnNonDurableSend(blockOnNonDurableSend); @@ -1037,8 +1035,8 @@ public class ActiveMQResourceAdapter implements ResourceAdapter, Serializable { * @return The value */ public Boolean getBlockOnDurableSend() { - if (ActiveMQResourceAdapter.trace) { - ActiveMQRALogger.LOGGER.trace("getBlockOnDurableSend()"); + if (logger.isTraceEnabled()) { + logger.trace("getBlockOnDurableSend()"); } return raProperties.isBlockOnDurableSend(); @@ -1050,8 +1048,8 @@ public class ActiveMQResourceAdapter implements ResourceAdapter, Serializable { * @param blockOnDurableSend The value */ public void setBlockOnDurableSend(final Boolean blockOnDurableSend) { - if (ActiveMQResourceAdapter.trace) { - ActiveMQRALogger.LOGGER.trace("setBlockOnDurableSend(" + blockOnDurableSend + ")"); + if (logger.isTraceEnabled()) { + logger.trace("setBlockOnDurableSend(" + blockOnDurableSend + ")"); } raProperties.setBlockOnDurableSend(blockOnDurableSend); @@ -1063,8 +1061,8 @@ public class ActiveMQResourceAdapter implements ResourceAdapter, Serializable { * @return The value */ public Boolean getAutoGroup() { - if (ActiveMQResourceAdapter.trace) { - ActiveMQRALogger.LOGGER.trace("getAutoGroup()"); + if (logger.isTraceEnabled()) { + logger.trace("getAutoGroup()"); } return raProperties.isAutoGroup(); @@ -1076,8 +1074,8 @@ public class ActiveMQResourceAdapter implements ResourceAdapter, Serializable { * @param autoGroup The value */ public void setAutoGroup(final Boolean autoGroup) { - if (ActiveMQResourceAdapter.trace) { - ActiveMQRALogger.LOGGER.trace("setAutoGroup(" + autoGroup + ")"); + if (logger.isTraceEnabled()) { + logger.trace("setAutoGroup(" + autoGroup + ")"); } raProperties.setAutoGroup(autoGroup); @@ -1089,8 +1087,8 @@ public class ActiveMQResourceAdapter implements ResourceAdapter, Serializable { * @return The value */ public Boolean getPreAcknowledge() { - if (ActiveMQResourceAdapter.trace) { - ActiveMQRALogger.LOGGER.trace("getPreAcknowledge()"); + if (logger.isTraceEnabled()) { + logger.trace("getPreAcknowledge()"); } return raProperties.isPreAcknowledge(); @@ -1102,8 +1100,8 @@ public class ActiveMQResourceAdapter implements ResourceAdapter, Serializable { * @param preAcknowledge The value */ public void setPreAcknowledge(final Boolean preAcknowledge) { - if (ActiveMQResourceAdapter.trace) { - ActiveMQRALogger.LOGGER.trace("setPreAcknowledge(" + preAcknowledge + ")"); + if (logger.isTraceEnabled()) { + logger.trace("setPreAcknowledge(" + preAcknowledge + ")"); } raProperties.setPreAcknowledge(preAcknowledge); @@ -1115,8 +1113,8 @@ public class ActiveMQResourceAdapter implements ResourceAdapter, Serializable { * @return The value */ public Integer getInitialConnectAttempts() { - if (ActiveMQResourceAdapter.trace) { - ActiveMQRALogger.LOGGER.trace("getInitialConnectAttempts()"); + if (logger.isTraceEnabled()) { + logger.trace("getInitialConnectAttempts()"); } return raProperties.getInitialConnectAttempts(); @@ -1128,8 +1126,8 @@ public class ActiveMQResourceAdapter implements ResourceAdapter, Serializable { * @param initialConnectAttempts The value */ public void setInitialConnectAttempts(final Integer initialConnectAttempts) { - if (ActiveMQResourceAdapter.trace) { - ActiveMQRALogger.LOGGER.trace("setInitialConnectionAttempts(" + initialConnectAttempts + ")"); + if (logger.isTraceEnabled()) { + logger.trace("setInitialConnectionAttempts(" + initialConnectAttempts + ")"); } raProperties.setInitialConnectAttempts(initialConnectAttempts); @@ -1141,8 +1139,8 @@ public class ActiveMQResourceAdapter implements ResourceAdapter, Serializable { * @return The value */ public Integer getInitialMessagePacketSize() { - if (ActiveMQResourceAdapter.trace) { - ActiveMQRALogger.LOGGER.trace("getInitialMessagePacketSize()"); + if (logger.isTraceEnabled()) { + logger.trace("getInitialMessagePacketSize()"); } return raProperties.getInitialMessagePacketSize(); @@ -1154,8 +1152,8 @@ public class ActiveMQResourceAdapter implements ResourceAdapter, Serializable { * @param initialMessagePacketSize The value */ public void setInitialMessagePacketSize(final Integer initialMessagePacketSize) { - if (ActiveMQResourceAdapter.trace) { - ActiveMQRALogger.LOGGER.trace("setInitialMessagePacketSize(" + initialMessagePacketSize + ")"); + if (logger.isTraceEnabled()) { + logger.trace("setInitialMessagePacketSize(" + initialMessagePacketSize + ")"); } raProperties.setInitialMessagePacketSize(initialMessagePacketSize); @@ -1167,8 +1165,8 @@ public class ActiveMQResourceAdapter implements ResourceAdapter, Serializable { * @return The value */ public Long getRetryInterval() { - if (ActiveMQResourceAdapter.trace) { - ActiveMQRALogger.LOGGER.trace("getRetryInterval()"); + if (logger.isTraceEnabled()) { + logger.trace("getRetryInterval()"); } return raProperties.getRetryInterval(); @@ -1180,8 +1178,8 @@ public class ActiveMQResourceAdapter implements ResourceAdapter, Serializable { * @param retryInterval The value */ public void setRetryInterval(final Long retryInterval) { - if (ActiveMQResourceAdapter.trace) { - ActiveMQRALogger.LOGGER.trace("setRetryInterval(" + retryInterval + ")"); + if (logger.isTraceEnabled()) { + logger.trace("setRetryInterval(" + retryInterval + ")"); } raProperties.setRetryInterval(retryInterval); @@ -1193,8 +1191,8 @@ public class ActiveMQResourceAdapter implements ResourceAdapter, Serializable { * @return The value */ public Double getRetryIntervalMultiplier() { - if (ActiveMQResourceAdapter.trace) { - ActiveMQRALogger.LOGGER.trace("getRetryIntervalMultiplier()"); + if (logger.isTraceEnabled()) { + logger.trace("getRetryIntervalMultiplier()"); } return raProperties.getRetryIntervalMultiplier(); @@ -1206,8 +1204,8 @@ public class ActiveMQResourceAdapter implements ResourceAdapter, Serializable { * @param retryIntervalMultiplier The value */ public void setRetryIntervalMultiplier(final Double retryIntervalMultiplier) { - if (ActiveMQResourceAdapter.trace) { - ActiveMQRALogger.LOGGER.trace("setRetryIntervalMultiplier(" + retryIntervalMultiplier + ")"); + if (logger.isTraceEnabled()) { + logger.trace("setRetryIntervalMultiplier(" + retryIntervalMultiplier + ")"); } raProperties.setRetryIntervalMultiplier(retryIntervalMultiplier); @@ -1219,8 +1217,8 @@ public class ActiveMQResourceAdapter implements ResourceAdapter, Serializable { * @return The value */ public Long getMaxRetryInterval() { - if (ActiveMQResourceAdapter.trace) { - ActiveMQRALogger.LOGGER.trace("getMaxRetryInterval()"); + if (logger.isTraceEnabled()) { + logger.trace("getMaxRetryInterval()"); } return raProperties.getMaxRetryInterval(); @@ -1232,8 +1230,8 @@ public class ActiveMQResourceAdapter implements ResourceAdapter, Serializable { * @param maxRetryInterval The value */ public void setMaxRetryInterval(final Long maxRetryInterval) { - if (ActiveMQResourceAdapter.trace) { - ActiveMQRALogger.LOGGER.trace("setMaxRetryInterval(" + maxRetryInterval + ")"); + if (logger.isTraceEnabled()) { + logger.trace("setMaxRetryInterval(" + maxRetryInterval + ")"); } raProperties.setMaxRetryInterval(maxRetryInterval); @@ -1245,8 +1243,8 @@ public class ActiveMQResourceAdapter implements ResourceAdapter, Serializable { * @return The value */ public Integer getReconnectAttempts() { - if (ActiveMQResourceAdapter.trace) { - ActiveMQRALogger.LOGGER.trace("getReconnectAttempts()"); + if (logger.isTraceEnabled()) { + logger.trace("getReconnectAttempts()"); } return raProperties.getReconnectAttempts(); @@ -1258,8 +1256,8 @@ public class ActiveMQResourceAdapter implements ResourceAdapter, Serializable { * @param reconnectAttempts The value */ public void setReconnectAttempts(final Integer reconnectAttempts) { - if (ActiveMQResourceAdapter.trace) { - ActiveMQRALogger.LOGGER.trace("setReconnectAttempts(" + reconnectAttempts + ")"); + if (logger.isTraceEnabled()) { + logger.trace("setReconnectAttempts(" + reconnectAttempts + ")"); } raProperties.setReconnectAttempts(reconnectAttempts); @@ -1270,8 +1268,8 @@ public class ActiveMQResourceAdapter implements ResourceAdapter, Serializable { } public void setConnectionLoadBalancingPolicyClassName(final String connectionLoadBalancingPolicyClassName) { - if (ActiveMQResourceAdapter.trace) { - ActiveMQRALogger.LOGGER.trace("setFailoverOnServerShutdown(" + connectionLoadBalancingPolicyClassName + ")"); + if (logger.isTraceEnabled()) { + logger.trace("setFailoverOnServerShutdown(" + connectionLoadBalancingPolicyClassName + ")"); } raProperties.setConnectionLoadBalancingPolicyClassName(connectionLoadBalancingPolicyClassName); } @@ -1281,8 +1279,8 @@ public class ActiveMQResourceAdapter implements ResourceAdapter, Serializable { } public void setScheduledThreadPoolMaxSize(final Integer scheduledThreadPoolMaxSize) { - if (ActiveMQResourceAdapter.trace) { - ActiveMQRALogger.LOGGER.trace("setFailoverOnServerShutdown(" + scheduledThreadPoolMaxSize + ")"); + if (logger.isTraceEnabled()) { + logger.trace("setFailoverOnServerShutdown(" + scheduledThreadPoolMaxSize + ")"); } raProperties.setScheduledThreadPoolMaxSize(scheduledThreadPoolMaxSize); } @@ -1292,8 +1290,8 @@ public class ActiveMQResourceAdapter implements ResourceAdapter, Serializable { } public void setThreadPoolMaxSize(final Integer threadPoolMaxSize) { - if (ActiveMQResourceAdapter.trace) { - ActiveMQRALogger.LOGGER.trace("setFailoverOnServerShutdown(" + threadPoolMaxSize + ")"); + if (logger.isTraceEnabled()) { + logger.trace("setFailoverOnServerShutdown(" + threadPoolMaxSize + ")"); } raProperties.setThreadPoolMaxSize(threadPoolMaxSize); } @@ -1303,8 +1301,8 @@ public class ActiveMQResourceAdapter implements ResourceAdapter, Serializable { } public void setUseGlobalPools(final Boolean useGlobalPools) { - if (ActiveMQResourceAdapter.trace) { - ActiveMQRALogger.LOGGER.trace("setFailoverOnServerShutdown(" + useGlobalPools + ")"); + if (logger.isTraceEnabled()) { + logger.trace("setFailoverOnServerShutdown(" + useGlobalPools + ")"); } raProperties.setUseGlobalPools(useGlobalPools); } @@ -1315,8 +1313,8 @@ public class ActiveMQResourceAdapter implements ResourceAdapter, Serializable { * @return The value */ public String getUserName() { - if (ActiveMQResourceAdapter.trace) { - ActiveMQRALogger.LOGGER.trace("getUserName()"); + if (logger.isTraceEnabled()) { + logger.trace("getUserName()"); } return raProperties.getUserName(); @@ -1328,8 +1326,8 @@ public class ActiveMQResourceAdapter implements ResourceAdapter, Serializable { * @param userName The value */ public void setUserName(final String userName) { - if (ActiveMQResourceAdapter.trace) { - ActiveMQRALogger.LOGGER.trace("setUserName(" + userName + ")"); + if (logger.isTraceEnabled()) { + logger.trace("setUserName(" + userName + ")"); } raProperties.setUserName(userName); @@ -1341,8 +1339,8 @@ public class ActiveMQResourceAdapter implements ResourceAdapter, Serializable { * @return The value */ public String getPassword() { - if (ActiveMQResourceAdapter.trace) { - ActiveMQRALogger.LOGGER.trace("getPassword()"); + if (logger.isTraceEnabled()) { + logger.trace("getPassword()"); } return raProperties.getPassword(); @@ -1354,8 +1352,8 @@ public class ActiveMQResourceAdapter implements ResourceAdapter, Serializable { * @param password The value */ public void setPassword(final String password) { - if (ActiveMQResourceAdapter.trace) { - ActiveMQRALogger.LOGGER.trace("setPassword(****)"); + if (logger.isTraceEnabled()) { + logger.trace("setPassword(****)"); } raProperties.setPassword(password); @@ -1397,8 +1395,8 @@ public class ActiveMQResourceAdapter implements ResourceAdapter, Serializable { * @return The value */ public String getClientID() { - if (ActiveMQResourceAdapter.trace) { - ActiveMQRALogger.LOGGER.trace("getClientID()"); + if (logger.isTraceEnabled()) { + logger.trace("getClientID()"); } return raProperties.getClientID(); @@ -1410,8 +1408,8 @@ public class ActiveMQResourceAdapter implements ResourceAdapter, Serializable { * @param clientID The client id */ public void setClientID(final String clientID) { - if (ActiveMQResourceAdapter.trace) { - ActiveMQRALogger.LOGGER.trace("setClientID(" + clientID + ")"); + if (logger.isTraceEnabled()) { + logger.trace("setClientID(" + clientID + ")"); } raProperties.setClientID(clientID); @@ -1423,8 +1421,8 @@ public class ActiveMQResourceAdapter implements ResourceAdapter, Serializable { * @return The value */ public String getGroupID() { - if (ActiveMQResourceAdapter.trace) { - ActiveMQRALogger.LOGGER.trace("getGroupID()"); + if (logger.isTraceEnabled()) { + logger.trace("getGroupID()"); } return raProperties.getGroupID(); @@ -1436,8 +1434,8 @@ public class ActiveMQResourceAdapter implements ResourceAdapter, Serializable { * @param groupID The group id */ public void setGroupID(final String groupID) { - if (ActiveMQResourceAdapter.trace) { - ActiveMQRALogger.LOGGER.trace("setGroupID(" + groupID + ")"); + if (logger.isTraceEnabled()) { + logger.trace("setGroupID(" + groupID + ")"); } raProperties.setGroupID(groupID); @@ -1449,8 +1447,8 @@ public class ActiveMQResourceAdapter implements ResourceAdapter, Serializable { * @return The value */ public Boolean getUseLocalTx() { - if (ActiveMQResourceAdapter.trace) { - ActiveMQRALogger.LOGGER.trace("getUseLocalTx()"); + if (logger.isTraceEnabled()) { + logger.trace("getUseLocalTx()"); } return raProperties.getUseLocalTx(); @@ -1462,37 +1460,37 @@ public class ActiveMQResourceAdapter implements ResourceAdapter, Serializable { * @param localTx The value */ public void setUseLocalTx(final Boolean localTx) { - if (ActiveMQResourceAdapter.trace) { - ActiveMQRALogger.LOGGER.trace("setUseXA(" + localTx + ")"); + if (logger.isTraceEnabled()) { + logger.trace("setUseXA(" + localTx + ")"); } raProperties.setUseLocalTx(localTx); } public int getSetupAttempts() { - if (ActiveMQResourceAdapter.trace) { - ActiveMQRALogger.LOGGER.trace("getSetupAttempts()"); + if (logger.isTraceEnabled()) { + logger.trace("getSetupAttempts()"); } return raProperties.getSetupAttempts(); } public void setSetupAttempts(Integer setupAttempts) { - if (ActiveMQResourceAdapter.trace) { - ActiveMQRALogger.LOGGER.trace("setSetupAttempts(" + setupAttempts + ")"); + if (logger.isTraceEnabled()) { + logger.trace("setSetupAttempts(" + setupAttempts + ")"); } raProperties.setSetupAttempts(setupAttempts); } public long getSetupInterval() { - if (ActiveMQResourceAdapter.trace) { - ActiveMQRALogger.LOGGER.trace("getSetupInterval()"); + if (logger.isTraceEnabled()) { + logger.trace("getSetupInterval()"); } return raProperties.getSetupInterval(); } public void setSetupInterval(Long interval) { - if (ActiveMQResourceAdapter.trace) { - ActiveMQRALogger.LOGGER.trace("setSetupInterval(" + interval + ")"); + if (logger.isTraceEnabled()) { + logger.trace("setSetupInterval(" + interval + ")"); } raProperties.setSetupInterval(interval); } @@ -1505,8 +1503,8 @@ public class ActiveMQResourceAdapter implements ResourceAdapter, Serializable { */ @Override public boolean equals(final Object obj) { - if (ActiveMQResourceAdapter.trace) { - ActiveMQRALogger.LOGGER.trace("equals(" + obj + ")"); + if (logger.isTraceEnabled()) { + logger.trace("equals(" + obj + ")"); } if (obj == null) { @@ -1526,8 +1524,8 @@ public class ActiveMQResourceAdapter implements ResourceAdapter, Serializable { */ @Override public int hashCode() { - if (ActiveMQResourceAdapter.trace) { - ActiveMQRALogger.LOGGER.trace("hashCode()"); + if (logger.isTraceEnabled()) { + logger.trace("hashCode()"); } return raProperties.hashCode(); @@ -1539,8 +1537,8 @@ public class ActiveMQResourceAdapter implements ResourceAdapter, Serializable { * @return The manager */ public WorkManager getWorkManager() { - if (ActiveMQResourceAdapter.trace) { - ActiveMQRALogger.LOGGER.trace("getWorkManager()"); + if (logger.isTraceEnabled()) { + logger.trace("getWorkManager()"); } if (ctx == null) { @@ -1608,8 +1606,8 @@ public class ActiveMQResourceAdapter implements ResourceAdapter, Serializable { * @return The properties */ protected ActiveMQRAProperties getProperties() { - if (ActiveMQResourceAdapter.trace) { - ActiveMQRALogger.LOGGER.trace("getProperties()"); + if (logger.isTraceEnabled()) { + logger.trace("getProperties()"); } return raProperties; diff --git a/artemis-ra/src/main/java/org/apache/activemq/artemis/ra/inflow/ActiveMQActivation.java b/artemis-ra/src/main/java/org/apache/activemq/artemis/ra/inflow/ActiveMQActivation.java index cb8472a126..3a8468672d 100644 --- a/artemis-ra/src/main/java/org/apache/activemq/artemis/ra/inflow/ActiveMQActivation.java +++ b/artemis-ra/src/main/java/org/apache/activemq/artemis/ra/inflow/ActiveMQActivation.java @@ -58,16 +58,14 @@ import org.apache.activemq.artemis.ra.ActiveMQResourceAdapter; import org.apache.activemq.artemis.service.extensions.xa.recovery.XARecoveryConfig; import org.apache.activemq.artemis.utils.FutureLatch; import org.apache.activemq.artemis.utils.SensitiveDataCodec; +import org.jboss.logging.Logger; /** * The activation. */ public class ActiveMQActivation { - - /** - * Trace enabled - */ - private static boolean trace = ActiveMQRALogger.LOGGER.isTraceEnabled(); + + private static final Logger logger = Logger.getLogger(ActiveMQActivation.class); /** * The onMessage method @@ -146,8 +144,8 @@ public class ActiveMQActivation { final ActiveMQActivationSpec spec) throws ResourceException { spec.validate(); - if (ActiveMQActivation.trace) { - ActiveMQRALogger.LOGGER.trace("constructor(" + ra + ", " + endpointFactory + ", " + spec + ")"); + if (logger.isTraceEnabled()) { + logger.trace("constructor(" + ra + ", " + endpointFactory + ", " + spec + ")"); } if (ra.isUseMaskedPassword()) { @@ -179,8 +177,8 @@ public class ActiveMQActivation { * @return The value */ public ActiveMQActivationSpec getActivationSpec() { - if (ActiveMQActivation.trace) { - ActiveMQRALogger.LOGGER.trace("getActivationSpec()"); + if (logger.isTraceEnabled()) { + logger.trace("getActivationSpec()"); } return spec; @@ -192,8 +190,8 @@ public class ActiveMQActivation { * @return The value */ public MessageEndpointFactory getMessageEndpointFactory() { - if (ActiveMQActivation.trace) { - ActiveMQRALogger.LOGGER.trace("getMessageEndpointFactory()"); + if (logger.isTraceEnabled()) { + logger.trace("getMessageEndpointFactory()"); } return endpointFactory; @@ -205,8 +203,8 @@ public class ActiveMQActivation { * @return The value */ public boolean isDeliveryTransacted() { - if (ActiveMQActivation.trace) { - ActiveMQRALogger.LOGGER.trace("isDeliveryTransacted()"); + if (logger.isTraceEnabled()) { + logger.trace("isDeliveryTransacted()"); } return isDeliveryTransacted; @@ -218,8 +216,8 @@ public class ActiveMQActivation { * @return The value */ public WorkManager getWorkManager() { - if (ActiveMQActivation.trace) { - ActiveMQRALogger.LOGGER.trace("getWorkManager()"); + if (logger.isTraceEnabled()) { + logger.trace("getWorkManager()"); } return ra.getWorkManager(); @@ -231,8 +229,8 @@ public class ActiveMQActivation { * @return The value */ public boolean isTopic() { - if (ActiveMQActivation.trace) { - ActiveMQRALogger.LOGGER.trace("isTopic()"); + if (logger.isTraceEnabled()) { + logger.trace("isTopic()"); } return isTopic; @@ -244,8 +242,8 @@ public class ActiveMQActivation { * @throws ResourceException Thrown if an error occurs */ public void start() throws ResourceException { - if (ActiveMQActivation.trace) { - ActiveMQRALogger.LOGGER.trace("start()"); + if (logger.isTraceEnabled()) { + logger.trace("start()"); } deliveryActive.set(true); ra.getWorkManager().scheduleWork(new SetupActivation()); @@ -283,8 +281,8 @@ public class ActiveMQActivation { * Stop the activation */ public void stop() { - if (ActiveMQActivation.trace) { - ActiveMQRALogger.LOGGER.trace("stop()"); + if (logger.isTraceEnabled()) { + logger.trace("stop()"); } deliveryActive.set(false); @@ -497,7 +495,7 @@ public class ActiveMQActivation { result.close(); } } catch (Exception e) { - ActiveMQRALogger.LOGGER.trace("Ignored error closing connection", e); + logger.trace("Ignored error closing connection", e); } if (t instanceof Exception) { throw (Exception) t; @@ -522,8 +520,8 @@ public class ActiveMQActivation { ctx = new InitialContext(spec.getParsedJndiParams()); } ActiveMQRALogger.LOGGER.debug("Using context " + ctx.getEnvironment() + " for " + spec); - if (ActiveMQActivation.trace) { - ActiveMQRALogger.LOGGER.trace("setupDestination(" + ctx + ")"); + if (logger.isTraceEnabled()) { + logger.trace("setupDestination(" + ctx + ")"); } String destinationTypeString = spec.getDestinationType(); @@ -602,8 +600,8 @@ public class ActiveMQActivation { } public void startReconnectThread(final String threadName) { - if (trace) { - ActiveMQRALogger.LOGGER.trace("Starting reconnect Thread " + threadName + " on MDB activation " + this); + if (logger.isTraceEnabled()) { + logger.trace("Starting reconnect Thread " + threadName + " on MDB activation " + this); } Runnable runnable = new Runnable() { @Override @@ -621,8 +619,8 @@ public class ActiveMQActivation { * @param failure if reconnecting in the event of a failure */ public void reconnect(Throwable failure) { - if (trace) { - ActiveMQRALogger.LOGGER.trace("reconnecting activation " + this); + if (logger.isTraceEnabled()) { + logger.trace("reconnecting activation " + this); } if (failure != null) { if (failure instanceof ActiveMQException && ((ActiveMQException) failure).getType() == ActiveMQExceptionType.QUEUE_DOES_NOT_EXIST) { diff --git a/artemis-ra/src/main/java/org/apache/activemq/artemis/ra/inflow/ActiveMQActivationSpec.java b/artemis-ra/src/main/java/org/apache/activemq/artemis/ra/inflow/ActiveMQActivationSpec.java index 6b6eedc409..635b968a4f 100644 --- a/artemis-ra/src/main/java/org/apache/activemq/artemis/ra/inflow/ActiveMQActivationSpec.java +++ b/artemis-ra/src/main/java/org/apache/activemq/artemis/ra/inflow/ActiveMQActivationSpec.java @@ -34,6 +34,7 @@ import org.apache.activemq.artemis.ra.ActiveMQRALogger; import org.apache.activemq.artemis.ra.ActiveMQRaUtils; import org.apache.activemq.artemis.ra.ActiveMQResourceAdapter; import org.apache.activemq.artemis.ra.ConnectionFactoryProperties; +import org.jboss.logging.Logger; /** * The activation spec @@ -41,15 +42,12 @@ import org.apache.activemq.artemis.ra.ConnectionFactoryProperties; */ public class ActiveMQActivationSpec extends ConnectionFactoryProperties implements ActivationSpec, Serializable { + private static final Logger logger = Logger.getLogger(ActiveMQActivationSpec.class); + private static final long serialVersionUID = -7997041053897964654L; private static final int DEFAULT_MAX_SESSION = 15; - /** - * Whether trace is enabled - */ - private static boolean trace = ActiveMQRALogger.LOGGER.isTraceEnabled(); - public String strConnectorClassName; public String strConnectionParameters; @@ -141,8 +139,8 @@ public class ActiveMQActivationSpec extends ConnectionFactoryProperties implemen * Constructor */ public ActiveMQActivationSpec() { - if (ActiveMQActivationSpec.trace) { - ActiveMQRALogger.LOGGER.trace("constructor()"); + if (logger.isTraceEnabled()) { + logger.trace("constructor()"); } ra = null; @@ -165,8 +163,8 @@ public class ActiveMQActivationSpec extends ConnectionFactoryProperties implemen */ @Override public ResourceAdapter getResourceAdapter() { - if (ActiveMQActivationSpec.trace) { - ActiveMQRALogger.LOGGER.trace("getResourceAdapter()"); + if (logger.isTraceEnabled()) { + logger.trace("getResourceAdapter()"); } return ra; @@ -219,8 +217,8 @@ public class ActiveMQActivationSpec extends ConnectionFactoryProperties implemen */ @Override public void setResourceAdapter(final ResourceAdapter ra) throws ResourceException { - if (ActiveMQActivationSpec.trace) { - ActiveMQRALogger.LOGGER.trace("setResourceAdapter(" + ra + ")"); + if (logger.isTraceEnabled()) { + logger.trace("setResourceAdapter(" + ra + ")"); } if (ra == null || !(ra instanceof ActiveMQResourceAdapter)) { @@ -236,8 +234,8 @@ public class ActiveMQActivationSpec extends ConnectionFactoryProperties implemen * @return The value */ public String getConnectionFactoryLookup() { - if (ActiveMQActivationSpec.trace) { - ActiveMQRALogger.LOGGER.trace("getConnectionFactoryLookup() ->" + connectionFactoryLookup); + if (logger.isTraceEnabled()) { + logger.trace("getConnectionFactoryLookup() ->" + connectionFactoryLookup); } return connectionFactoryLookup; @@ -249,8 +247,8 @@ public class ActiveMQActivationSpec extends ConnectionFactoryProperties implemen * @param value The value */ public void setConnectionFactoryLookup(final String value) { - if (ActiveMQActivationSpec.trace) { - ActiveMQRALogger.LOGGER.trace("setConnectionFactoryLookup(" + value + ")"); + if (logger.isTraceEnabled()) { + logger.trace("setConnectionFactoryLookup(" + value + ")"); } connectionFactoryLookup = value; @@ -262,8 +260,8 @@ public class ActiveMQActivationSpec extends ConnectionFactoryProperties implemen * @return The value */ public String getDestination() { - if (ActiveMQActivationSpec.trace) { - ActiveMQRALogger.LOGGER.trace("getDestination()"); + if (logger.isTraceEnabled()) { + logger.trace("getDestination()"); } return destination; @@ -275,8 +273,8 @@ public class ActiveMQActivationSpec extends ConnectionFactoryProperties implemen * @param value The value */ public void setDestination(final String value) { - if (ActiveMQActivationSpec.trace) { - ActiveMQRALogger.LOGGER.trace("setDestination(" + value + ")"); + if (logger.isTraceEnabled()) { + logger.trace("setDestination(" + value + ")"); } destination = value; @@ -307,8 +305,8 @@ public class ActiveMQActivationSpec extends ConnectionFactoryProperties implemen * @return The value */ public String getDestinationType() { - if (ActiveMQActivationSpec.trace) { - ActiveMQRALogger.LOGGER.trace("getDestinationType()"); + if (logger.isTraceEnabled()) { + logger.trace("getDestinationType()"); } return destinationType; @@ -320,8 +318,8 @@ public class ActiveMQActivationSpec extends ConnectionFactoryProperties implemen * @param value The value */ public void setDestinationType(final String value) { - if (ActiveMQActivationSpec.trace) { - ActiveMQRALogger.LOGGER.trace("setDestinationType(" + value + ")"); + if (logger.isTraceEnabled()) { + logger.trace("setDestinationType(" + value + ")"); } destinationType = value; @@ -333,8 +331,8 @@ public class ActiveMQActivationSpec extends ConnectionFactoryProperties implemen * @return The value */ public String getMessageSelector() { - if (ActiveMQActivationSpec.trace) { - ActiveMQRALogger.LOGGER.trace("getMessageSelector()"); + if (logger.isTraceEnabled()) { + logger.trace("getMessageSelector()"); } return messageSelector; @@ -346,8 +344,8 @@ public class ActiveMQActivationSpec extends ConnectionFactoryProperties implemen * @param value The value */ public void setMessageSelector(final String value) { - if (ActiveMQActivationSpec.trace) { - ActiveMQRALogger.LOGGER.trace("setMessageSelector(" + value + ")"); + if (logger.isTraceEnabled()) { + logger.trace("setMessageSelector(" + value + ")"); } messageSelector = value; @@ -359,8 +357,8 @@ public class ActiveMQActivationSpec extends ConnectionFactoryProperties implemen * @return The value */ public String getAcknowledgeMode() { - if (ActiveMQActivationSpec.trace) { - ActiveMQRALogger.LOGGER.trace("getAcknowledgeMode()"); + if (logger.isTraceEnabled()) { + logger.trace("getAcknowledgeMode()"); } if (Session.DUPS_OK_ACKNOWLEDGE == acknowledgeMode) { @@ -376,8 +374,8 @@ public class ActiveMQActivationSpec extends ConnectionFactoryProperties implemen * @param value The value */ public void setAcknowledgeMode(final String value) { - if (ActiveMQActivationSpec.trace) { - ActiveMQRALogger.LOGGER.trace("setAcknowledgeMode(" + value + ")"); + if (logger.isTraceEnabled()) { + logger.trace("setAcknowledgeMode(" + value + ")"); } if ("DUPS_OK_ACKNOWLEDGE".equalsIgnoreCase(value) || "Dups-ok-acknowledge".equalsIgnoreCase(value)) { @@ -393,8 +391,8 @@ public class ActiveMQActivationSpec extends ConnectionFactoryProperties implemen * @return the acknowledgement mode */ public Integer getAcknowledgeModeInt() { - if (ActiveMQActivationSpec.trace) { - ActiveMQRALogger.LOGGER.trace("getAcknowledgeMode()"); + if (logger.isTraceEnabled()) { + logger.trace("getAcknowledgeMode()"); } return acknowledgeMode; @@ -406,8 +404,8 @@ public class ActiveMQActivationSpec extends ConnectionFactoryProperties implemen * @return The value */ public String getSubscriptionDurability() { - if (ActiveMQActivationSpec.trace) { - ActiveMQRALogger.LOGGER.trace("getSubscriptionDurability()"); + if (logger.isTraceEnabled()) { + logger.trace("getSubscriptionDurability()"); } if (subscriptionDurability) { @@ -423,8 +421,8 @@ public class ActiveMQActivationSpec extends ConnectionFactoryProperties implemen * @param value The value */ public void setSubscriptionDurability(final String value) { - if (ActiveMQActivationSpec.trace) { - ActiveMQRALogger.LOGGER.trace("setSubscriptionDurability(" + value + ")"); + if (logger.isTraceEnabled()) { + logger.trace("setSubscriptionDurability(" + value + ")"); } subscriptionDurability = "Durable".equals(value); @@ -436,8 +434,8 @@ public class ActiveMQActivationSpec extends ConnectionFactoryProperties implemen * @return The value */ public Boolean isSubscriptionDurable() { - if (ActiveMQActivationSpec.trace) { - ActiveMQRALogger.LOGGER.trace("isSubscriptionDurable()"); + if (logger.isTraceEnabled()) { + logger.trace("isSubscriptionDurable()"); } return subscriptionDurability; @@ -449,8 +447,8 @@ public class ActiveMQActivationSpec extends ConnectionFactoryProperties implemen * @return The value */ public String getSubscriptionName() { - if (ActiveMQActivationSpec.trace) { - ActiveMQRALogger.LOGGER.trace("getSubscriptionName()"); + if (logger.isTraceEnabled()) { + logger.trace("getSubscriptionName()"); } return subscriptionName; @@ -462,8 +460,8 @@ public class ActiveMQActivationSpec extends ConnectionFactoryProperties implemen * @param value The value */ public void setSubscriptionName(final String value) { - if (ActiveMQActivationSpec.trace) { - ActiveMQRALogger.LOGGER.trace("setSubscriptionName(" + value + ")"); + if (logger.isTraceEnabled()) { + logger.trace("setSubscriptionName(" + value + ")"); } subscriptionName = value; @@ -473,8 +471,8 @@ public class ActiveMQActivationSpec extends ConnectionFactoryProperties implemen * @return the shareDurableSubscriptions */ public Boolean isShareSubscriptions() { - if (ActiveMQActivationSpec.trace) { - ActiveMQRALogger.LOGGER.trace("isShareSubscriptions() = " + shareSubscriptions); + if (logger.isTraceEnabled()) { + logger.trace("isShareSubscriptions() = " + shareSubscriptions); } return shareSubscriptions; @@ -484,8 +482,8 @@ public class ActiveMQActivationSpec extends ConnectionFactoryProperties implemen * @param shareSubscriptions the shareDurableSubscriptions to set */ public void setShareSubscriptions(final Boolean shareSubscriptions) { - if (ActiveMQActivationSpec.trace) { - ActiveMQRALogger.LOGGER.trace("setShareSubscriptions(" + shareSubscriptions + ")"); + if (logger.isTraceEnabled()) { + logger.trace("setShareSubscriptions(" + shareSubscriptions + ")"); } this.shareSubscriptions = shareSubscriptions; @@ -497,8 +495,8 @@ public class ActiveMQActivationSpec extends ConnectionFactoryProperties implemen * @return The value */ public String getUser() { - if (ActiveMQActivationSpec.trace) { - ActiveMQRALogger.LOGGER.trace("getUser()"); + if (logger.isTraceEnabled()) { + logger.trace("getUser()"); } if (user == null) { @@ -514,8 +512,8 @@ public class ActiveMQActivationSpec extends ConnectionFactoryProperties implemen * @param value The value */ public void setUser(final String value) { - if (ActiveMQActivationSpec.trace) { - ActiveMQRALogger.LOGGER.trace("setUser(" + value + ")"); + if (logger.isTraceEnabled()) { + logger.trace("setUser(" + value + ")"); } user = value; @@ -527,8 +525,8 @@ public class ActiveMQActivationSpec extends ConnectionFactoryProperties implemen * @return The value */ public String getPassword() { - if (ActiveMQActivationSpec.trace) { - ActiveMQRALogger.LOGGER.trace("getPassword()"); + if (logger.isTraceEnabled()) { + logger.trace("getPassword()"); } if (password == null) { @@ -548,8 +546,8 @@ public class ActiveMQActivationSpec extends ConnectionFactoryProperties implemen * @param value The value */ public void setPassword(final String value) throws Exception { - if (ActiveMQActivationSpec.trace) { - ActiveMQRALogger.LOGGER.trace("setPassword(****)"); + if (logger.isTraceEnabled()) { + logger.trace("setPassword(****)"); } password = value; @@ -561,8 +559,8 @@ public class ActiveMQActivationSpec extends ConnectionFactoryProperties implemen * @return The value */ public Integer getMaxSession() { - if (ActiveMQActivationSpec.trace) { - ActiveMQRALogger.LOGGER.trace("getMaxSession()"); + if (logger.isTraceEnabled()) { + logger.trace("getMaxSession()"); } if (maxSession == null) { @@ -578,8 +576,8 @@ public class ActiveMQActivationSpec extends ConnectionFactoryProperties implemen * @param value The value */ public void setMaxSession(final Integer value) { - if (ActiveMQActivationSpec.trace) { - ActiveMQRALogger.LOGGER.trace("setMaxSession(" + value + ")"); + if (logger.isTraceEnabled()) { + logger.trace("setMaxSession(" + value + ")"); } maxSession = value; @@ -591,8 +589,8 @@ public class ActiveMQActivationSpec extends ConnectionFactoryProperties implemen * @return The value */ public Integer getTransactionTimeout() { - if (ActiveMQActivationSpec.trace) { - ActiveMQRALogger.LOGGER.trace("getTransactionTimeout()"); + if (logger.isTraceEnabled()) { + logger.trace("getTransactionTimeout()"); } return transactionTimeout; @@ -604,8 +602,8 @@ public class ActiveMQActivationSpec extends ConnectionFactoryProperties implemen * @param value The value */ public void setTransactionTimeout(final Integer value) { - if (ActiveMQActivationSpec.trace) { - ActiveMQRALogger.LOGGER.trace("setTransactionTimeout(" + value + ")"); + if (logger.isTraceEnabled()) { + logger.trace("setTransactionTimeout(" + value + ")"); } transactionTimeout = value; @@ -632,8 +630,8 @@ public class ActiveMQActivationSpec extends ConnectionFactoryProperties implemen } public Integer getSetupAttempts() { - if (ActiveMQActivationSpec.trace) { - ActiveMQRALogger.LOGGER.trace("getSetupAttempts()"); + if (logger.isTraceEnabled()) { + logger.trace("getSetupAttempts()"); } if (setupAttempts == null) { @@ -644,16 +642,16 @@ public class ActiveMQActivationSpec extends ConnectionFactoryProperties implemen } public void setSetupAttempts(final Integer setupAttempts) { - if (ActiveMQActivationSpec.trace) { - ActiveMQRALogger.LOGGER.trace("setSetupAttempts(" + setupAttempts + ")"); + if (logger.isTraceEnabled()) { + logger.trace("setSetupAttempts(" + setupAttempts + ")"); } this.setupAttempts = setupAttempts; } public Long getSetupInterval() { - if (ActiveMQActivationSpec.trace) { - ActiveMQRALogger.LOGGER.trace("getSetupInterval()"); + if (logger.isTraceEnabled()) { + logger.trace("getSetupInterval()"); } if (setupInterval == null) { @@ -664,8 +662,8 @@ public class ActiveMQActivationSpec extends ConnectionFactoryProperties implemen } public void setSetupInterval(final Long setupInterval) { - if (ActiveMQActivationSpec.trace) { - ActiveMQRALogger.LOGGER.trace("setSetupInterval(" + setupInterval + ")"); + if (logger.isTraceEnabled()) { + logger.trace("setSetupInterval(" + setupInterval + ")"); } this.setupInterval = setupInterval; @@ -683,8 +681,8 @@ public class ActiveMQActivationSpec extends ConnectionFactoryProperties implemen */ @Override public void validate() throws InvalidPropertyException { - if (ActiveMQActivationSpec.trace) { - ActiveMQRALogger.LOGGER.trace("validate()"); + if (logger.isTraceEnabled()) { + logger.trace("validate()"); } List errorMessages = new ArrayList<>(); @@ -728,8 +726,8 @@ public class ActiveMQActivationSpec extends ConnectionFactoryProperties implemen } public void setConnectorClassName(final String connectorClassName) { - if (ActiveMQActivationSpec.trace) { - ActiveMQRALogger.LOGGER.trace("setConnectorClassName(" + connectorClassName + ")"); + if (logger.isTraceEnabled()) { + logger.trace("setConnectorClassName(" + connectorClassName + ")"); } strConnectorClassName = connectorClassName;