Class JmsManager
java.lang.Object
org.apache.logging.log4j.core.appender.AbstractManager
org.apache.logging.log4j.core.appender.mom.jakarta.JmsManager
- All Implemented Interfaces:
AutoCloseable
Consider this class private; it is only public for access by integration tests.
JMS connection and session manager. Can be used to access MessageProducer, MessageConsumer, and Message objects involving a configured ConnectionFactory and Destination.
-
Nested Class Summary
Nested ClassesNested classes/interfaces inherited from class AbstractManager
AbstractManager.AbstractFactoryData -
Field Summary
Fields inherited from class AbstractManager
count, LOGGER -
Method Summary
Modifier and TypeMethodDescriptionstatic JmsManagergetJmsManager(String name, Properties jndiProperties, String connectionFactoryName, String destinationName, String userName, char[] password, boolean immediateFail, long reconnectIntervalMillis) Gets a JmsManager using the specified configuration parameters.protected booleanreleaseSub(long timeout, TimeUnit timeUnit) May be overridden by managers to perform processing while the manager is being released and the lock is held.Methods inherited from class AbstractManager
close, getContentFormat, getCount, getLoggerContext, getManager, getName, getStrSubstitutor, hasManager, log, logDebug, logError, logger, logWarn, narrow, release, stop, updateData
-
Method Details
-
getJmsManager
public static JmsManager getJmsManager(String name, Properties jndiProperties, String connectionFactoryName, String destinationName, String userName, char[] password, boolean immediateFail, long reconnectIntervalMillis) Gets a JmsManager using the specified configuration parameters.- Parameters:
name- The name to use for this JmsManager.jndiProperties- JNDI properties.connectionFactoryName- The binding name for theConnectionFactory.destinationName- The binding name for theDestination.userName- The userName to connect with ornullfor no authentication.password- The password to use with the given userName ornullfor no authentication.immediateFail- Whether or not to fail immediately with aAppenderLoggingExceptionwhen connecting to JMS fails.reconnectIntervalMillis- How to log sleep in milliseconds before trying to reconnect to JMS.- Returns:
- The JmsManager as configured.
-
getJmsManagerConfiguration
-
releaseSub
Description copied from class:AbstractManagerMay be overridden by managers to perform processing while the manager is being released and the lock is held. A timeout is passed for implementors to use as they see fit.- Overrides:
releaseSubin classAbstractManager- Parameters:
timeout- timeouttimeUnit- timeout time unit- Returns:
- true if all resources were closed normally, false otherwise.
-