org.apache.log4j.net
Class JMSAppender

java.lang.Object
  extended byorg.apache.log4j.AppenderSkeleton
      extended byorg.apache.log4j.net.JMSAppender
All Implemented Interfaces:
Appender, OptionHandler

public class JMSAppender
extends AppenderSkeleton

A simple appender based on JMS.


Field Summary
 
Fields inherited from class org.apache.log4j.AppenderSkeleton
closed, errorHandler, headFilter, layout, name, tailFilter, threshold
 
Constructor Summary
JMSAppender()
           
 
Method Summary
 void activateOptions()
          Derived appenders should override this method if option structure requires it.
 void append(LoggingEvent event)
          This method called by AppenderSkeleton.doAppend(org.apache.log4j.spi.LoggingEvent) method to do most of the real appending work.
protected  boolean checkEntryConditions()
           
 void close()
          Close this JMSAppender.
 boolean getLocationInfo()
          Returns value of the LocationInfo property which determines whether location (stack) info is sent to the remote subscriber.
 String getTopicBindingName()
          Returns the value of the TopicBindingName option.
 String getTopicConnectionFactoryBindingName()
          Returns the value of the TopicConnectionFactoryBindingName option.
protected  Object lookup(Context ctx, String name)
           
 boolean requiresLayout()
          Configurators call this method to determine if the appender requires a layout.
 void setLocationInfo(boolean locationInfo)
          If true, the information sent to the remote subscriber will include location information.
 void setTopicBindingName(String topicBindingName)
          The TopicBindingName option takes a string value.
 void setTopicConnectionFactoryBindingName(String tcfBindingName)
          The TopicConnectionFactoryBindingName option takes a string value.
 
Methods inherited from class org.apache.log4j.AppenderSkeleton
addFilter, clearFilters, doAppend, finalize, getErrorHandler, getFilter, getFirstFilter, getLayout, getName, getThreshold, isAsSevereAsThreshold, setErrorHandler, setLayout, setName, setThreshold
 
Methods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

JMSAppender

public JMSAppender()
Method Detail

setTopicConnectionFactoryBindingName

public void setTopicConnectionFactoryBindingName(String tcfBindingName)
The TopicConnectionFactoryBindingName option takes a string value. Its value will be used to lookup the appropriate TopicConnectionFactory from the JNDI context.


getTopicConnectionFactoryBindingName

public String getTopicConnectionFactoryBindingName()
Returns the value of the TopicConnectionFactoryBindingName option.


setTopicBindingName

public void setTopicBindingName(String topicBindingName)
The TopicBindingName option takes a string value. Its value will be used to lookup the appropriate Topic from the JNDI context.


getTopicBindingName

public String getTopicBindingName()
Returns the value of the TopicBindingName option.


getLocationInfo

public boolean getLocationInfo()
Returns value of the LocationInfo property which determines whether location (stack) info is sent to the remote subscriber.


activateOptions

public void activateOptions()
Description copied from class: AppenderSkeleton
Derived appenders should override this method if option structure requires it.

Specified by:
activateOptions in interface OptionHandler
Overrides:
activateOptions in class AppenderSkeleton

lookup

protected Object lookup(Context ctx,
                        String name)
                 throws NamingException
Throws:
NamingException

checkEntryConditions

protected boolean checkEntryConditions()

close

public void close()
Close this JMSAppender. Closing releases all resources used by the appender. A closed appender cannot be re-opened.


append

public void append(LoggingEvent event)
This method called by AppenderSkeleton.doAppend(org.apache.log4j.spi.LoggingEvent) method to do most of the real appending work.

Specified by:
append in class AppenderSkeleton

setLocationInfo

public void setLocationInfo(boolean locationInfo)
If true, the information sent to the remote subscriber will include location information. By default no location information is sent to the subscriber.


requiresLayout

public boolean requiresLayout()
Description copied from interface: Appender
Configurators call this method to determine if the appender requires a layout. If this method returns true, meaning that layout is required, then the configurator will configure an layout using the configuration information at its disposal. If this method returns false, meaning that a layout is not required, then layout configuration will be skipped even if there is available layout configuration information at the disposal of the configurator..

In the rather exceptional case, where the appender implementation admits a layout but can also work without it, then the appender should return true.




Copyright © 2000 Micro Focus International Limited. All rights reserved.
This document and the proprietary marks and names used herein are protected by international law.