Log4j 1.1.3

org.apache.log4j.net
Class JMSAppender

java.lang.Object
  |
  +--org.apache.log4j.AppenderSkeleton
        |
        +--org.apache.log4j.net.JMSAppender
All Implemented Interfaces:
Appender, OptionHandler

public class JMSAppender
extends AppenderSkeleton

A simple appender based on JMS.

Author:
Ceki Gülcü

Field Summary
static String TOPIC_BINDING_NAME_OPTION
          Deprecated. Options are now handled using the JavaBeans paradigm. This constant is not longer needed and will be removed in the near term.
static String TOPIC_CONNECTION_FACTORY_BINDING_NAME_OPTION
          Deprecated. Options are now handled using the JavaBeans paradigm. This constant is not longer needed and will be removed in the near term.
 
Fields inherited from class org.apache.log4j.AppenderSkeleton
closed, errorHandler, headFilter, layout, name, tailFilter, threshold, THRESHOLD_OPTION
 
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.
 String[] getOptionStrings()
          Deprecated. We now use JavaBeans introspection to configure components. Options strings are no longer needed.
 String getTopicBindingName()
          Returns the value of the TopicBindingName option.
 String getTopicConnectionFactoryBindingName()
          Returns the value of the TopicConnectionFactoryBindingName option.
protected  Object lookup(javax.naming.Context ctx, String name)
           
 boolean requiresLayout()
          Configurators call this method to determine if the appender requires a layout.
 void setOption(String key, String value)
          Deprecated. Use the setter method for the option directly instead of the generic setOption method.
 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
 

Field Detail

TOPIC_CONNECTION_FACTORY_BINDING_NAME_OPTION

public static final String TOPIC_CONNECTION_FACTORY_BINDING_NAME_OPTION
Deprecated. Options are now handled using the JavaBeans paradigm. This constant is not longer needed and will be removed in the near term.

A string constant used in naming the topic connection factory binding name option. output file. Current value of this string constant is TopicConnectionFactoryBindingName.

Note that all option keys are case sensitive.


TOPIC_BINDING_NAME_OPTION

public static final String TOPIC_BINDING_NAME_OPTION
Deprecated. Options are now handled using the JavaBeans paradigm. This constant is not longer needed and will be removed in the near term.

A string constant used in naming the topic binding name option. Current value of this string constant is TopicBindingName.

Note that all option keys are case sensitive.

Constructor Detail

JMSAppender

public JMSAppender()
Method Detail

getOptionStrings

public String[] getOptionStrings()
Deprecated. We now use JavaBeans introspection to configure components. Options strings are no longer needed.

Retuns the option names for this component, namely the string array TOPIC_BINDING_NAME_OPTION, TOPIC_CONNECTION_FACTORY_BINDING_NAME_OPTION in addition to the options of its super class AppenderSkeleton.
Overrides:
getOptionStrings in class AppenderSkeleton

setOption

public void setOption(String key,
                      String value)
Deprecated. Use the setter method for the option directly instead of the generic setOption method.

Set JMSAppender specific options. The options of the super class AppenderSkeleton are also recognized.

The TopicConnectionFactoryBindingName option takes a string value. Its value will be used to lookup the appropriate TopicConnectionFactory from the JNDI context.

The TopicBindingName option takes a string value. Its value will be used to lookup the appropriate Topic from the JNDI context.

Overrides:
setOption in class AppenderSkeleton

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.

activateOptions

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

lookup

protected Object lookup(javax.naming.Context ctx,
                        String name)
                 throws javax.naming.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.
Overrides:
append in class AppenderSkeleton

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.


Log4j 1.1.3

Please notify me about new log4j releases.