org.apache.log4j.net
クラス JMSReceiver

java.lang.Object
  上位を拡張 org.apache.log4j.spi.ComponentBase
      上位を拡張 org.apache.log4j.plugins.PluginSkeleton
          上位を拡張 org.apache.log4j.plugins.Receiver
              上位を拡張 org.apache.log4j.net.JMSReceiver
すべての実装されたインタフェース:
javax.jms.MessageListener, org.apache.log4j.plugins.Plugin, org.apache.log4j.spi.Component, org.apache.log4j.spi.OptionHandler, org.apache.log4j.spi.Thresholdable

public class JMSReceiver
extends org.apache.log4j.plugins.Receiver
implements javax.jms.MessageListener

JMSReceiver receives a remote logging event on a configured JSM topic and "posts" it to a LoggerRepository as if the event was generated locally. This class is designed to receive events from the JMSAppender class (or classes that send compatible events).

Once the event has been "posted", it will be handled by the appenders currently configured in the LoggerRespository.

This implementation borrows heavily from the JMSSink implementation.

作成者:
Mark Womack, Paul Smith, Stephen Pain

フィールドの概要
protected  java.lang.String jndiPath
           
protected  java.lang.String password
           
protected  javax.jms.TopicConnection topicConnection
           
protected  java.lang.String topicFactoryName
           
protected  java.lang.String topicName
           
protected  java.lang.String userId
           
 
クラス org.apache.log4j.plugins.Receiver から継承されたフィールド
thresholdLevel
 
クラス org.apache.log4j.plugins.PluginSkeleton から継承されたフィールド
name
 
クラス org.apache.log4j.spi.ComponentBase から継承されたフィールド
repository
 
コンストラクタの概要
JMSReceiver()
           
JMSReceiver(java.lang.String _topicFactoryName, java.lang.String _topicName, java.lang.String _userId, java.lang.String _password, java.lang.String _jndiPath)
           
 
メソッドの概要
 void activateOptions()
          Starts the JMSReceiver with the current options.
 java.lang.String getJndiPath()
          Gets the path to a properties file containing the initial context and jndi provider url
 java.lang.String getPassword()
          Gets the curernt password property.
 java.lang.String getTopicFactoryName()
          Gets the curernt JMS topic factory name property.
 java.lang.String getTopicName()
          Gets the curernt JMS topic name property.
 java.lang.String getUserId()
          Gets the current user id property.
 boolean isActive()
          Returns true if this receiver is active.
 boolean isEquivalent(org.apache.log4j.plugins.Plugin testPlugin)
          Returns true if the receiver is the same class and they are configured for the same properties, and super class also considers them to be equivalent.
protected  java.lang.Object lookup(javax.naming.Context ctx, java.lang.String name)
           
 void onMessage(javax.jms.Message message)
           
protected  void setActive(boolean _active)
          Sets the flag to indicate if receiver is active or not.
 void setJndiPath(java.lang.String _jndiPath)
          Sets the path to a properties file containing the initial context and jndi provider url
 void setPassword(java.lang.String _password)
          Sets the password to use when creating the JMS connection.
 void setTopicFactoryName(java.lang.String _topicFactoryName)
          Sets the JMS topic factory name to use when creating the JMS connection.
 void setTopicName(java.lang.String _topicName)
          Sets the JMS topic name to use when creating the JMS connection.
 void setUserId(java.lang.String _userId)
          Sets the user id to use when creating the JMS connection.
 void shutdown()
          Called when the receiver should be stopped.
 
クラス org.apache.log4j.plugins.Receiver から継承されたメソッド
doPost, getThreshold, isAsSevereAsThreshold, setThreshold
 
クラス org.apache.log4j.plugins.PluginSkeleton から継承されたメソッド
addPropertyChangeListener, addPropertyChangeListener, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getLoggerRepository, getName, removePropertyChangeListener, removePropertyChangeListener, setLoggerRepository, setName
 
クラス org.apache.log4j.spi.ComponentBase から継承されたメソッド
getLogger, getNonFloodingLogger, resetErrorCount
 
クラス java.lang.Object から継承されたメソッド
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

フィールドの詳細

topicFactoryName

protected java.lang.String topicFactoryName

topicName

protected java.lang.String topicName

userId

protected java.lang.String userId

password

protected java.lang.String password

topicConnection

protected javax.jms.TopicConnection topicConnection

jndiPath

protected java.lang.String jndiPath
コンストラクタの詳細

JMSReceiver

public JMSReceiver()

JMSReceiver

public JMSReceiver(java.lang.String _topicFactoryName,
                   java.lang.String _topicName,
                   java.lang.String _userId,
                   java.lang.String _password,
                   java.lang.String _jndiPath)
メソッドの詳細

setJndiPath

public void setJndiPath(java.lang.String _jndiPath)
Sets the path to a properties file containing the initial context and jndi provider url


getJndiPath

public java.lang.String getJndiPath()
Gets the path to a properties file containing the initial context and jndi provider url


setTopicFactoryName

public void setTopicFactoryName(java.lang.String _topicFactoryName)
Sets the JMS topic factory name to use when creating the JMS connection.


getTopicFactoryName

public java.lang.String getTopicFactoryName()
Gets the curernt JMS topic factory name property.


setTopicName

public void setTopicName(java.lang.String _topicName)
Sets the JMS topic name to use when creating the JMS connection.


getTopicName

public java.lang.String getTopicName()
Gets the curernt JMS topic name property.


setUserId

public void setUserId(java.lang.String _userId)
Sets the user id to use when creating the JMS connection.


getUserId

public java.lang.String getUserId()
Gets the current user id property.


setPassword

public void setPassword(java.lang.String _password)
Sets the password to use when creating the JMS connection.


getPassword

public java.lang.String getPassword()
Gets the curernt password property.


isEquivalent

public boolean isEquivalent(org.apache.log4j.plugins.Plugin testPlugin)
Returns true if the receiver is the same class and they are configured for the same properties, and super class also considers them to be equivalent. This is used by PluginRegistry when determining if the a similarly configured receiver is being started.

定義:
インタフェース org.apache.log4j.plugins.Plugin 内の isEquivalent
オーバーライド:
クラス org.apache.log4j.plugins.PluginSkeleton 内の isEquivalent
パラメータ:
testPlugin - The plugin to test equivalency against.
戻り値:
boolean True if the testPlugin is equivalent to this plugin.

isActive

public boolean isActive()
Returns true if this receiver is active.

定義:
インタフェース org.apache.log4j.plugins.Plugin 内の isActive
オーバーライド:
クラス org.apache.log4j.plugins.PluginSkeleton 内の isActive

setActive

protected void setActive(boolean _active)
Sets the flag to indicate if receiver is active or not.


activateOptions

public void activateOptions()
Starts the JMSReceiver with the current options.

定義:
インタフェース org.apache.log4j.spi.OptionHandler 内の activateOptions

shutdown

public void shutdown()
Called when the receiver should be stopped.

定義:
インタフェース org.apache.log4j.plugins.Plugin 内の shutdown

onMessage

public void onMessage(javax.jms.Message message)
定義:
インタフェース javax.jms.MessageListener 内の onMessage

lookup

protected java.lang.Object lookup(javax.naming.Context ctx,
                                  java.lang.String name)
                           throws javax.naming.NamingException
例外:
javax.naming.NamingException


Copyright © 2010 Apache Software Foundation. All Rights Reserved.