public class JMSReceiver extends Receiver implements javax.jms.MessageListener
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.
Modifier and Type | Field and Description |
---|---|
protected String |
jndiPath |
protected String |
password |
protected javax.jms.TopicConnection |
topicConnection |
protected String |
topicFactoryName |
protected String |
topicName |
protected String |
userId |
thresholdLevel
name
repository
Constructor and Description |
---|
JMSReceiver() |
JMSReceiver(String _topicFactoryName,
String _topicName,
String _userId,
String _password,
String _jndiPath) |
Modifier and Type | Method and Description |
---|---|
void |
activateOptions()
Starts the JMSReceiver with the current options.
|
String |
getJndiPath()
Gets the path to a properties file containing
the initial context and jndi provider url
|
String |
getPassword()
Gets the curernt password property.
|
String |
getTopicFactoryName()
Gets the curernt JMS topic factory name property.
|
String |
getTopicName()
Gets the curernt JMS topic name property.
|
String |
getUserId()
Gets the current user id property.
|
boolean |
isActive()
Returns true if this receiver is active.
|
boolean |
isEquivalent(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 Object |
lookup(Context ctx,
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(String _jndiPath)
Sets the path to a properties file containing
the initial context and jndi provider url
|
void |
setPassword(String _password)
Sets the password to use when creating the
JMS connection.
|
void |
setTopicFactoryName(String _topicFactoryName)
Sets the JMS topic factory name to use when creating the
JMS connection.
|
void |
setTopicName(String _topicName)
Sets the JMS topic name to use when creating the
JMS connection.
|
void |
setUserId(String _userId)
Sets the user id to use when creating the
JMS connection.
|
void |
shutdown()
Called when the receiver should be stopped.
|
doPost, getThreshold, isAsSevereAsThreshold, setThreshold
addPropertyChangeListener, addPropertyChangeListener, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getLoggerRepository, getName, removePropertyChangeListener, removePropertyChangeListener, setLoggerRepository, setName
getLogger, getNonFloodingLogger, resetErrorCount
protected String topicFactoryName
protected String topicName
protected String userId
protected String password
protected javax.jms.TopicConnection topicConnection
protected String jndiPath
public void setJndiPath(String _jndiPath)
public String getJndiPath()
public void setTopicFactoryName(String _topicFactoryName)
public String getTopicFactoryName()
public void setTopicName(String _topicName)
public String getTopicName()
public void setUserId(String _userId)
public String getUserId()
public void setPassword(String _password)
public String getPassword()
public boolean isEquivalent(Plugin testPlugin)
isEquivalent
in interface Plugin
isEquivalent
in class PluginSkeleton
testPlugin
- The plugin to test equivalency against.public boolean isActive()
isActive
in interface Plugin
isActive
in class PluginSkeleton
protected void setActive(boolean _active)
public void activateOptions()
activateOptions
in interface org.apache.log4j.spi.OptionHandler
public void shutdown()
public void onMessage(javax.jms.Message message)
onMessage
in interface javax.jms.MessageListener
protected Object lookup(Context ctx, String name) throws NamingException
NamingException
Copyright © 2002-2017 Apache Software Foundation. All Rights Reserved.
Apache Logging, Apache Log4j, Log4j, Apache Chainsaw, Chainsaw, Apache, the Apache feather logo, the Apache Logging project logo, and the Apache Log4j logo are trademarks of The Apache Software Foundation.