org.apache.excalibur.instrument.manager.http
Class InstrumentManagerHTTPConnector

java.lang.Object
  extended by org.apache.avalon.framework.logger.AbstractLogEnabled
      extended by org.apache.excalibur.instrument.AbstractLogEnabledInstrumentable
          extended by org.apache.excalibur.instrument.manager.http.InstrumentManagerHTTPConnector
All Implemented Interfaces:
org.apache.avalon.framework.activity.Startable, org.apache.avalon.framework.configuration.Configurable, org.apache.avalon.framework.logger.LogEnabled, org.apache.excalibur.instrument.Instrumentable, org.apache.excalibur.instrument.manager.DefaultInstrumentManagerConnector

public class InstrumentManagerHTTPConnector
extends org.apache.excalibur.instrument.AbstractLogEnabledInstrumentable
implements org.apache.excalibur.instrument.manager.DefaultInstrumentManagerConnector, org.apache.avalon.framework.configuration.Configurable, org.apache.avalon.framework.activity.Startable

An HTTP connector which allows a client to connect to the ServiceManager using the HTTP protocol. This connector makes use of an extremely lightweight internal HTTP server to provide this access. If the application is already running a full blown Servlet Engine, one alternative to this connector is to make use of the InstrumentManagerServlet.

Since:
4.1
Version:
CVS $Revision: 1.6 $ $Date: 2004/03/06 14:01:28 $
Author:
Avalon Development Team

Field Summary
static int DEFAULT_PORT
          The default port.
static java.lang.String ENCODING
          The encoding to use when writing out pages and reading in parameters.
private  boolean m_antialias
          Antialias flag for images.
private  java.net.InetAddress m_bindAddr
          The address to bind the port server to.
private  int m_chartHeight
          Default Chart Height.
private  int m_chartWidth
          Default Chart Width.
private  boolean m_html
          True if HTML handlers should be registered.
private  HTTPServer m_httpServer
           
private  org.apache.excalibur.instrument.manager.DefaultInstrumentManager m_manager
          Reference to the actual instrument manager.
private  long m_maxLeasedSampleLease
          The maximum amount of time that a lease will be granted for.
private  int m_maxLeasedSamples
          The maximum number of leased samples which will be allowed.
private  int m_maxLeasedSampleSize
          The maximum size of a leased sample.
private  int m_port
          The port to listen on for connections.
private  boolean m_readOnly
          True if the connector should only provide read-only access to the Instrument Manager.
private  java.lang.String m_rootBreadCrumbLabel
          The root bread crumb label if configured.
private  java.lang.String m_rootBreadCrumbURL
          The root bread crumb URL if configured.
private  boolean m_xml
          True if XML handlers should be registered.
static java.lang.String XML_BANNER
           
 
Fields inherited from interface org.apache.excalibur.instrument.Instrumentable
EMPTY_INSTRUMENT_ARRAY, EMPTY_INSTRUMENTABLE_ARRAY
 
Constructor Summary
InstrumentManagerHTTPConnector()
          Creates a new InstrumentManagerHTTPConnector.
 
Method Summary
 void configure(org.apache.avalon.framework.configuration.Configuration configuration)
           
(package private)  long getMaxLeasedSampleLease()
          Returns the maximum number of milliseconds that a lease will be granted for.
(package private)  int getMaxLeasedSamples()
          Returns the maximum number of leased samples that will be approved.
(package private)  int getMaxLeasedSampleSize()
          Returns the maximum size of a leased sample.
(package private)  java.lang.String getRootBreadCrumbLabel()
          Returns the root bread crumb label or null if not configured.
(package private)  java.lang.String getRootBreadCrumbURL()
          Returns the root bread crumb URL or null if not configured.
private  void initAndRegisterHandler(AbstractHTTPURLHandler handler, java.lang.String name)
           
(package private)  boolean isReadOnly()
          True if the connector should only provide read-only access to the Instrument Manager.
 void setInstrumentManager(org.apache.excalibur.instrument.manager.DefaultInstrumentManager manager)
          Set the InstrumentManager to which the Connecter will provide access.
 void start()
           
 void stop()
           
 
Methods inherited from class org.apache.excalibur.instrument.AbstractLogEnabledInstrumentable
addChildInstrumentable, addInstrument, getChildInstrumentables, getInstrumentableName, getInstruments, setInstrumentableName
 
