org.apache.commons.messagelet
Class MessageDrivenObjectSupport

java.lang.Object
  extended by org.apache.commons.messagelet.MessageDrivenObjectSupport
All Implemented Interfaces:
javax.jms.MessageListener, MessageDrivenObject
Direct Known Subclasses:
MessageHttpServletDispatcher, MessageServletDispatcher, MessengerMDO

public abstract class MessageDrivenObjectSupport
extends Object
implements MessageDrivenObject

MessageDrivenObjectSupport is an abstract base class for implementing your own MessageDrivenObject instance with some useful implementation level methods.

Version:
$Revision: 155459 $
Author:
James Strachan

Constructor Summary
MessageDrivenObjectSupport()
           
 
Method Summary
 void destroy()
          Called when the web application (servlet context) is being destroyed, giving the bean chance to do a graceful shutdown
protected  org.apache.commons.logging.Log getLog()
          Provides access to a logger which can use JDK 1.4 logging, log4j or logkit under the covers.
 javax.servlet.ServletContext getServletContext()
           
 void init()
          This method allows the init() method to be overriden without having to call the super.init( ServletContext ) method first.
 void init(javax.servlet.ServletContext context)
          Called when this message listener bean is initialized by the Serlvet container.
protected  void log(String message)
          Logs a message to the current ServletContext
protected  void log(String message, Throwable t)
          Logs a message and exception the current ServletContext
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface javax.jms.MessageListener
onMessage
 

Constructor Detail

MessageDrivenObjectSupport

public MessageDrivenObjectSupport()
Method Detail

getServletContext

public javax.servlet.ServletContext getServletContext()

init

public void init()
          throws javax.servlet.ServletException
This method allows the init() method to be overriden without having to call the super.init( ServletContext ) method first. This is similar to the init() method in GenericServlet.

Throws:
javax.servlet.ServletException

init

public void init(javax.servlet.ServletContext context)
          throws javax.servlet.ServletException
Description copied from interface: MessageDrivenObject
Called when this message listener bean is initialized by the Serlvet container.

Specified by:
init in interface MessageDrivenObject
Throws:
javax.servlet.ServletException

destroy

public void destroy()
Description copied from interface: MessageDrivenObject
Called when the web application (servlet context) is being destroyed, giving the bean chance to do a graceful shutdown

Specified by:
destroy in interface MessageDrivenObject

getLog

protected org.apache.commons.logging.Log getLog()
Provides access to a logger which can use JDK 1.4 logging, log4j or logkit under the covers.


log

protected void log(String message)
Logs a message to the current ServletContext


log

protected void log(String message,
                   Throwable t)
Logs a message and exception the current ServletContext



Copyright © 2001-2010 The Apache Software Foundation. All Rights Reserved.