Top Description Fields Constructors Methods
org.apache.log.output.jms

public Class TextMessageBuilder

extends Object
implements MessageBuilder
Class Inheritance
All Implemented Interfaces
org.apache.log.output.jms.MessageBuilder
Imports
java.io.PrintWriter, .StringWriter, javax.jms.JMSException, .Message, .Session, .TextMessage, org.apache.log.ContextMap, .LogEvent, org.apache.log.format.Formatter

Basic message factory that stores LogEvent in Message.
Authors
Avalon Development Team, Peter Donald

Field Summary

Modifier and TypeField and Description
private final Formatter
private final PropertyInfo[]

Constructor Summary

AccessConstructor and Description
public
TextMessageBuilder(final Formatter
the message formatter
formatter
)

Creation of a new text message builder.

public
TextMessageBuilder(final PropertyInfo[]
the property info set
properties
,
final Formatter
the message formatter
formatter
)

Creation of a new text message builder.

Method Summary

Modifier and TypeMethod and Description
public Message

Returns:

the message
buildMessage
(final Session
the session
session
,
final LogEvent
the log event
event
)

Implements org.apache.log.output.jms.MessageBuilder.buildMessage.

Build a message from the supplied session for the supplied event
private String
getContextMap(final ContextMap map, final String aux)

private String
getStackTrace(final Throwable throwable)

private String
getText(final LogEvent event)

private void
setProperty(final TextMessage
the text message
message
,
final int
the index
index
,
final LogEvent
the log event
event
)

Set a property

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

m_formatterback to summary
private final Formatter m_formatter
m_propertiesback to summary
private final PropertyInfo[] m_properties

Constructor Detail

TextMessageBuilderback to summary
public TextMessageBuilder(final Formatter formatter)

Creation of a new text message builder.

Parameters
formatter:Formatter

the message formatter

TextMessageBuilderback to summary
public TextMessageBuilder(final PropertyInfo[] properties, final Formatter formatter)

Creation of a new text message builder.

Parameters
properties:PropertyInfo[]

the property info set

formatter:Formatter

the message formatter

Method Detail

buildMessageback to summary
public Message buildMessage(final Session session, final LogEvent event) throws JMSException

Implements org.apache.log.output.jms.MessageBuilder.buildMessage.

Build a message from the supplied session for the supplied event

Parameters
session:Session

the session

event:LogEvent

the log event

Returns:Message

the message

Exceptions
JMSException:
if a messaging related error occurs
getContextMapback to summary
private String getContextMap(final ContextMap map, final String aux)
getStackTraceback to summary
private String getStackTrace(final Throwable throwable)
getTextback to summary
private String getText(final LogEvent event)
setPropertyback to summary
private void setProperty(final TextMessage message, final int index, final LogEvent event) throws JMSException

Set a property

Parameters
message:TextMessage

the text message

index:int

the index

event:LogEvent

the log event