Skip to Content.
Sympa Menu

notify-dpml - svn commit: r2879 - 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: r2879 - development/main/test/components/http/impl/src/main/net/dpml/http/impl
  • Date: Fri, 17 Jun 2005 16:33:49 -0400

Author: mcconnell AT dpml.net
Date: Fri Jun 17 16:33:49 2005
New Revision: 2879

Modified:

development/main/test/components/http/impl/src/main/net/dpml/http/impl/ForwardHandler.java
Log:
updating to FT

Modified:
development/main/test/components/http/impl/src/main/net/dpml/http/impl/ForwardHandler.java
==============================================================================
---
development/main/test/components/http/impl/src/main/net/dpml/http/impl/ForwardHandler.java
(original)
+++
development/main/test/components/http/impl/src/main/net/dpml/http/impl/ForwardHandler.java
Fri Jun 17 16:33:49 2005
@@ -16,21 +16,10 @@
package net.dpml.http.impl;

import net.dpml.activity.Startable;
-import net.dpml.configuration.Configurable;
import net.dpml.configuration.Configuration;
import net.dpml.configuration.ConfigurationException;
-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-forward-handler" lifestyle="singleton"
@@ -38,8 +27,17 @@
*/
public class ForwardHandler
extends org.mortbay.http.handler.ForwardHandler
- implements Startable, Configurable
+ implements Startable
{
+ public interface Context
+ {
+ HttpContextService getHttpContext();
+ int getHandlerIndex( int value );
+ String getName();
+ String getRootForward( String value );
+ boolean getHandleQueries( boolean value );
+ }
+
private Logger m_logger;
private HttpContextService m_context;
private int m_index;
@@ -51,27 +49,24 @@
* @metro.dependency type="net.dpml.http.HttpContextService"
* key="http-context"
*/
- public ForwardHandler(Logger logger, Context ctx, Parameters params,
ServiceManager man)
- throws ContextException, ServiceException
+ public ForwardHandler(Logger logger, Context context, Configuration conf
)
+ throws ConfigurationException
{
m_logger = logger;
- 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 rootForward = params.getParameter( "root-forward", null );
+ String rootForward = context.getRootForward( null );
if( rootForward != null )
+ {
setRootForward( rootForward );
+ }

- boolean queries = params.getParameterAsBoolean( "handle-queries",
false );
+ boolean queries = context.getHandleQueries( false );
setHandleQueries( queries );
- m_context = (HttpContextService) man.lookup( "http-context" );
- }

- public void configure( Configuration conf )
- throws ConfigurationException
- {
Configuration child = conf.getChild( "forwards" );
configureForwards( child );
}
@@ -96,22 +91,34 @@
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 ForwardHandler: " + this );
+ }
if( ! isStarted() )
+ {
super.start();
+ }
}

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



  • svn commit: r2879 - 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