notify-dpml AT lists.ibiblio.org
Subject: DPML Notify
List archive
svn commit: r2880 - development/main/test/components/http/impl/src/main/net/dpml/http/impl
- From: mcconnell AT dpml.net
- To: notify-dpml AT lists.ibiblio.org
- Subject: svn commit: r2880 - development/main/test/components/http/impl/src/main/net/dpml/http/impl
- Date: Fri, 17 Jun 2005 16:38:23 -0400
Author: mcconnell AT dpml.net
Date: Fri Jun 17 16:38:23 2005
New Revision: 2880
Modified:
development/main/test/components/http/impl/src/main/net/dpml/http/impl/HTAccessHandler.java
Log:
updating to FT
Modified:
development/main/test/components/http/impl/src/main/net/dpml/http/impl/HTAccessHandler.java
==============================================================================
---
development/main/test/components/http/impl/src/main/net/dpml/http/impl/HTAccessHandler.java
(original)
+++
development/main/test/components/http/impl/src/main/net/dpml/http/impl/HTAccessHandler.java
Fri Jun 17 16:38:23 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-htaccess-handler" lifestyle="singleton"
@@ -37,56 +27,74 @@
extends org.mortbay.http.handler.HTAccessHandler
implements Startable
{
+ public interface Context
+ {
+ HttpContextService getHttpContext();
+ int getHandlerIndex( int value );
+ String getName();
+ String getDefaultAccess( String value );
+ String getAccessFile( String 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 HTAccessHandler( Logger logger, Context ctx, Parameters params,
ServiceManager man)
- throws ContextException, ServiceException
+ public HTAccessHandler( Logger logger, Context context )
{
m_logger = logger;
- m_context = (HttpContextService) man.lookup( "http-context" );
- String name = (String) ctx.get( "urn:metro:name" );
+ m_context = context.getHttpContext();
+ m_index = context.getHandlerIndex( -1 );
+ String name = context.getName();
setName( name );
- m_index = params.getParameterAsInteger( "handler-index", -1 );
-
- String defaultAccess = params.getParameter( "default-access", null );
+ String defaultAccess = context.getDefaultAccess( null );
if( defaultAccess != null )
+ {
setDefault( defaultAccess );
+ }
- String filename = params.getParameter( "access-file", null );
+ String filename = context.getAccessFile( null );
if( filename != null )
+ {
setAccessFile( filename );
+ }
}
public void start()
throws Exception
{
if( m_index >= 0 )
+ {
m_context.addHandler( m_index, this );
+ }
else
+ {
m_context.addHandler( this );
+ }
if( m_logger.isDebugEnabled() )
+ {
m_logger.debug( "Starting HTAccessHandler: " + this );
+ }
if( ! isStarted() )
+ {
super.start();
+ }
}
public void stop()
throws InterruptedException
{
if( m_logger.isDebugEnabled() )
+ {
m_logger.debug( "Stopping HTAccessHandler: " + this );
+ }
if( isStarted() )
+ {
super.stop();
+ }
m_context.removeHandler( this );
}
}
- svn commit: r2880 - development/main/test/components/http/impl/src/main/net/dpml/http/impl, mcconnell, 06/17/2005
Archive powered by MHonArc 2.6.24.