Methods inherited from class org.apache.avalon.framework.logger.AbstractLogEnabled
enableLogging, getLogger, setupLogger, setupLogger, setupLogger
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DEFAULT_PORT

public static final int DEFAULT_PORT
The default port.

See Also:
Constant Field Values

ENCODING

public static final java.lang.String ENCODING
The encoding to use when writing out pages and reading in parameters.

See Also:
Constant Field Values

XML_BANNER

public static final java.lang.String XML_BANNER
See Also:
Constant Field Values

m_manager

private org.apache.excalibur.instrument.manager.DefaultInstrumentManager m_manager
Reference to the actual instrument manager.


m_port

private int m_port
The port to listen on for connections.


m_bindAddr

private java.net.InetAddress m_bindAddr
The address to bind the port server to. Null for any address.


m_xml

private boolean m_xml
True if XML handlers should be registered.


m_html

private boolean m_html
True if HTML handlers should be registered.


m_chartWidth

private int m_chartWidth
Default Chart Width.


m_chartHeight

private int m_chartHeight
Default Chart Height.


m_antialias

private boolean m_antialias
Antialias flag for images.


m_maxLeasedSamples

private int m_maxLeasedSamples
The maximum number of leased samples which will be allowed. This is important to prevent denial of service attacks using connectors.


m_maxLeasedSampleSize

private int m_maxLeasedSampleSize
The maximum size of a leased sample. This is important to prevent denial of service attacks using connectors.


m_maxLeasedSampleLease

private long m_maxLeasedSampleLease
The maximum amount of time that a lease will be granted for. This is important to prevent denial of service attacks using connectors.


m_readOnly

private boolean m_readOnly
True if the connector should only provide read-only access to the Instrument Manager.


m_rootBreadCrumbURL

private java.lang.String m_rootBreadCrumbURL
The root bread crumb URL if configured.


m_rootBreadCrumbLabel

private java.lang.String m_rootBreadCrumbLabel
The root bread crumb label if configured.


m_httpServer

private HTTPServer m_httpServer
Constructor Detail

InstrumentManagerHTTPConnector

public InstrumentManagerHTTPConnector()
Creates a new InstrumentManagerHTTPConnector.

Method Detail

setInstrumentManager

public void setInstrumentManager(org.apache.excalibur.instrument.manager.DefaultInstrumentManager manager)
Set the InstrumentManager to which the Connecter will provide access. This method is called before the new connector is configured or started.

Specified by:
setInstrumentManager in interface org.apache.excalibur.instrument.manager.DefaultInstrumentManagerConnector

configure

public void configure(org.apache.avalon.framework.configuration.Configuration configuration)
               throws org.apache.avalon.framework.configuration.ConfigurationException
Specified by:
configure in interface org.apache.avalon.framework.configuration.Configurable
Throws:
org.apache.avalon.framework.configuration.ConfigurationException

start

public void start()
           throws java.lang.Exception
Specified by:
start in interface org.apache.avalon.framework.activity.Startable
Throws:
java.lang.Exception

stop

public void stop()
          throws java.lang.Exception
Specified by:
stop in interface org.apache.avalon.framework.activity.Startable
Throws:
java.lang.Exception

getMaxLeasedSamples

int getMaxLeasedSamples()
Returns the maximum number of leased samples that will be approved.

Returns:
The maximum number of leased samples.

getMaxLeasedSampleSize

int getMaxLeasedSampleSize()
Returns the maximum size of a leased sample.

Returns:
The maximum size of a leased sample.

getMaxLeasedSampleLease

long getMaxLeasedSampleLease()
Returns the maximum number of milliseconds that a lease will be granted for.

Returns:
The maximum lease length.

isReadOnly

boolean isReadOnly()
True if the connector should only provide read-only access to the Instrument Manager.

Returns:
The read-only flag.

getRootBreadCrumbURL

java.lang.String getRootBreadCrumbURL()
Returns the root bread crumb URL or null if not configured.

Returns:
The root bread crumb URL or null if not configured.

getRootBreadCrumbLabel

java.lang.String getRootBreadCrumbLabel()
Returns the root bread crumb label or null if not configured.

Returns:
The root bread crumb label or null if not configured.

initAndRegisterHandler

private void initAndRegisterHandler(AbstractHTTPURLHandler handler,
                                    java.lang.String name)
                             throws java.lang.Exception
Throws:
java.lang.Exception