Skip to Content.
Sympa Menu

notify-dpml - svn commit: r2876 - development/main/test/components/http/impl/src/main/net/dpml/http/impl

notify-dpml AT lists.ibiblio.org

Subject: DPML Notify

List archive

Chronological Thread  
  • From: mcconnell AT dpml.net
  • To: notify-dpml AT lists.ibiblio.org
  • Subject: svn commit: r2876 - development/main/test/components/http/impl/src/main/net/dpml/http/impl
  • Date: Fri, 17 Jun 2005 16:11:13 -0400

Author: mcconnell AT dpml.net
Date: Fri Jun 17 16:11:13 2005
New Revision: 2876

Modified:

development/main/test/components/http/impl/src/main/net/dpml/http/impl/DumpHandler.java
Log:
updating

Modified:
development/main/test/components/http/impl/src/main/net/dpml/http/impl/DumpHandler.java
==============================================================================
---
development/main/test/components/http/impl/src/main/net/dpml/http/impl/DumpHandler.java
(original)
+++
development/main/test/components/http/impl/src/main/net/dpml/http/impl/DumpHandler.java
Fri Jun 17 16:11:13 2005
@@ -16,18 +16,8 @@
package net.dpml.http.impl;

import net.dpml.activity.Startable;
-import net.dpml.context.Context;
-import net.dpml.context.ContextException;
-import net.dpml.context.Contextualizable;
-import net.dpml.logging.LogEnabled;
import net.dpml.logging.Logger;
-import net.dpml.parameters.ParameterException;
-import net.dpml.parameters.Parameterizable;
-import net.dpml.parameters.Parameters;
import net.dpml.http.HttpContextService;
-import net.dpml.service.ServiceException;
-import net.dpml.service.ServiceManager;
-import net.dpml.service.Serviceable;

/**
* @metro.component name="http-dump-handler" lifestyle="singleton"
@@ -36,48 +26,60 @@
public class DumpHandler extends org.mortbay.http.handler.DumpHandler
implements Startable
{
- private Logger m_Logger;
- private HttpContextService m_Context;
- private int m_Index;
+ public interface Context
+ {
+ HttpContextService getHttpContext();
+ int getHandlerIndex( int value );
+ }
+
+ private Logger m_logger;
+ private HttpContextService m_context;
+ private int m_index;

/**
- * @metro.logger name="http"
- * @metro.entry key="urn:metro:name"
- * type="java.lang.String"
- * @metro.dependency type="net.dpml.http.HttpContextService"
- * key="http-context"
*/
- public DumpHandler( Logger logger, Context ctx, Parameters params,
ServiceManager man )
- throws ContextException, ServiceException
+ public DumpHandler( Logger logger, Context context )
{
- m_Logger = logger;
- m_Context = (HttpContextService) man.lookup( "http-context" );
- m_Index = params.getParameterAsInteger( "handler-index", -1 );
- String name = (String) ctx.get( "urn:metro:name" );
+ m_logger = logger;
+ m_context = context.getHttpContext();
+ m_index = context.getHandlerIndex( -1 );
+ String name = context.getName();
setName( name );
}

public void start()
throws Exception
{
- if( m_Index >= 0 )
- m_Context.addHandler( m_Index, this );
+ if( m_index >= 0 )
+ {
+ m_context.addHandler( m_index, this );
+ }
else
- m_Context.addHandler( this );
- if( m_Logger.isDebugEnabled() )
- m_Logger.debug( "Starting DumpHandler: " + this );
- if( ! isStarted() )
+ {
+ m_context.addHandler( this );
+ }
+ if( m_logger.isDebugEnabled() )
+ {
+ m_logger.debug( "Starting DumpHandler: " + this );
+ }
+ if( false == isStarted() )
+ {
super.start();
+ }
}

public void stop()
throws InterruptedException
{
- if( m_Logger.isDebugEnabled() )
- m_Logger.debug( "Stopping DumpHandler: " + this );
+ if( m_logger.isDebugEnabled() )
+ {
+ m_logger.debug( "Stopping DumpHandler: " + this );
+ }
if( isStarted() )
+ {
super.stop();
- m_Context.removeHandler( this );
+ }
+ m_context.removeHandler( this );
}
}




  • svn commit: r2876 - development/main/test/components/http/impl/src/main/net/dpml/http/impl, mcconnell, 06/17/2005

Archive powered by MHonArc 2.6.24.

Top of Page