org.apache.logging.log4j.core.net
Class AbstractJMSManager

java.lang.Object
  extended by org.apache.logging.log4j.core.appender.AbstractManager
      extended by org.apache.logging.log4j.core.net.AbstractJMSManager
Direct Known Subclasses:
JMSQueueManager, JMSTopicManager

public abstract class AbstractJMSManager
extends AbstractManager

Base Class for Managers of JMS connections.


Field Summary
 
Fields inherited from class org.apache.logging.log4j.core.appender.AbstractManager
count, LOGGER
 
Constructor Summary
AbstractJMSManager(String name)
          The Constructor.
 
Method Summary
protected static Context createContext(String factoryName, String providerURL, String urlPkgPrefixes, String securityPrincipalName, String securityCredentials)
          Create the InitialContext.
protected static Properties getEnvironment(String factoryName, String providerURL, String urlPkgPrefixes, String securityPrincipalName, String securityCredentials)
          Sets up the properties to pass to the InitialContext.
protected static Object lookup(Context ctx, String name)
          Looks up the name in the context.
abstract  void send(Serializable object)
          Send the message.
 void send(Serializable object, javax.jms.Session session, javax.jms.MessageProducer producer)
          Send the Object.
 
Methods inherited from class org.apache.logging.log4j.core.appender.AbstractManager
getCount, getManager, getName, hasManager, release, releaseSub
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AbstractJMSManager

public AbstractJMSManager(String name)
The Constructor.

Parameters:
name - The name of the Appender.
Method Detail

createContext

protected static Context createContext(String factoryName,
                                       String providerURL,
                                       String urlPkgPrefixes,
                                       String securityPrincipalName,
                                       String securityCredentials)
                                throws NamingException
Create the InitialContext.

Parameters:
factoryName - The fully qualified class name of the InitialContextFactory.
providerURL - The URL of the provider to use.
urlPkgPrefixes - A colon-separated list of package prefixes for the class name of the factory class that will create a URL context factory
securityPrincipalName - The name of the identity of the Principal.
securityCredentials - The security credentials of the Principal.
Returns:
the InitialContext.
Throws:
NamingException - if a naming error occurs.

lookup

protected static Object lookup(Context ctx,
                               String name)
                        throws NamingException
Looks up the name in the context.

Parameters:
ctx - The Context.
name - The name to locate.
Returns:
The object to be located.
Throws:
NamingException - If an error occurs locating the name.

getEnvironment

protected static Properties getEnvironment(String factoryName,
                                           String providerURL,
                                           String urlPkgPrefixes,
                                           String securityPrincipalName,
                                           String securityCredentials)
Sets up the properties to pass to the InitialContext.

Parameters:
factoryName - The fully qualified class name of the InitialContextFactory.
providerURL - The URL of the provider to use.
urlPkgPrefixes - A colon-separated list of package prefixes for the class name of the factory class that will create a URL context factory
securityPrincipalName - The name of the identity of the Principal.
securityCredentials - The security credentials of the Principal.
Returns:
The Properties.

send

public abstract void send(Serializable object)
                   throws Exception
Send the message.

Parameters:
object - The Object to sent.
Throws:
Exception - if an error occurs.

send

public void send(Serializable object,
                 javax.jms.Session session,
                 javax.jms.MessageProducer producer)
          throws Exception
Send the Object.

Parameters:
object - The Object to send.
session - The Session.
producer - The MessageProducer.
Throws:
Exception - if an error occurs.


Copyright © 1999-2012 Apache Software Foundation. All Rights Reserved. Apache Logging, Apache Log4j, Log4j, Apache, the Apache feather logo, and the Apache Logging project logo are trademarks of The Apache Software Foundation.