org.norther.tammi.spray.servlet
Class DefaultStartupServlet

java.lang.Object
  extended by javax.servlet.GenericServlet
      extended by javax.servlet.http.HttpServlet
          extended by org.norther.tammi.spray.servlet.DefaultStartupServlet
All Implemented Interfaces:
Serializable, NotificationBroadcaster, NotificationEmitter, Servlet, ServletConfig, Manageable, StartupServlet

public class DefaultStartupServlet
extends HttpServlet
implements StartupServlet, Manageable, NotificationEmitter, Serializable

A default implementation of StartupServlet.

Author:
Ilkka Priha
See Also:
Serialized Form

Field Summary
 
Fields inherited from interface org.norther.tammi.spray.servlet.StartupServlet
CONNECTOR_NAME_PROPERTY, INIT_PROPERTY_PREFIX, OBJECT_NAME_PROPERTY
 
Constructor Summary
DefaultStartupServlet()
          Constructs a new servlet.
 
Method Summary
 void addNotificationListener(NotificationListener listener, NotificationFilter filter, Object handback)
           
 void destroy()
          Destroys the servlet.
 void doGet(HttpServletRequest req, HttpServletResponse res)
          Handles the GET method.
 void doPost(HttpServletRequest req, HttpServletResponse res)
          Handles the POST method.
 ObjectName getConnector()
          Gets the servlet connector name.
protected  MBeanDelegate getMBeanDelegate()
          Gets the delegate to provide access to its methods for subclasses.
 MBeanNotificationInfo[] getNotificationInfo()
           
 String getServletInfo()
          Gets the servlet info.
 void init(ServletConfig config)
          Initializes the servlet.
 void postmanaged()
          This method is called when the implementing adaptee has been managed either during post-registration of the corresponding adapter MBean or just after it is explicitly added to the adapter MBean during run-time.
 void premanaged(MBeanDelegate adapter)
          This method is called when the implementing adaptee is trying to be managed either during pre-registration of the corresponding adapter MBean or just before it is explicitly added to the adapter MBean during run-time.
 void removeNotificationListener(NotificationListener listener)
           
 void removeNotificationListener(NotificationListener listener, NotificationFilter filter, Object handback)
           
 void setConnector(ObjectName name)
          Sets the servlet connector name.
 void unmanaged()
          This method is called when the implementing adaptee is unmanaged either during pre-deregistration of the corresponding adapter MBean or just before it is explicitly removed from the adapter MBean during run-time.
 
Methods inherited from class javax.servlet.http.HttpServlet
doDelete, doHead, doOptions, doPut, doTrace, getLastModified, service, service
 
Methods inherited from class javax.servlet.GenericServlet
getInitParameter, getInitParameterNames, getServletConfig, getServletContext, getServletName, init, log, log
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.norther.tammi.spray.servlet.StartupServlet
getServletConfig, getServletName
 

Constructor Detail

DefaultStartupServlet

public DefaultStartupServlet()
Constructs a new servlet.

Method Detail

premanaged

public void premanaged(MBeanDelegate adapter)
                throws Exception
Description copied from interface: Manageable
This method is called when the implementing adaptee is trying to be managed either during pre-registration of the corresponding adapter MBean or just before it is explicitly added to the adapter MBean during run-time.

Specified by:
premanaged in interface Manageable
Parameters:
adapter - the managing adapter.
Throws:
Exception - if the adaptee refused to be managed.

postmanaged

public void postmanaged()
Description copied from interface: Manageable
This method is called when the implementing adaptee has been managed either during post-registration of the corresponding adapter MBean or just after it is explicitly added to the adapter MBean during run-time.

Specified by:
postmanaged in interface Manageable

unmanaged

public void unmanaged()
               throws Exception
Description copied from interface: Manageable
This method is called when the implementing adaptee is unmanaged either during pre-deregistration of the corresponding adapter MBean or just before it is explicitly removed from the adapter MBean during run-time.

Specified by:
unmanaged in interface Manageable
Throws:
Exception - if the adaptee refused to be unmanaged.

getServletInfo

public String getServletInfo()
Description copied from interface: StartupServlet
Gets the servlet info.

Specified by:
getServletInfo in interface Servlet
Specified by:
getServletInfo in interface StartupServlet
Overrides:
getServletInfo in class GenericServlet
Returns:
the servlet info.

getConnector

public ObjectName getConnector()
Description copied from interface: StartupServlet
Gets the servlet connector name.

Specified by:
getConnector in interface StartupServlet
Returns:
the name of the connector or a query.

setConnector

public void setConnector(ObjectName name)
Description copied from interface: StartupServlet
Sets the servlet connector name.

Specified by:
setConnector in interface StartupServlet
Parameters:
name - the name of the connector or a query.

addNotificationListener

public void addNotificationListener(NotificationListener listener,
                                    NotificationFilter filter,
                                    Object handback)
Specified by:
addNotificationListener in interface NotificationBroadcaster

removeNotificationListener

public void removeNotificationListener(NotificationListener listener,
                                       NotificationFilter filter,
                                       Object handback)
                                throws ListenerNotFoundException
Specified by:
removeNotificationListener in interface NotificationEmitter
Throws:
ListenerNotFoundException

removeNotificationListener

public void removeNotificationListener(NotificationListener listener)
                                throws ListenerNotFoundException
Specified by:
removeNotificationListener in interface NotificationBroadcaster
Throws:
ListenerNotFoundException

getNotificationInfo

public MBeanNotificationInfo[] getNotificationInfo()
Specified by:
getNotificationInfo in interface NotificationBroadcaster

init

public void init(ServletConfig config)
          throws ServletException
Initializes the servlet.

Specified by:
init in interface Servlet
Overrides:
init in class GenericServlet
Parameters:
config - the configuration of the servlet.
Throws:
ServletException - on errors.

destroy

public void destroy()
Destroys the servlet.

Specified by:
destroy in interface Servlet
Overrides:
destroy in class GenericServlet

doGet

public void doGet(HttpServletRequest req,
                  HttpServletResponse res)
           throws ServletException
Handles the GET method.

Overrides:
doGet in class HttpServlet
Parameters:
req - a HTTP request.
res - a HTTP response.
Throws:
ServletException - on errors.

doPost

public void doPost(HttpServletRequest req,
                   HttpServletResponse res)
            throws ServletException
Handles the POST method.

Overrides:
doPost in class HttpServlet
Parameters:
req - a HTTP request.
res - a HTTP response
Throws:
ServletException - on errors.

getMBeanDelegate

protected MBeanDelegate getMBeanDelegate()
Gets the delegate to provide access to its methods for subclasses.

Returns:
the adaptable.


Copyright © 2004 The Norther Organization. All rights reserved.