Class JmsManager
java.lang.Object
org.apache.logging.log4j.core.appender.AbstractManager
org.apache.logging.log4j.core.appender.mom.JmsManager
- All Implemented Interfaces:
AutoCloseable
Deprecated.
Consider this class private; it is only public for access by integration tests.
JMS connection and destination manager. Uses a MessageProducer to send log events to a JMS Destination.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classDeprecated.private static classDeprecated.private final classDeprecated.Handles reconnecting to JMS on a Thread.Nested classes/interfaces inherited from class AbstractManager
AbstractManager.AbstractFactoryData -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final JmsManager.JmsManagerConfigurationDeprecated.private javax.jms.ConnectionDeprecated.private javax.jms.DestinationDeprecated.(package private) static final JmsManager.JmsManagerFactoryDeprecated.private JndiManagerDeprecated.private javax.jms.MessageProducerDeprecated.private JmsManager.ReconnectorDeprecated.private javax.jms.SessionDeprecated.Fields inherited from class AbstractManager
count, LOGGER -
Constructor Summary
ConstructorsModifierConstructorDescriptionprivateJmsManager(String name, JmsManager.JmsManagerConfiguration configuration) Deprecated. -
Method Summary
Modifier and TypeMethodDescriptionprivate booleanDeprecated.private booleanDeprecated.private booleanDeprecated.private booleanDeprecated.private javax.jms.ConnectioncreateConnection(JndiManager jndiManager) Deprecated.private javax.jms.DestinationcreateDestination(JndiManager jndiManager) Deprecated.javax.jms.MessagecreateMessage(Serializable object) Deprecated.Creates a TextMessage, MapMessage, or ObjectMessage from a Serializable object.private voidcreateMessageAndSend(LogEvent event, Serializable serializable) Deprecated.javax.jms.MessageConsumerDeprecated.Creates a MessageConsumer on this Destination using the current Session.javax.jms.MessageProducercreateMessageProducer(javax.jms.Session session, javax.jms.Destination destination) Deprecated.Creates a MessageProducer on this Destination using the current Session.private JmsManager.ReconnectorDeprecated.private javax.jms.SessioncreateSession(javax.jms.Connection connection) Deprecated.static JmsManagergetJmsManager(String name, Properties jndiProperties, String connectionFactoryName, String destinationName, String userName, char[] password, boolean immediateFail, long reconnectIntervalMillis) Deprecated.Gets a JmsManager using the specified configuration parameters.Deprecated.(package private) JndiManagerDeprecated.(package private) <T> TDeprecated.private javax.jms.MapMessagemap(MapMessage<?, ?> log4jMapMessage, javax.jms.MapMessage jmsMapMessage) Deprecated.protected booleanreleaseSub(long timeout, TimeUnit timeUnit) Deprecated.May be overridden by managers to perform processing while the manager is being released and the lock is held.(package private) voidsend(LogEvent event, Serializable serializable) Deprecated.Methods inherited from class AbstractManager
close, getContentFormat, getCount, getLoggerContext, getManager, getName, getStrSubstitutor, hasManager, log, logDebug, logError, logger, logWarn, narrow, release, stop, updateData
-
Field Details
-
FACTORY
Deprecated. -
configuration
Deprecated. -
reconnector
Deprecated. -
jndiManager
Deprecated. -
connection
private volatile javax.jms.Connection connectionDeprecated. -
session
private volatile javax.jms.Session sessionDeprecated. -
destination
private volatile javax.jms.Destination destinationDeprecated. -
messageProducer
private volatile javax.jms.MessageProducer messageProducerDeprecated.
-
-
Constructor Details
-
JmsManager
Deprecated.
-
-
Method Details
-
getJmsManager
public static JmsManager getJmsManager(String name, Properties jndiProperties, String connectionFactoryName, String destinationName, String userName, char[] password, boolean immediateFail, long reconnectIntervalMillis) Deprecated.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.
-
closeConnection
private boolean closeConnection()Deprecated. -
closeJndiManager
private boolean closeJndiManager()Deprecated. -
closeMessageProducer
private boolean closeMessageProducer()Deprecated. -
closeSession
private boolean closeSession()Deprecated. -
createConnection
private javax.jms.Connection createConnection(JndiManager jndiManager) throws NamingException, javax.jms.JMSException Deprecated.- Throws:
NamingExceptionjavax.jms.JMSException
-
createDestination
Deprecated.- Throws:
NamingException
-
createMessage
Deprecated.Creates a TextMessage, MapMessage, or ObjectMessage from a Serializable object.For instance, when using a text-based
Layoutsuch asPatternLayout, theLogEventmessage will be serialized to a String.When using a layout such as
SerializedLayout, the LogEvent message will be serialized as a Java object.When using a layout such as
MessageLayoutand the LogEvent message is a Log4j MapMessage, the message will be serialized as a JMS MapMessage.- Parameters:
object- The LogEvent or String message to wrap.- Returns:
- A new JMS message containing the provided object.
- Throws:
javax.jms.JMSException- if the JMS provider fails to create this message due to some internal error.
-
createMessageAndSend
private void createMessageAndSend(LogEvent event, Serializable serializable) throws javax.jms.JMSException Deprecated.- Throws:
javax.jms.JMSException
-
createMessageConsumer
public javax.jms.MessageConsumer createMessageConsumer() throws javax.jms.JMSExceptionDeprecated.Creates a MessageConsumer on this Destination using the current Session.- Returns:
- A MessageConsumer on this Destination.
- Throws:
javax.jms.JMSException- if the session fails to create a consumer due to some internal error.
-
createMessageProducer
public javax.jms.MessageProducer createMessageProducer(javax.jms.Session session, javax.jms.Destination destination) throws javax.jms.JMSException Deprecated.Creates a MessageProducer on this Destination using the current Session.- Parameters:
session- The JMS Session to use to create the MessageProducerdestination- The JMS Destination for the MessageProducer- Returns:
- A MessageProducer on this Destination.
- Throws:
javax.jms.JMSException- if the session fails to create a MessageProducer due to some internal error.
-
createReconnector
Deprecated. -
createSession
private javax.jms.Session createSession(javax.jms.Connection connection) throws javax.jms.JMSException Deprecated.- Throws:
javax.jms.JMSException
-
getJmsManagerConfiguration
Deprecated. -
getJndiManager
JndiManager getJndiManager()Deprecated. -
lookup
-
map
private javax.jms.MapMessage map(MapMessage<?, ?> log4jMapMessage, javax.jms.MapMessage jmsMapMessage) Deprecated. -
releaseSub
Deprecated.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.
-
send
Deprecated.
-
org.apache.logging.log4j.core.appender.mom.jakarta.JmsManager.