org.apache.avalon.excalibur.component.servlet
Class AbstractComponentManagerServlet

java.lang.Object
  extended byjavax.servlet.GenericServlet
      extended byjavax.servlet.http.HttpServlet
          extended byorg.apache.avalon.excalibur.component.servlet.AbstractComponentManagerServlet
All Implemented Interfaces:
Instrumentable, java.io.Serializable, javax.servlet.Servlet, javax.servlet.ServletConfig

Deprecated. Use of this class has been deprecated along with the ComponentManager interface. Please use the AbstractServiceManagerServlet.

public abstract class AbstractComponentManagerServlet
extends javax.servlet.http.HttpServlet
implements Instrumentable

Abstract Servlet which can be used with the ExcaliburComponentManagerServlet to enable servlets to have access to a ComponentManager as well as logging and instrumentation features.

Since:
4.2
Version:
CVS $Revision: 1.4 $ $Date: 2004/02/28 11:47:16 $
Author:
Avalon Development Team
See Also:
Serialized Form

Field Summary
 
Fields inherited from interface org.apache.excalibur.instrument.Instrumentable
EMPTY_INSTRUMENT_ARRAY, EMPTY_INSTRUMENTABLE_ARRAY
 
Constructor Summary
AbstractComponentManagerServlet(java.lang.String referenceName)
          Deprecated. Create a new AbstractComponentManagerServlet.
 
Method Summary
protected  void addChildInstrumentable(Instrumentable child)
          Deprecated. Adds a child Instrumentable to the list of child Instrumentables published by the component.
protected  void addInstrument(Instrument instrument)
          Deprecated. Adds an Instrument to the list of Instruments published by the component.
 void destroy()
          Deprecated. Called by the servlet container to indicate to a servlet that the servlet is being taken out of service.
 Instrumentable[] getChildInstrumentables()
          Deprecated. Any Object which implements Instrumentable can also make use of other Instrumentable child objects.
 ComponentManager getComponentManager()
          Deprecated. Returns the current ComponentManager.
 java.lang.String getInstrumentableName()
          Deprecated. Gets the name of the Instrumentable.
 Instrument[] getInstruments()
          Deprecated. Obtain a reference to all the Instruments that the Instrumentable object wishes to expose.
protected  Logger getLogger()
          Deprecated. Obtain a reference to the servlet's logger.
 void init(javax.servlet.ServletConfig config)
          Deprecated. Called by the servlet container to initialize a servlet before it is put into service.
 void service(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)
          Deprecated. Receives standard HTTP requests from the public service method and dispatches them to the doXXX methods defined in this class.
 void setInstrumentableName(java.lang.String name)
          Deprecated. Sets the name for the Instrumentable.
 
Methods inherited from class javax.servlet.http.HttpServlet
doDelete, doGet, doHead, doOptions, doPost, doPut, doTrace, getLastModified, service
 
Methods inherited from class javax.servlet.GenericServlet
getInitParameter, getInitParameterNames, getServletConfig, getServletContext, getServletInfo, getServletName, init, log, log
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AbstractComponentManagerServlet

public AbstractComponentManagerServlet(java.lang.String referenceName)
Deprecated. 
Create a new AbstractComponentManagerServlet.

Parameters:
referenceName - A name which does not include any spaces or periods that will be used to name the logger category and instrumentable which represents this servlet.
Method Detail

init

public void init(javax.servlet.ServletConfig config)
          throws javax.servlet.ServletException
Deprecated. 
Called by the servlet container to initialize a servlet before it is put into service.

Specified by:
init in interface javax.servlet.Servlet
Parameters:
config - ServletConfig object for the servlet.
Throws:
javax.servlet.ServletException - If there are any initialization problems.

destroy

public void destroy()
Deprecated. 
Called by the servlet container to indicate to a servlet that the servlet is being taken out of service.

Specified by:
destroy in interface javax.servlet.Servlet

service

public void service(javax.servlet.http.HttpServletRequest request,
                    javax.servlet.http.HttpServletResponse response)
             throws javax.servlet.ServletException,
                    java.io.IOException
Deprecated. 
Receives standard HTTP requests from the public service method and dispatches them to the doXXX methods defined in this class. Overrides the default method to allow for instrumentation.

Parameters:
request - The HttpServletRequest object that contains the request the client made of the servlet.
response - The HttpServletResponse object that contains the response the servlet returns to the client.
Throws:
javax.servlet.ServletException
java.io.IOException

getInstrumentableName

public final java.lang.String getInstrumentableName()
Deprecated. 
Gets the name of the Instrumentable.

Specified by:
getInstrumentableName in interface Instrumentable
Returns:
The name used to identify a Instrumentable.

setInstrumentableName

public final void setInstrumentableName(java.lang.String name)
Deprecated. 
Sets the name for the Instrumentable. The Instrumentable Name is used to uniquely identify the Instrumentable during the configuration of the InstrumentManager and to gain access to an InstrumentableDescriptor through the InstrumentManager. The value should be a string which does not contain spaces or periods.

This value may be set by a parent Instrumentable, or by the InstrumentManager using the value of the 'instrumentable' attribute in the configuration of the component.

Specified by:
setInstrumentableName in interface Instrumentable
Parameters:
name - The name used to identify a Instrumentable.

getChildInstrumentables

public final Instrumentable[] getChildInstrumentables()
Deprecated. 
Any Object which implements Instrumentable can also make use of other Instrumentable child objects. This method is used to tell the InstrumentManager about them.

Specified by:
getChildInstrumentables in interface Instrumentable
Returns:
An array of child Instrumentables. This method should never return null. If there are no child Instrumentables, then EMPTY_INSTRUMENTABLE_ARRAY can be returned.

getInstruments

public final Instrument[] getInstruments()
Deprecated. 
Obtain a reference to all the Instruments that the Instrumentable object wishes to expose. All sampling is done directly through the Instruments as opposed to the Instrumentable interface.

Specified by:
getInstruments in interface Instrumentable
Returns:
An array of the Instruments available for profiling. Should never be null. If there are no Instruments, then EMPTY_INSTRUMENT_ARRAY can be returned. This should never be the case though unless there are child Instrumentables with Instruments.

addInstrument

protected void addInstrument(Instrument instrument)
Deprecated. 
Adds an Instrument to the list of Instruments published by the component. This method may not be called after the Instrumentable has been registered with the InstrumentManager.

Parameters:
instrument - Instrument to publish.

addChildInstrumentable

protected void addChildInstrumentable(Instrumentable child)
Deprecated. 
Adds a child Instrumentable to the list of child Instrumentables published by the component. This method may not be called after the Instrumentable has been registered with the InstrumentManager.

Note that Child Instrumentables must be named by the caller using the setInstrumentableName method.

Parameters:
child - Child Instrumentable to publish.

getLogger

protected Logger getLogger()
Deprecated. 
Obtain a reference to the servlet's logger.

Returns:
The servlet's logger.

getComponentManager

public ComponentManager getComponentManager()
Deprecated. 
Returns the current ComponentManager.

Returns:
The current ComponentManager.


Copyright © 1997-2005 The Apache Software Foundation. All Rights Reserved.