Skip to Content.
Sympa Menu

notify-dpml - svn commit: r1291 - in development/main/planet/facilities/http: . blocks/context blocks/demo blocks/hash-basic blocks/hash-clientcert blocks/hash-digest blocks/hash-form blocks/server blocks/servlet blocks/static blocks/webappserver blocks/webappserver/etc/deliverables/confs examples/hangman/etc examples/hangman/etc/deliverables/confs examples/hangman/src/main/tutorial/hangman examples/hangman/src/web impl/src/main/net/dpml/http/impl

notify-dpml AT lists.ibiblio.org

Subject: DPML Notify

List archive

Chronological Thread  
  • From: niclas AT netcompartner.com
  • To: notify-dpml AT lists.ibiblio.org
  • Subject: svn commit: r1291 - in development/main/planet/facilities/http: . blocks/context blocks/demo blocks/hash-basic blocks/hash-clientcert blocks/hash-digest blocks/hash-form blocks/server blocks/servlet blocks/static blocks/webappserver blocks/webappserver/etc/deliverables/confs examples/hangman/etc examples/hangman/etc/deliverables/confs examples/hangman/src/main/tutorial/hangman examples/hangman/src/web impl/src/main/net/dpml/http/impl
  • Date: Sat, 25 Dec 2004 23:25:12 +0100

Author: niclas
Date: Sat Dec 25 23:25:12 2004
New Revision: 1291

Modified:
development/main/planet/facilities/http/blocks/context/build.xml
development/main/planet/facilities/http/blocks/demo/build.xml
development/main/planet/facilities/http/blocks/hash-basic/build.xml
development/main/planet/facilities/http/blocks/hash-clientcert/build.xml
development/main/planet/facilities/http/blocks/hash-digest/build.xml
development/main/planet/facilities/http/blocks/hash-form/build.xml
development/main/planet/facilities/http/blocks/server/build.xml
development/main/planet/facilities/http/blocks/servlet/build.xml
development/main/planet/facilities/http/blocks/static/build.xml
development/main/planet/facilities/http/blocks/webappserver/build.xml

development/main/planet/facilities/http/blocks/webappserver/etc/deliverables/confs/webapp-defaults.conf

development/main/planet/facilities/http/examples/hangman/etc/deliverables/confs/webapp.conf
development/main/planet/facilities/http/examples/hangman/etc/web.xml

development/main/planet/facilities/http/examples/hangman/src/main/tutorial/hangman/Home.java

development/main/planet/facilities/http/examples/hangman/src/main/tutorial/hangman/Visit.java
development/main/planet/facilities/http/examples/hangman/src/web/index.html

development/main/planet/facilities/http/impl/src/main/net/dpml/http/impl/Ajp13Listener.java

development/main/planet/facilities/http/impl/src/main/net/dpml/http/impl/ClientCertAuthenticator.java

development/main/planet/facilities/http/impl/src/main/net/dpml/http/impl/DumpHandler.java

development/main/planet/facilities/http/impl/src/main/net/dpml/http/impl/ErrorPageHandler.java

development/main/planet/facilities/http/impl/src/main/net/dpml/http/impl/ExpiryHandler.java

development/main/planet/facilities/http/impl/src/main/net/dpml/http/impl/FormAuthenticator.java

development/main/planet/facilities/http/impl/src/main/net/dpml/http/impl/ForwardHandler.java

development/main/planet/facilities/http/impl/src/main/net/dpml/http/impl/HTAccessHandler.java

development/main/planet/facilities/http/impl/src/main/net/dpml/http/impl/HashSessionManager.java

development/main/planet/facilities/http/impl/src/main/net/dpml/http/impl/HashUserRealm.java

development/main/planet/facilities/http/impl/src/main/net/dpml/http/impl/HttpContextImpl.java

development/main/planet/facilities/http/impl/src/main/net/dpml/http/impl/HttpServerImpl.java

development/main/planet/facilities/http/impl/src/main/net/dpml/http/impl/IPAccessHandler.java

development/main/planet/facilities/http/impl/src/main/net/dpml/http/impl/JaasUserRealm.java

development/main/planet/facilities/http/impl/src/main/net/dpml/http/impl/JsseListener.java

development/main/planet/facilities/http/impl/src/main/net/dpml/http/impl/ModelHandler.java

development/main/planet/facilities/http/impl/src/main/net/dpml/http/impl/MsieSslHandler.java

development/main/planet/facilities/http/impl/src/main/net/dpml/http/impl/NcsaRequestLog.java

development/main/planet/facilities/http/impl/src/main/net/dpml/http/impl/NotFoundHandler.java

development/main/planet/facilities/http/impl/src/main/net/dpml/http/impl/NullHandler.java

development/main/planet/facilities/http/impl/src/main/net/dpml/http/impl/ProxyHandler.java

development/main/planet/facilities/http/impl/src/main/net/dpml/http/impl/ResourceHandler.java

development/main/planet/facilities/http/impl/src/main/net/dpml/http/impl/RootNotFoundHandler.java

development/main/planet/facilities/http/impl/src/main/net/dpml/http/impl/SecurityHandler.java

development/main/planet/facilities/http/impl/src/main/net/dpml/http/impl/ServletHandler.java

development/main/planet/facilities/http/impl/src/main/net/dpml/http/impl/SetResponseHeadersHandler.java

development/main/planet/facilities/http/impl/src/main/net/dpml/http/impl/SocketListener.java

development/main/planet/facilities/http/impl/src/main/net/dpml/http/impl/SystemMimeTypes.java

development/main/planet/facilities/http/impl/src/main/net/dpml/http/impl/WebApplicationContext.java
development/main/planet/facilities/http/index.xml
Log:
Cleaning up and re-arrangements for Jetty 5.1

Modified: development/main/planet/facilities/http/blocks/context/build.xml
==============================================================================
--- development/main/planet/facilities/http/blocks/context/build.xml
(original)
+++ development/main/planet/facilities/http/blocks/context/build.xml Sat
Dec 25 23:25:12 2004
@@ -23,26 +23,26 @@

<target name="build" depends="standard.build">
<x:block name="default-context">
- <x:component name="context" class="net.dpml.http.impl.HttpContextImpl"
/>
- <x:component name="security-handler"
class="net.dpml.http.impl.SecurityHandler" />
+ <x:component name="context" class="net.dpml.http.impl.HttpContextImpl"
activation="startup" />
+ <x:component name="security-handler"
class="net.dpml.http.impl.SecurityHandler" activation="startup" />

- <x:component name="resource-handler"
class="net.dpml.http.impl.ResourceHandler" >
+ <x:component name="resource-handler"
class="net.dpml.http.impl.ResourceHandler" activation="startup" >
<x:parameters>
<x:parameter name="allow-directory" value="true" />
<x:parameter name="allow-methods" value="GET" />
</x:parameters>
</x:component>

- <x:component name="notfound-handler"
class="net.dpml.http.impl.NotFoundHandler" />
+ <x:component name="notfound-handler"
class="net.dpml.http.impl.NotFoundHandler" activation="startup" />

- <x:component name="errorpage-handler"
class="net.dpml.http.impl.ErrorPageHandler" >
+ <x:component name="errorpage-handler"
class="net.dpml.http.impl.ErrorPageHandler" activation="startup" >
<x:parameters>
<x:parameter name="login-page" value="/login.html" />
<x:parameter name="error-page" value="/login_error.html" />
</x:parameters>
</x:component>

- <x:component name="request-log"
class="net.dpml.http.impl.NcsaRequestLog" >
+ <x:component name="request-log"
class="net.dpml.http.impl.NcsaRequestLog" activation="startup" >
<x:parameters>
<x:parameter name="filename" value="logs/request.log" />
<x:parameter name="append" value="true" />

Modified: development/main/planet/facilities/http/blocks/demo/build.xml
==============================================================================
--- development/main/planet/facilities/http/blocks/demo/build.xml
(original)
+++ development/main/planet/facilities/http/blocks/demo/build.xml Sat
Dec 25 23:25:12 2004
@@ -33,7 +33,7 @@
<x:block name="demo">
<x:include name="server" uri="${server.uri}"/>
<x:include name="static-context" uri="${static.uri}"/>
- <x:component name="hello" class="net.dpml.playground.HelloComponent"/>
+ <x:component name="hello" class="net.dpml.playground.HelloComponent"
activation="startup" />
<x:include name="authentication" uri="${hash.uri}"/>
</x:block>


Modified: development/main/planet/facilities/http/blocks/hash-basic/build.xml
==============================================================================
--- development/main/planet/facilities/http/blocks/hash-basic/build.xml
(original)
+++ development/main/planet/facilities/http/blocks/hash-basic/build.xml Sat
Dec 25 23:25:12 2004
@@ -23,13 +23,13 @@

<target name="build" depends="standard.build">
<x:block name="hash-basic-auth">
- <x:component name="realm" class="net.dpml.http.impl.HashUserRealm" >
+ <x:component name="realm" class="net.dpml.http.impl.HashUserRealm"
activation="startup" >
<x:parameters>
<x:parameter name="name" value="default" />
<x:parameter name="filename" value="conf/default-realm" />
</x:parameters>
</x:component>
- <x:component name="authenticator"
class="org.mortbay.http.BasicAuthenticator" />
+ <x:component name="authenticator"
class="org.mortbay.http.BasicAuthenticator" activation="startup" />
</x:block>
</target>


Modified:
development/main/planet/facilities/http/blocks/hash-clientcert/build.xml
==============================================================================
--- development/main/planet/facilities/http/blocks/hash-clientcert/build.xml
(original)
+++ development/main/planet/facilities/http/blocks/hash-clientcert/build.xml
Sat Dec 25 23:25:12 2004
@@ -23,13 +23,13 @@

<target name="build" depends="standard.build">
<x:block name="hash-clientcert-auth">
- <x:component name="realm" class="net.dpml.http.impl.HashUserRealm" >
+ <x:component name="realm" class="net.dpml.http.impl.HashUserRealm"
activation="startup" >
<x:parameters>
<x:parameter name="name" value="default" />
<x:parameter name="filename" value="conf/default-realm" />
</x:parameters>
</x:component>
- <x:component name="authenticator"
class="net.dpml.http.impl.ClientCertAuthenticator" />
+ <x:component name="authenticator"
class="net.dpml.http.impl.ClientCertAuthenticator" activation="startup" />
</x:block>
</target>


Modified: development/main/planet/facilities/http/blocks/hash-digest/build.xml
==============================================================================
--- development/main/planet/facilities/http/blocks/hash-digest/build.xml
(original)
+++ development/main/planet/facilities/http/blocks/hash-digest/build.xml
Sat Dec 25 23:25:12 2004
@@ -23,13 +23,13 @@

<target name="build" depends="standard.build">
<x:block name="hash-digest-auth">
- <x:component name="realm" class="net.dpml.http.impl.HashUserRealm" >
+ <x:component name="realm" class="net.dpml.http.impl.HashUserRealm"
activation="startup" >
<x:parameters>
<x:parameter name="name" value="default" />
<x:parameter name="filename" value="conf/default-realm" />
</x:parameters>
</x:component>
- <x:component name="authenticator"
class="org.mortbay.http.DigestAuthenticator" />
+ <x:component name="authenticator"
class="org.mortbay.http.DigestAuthenticator" activation="startup" />
</x:block>
</target>


Modified: development/main/planet/facilities/http/blocks/hash-form/build.xml
==============================================================================
--- development/main/planet/facilities/http/blocks/hash-form/build.xml
(original)
+++ development/main/planet/facilities/http/blocks/hash-form/build.xml Sat
Dec 25 23:25:12 2004
@@ -23,13 +23,13 @@

<target name="build" depends="standard.build">
<x:block name="hash-form-auth">
- <x:component name="realm" class="net.dpml.http.impl.HashUserRealm" >
+ <x:component name="realm" class="net.dpml.http.impl.HashUserRealm"
activation="startup" >
<x:parameters>
<x:parameter name="name" value="default" />
<x:parameter name="filename" value="conf/default-realm" />
</x:parameters>
</x:component>
- <x:component name="authenticator"
class="net.dpml.http.impl.FormAuthenticator" >
+ <x:component name="authenticator"
class="net.dpml.http.impl.FormAuthenticator" activation="startup" >
<x:parameters>
<x:parameter name="login-page" value="/login.html" />
<x:parameter name="error-page" value="/login_error.html" />

Modified: development/main/planet/facilities/http/blocks/server/build.xml
==============================================================================
--- development/main/planet/facilities/http/blocks/server/build.xml
(original)
+++ development/main/planet/facilities/http/blocks/server/build.xml Sat
Dec 25 23:25:12 2004
@@ -24,9 +24,9 @@
<target name="build" depends="standard.build">
<x:block name="http-server">
<x:service type="net.dpml.http.HttpService" source="httpserver"/>
- <x:component name="socketlistener"
class="net.dpml.http.impl.SocketListener" />
- <x:component name="ssllistener"
class="net.dpml.http.impl.JsseListener" />
- <x:component name="httpserver"
class="net.dpml.http.impl.HttpServerImpl" />
+ <x:component name="socketlistener"
class="net.dpml.http.impl.SocketListener" activation="startup" />
+ <x:component name="ssllistener"
class="net.dpml.http.impl.JsseListener" activation="startup" />
+ <x:component name="httpserver"
class="net.dpml.http.impl.HttpServerImpl" activation="startup" />
</x:block>
</target>


Modified: development/main/planet/facilities/http/blocks/servlet/build.xml
==============================================================================
--- development/main/planet/facilities/http/blocks/servlet/build.xml
(original)
+++ development/main/planet/facilities/http/blocks/servlet/build.xml Sat
Dec 25 23:25:12 2004
@@ -23,17 +23,17 @@

<target name="build" depends="standard.build">
<x:block name="servlet">
- <x:component name="context"
class="net.dpml.http.impl.HttpContextImpl"/>
- <x:component name="security-handler"
class="net.dpml.http.impl.SecurityHandler"/>
- <x:component name="servlets" class="net.dpml.http.impl.ServletHandler"
/>
- <x:component name="resource-handler"
class="net.dpml.http.impl.ResourceHandler">
+ <x:component name="context" class="net.dpml.http.impl.HttpContextImpl"
activation="startup" />
+ <x:component name="security-handler"
class="net.dpml.http.impl.SecurityHandler" activation="startup" />
+ <x:component name="servlets" class="net.dpml.http.impl.ServletHandler"
activation="startup" />
+ <x:component name="resource-handler"
class="net.dpml.http.impl.ResourceHandler" activation="startup" >
<x:parameters>
<x:parameter name="allow-directory" value="true"/>
<x:parameter name="allow-methods" value="GET"/>
</x:parameters>
</x:component>
- <x:component name="notfound-handler"
class="net.dpml.http.impl.NotFoundHandler"/>
- <x:component name="request-log"
class="net.dpml.http.impl.NcsaRequestLog">
+ <x:component name="notfound-handler"
class="net.dpml.http.impl.NotFoundHandler" activation="startup" />
+ <x:component name="request-log"
class="net.dpml.http.impl.NcsaRequestLog" activation="startup" >
<x:parameters>
<x:parameter name="filename" value="static_request.log"/>
<x:parameter name="append" value="true"/>

Modified: development/main/planet/facilities/http/blocks/static/build.xml
==============================================================================
--- development/main/planet/facilities/http/blocks/static/build.xml
(original)
+++ development/main/planet/facilities/http/blocks/static/build.xml Sat
Dec 25 23:25:12 2004
@@ -23,17 +23,17 @@

<target name="build" depends="standard.build">
<x:block name="static">
- <x:component name="context"
class="net.dpml.http.impl.HttpContextImpl"/>
- <x:component name="security-handler"
class="net.dpml.http.impl.SecurityHandler"/>
- <x:component name="resource-handler"
class="net.dpml.http.impl.ResourceHandler">
+ <x:component name="context" class="net.dpml.http.impl.HttpContextImpl"
activation="startup" />
+ <x:component name="security-handler"
class="net.dpml.http.impl.SecurityHandler" activation="startup" />
+ <x:component name="resource-handler"
class="net.dpml.http.impl.ResourceHandler" activation="startup" >
<x:parameters>
<x:parameter name="allow-directory" value="true"/>
<x:parameter name="allow-methods" value="GET"/>
</x:parameters>
</x:component>
- <x:component name="forward-handler"
class="net.dpml.http.impl.ForwardHandler"/>
- <x:component name="notfound-handler"
class="net.dpml.http.impl.NotFoundHandler"/>
- <x:component name="request-log"
class="net.dpml.http.impl.NcsaRequestLog">
+ <x:component name="forward-handler"
class="net.dpml.http.impl.ForwardHandler" activation="startup" />
+ <x:component name="notfound-handler"
class="net.dpml.http.impl.NotFoundHandler" activation="startup" />
+ <x:component name="request-log"
class="net.dpml.http.impl.NcsaRequestLog" activation="startup" >
<x:parameters>
<x:parameter name="filename" value="static_request.log"/>
<x:parameter name="append" value="true"/>

Modified:
development/main/planet/facilities/http/blocks/webappserver/build.xml
==============================================================================
--- development/main/planet/facilities/http/blocks/webappserver/build.xml
(original)
+++ development/main/planet/facilities/http/blocks/webappserver/build.xml
Sat Dec 25 23:25:12 2004
@@ -29,27 +29,9 @@
<x:block name="webapp">
<x:include name="server" uri="${server.uri}"/>

- <x:component name="context"
class="net.dpml.http.impl.WebApplicationContext" />
-<!-- Part of WebContext ??
- <x:component name="security-handler"
class="net.dpml.http.impl.SecurityHandler" />
-
- <x:component name="resource-handler"
class="net.dpml.http.impl.ResourceHandler" >
- <x:parameters>
- <x:parameter name="allow-directory" value="true" />
- <x:parameter name="allow-methods" value="GET" />
- </x:parameters>
- </x:component>
-
- <x:component name="notfound-handler"
class="net.dpml.http.impl.NotFoundHandler" />
-
- <x:component name="errorpage-handler"
class="net.dpml.http.impl.ErrorPageHandler" >
- <x:parameters>
- <x:parameter name="login-page" value="/login.html" />
- <x:parameter name="error-page" value="/login_error.html" />
- </x:parameters>
- </x:component>
--->
- <x:component name="request-log"
class="net.dpml.http.impl.NcsaRequestLog" >
+ <x:component name="context"
class="net.dpml.http.impl.WebApplicationContext" activation="startup" />
+
+ <x:component name="request-log"
class="net.dpml.http.impl.NcsaRequestLog" activation="startup" >
<x:parameters>
<x:parameter name="filename" value="logs/request.log" />
<x:parameter name="append" value="true" />

Modified:
development/main/planet/facilities/http/blocks/webappserver/etc/deliverables/confs/webapp-defaults.conf
==============================================================================
---
development/main/planet/facilities/http/blocks/webappserver/etc/deliverables/confs/webapp-defaults.conf
(original)
+++
development/main/planet/facilities/http/blocks/webappserver/etc/deliverables/confs/webapp-defaults.conf
Sat Dec 25 23:25:12 2004
@@ -1,34 +1,32 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE web-app PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application
2.3//EN" "http://java.sun.com/dtd/web-app_2_3.dtd";>
+<?xml version="1.0" encoding="ISO-8859-1"?>

<!-- =====================================================================
-->
<!-- This file contains the default descriptor for web applications.
-->
<!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
-->
-<!-- The original of this file is included as a resource in the
-->
-<!-- org.mortbay.jetty.jar file and is loaded by default for all web
-->
-<!-- applications before there own WEB-INF/web.xml file is loaded
-->
+<!-- The intent of this descriptor is to include jetty specific or common
-->
+<!-- configuration for all webapps. If a context has a webdefault.xml
-->
+<!-- descriptor, it is applied before the contexts own web.xml file
-->
+<!--
-->
+<!-- A context may be assigned a default descriptor by:
-->
+<!-- + Allowing the default defaultweb.xml to be applied
-->
+<!-- + Calling WebApplicationContext.setDefaultsDescriptor
-->
+<!-- + Passed an arg to addWebApplications
-->
+<!--
-->
+<!-- If a defaults descriptor is set, it is first looked for as a system
-->
+<!-- resource. The jetty jar contains a webdefault.xml file as a resource
-->
+<!-- at "org/mortbay/jetty/servlet/webdefault.xml". If a system resource
-->
+<!-- is not found, then a normal resource is tried, thus a filename or URL
-->
+<!-- may be used to specify an arbitrary file.
-->
<!--
-->
-<!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
-->
-<!-- THE COPY OF THIS FILE in $JETTY_HOME/etc IS NOT USED BY DEFAULT!
-->
-<!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
-->
-<!-- If the version in $JETTY_HOME/etc/ is to be used, then the
-->
-<!-- setDefaultsDescriptor method must be called on each context,
-->
-<!-- giving the location of the default web.xml file to use.
-->
-<!-- eg of setting the defaultsDescriptor in jetty.xml:
-
- <Call name="addWebApplication">
- <Arg>/mycontext</Arg>
- <Arg><SystemProperty name="jetty.home"
default=".">/webapps/mywebapp</Arg>
- <Set name="defaultsDescriptor"><SystemProperty name="jetty.home"
default="."/>/etc/webdefault.xml</Set>
- </Call>
-
-->
-<!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
-->
-
-
<!-- =====================================================================
-->
-<web-app>
+<web-app
+ xmlns="http://java.sun.com/xml/ns/j2ee";
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";
+ xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee
http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd";
+ version="2.4">
+
<description>
- Default web.xml file.
+ Default web.xml file.
This file is applied to a Web application before it's own
WEB_INF/web.xml file
</description>

@@ -59,7 +57,7 @@
<!-- ====================================================================
-->
<!-- The default servlet.
-->
<!-- This servlet, normally mapped to /, provides the handling for static
-->
- <!-- content, OPTION and TRACE methods for the context.
-->
+ <!-- content, OPTIONS and TRACE methods for the context.
-->
<!-- The following initParameters are supported:
-->
<!--
-->
<!-- acceptRanges If true, range requests and responses are
-->
@@ -112,36 +110,54 @@
<param-value>8192</param-value>
</init-param>
<load-on-startup>0</load-on-startup>
- </servlet>
-
+ </servlet>
+
<!-- ====================================================================
-->
<!-- JSP Servlet
-->
<!-- This is the jasper JSP servlet from the jakarta project
-->
- <!-- The following initParameters are supported:
-->
+ <!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
-->
+ <!-- The JSP page compiler and execution servlet, which is the mechanism
-->
+ <!-- used by Tomcat to support JSP pages. Traditionally, this servlet
-->
+ <!-- is mapped to URL patterh "*.jsp". This servlet supports the
-->
+ <!-- following initialization parameters (default values are in square
-->
+ <!-- brackets):
-->
+ <!--
-->
+ <!-- checkInterval If development is false and reloading is true,
-->
+ <!-- background compiles are enabled. checkInterval
-->
+ <!-- is the time in seconds between checks to see
-->
+ <!-- if a JSP page needs to be recompiled. [300]
-->
+ <!--
-->
+ <!-- compiler Which compiler Ant should use to compile JSP
-->
+ <!-- pages. See the Ant documenation for more
-->
+ <!-- information. [javac]
-->
+ <!--
-->
+ <!-- classdebuginfo Should the class file be compiled with
-->
+ <!-- debugging information? [true]
-->
<!--
-->
<!-- classpath What class path should I use while compiling
-->
<!-- generated servlets? [Created dynamically
-->
<!-- based on the current web application]
-->
<!--
-->
- <!-- classdebuginfo Should the class file be compiled with
-->
- <!-- debugging information? [false]
-->
+ <!-- development Is Jasper used in development mode (will check
-->
+ <!-- for JSP modification on every access)? [true]
-->
+ <!--
-->
+ <!-- enablePooling Determines whether tag handler pooling is
-->
+ <!-- enabled [true]
-->
+ <!--
-->
+ <!-- fork Tell Ant to fork compiles of JSP pages so that
-->
+ <!-- a separate JVM is used for JSP page compiles
-->
+ <!-- from the one Tomcat is running in. [true]
-->
<!--
-->
<!-- ieClassId The class-id value to be sent to Internet
-->
<!-- Explorer when using <jsp:plugin> tags.
-->
<!-- [clsid:8AD9C840-044E-11D1-B3E9-00805F499D93]
-->
<!--
-->
- <!-- jspCompilerPlugin The fully qualified class name of the JSP
-->
- <!-- compiler plug-in to be used. See below for
-->
- <!-- more information.
-->
- <!-- [Use internal JDK compiler]
-->
+ <!-- javaEncoding Java file encoding to use for generating java
-->
+ <!-- source files. [UTF8]
-->
<!--
-->
<!-- keepgenerated Should we keep the generated Java source code
-->
<!-- for each page instead of deleting it? [true]
-->
<!--
-->
- <!-- largefile Should we store the static content of JSP
-->
- <!-- pages in external data files, to reduce the
-->
- <!-- size of the generated servlets? [false]
-->
- <!--
-->
<!-- logVerbosityLevel The level of detailed messages to be produced
-->
<!-- by this servlet. Increasing levels cause the
-->
<!-- generation of more messages. Valid values are
-->
@@ -152,19 +168,48 @@
<!-- print statement per input line, to ease
-->
<!-- debugging? [false]
-->
<!--
-->
+ <!--
-->
+ <!-- reloading Should Jasper check for modified JSPs? [true]
-->
+ <!--
-->
+ <!-- suppressSmap Should the generation of SMAP info for JSR45
-->
+ <!-- debugging be suppressed? [false]
-->
+ <!--
-->
+ <!-- dumpSmap Should the SMAP info for JSR45 debugging be
-->
+ <!-- dumped to a file? [false]
-->
+ <!-- False if suppressSmap is true
-->
+ <!--
-->
<!-- scratchdir What scratch directory should we use when
-->
<!-- compiling JSP pages? [default work directory
-->
<!-- for the current web application]
-->
<!--
-->
+ <!-- tagpoolMaxSize The maximum tag handler pool size [5]
-->
+ <!--
-->
+ <!-- xpoweredBy Determines whether X-Powered-By response
-->
+ <!-- header is added by generated servlet [false]
-->
+ <!--
-->
<!-- If you wish to use Jikes to compile JSP pages:
-->
- <!-- * Set the "classpath" initialization parameter appropriately
-->
- <!-- for this web application.
-->
- <!-- * Set the "jspCompilerPlugin" initialization parameter to
-->
- <!-- "org.apache.jasper.compiler.JikesJavaCompiler".
-->
+ <!-- Set the init parameter "compiler" to "jikes". Define
-->
+ <!-- the property "-Dbuild.compiler.emacs=true" when starting Jetty
-->
+ <!-- to cause Jikes to emit error messages in a format compatible with
-->
+ <!-- Jasper.
-->
+ <!-- If you get an error reporting that jikes can't use UTF8 encoding,
-->
+ <!-- try setting the init parameter "javaEncoding" to "ISO-8859-1".
-->
<!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
-->
<servlet>
<servlet-name>jsp</servlet-name>
<servlet-class>org.apache.jasper.servlet.JspServlet</servlet-class>
+ <init-param>
+ <param-name>logVerbosityLevel</param-name>
+ <param-value>DEBUG</param-value>
+ </init-param>
+ <init-param>
+ <param-name>fork</param-name>
+ <param-value>false</param-value>
+ </init-param>
+ <init-param>
+ <param-name>xpoweredBy</param-name>
+ <param-value>false</param-value>
+ </init-param>
<load-on-startup>0</load-on-startup>
</servlet>

@@ -225,11 +270,16 @@

<!-- ====================================================================
-->
<servlet-mapping>
+ <servlet-name>jsp</servlet-name>
+ <url-pattern>*.jspx</url-pattern>
+ </servlet-mapping>
+
+ <!-- ====================================================================
-->
+ <servlet-mapping>
<servlet-name>invoker</servlet-name>
<url-pattern>/servlet/*</url-pattern>
</servlet-mapping>

-
<!-- ====================================================================
-->
<session-config>
<session-timeout>30</session-timeout>
@@ -255,4 +305,48 @@
<welcome-file>index.jsp</welcome-file>
</welcome-file-list>

+ <!-- ====================================================================
-->
+ <locale-encoding-mapping-list>
+
<locale-encoding-mapping><locale>ar</locale><encoding>ISO-8859-6</encoding></locale-encoding-mapping>
+
<locale-encoding-mapping><locale>be</locale><encoding>ISO-8859-5</encoding></locale-encoding-mapping>
+
<locale-encoding-mapping><locale>bg</locale><encoding>ISO-8859-5</encoding></locale-encoding-mapping>
+
<locale-encoding-mapping><locale>ca</locale><encoding>ISO-8859-1</encoding></locale-encoding-mapping>
+
<locale-encoding-mapping><locale>cs</locale><encoding>ISO-8859-2</encoding></locale-encoding-mapping>
+
<locale-encoding-mapping><locale>da</locale><encoding>ISO-8859-1</encoding></locale-encoding-mapping>
+
<locale-encoding-mapping><locale>de</locale><encoding>ISO-8859-1</encoding></locale-encoding-mapping>
+
<locale-encoding-mapping><locale>el</locale><encoding>ISO-8859-7</encoding></locale-encoding-mapping>
+
<locale-encoding-mapping><locale>en</locale><encoding>ISO-8859-1</encoding></locale-encoding-mapping>
+
<locale-encoding-mapping><locale>es</locale><encoding>ISO-8859-1</encoding></locale-encoding-mapping>
+
<locale-encoding-mapping><locale>et</locale><encoding>ISO-8859-1</encoding></locale-encoding-mapping>
+
<locale-encoding-mapping><locale>fi</locale><encoding>ISO-8859-1</encoding></locale-encoding-mapping>
+
<locale-encoding-mapping><locale>fr</locale><encoding>ISO-8859-1</encoding></locale-encoding-mapping>
+
<locale-encoding-mapping><locale>hr</locale><encoding>ISO-8859-2</encoding></locale-encoding-mapping>
+
<locale-encoding-mapping><locale>hu</locale><encoding>ISO-8859-2</encoding></locale-encoding-mapping>
+
<locale-encoding-mapping><locale>is</locale><encoding>ISO-8859-1</encoding></locale-encoding-mapping>
+
<locale-encoding-mapping><locale>it</locale><encoding>ISO-8859-1</encoding></locale-encoding-mapping>
+
<locale-encoding-mapping><locale>iw</locale><encoding>ISO-8859-8</encoding></locale-encoding-mapping>
+
<locale-encoding-mapping><locale>ja</locale><encoding>Shift_JIS</encoding></locale-encoding-mapping>
+
<locale-encoding-mapping><locale>ko</locale><encoding>EUC-KR</encoding></locale-encoding-mapping>

+
<locale-encoding-mapping><locale>lt</locale><encoding>ISO-8859-2</encoding></locale-encoding-mapping>
+
<locale-encoding-mapping><locale>lv</locale><encoding>ISO-8859-2</encoding></locale-encoding-mapping>
+
<locale-encoding-mapping><locale>mk</locale><encoding>ISO-8859-5</encoding></locale-encoding-mapping>
+
<locale-encoding-mapping><locale>nl</locale><encoding>ISO-8859-1</encoding></locale-encoding-mapping>
+
<locale-encoding-mapping><locale>no</locale><encoding>ISO-8859-1</encoding></locale-encoding-mapping>
+
<locale-encoding-mapping><locale>pl</locale><encoding>ISO-8859-2</encoding></locale-encoding-mapping>
+
<locale-encoding-mapping><locale>pt</locale><encoding>ISO-8859-1</encoding></locale-encoding-mapping>
+
<locale-encoding-mapping><locale>ro</locale><encoding>ISO-8859-2</encoding></locale-encoding-mapping>
+
<locale-encoding-mapping><locale>ru</locale><encoding>ISO-8859-5</encoding></locale-encoding-mapping>
+
<locale-encoding-mapping><locale>sh</locale><encoding>ISO-8859-5</encoding></locale-encoding-mapping>
+
<locale-encoding-mapping><locale>sk</locale><encoding>ISO-8859-2</encoding></locale-encoding-mapping>
+
<locale-encoding-mapping><locale>sl</locale><encoding>ISO-8859-2</encoding></locale-encoding-mapping>
+
<locale-encoding-mapping><locale>sq</locale><encoding>ISO-8859-2</encoding></locale-encoding-mapping>
+
<locale-encoding-mapping><locale>sr</locale><encoding>ISO-8859-5</encoding></locale-encoding-mapping>
+
<locale-encoding-mapping><locale>sv</locale><encoding>ISO-8859-1</encoding></locale-encoding-mapping>
+
<locale-encoding-mapping><locale>tr</locale><encoding>ISO-8859-9</encoding></locale-encoding-mapping>
+
<locale-encoding-mapping><locale>uk</locale><encoding>ISO-8859-5</encoding></locale-encoding-mapping>
+
<locale-encoding-mapping><locale>zh</locale><encoding>GB2312</encoding></locale-encoding-mapping>
+
<locale-encoding-mapping><locale>zh_TW</locale><encoding>Big5</encoding></locale-encoding-mapping>

+ </locale-encoding-mapping-list>
+
</web-app>
+

Modified:
development/main/planet/facilities/http/examples/hangman/etc/deliverables/confs/webapp.conf
==============================================================================
---
development/main/planet/facilities/http/examples/hangman/etc/deliverables/confs/webapp.conf
(original)
+++
development/main/planet/facilities/http/examples/hangman/etc/deliverables/confs/webapp.conf
Sat Dec 25 23:25:12 2004
@@ -21,7 +21,7 @@
<target path="/tapestry/server/context">
<configuration>

<web-application>artifact:war:dpml/http/examples/hangman/hangman</web-application>
- <context-path>/</context-path>
+ <context-path>/hangman</context-path>

<defaults-descriptor>artifact:conf:dpml/http/webapp-defaults</defaults-descriptor>
</configuration>
</target>

Modified: development/main/planet/facilities/http/examples/hangman/etc/web.xml
==============================================================================
--- development/main/planet/facilities/http/examples/hangman/etc/web.xml
(original)
+++ development/main/planet/facilities/http/examples/hangman/etc/web.xml
Sat Dec 25 23:25:12 2004
@@ -1,20 +1,39 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE web-app
- PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN"
- "http://java.sun.com/dtd/web-app_2_3.dtd";>
+<?xml version="1.0" encoding="ISO-8859-1"?>
+<web-app
+ xmlns="http://java.sun.com/xml/ns/j2ee";
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";
+ xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee
http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd";
+ version="2.4">

-<web-app>
<display-name>hangman</display-name>
+ <distributable/>
<servlet>
<servlet-name>hangman</servlet-name>
<servlet-class>org.apache.tapestry.ApplicationServlet</servlet-class>
<load-on-startup>1</load-on-startup>
</servlet>
+
<servlet-mapping>
<servlet-name>hangman</servlet-name>
<url-pattern>/app</url-pattern>
</servlet-mapping>
+
+ <filter>
+ <filter-name>redirect</filter-name>
+ <filter-class>org.apache.tapestry.RedirectFilter</filter-class>
+ </filter>
+
+ <filter-mapping>
+ <filter-name>redirect</filter-name>
+ <url-pattern>/</url-pattern>
+ </filter-mapping>
+
+ <session-config>
+ <session-timeout>15</session-timeout>
+ </session-config>
+
<welcome-file-list>
- <welcome-file>index.html</welcome-file>
- </welcome-file-list>
-</web-app>
+ <welcome-file>index.html</welcome-file>
+ </welcome-file-list>
+
+</web-app>
\ No newline at end of file

Modified:
development/main/planet/facilities/http/examples/hangman/src/main/tutorial/hangman/Home.java
==============================================================================
---
development/main/planet/facilities/http/examples/hangman/src/main/tutorial/hangman/Home.java
(original)
+++
development/main/planet/facilities/http/examples/hangman/src/main/tutorial/hangman/Home.java
Sat Dec 25 23:25:12 2004
@@ -3,47 +3,57 @@
import org.apache.tapestry.IRequestCycle;
import org.apache.tapestry.html.BasePage;

-public class Home extends BasePage {
+public class Home extends BasePage
+{

- public static final int EASY = 10;
- public static final int MEDIUM = 5;
- public static final int HARD = 3;
-
- private int misses = 0;
- private String error = "";
-
- public void detach() {
- misses = 0;
- error = null;
- super.detach();
- }
-
- public int getMisses() {
- return misses;
- }
-
- public void setMisses(int value) {
- misses = value;
- }
-
- public String getError() {
- return error;
- }
-
- public boolean getHasError() {
- if ((error == null) || (error.length() == 0)) {
- return (false);
- }
- return (true);
- }
-
- public void formSubmit(IRequestCycle cycle) {
- if (misses == 0) {
- error = "Please select a game difficulty.";
- return;
- }
- Visit visit = (Visit)getVisit();
- visit.startGame(misses);
- cycle.activate("Guess");
- }
-}
\ No newline at end of file
+ public static final int EASY = 10;
+ public static final int MEDIUM = 5;
+ public static final int HARD = 3;
+
+ private int misses = 0;
+ private String error = "";
+
+ public void detach()
+ {
+ misses = 0;
+ error = null;
+ super.detach();
+ }
+
+ public int getMisses()
+ {
+ return misses;
+ }
+
+ public void setMisses( int value )
+ {
+ misses = value;
+ }
+
+ public String getError()
+ {
+ return error;
+ }
+
+ public boolean getHasError()
+ {
+ if( ( error == null ) || ( error.length() == 0 ) )
+ {
+ return false;
+ }
+ return true;
+ }
+
+ public void formSubmit( IRequestCycle cycle )
+ {
+ if (misses == 0)
+ {
+ error = "Please select a game difficulty.";
+ return;
+ }
+ System.out.println( getVisit() );
+ Visit visit = (Visit) getVisit();
+ visit.startGame( misses );
+ cycle.activate( "Guess" );
+ }
+}

Modified:
development/main/planet/facilities/http/examples/hangman/src/main/tutorial/hangman/Visit.java
==============================================================================
---
development/main/planet/facilities/http/examples/hangman/src/main/tutorial/hangman/Visit.java
(original)
+++
development/main/planet/facilities/http/examples/hangman/src/main/tutorial/hangman/Visit.java
Sat Dec 25 23:25:12 2004
@@ -2,18 +2,25 @@

import java.io.Serializable;

-public class Visit implements Serializable {
- private HangmanGame oGame = null;
- public HangmanGame getGame() {
- if(oGame==null) {
- oGame=new HangmanGame();
- }
- return(oGame);
- }
- public void startGame(int iMaxMisses) {
- //We are completely resetting
- oGame=null;
- getGame();
- oGame.start(iMaxMisses);
- }
+public class Visit
+ implements Serializable
+{
+ private HangmanGame oGame = null;
+
+ public HangmanGame getGame()
+ {
+ if( oGame == null )
+ {
+ oGame=new HangmanGame();
+ }
+ return( oGame );
+ }
+
+ public void startGame(int iMaxMisses)
+ {
+ //We are completely resetting
+ oGame=null;
+ getGame();
+ oGame.start( iMaxMisses );
+ }
}

Modified:
development/main/planet/facilities/http/examples/hangman/src/web/index.html
==============================================================================
---
development/main/planet/facilities/http/examples/hangman/src/web/index.html
(original)
+++
development/main/planet/facilities/http/examples/hangman/src/web/index.html
Sat Dec 25 23:25:12 2004
@@ -4,6 +4,6 @@
<TITLE>hangman2</TITLE>
</HEADER>
<BODY>
-<P><A HREF="/hangman2/app">If you are not automatically redirected click
here</A></P>
+<P><A HREF="/hangman/app">If you are not automatically redirected click
here</A></P>
</BODY>
</HTML>

Modified:
development/main/planet/facilities/http/impl/src/main/net/dpml/http/impl/Ajp13Listener.java
==============================================================================
---
development/main/planet/facilities/http/impl/src/main/net/dpml/http/impl/Ajp13Listener.java
(original)
+++
development/main/planet/facilities/http/impl/src/main/net/dpml/http/impl/Ajp13Listener.java
Sat Dec 25 23:25:12 2004
@@ -33,28 +33,22 @@
* @metro.service type="org.mortbay.http.HttpListener"
*/
public class Ajp13Listener extends org.mortbay.http.ajp.AJP13Listener
- implements Parameterizable, Startable, Serviceable, LogEnabled,
HttpListener
+ implements Parameterizable, HttpListener, Startable
{
private HttpService m_HttpServer;
private Logger m_Logger;

- public Ajp13Listener()
- {
- }
-
/**
- * Enable the logging system.
- *
* @metro.logger name="http"
+ * @metro.dependency type="net.dpml.http.HttpService"
+ * key="server"
*/
- public void enableLogging( Logger logger )
+ public Ajp13Listener( Logger logger, ServiceManager man )
+ throws ServiceException
{
m_Logger = logger;
- }
-
- public Logger getLogger()
- {
- return m_Logger;
+ m_HttpServer = (HttpService) man.lookup( "server" );
+ m_HttpServer.addListener( this );
}

public void parameterize( Parameters params )
@@ -99,18 +93,6 @@

boolean identify = params.getParameterAsBoolean(
"identify-listener", false );
setIdentifyListener( identify );
-
-
- }
-
- /**
- * @metro.dependency type="net.dpml.http.HttpService"
- * key="server"
- */
- public void service( ServiceManager man )
- throws ServiceException
- {
- m_HttpServer = (HttpService) man.lookup( "server" );
}

public void start()
@@ -118,8 +100,8 @@
{
if( m_Logger.isDebugEnabled() )
m_Logger.debug( "Starting socket: " + this );
- m_HttpServer.addListener( this );
- super.start();
+ if( ! isStarted() )
+ super.start();
}

public void stop()
@@ -127,7 +109,8 @@
{
if( m_Logger.isDebugEnabled() )
m_Logger.debug( "Stopping socket: " + this );
- super.stop();
+ if( isStarted() )
+ super.stop();
m_HttpServer.removeListener( this );
}
}

Modified:
development/main/planet/facilities/http/impl/src/main/net/dpml/http/impl/ClientCertAuthenticator.java
==============================================================================
---
development/main/planet/facilities/http/impl/src/main/net/dpml/http/impl/ClientCertAuthenticator.java
(original)
+++
development/main/planet/facilities/http/impl/src/main/net/dpml/http/impl/ClientCertAuthenticator.java
Sat Dec 25 23:25:12 2004
@@ -25,14 +25,8 @@
* @metro.service type="org.mortbay.http.Authenticator"
*/
public class ClientCertAuthenticator extends
org.mortbay.http.ClientCertAuthenticator
- implements Parameterizable
{
- public ClientCertAuthenticator()
- {
- }
-
- public void parameterize( Parameters params )
- throws ParameterException
+ public ClientCertAuthenticator( Parameters params )
{
int maxHandshakeSec = params.getParameterAsInteger(
"max-handshake-sec", -1 );
if( maxHandshakeSec >= 0 )

Modified:
development/main/planet/facilities/http/impl/src/main/net/dpml/http/impl/DumpHandler.java
==============================================================================
---
development/main/planet/facilities/http/impl/src/main/net/dpml/http/impl/DumpHandler.java
(original)
+++
development/main/planet/facilities/http/impl/src/main/net/dpml/http/impl/DumpHandler.java
Sat Dec 25 23:25:12 2004
@@ -33,65 +33,28 @@
* @metro.component name="http-dump-handler" lifestyle="singleton"
* @metro.service type="org.mortbay.http.HttpHandler"
*/
-public class DumpHandler
- extends org.mortbay.http.handler.DumpHandler
- implements Startable, Parameterizable, LogEnabled,
- Serviceable, Contextualizable
+public class DumpHandler extends org.mortbay.http.handler.DumpHandler
+ implements Startable
{
private Logger m_Logger;
private HttpContextService m_Context;
private int m_Index;

- public DumpHandler()
- {
- }
-
/**
- * Enable the logging system.
- *
* @metro.logger name="http"
- */
- public void enableLogging( Logger logger )
- {
- m_Logger = logger;
- }
-
- public Logger getLogger()
- {
- return m_Logger;
- }
-
- /**
- * Contextulaization of the Handler.
- *
- * @param ctx the supplied listener context
- *
- * @exception ContextException if a contextualization error occurs
- *
* @metro.entry key="urn:metro:name"
* type="java.lang.String"
- */
- public void contextualize( Context ctx )
- throws ContextException
- {
- String name = (String) ctx.get( "urn:metro:name" );
- setName( name );
- }
-
- public void parameterize( Parameters params )
- throws ParameterException
- {
- m_Index = params.getParameterAsInteger( "handler-index", -1 );
- }
-
- /**
* @metro.dependency type="net.dpml.http.HttpContextService"
* key="http-context"
*/
- public void service( ServiceManager man )
- throws ServiceException
+ public DumpHandler( Logger logger, Context ctx, Parameters params,
ServiceManager man )
+ throws ContextException, ServiceException
{
+ 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" );
+ setName( name );
}

public void start()
@@ -103,7 +66,8 @@
m_Context.addHandler( this );
if( m_Logger.isDebugEnabled() )
m_Logger.debug( "Starting DumpHandler: " + this );
- super.start();
+ if( ! isStarted() )
+ super.start();
}

public void stop()
@@ -111,7 +75,8 @@
{
if( m_Logger.isDebugEnabled() )
m_Logger.debug( "Stopping DumpHandler: " + this );
- super.stop();
+ if( isStarted() )
+ super.stop();
m_Context.removeHandler( this );
}
}

Modified:
development/main/planet/facilities/http/impl/src/main/net/dpml/http/impl/ErrorPageHandler.java
==============================================================================
---
development/main/planet/facilities/http/impl/src/main/net/dpml/http/impl/ErrorPageHandler.java
(original)
+++
development/main/planet/facilities/http/impl/src/main/net/dpml/http/impl/ErrorPageHandler.java
Sat Dec 25 23:25:12 2004
@@ -35,62 +35,28 @@
*/
public class ErrorPageHandler
extends org.mortbay.http.handler.ErrorPageHandler
- implements Startable, Parameterizable, LogEnabled,
- Serviceable, Contextualizable
+ implements Startable
{
private Logger m_Logger;
private HttpContextService m_Context;
private int m_Index;

- public ErrorPageHandler()
- {
- }
-
/**
* Enable the logging system.
*
* @metro.logger name="http"
- */
- public void enableLogging( Logger logger )
- {
- m_Logger = logger;
- }
-
- public Logger getLogger()
- {
- return m_Logger;
- }
-
- /**
- * Contextulaization of the Handler.
- *
- * @param ctx the supplied listener context
- *
- * @exception ContextException if a contextualization error occurs
- *
* @metro.entry key="urn:metro:name"
* type="java.lang.String"
+ * @metro.dependency type="net.dpml.http.HttpContextService"
+ * key="http-context"
*/
- public void contextualize( Context ctx )
- throws ContextException
+ public ErrorPageHandler( Logger logger, Context ctx, Parameters params,
ServiceManager man )
+ throws ContextException, ServiceException
{
+ m_Logger = logger;
String name = (String) ctx.get( "urn:metro:name" );
setName( name );
- }
-
- public void parameterize( Parameters params )
- throws ParameterException
- {
m_Index = params.getParameterAsInteger( "handler-index", -1 );
- }
-
- /**
- * @metro.dependency type="net.dpml.http.HttpContextService"
- * key="http-context"
- */
- public void service( ServiceManager man )
- throws ServiceException
- {
m_Context = (HttpContextService) man.lookup( "http-context" );
}

@@ -103,7 +69,8 @@
m_Context.addHandler( this );
if( m_Logger.isDebugEnabled() )
m_Logger.debug( "Starting ErrorPageHandler: " + this );
- super.start();
+ if( ! isStarted() )
+ super.start();
}

public void stop()
@@ -111,7 +78,8 @@
{
if( m_Logger.isDebugEnabled() )
m_Logger.debug( "Stopping ErrorPageHandler: " + this );
- super.stop();
+ if( isStarted() )
+ super.stop();
m_Context.removeHandler( this );
}
}

Modified:
development/main/planet/facilities/http/impl/src/main/net/dpml/http/impl/ExpiryHandler.java
==============================================================================
---
development/main/planet/facilities/http/impl/src/main/net/dpml/http/impl/ExpiryHandler.java
(original)
+++
development/main/planet/facilities/http/impl/src/main/net/dpml/http/impl/ExpiryHandler.java
Sat Dec 25 23:25:12 2004
@@ -35,66 +35,29 @@
*/
public class ExpiryHandler
extends org.mortbay.http.handler.ExpiryHandler
- implements Startable, Parameterizable, LogEnabled,
- Serviceable, Contextualizable
+ implements Startable
{
private Logger m_Logger;
private HttpContextService m_Context;
private int m_Index;

- public ExpiryHandler()
- {
- }
-
/**
- * Enable the logging system.
- *
* @metro.logger name="http"
- */
- public void enableLogging( Logger logger )
- {
- m_Logger = logger;
- }
-
- public Logger getLogger()
- {
- return m_Logger;
- }
-
- /**
- * Contextulaization of the Handler.
- *
- * @param ctx the supplied listener context
- *
- * @exception ContextException if a contextualization error occurs
- *
* @metro.entry key="urn:metro:name"
* type="java.lang.String"
+ * @metro.dependency type="net.dpml.http.HttpContextService"
+ * key="http-context"
*/
- public void contextualize( Context ctx )
- throws ContextException
+ public ExpiryHandler( Logger logger, Context ctx, Parameters params,
ServiceManager man )
+ throws ContextException, ServiceException
{
+ m_Logger = logger;
String name = (String) ctx.get( "urn:metro:name" );
setName( name );
- }
-
- public void parameterize( Parameters params )
- throws ParameterException
- {
m_Index = params.getParameterAsInteger( "handler-index", -1 );
-
int ttl = params.getParameterAsInteger( "time-to-live", -1 );
if( ttl > 0 )
setTimeToLive( ttl );
- }
-
- /**
- * @metro.dependency type="net.dpml.http.HttpContextService"
- * key="http-context"
- */
- public void service( ServiceManager man )
- throws ServiceException
- {
m_Context = (HttpContextService) man.lookup( "http-context" );
}

@@ -107,7 +70,8 @@
m_Context.addHandler( this );
if( m_Logger.isDebugEnabled() )
m_Logger.debug( "Starting ExpiryHandler: " + this );
- super.start();
+ if( ! isStarted() )
+ super.start();
}

public void stop()
@@ -115,7 +79,8 @@
{
if( m_Logger.isDebugEnabled() )
m_Logger.debug( "Stopping ExpiryHandler: " + this );
- super.stop();
+ if( isStarted() )
+ super.stop();
m_Context.removeHandler( this );
}
}

Modified:
development/main/planet/facilities/http/impl/src/main/net/dpml/http/impl/FormAuthenticator.java
==============================================================================
---
development/main/planet/facilities/http/impl/src/main/net/dpml/http/impl/FormAuthenticator.java
(original)
+++
development/main/planet/facilities/http/impl/src/main/net/dpml/http/impl/FormAuthenticator.java
Sat Dec 25 23:25:12 2004
@@ -16,7 +16,6 @@
package net.dpml.http.impl;

import net.dpml.parameters.ParameterException;
-import net.dpml.parameters.Parameterizable;
import net.dpml.parameters.Parameters;

/** Wrapper for the Jetty FormAuthenticator.
@@ -25,10 +24,8 @@
* @metro.service type="org.mortbay.http.Authenticator"
*/
public class FormAuthenticator extends
org.mortbay.jetty.servlet.FormAuthenticator
- implements Parameterizable
{
- public void parameterize( Parameters params )
- throws ParameterException
+ public FormAuthenticator( Parameters params )
{
String loginPage = params.getParameter( "login-page", null );
if( loginPage != null )

Modified:
development/main/planet/facilities/http/impl/src/main/net/dpml/http/impl/ForwardHandler.java
==============================================================================
---
development/main/planet/facilities/http/impl/src/main/net/dpml/http/impl/ForwardHandler.java
(original)
+++
development/main/planet/facilities/http/impl/src/main/net/dpml/http/impl/ForwardHandler.java
Sat Dec 25 23:25:12 2004
@@ -38,52 +38,26 @@
*/
public class ForwardHandler
extends org.mortbay.http.handler.ForwardHandler
- implements Startable, Parameterizable, LogEnabled,
- Serviceable, Contextualizable, Configurable
+ implements Startable
{
private Logger m_Logger;
private HttpContextService m_Context;
private int m_Index;

- public ForwardHandler()
- {
- }
-
/**
- * Enable the logging system.
- *
* @metro.logger name="http"
- */
- public void enableLogging( Logger logger )
- {
- m_Logger = logger;
- }
-
- public Logger getLogger()
- {
- return m_Logger;
- }
-
- /**
- * Contextulaization of the Handler.
- *
- * @param ctx the supplied listener context
- *
- * @exception ContextException if a contextualization error occurs
- *
* @metro.entry key="urn:metro:name"
* type="java.lang.String"
+ * @metro.dependency type="net.dpml.http.HttpContextService"
+ * key="http-context"
*/
- public void contextualize( Context ctx )
- throws ContextException
+ public ForwardHandler(Logger logger, Context ctx, Parameters params,
ServiceManager man)
+ throws ContextException, ServiceException
{
+ m_Logger = logger;
String name = (String) ctx.get( "urn:metro:name" );
setName( name );
- }
-
- public void parameterize( Parameters params )
- throws ParameterException
- {
+
m_Index = params.getParameterAsInteger( "handler-index", -1 );

String rootForward = params.getParameter( "root-forward", null );
@@ -92,6 +66,7 @@

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

public void configure( Configuration conf )
@@ -117,16 +92,6 @@
addForward( oldPath.getValue(), newPath.getValue() );
}

- /**
- * @metro.dependency type="net.dpml.http.HttpContextService"
- * key="http-context"
- */
- public void service( ServiceManager man )
- throws ServiceException
- {
- m_Context = (HttpContextService) man.lookup( "http-context" );
- }
-
public void start()
throws Exception
{
@@ -136,7 +101,8 @@
m_Context.addHandler( this );
if( m_Logger.isDebugEnabled() )
m_Logger.debug( "Starting ForwardHandler: " + this );
- super.start();
+ if( ! isStarted() )
+ super.start();
}

public void stop()
@@ -144,7 +110,8 @@
{
if( m_Logger.isDebugEnabled() )
m_Logger.debug( "Stopping ForwardHandler: " + this );
- super.stop();
+ if( isStarted() )
+ super.stop();
m_Context.removeHandler( this );
}
}

Modified:
development/main/planet/facilities/http/impl/src/main/net/dpml/http/impl/HTAccessHandler.java
==============================================================================
---
development/main/planet/facilities/http/impl/src/main/net/dpml/http/impl/HTAccessHandler.java
(original)
+++
development/main/planet/facilities/http/impl/src/main/net/dpml/http/impl/HTAccessHandler.java
Sat Dec 25 23:25:12 2004
@@ -35,52 +35,27 @@
*/
public class HTAccessHandler
extends org.mortbay.http.handler.HTAccessHandler
- implements Startable, Parameterizable, LogEnabled,
- Serviceable, Contextualizable
+ implements Startable
{
private Logger m_Logger;
private HttpContextService m_Context;
private int m_Index;

- public HTAccessHandler()
- {
- }
-
/**
- * Enable the logging system.
- *
* @metro.logger name="http"
- */
- public void enableLogging( Logger logger )
- {
- m_Logger = logger;
- }
-
- public Logger getLogger()
- {
- return m_Logger;
- }
-
- /**
- * Contextulaization of the Handler.
- *
- * @param ctx the supplied listener context
- *
- * @exception ContextException if a contextualization error occurs
- *
* @metro.entry key="urn:metro:name"
* type="java.lang.String"
+ * @metro.dependency type="net.dpml.http.HttpContextService"
+ * key="http-context"
*/
- public void contextualize( Context ctx )
- throws ContextException
+ public HTAccessHandler( Logger logger, Context ctx, Parameters params,
ServiceManager man)
+ throws ContextException, ServiceException
{
+ m_Logger = logger;
+ m_Context = (HttpContextService) man.lookup( "http-context" );
String name = (String) ctx.get( "urn:metro:name" );
setName( name );
- }
-
- public void parameterize( Parameters params )
- throws ParameterException
- {
+
m_Index = params.getParameterAsInteger( "handler-index", -1 );

String defaultAccess = params.getParameter( "default-access", null );
@@ -92,16 +67,6 @@
setAccessFile( filename );
}

- /**
- * @metro.dependency type="net.dpml.http.HttpContextService"
- * key="http-context"
- */
- public void service( ServiceManager man )
- throws ServiceException
- {
- m_Context = (HttpContextService) man.lookup( "http-context" );
- }
-
public void start()
throws Exception
{
@@ -111,7 +76,8 @@
m_Context.addHandler( this );
if( m_Logger.isDebugEnabled() )
m_Logger.debug( "Starting HTAccessHandler: " + this );
- super.start();
+ if( ! isStarted() )
+ super.start();
}

public void stop()
@@ -119,7 +85,8 @@
{
if( m_Logger.isDebugEnabled() )
m_Logger.debug( "Stopping HTAccessHandler: " + this );
- super.stop();
+ if( isStarted() )
+ super.stop();
m_Context.removeHandler( this );
}
}

Modified:
development/main/planet/facilities/http/impl/src/main/net/dpml/http/impl/HashSessionManager.java
==============================================================================
---
development/main/planet/facilities/http/impl/src/main/net/dpml/http/impl/HashSessionManager.java
(original)
+++
development/main/planet/facilities/http/impl/src/main/net/dpml/http/impl/HashSessionManager.java
Sat Dec 25 23:25:12 2004
@@ -15,6 +15,7 @@
*/
package net.dpml.http.impl;

+import net.dpml.activity.Startable;
import net.dpml.parameters.ParameterException;
import net.dpml.parameters.Parameterizable;
import net.dpml.parameters.Parameters;
@@ -25,11 +26,10 @@
*/
public class HashSessionManager
extends org.mortbay.jetty.servlet.HashSessionManager
- implements Parameterizable
+ implements Startable
{

- public void parameterize( Parameters params )
- throws ParameterException
+ public HashSessionManager( Parameters params )
{
int maxInactiveInterval = params.getParameterAsInteger(
"max-inactive-interval", -1 );
if( maxInactiveInterval >= 0 )

Modified:
development/main/planet/facilities/http/impl/src/main/net/dpml/http/impl/HashUserRealm.java
==============================================================================
---
development/main/planet/facilities/http/impl/src/main/net/dpml/http/impl/HashUserRealm.java
(original)
+++
development/main/planet/facilities/http/impl/src/main/net/dpml/http/impl/HashUserRealm.java
Sat Dec 25 23:25:12 2004
@@ -26,13 +26,8 @@
* @metro.service type="org.mortbay.http.UserRealm"
*/
public class HashUserRealm extends org.mortbay.http.HashUserRealm
- implements Parameterizable
{
- public HashUserRealm()
- {
- }
-
- public void parameterize( Parameters params )
+ public HashUserRealm( Parameters params )
throws ParameterException
{
String realmName = params.getParameter( "name" );

Modified:
development/main/planet/facilities/http/impl/src/main/net/dpml/http/impl/HttpContextImpl.java
==============================================================================
---
development/main/planet/facilities/http/impl/src/main/net/dpml/http/impl/HttpContextImpl.java
(original)
+++
development/main/planet/facilities/http/impl/src/main/net/dpml/http/impl/HttpContextImpl.java
Sat Dec 25 23:25:12 2004
@@ -43,41 +43,24 @@
* @metro.service type="net.dpml.http.HttpContextService"
*/
public class HttpContextImpl extends HttpContext
- implements LogEnabled, Contextualizable, Serviceable, Startable,
- Disposable, Configurable, HttpContextService
+ implements Startable, Serviceable, Disposable, Configurable,
HttpContextService
{
private HttpService m_HttpServer;
private boolean m_Graceful;
private Logger m_Logger;


- public HttpContext getHttpContext()
- {
- return this;
- }
-
- public Logger getLogger()
- {
- return m_Logger;
- }
-
/**
* @metro.logger name="http"
- */
- public void enableLogging( Logger logger )
- {
- m_Logger = logger;
- }
-
- /**
* @metro.entry key="urn:metro:temp"
* type="java.io.File"
* @metro.entry key="urn:metro:classloader"
* type="java.lang.ClassLoader"
*/
- public void contextualize( Context ctx )
+ public HttpContextImpl( Logger logger, Context ctx )
throws ContextException
{
+ m_Logger = logger;
File tmpDir = (File) ctx.get( "urn:metro:temp" );
tmpDir.mkdirs();
setTempDirectory( tmpDir );
@@ -86,6 +69,11 @@
setClassLoader( cl );
}

+ public HttpContext getHttpContext()
+ {
+ return this;
+ }
+
/**
* @metro.dependency type="net.dpml.http.HttpService"
* key="server"
@@ -215,29 +203,22 @@
addWelcomeFile( files[i].getValue() );
}

- public void start()
+ protected void doStart()
throws Exception
{
if( m_Logger.isDebugEnabled() )
m_Logger.debug( "Starting context: " + this );
m_HttpServer.addContext( this );
- super.start();
+ super.doStart();
}

- public void stop()
- throws InterruptedException
+ protected void doStop()
+ throws Exception
{
if( m_Logger.isDebugEnabled() )
m_Logger.debug( "Stopping context: " + this );
-
- // The following is need due to strange delegation between the
- // methods stop() and stop( boolean ) in the superclasses are
- // inaccurately implemented, and an endless loop will result
- // unless the isStarted() method is checked.
- if( isStarted() )
- super.stop( m_Graceful );
-
m_HttpServer.removeContext( this );
+ super.doStop();
}

public void dispose()

Modified:
development/main/planet/facilities/http/impl/src/main/net/dpml/http/impl/HttpServerImpl.java
==============================================================================
---
development/main/planet/facilities/http/impl/src/main/net/dpml/http/impl/HttpServerImpl.java
(original)
+++
development/main/planet/facilities/http/impl/src/main/net/dpml/http/impl/HttpServerImpl.java
Sat Dec 25 23:25:12 2004
@@ -23,7 +23,7 @@
import net.dpml.parameters.Parameterizable;
import net.dpml.parameters.Parameters;
import net.dpml.http.HttpService;
-import org.mortbay.http.HttpServer;
+import org.mortbay.jetty.Server;
import org.mortbay.util.MultiException;

/** Wrapper for the Jetty HttpServer
@@ -31,35 +31,20 @@
* @metro.component name="http-server" lifestyle="singleton"
* @metro.service type="net.dpml.http.HttpService"
*/
-public class HttpServerImpl extends HttpServer
- implements LogEnabled, Parameterizable, Startable, Disposable,
HttpService
+public class HttpServerImpl extends Server
+ implements Startable, Disposable, HttpService
{
- private Logger m_Logger;
+ private Logger m_Logger;
private boolean m_Graceful;


- public HttpServerImpl()
- {
- }
-
/**
- * Enable the logging system.
- *
* @metro.logger name="http"
*/
- public void enableLogging( Logger logger )
+ public HttpServerImpl(Logger logger, Parameters params)
{
m_Logger = logger;
- }
-
- public Logger getLogger()
- {
- return m_Logger;
- }
-
- public void parameterize( Parameters params )
- throws ParameterException
- {
+
boolean trace = params.getParameterAsBoolean( "trace", false );
setTrace( trace );

@@ -73,22 +58,6 @@
setRequestsPerGC( reqs );
}

- public void start()
- throws MultiException
- {
- if( m_Logger.isDebugEnabled() )
- m_Logger.debug( "Starting server: " + this );
- super.start();
- }
-
- public void stop()
- throws InterruptedException
- {
- if( m_Logger.isDebugEnabled() )
- m_Logger.debug( "Stopping server: " + this );
- super.stop( m_Graceful );
- }
-
public void dispose()
{
if( m_Logger.isDebugEnabled() )

Modified:
development/main/planet/facilities/http/impl/src/main/net/dpml/http/impl/IPAccessHandler.java
==============================================================================
---
development/main/planet/facilities/http/impl/src/main/net/dpml/http/impl/IPAccessHandler.java
(original)
+++
development/main/planet/facilities/http/impl/src/main/net/dpml/http/impl/IPAccessHandler.java
Sat Dec 25 23:25:12 2004
@@ -37,52 +37,27 @@
*/
public class IPAccessHandler
extends org.mortbay.http.handler.IPAccessHandler
- implements Startable, Parameterizable, LogEnabled,
- Serviceable, Contextualizable
+ implements Startable
{
private Logger m_Logger;
private HttpContextService m_Context;
private int m_Index;

- public IPAccessHandler()
- {
- }
-
/**
- * Enable the logging system.
- *
* @metro.logger name="http"
- */
- public void enableLogging( Logger logger )
- {
- m_Logger = logger;
- }
-
- public Logger getLogger()
- {
- return m_Logger;
- }
-
- /**
- * Contextulaization of the Handler.
- *
- * @param ctx the supplied listener context
- *
- * @exception ContextException if a contextualization error occurs
- *
* @metro.entry key="urn:metro:name"
* type="java.lang.String"
+ * @metro.dependency type="net.dpml.http.HttpContextService"
+ * key="http-context"
*/
- public void contextualize( Context ctx )
- throws ContextException
+ public IPAccessHandler(Logger logger, Context ctx, Parameters params,
ServiceManager man )
+ throws ContextException, ServiceException
{
+ m_Logger = logger;
+ m_Context = (HttpContextService) man.lookup( "http-context" );
String name = (String) ctx.get( "urn:metro:name" );
setName( name );
- }
-
- public void parameterize( Parameters params )
- throws ParameterException
- {
+
m_Index = params.getParameterAsInteger( "handler-index", -1 );

String standard = params.getParameter( "standard-action", null );
@@ -109,16 +84,6 @@
setDenyIP( deny[i].getValue() );
}

- /**
- * @metro.dependency type="net.dpml.http.HttpContextService"
- * key="http-context"
- */
- public void service( ServiceManager man )
- throws ServiceException
- {
- m_Context = (HttpContextService) man.lookup( "http-context" );
- }
-
public void start()
throws Exception
{
@@ -128,7 +93,8 @@
m_Context.addHandler( this );
if( m_Logger.isDebugEnabled() )
m_Logger.debug( "Starting IPAccessHandler: " + this );
- super.start();
+ if( ! isStarted() )
+ super.start();
}

public void stop()
@@ -136,9 +102,8 @@
{
if( m_Logger.isDebugEnabled() )
m_Logger.debug( "Stopping IPAccessHandler: " + this );
- super.stop();
+ if( isStarted() )
+ super.stop();
m_Context.removeHandler( this );
}
}
-
-

Modified:
development/main/planet/facilities/http/impl/src/main/net/dpml/http/impl/JaasUserRealm.java
==============================================================================
---
development/main/planet/facilities/http/impl/src/main/net/dpml/http/impl/JaasUserRealm.java
(original)
+++
development/main/planet/facilities/http/impl/src/main/net/dpml/http/impl/JaasUserRealm.java
Sat Dec 25 23:25:12 2004
@@ -25,13 +25,8 @@
* @metro.service type="org.mortbay.http.UserRealm"
*/
public class JaasUserRealm extends org.mortbay.jaas.JAASUserRealm
- implements Parameterizable
{
- public JaasUserRealm()
- {
- }
-
- public void parameterize( Parameters params )
+ public JaasUserRealm( Parameters params )
throws ParameterException
{
String realmName = params.getParameter( "name" );

Modified:
development/main/planet/facilities/http/impl/src/main/net/dpml/http/impl/JsseListener.java
==============================================================================
---
development/main/planet/facilities/http/impl/src/main/net/dpml/http/impl/JsseListener.java
(original)
+++
development/main/planet/facilities/http/impl/src/main/net/dpml/http/impl/JsseListener.java
Sat Dec 25 23:25:12 2004
@@ -35,28 +35,23 @@
* @metro.service type="org.mortbay.http.HttpListener"
*/
public class JsseListener extends org.mortbay.http.SunJsseListener
- implements Parameterizable, Startable, Serviceable, LogEnabled,
HttpListener
+ implements Parameterizable, HttpListener, Startable
{
private HttpService m_HttpServer;
private Logger m_Logger;

- public JsseListener()
- {
- }
-
/**
- * Enable the logging system.
*
* @metro.logger name="http"
+ * @metro.dependency type="net.dpml.http.HttpService"
+ * key="server"
*/
- public void enableLogging( Logger logger )
+ public JsseListener( Logger logger, ServiceManager man )
+ throws ServiceException
{
m_Logger = logger;
- }
-
- public Logger getLogger()
- {
- return m_Logger;
+ m_HttpServer = (HttpService) man.lookup( "server" );
+ m_HttpServer.addListener( this );
}

public void parameterize( Parameters params )
@@ -140,30 +135,18 @@
setPassword( password );
}

- /**
- * @metro.dependency type="net.dpml.http.HttpService"
- * key="server"
- */
- public void service( ServiceManager man )
- throws ServiceException
- {
- m_HttpServer = (HttpService) man.lookup( "server" );
- }
-
public void start()
throws Exception
{
if( m_Logger.isDebugEnabled() )
m_Logger.debug( "Starting SSL socket: " + this );
- m_HttpServer.addListener( this );
try
{
- super.start();
+ if( ! isStarted() )
+ super.start();
} catch( IOException e )
{
- // Seems to be thrown if the password can not be properly
- // resolved. Let's log, but ignore it.
- m_Logger.warn( "SSL failed to start. Probably invalid KeyStore
or incorrect password to the KeyStore." );
+ m_Logger.warn( "Unable to start SSL. Possibly missing password
to KeyStore or an invalid KeyStore." );
}
}

@@ -172,7 +155,8 @@
{
if( m_Logger.isDebugEnabled() )
m_Logger.debug( "Stopping SSL socket: " + this );
- super.stop();
+ if( isStarted() )
+ super.stop();
m_HttpServer.removeListener( this );
}
}

Modified:
development/main/planet/facilities/http/impl/src/main/net/dpml/http/impl/ModelHandler.java
==============================================================================
---
development/main/planet/facilities/http/impl/src/main/net/dpml/http/impl/ModelHandler.java
(original)
+++
development/main/planet/facilities/http/impl/src/main/net/dpml/http/impl/ModelHandler.java
Sat Dec 25 23:25:12 2004
@@ -47,8 +47,7 @@
* @metro.service type="org.mortbay.http.HttpHandler"
*/
public class ModelHandler
- implements Serviceable, Parameterizable, Contextualizable, LogEnabled,
- HttpHandler, CompositionListener, Startable, Initializable
+ implements HttpHandler, CompositionListener, Initializable, Startable
{
private Logger m_Logger;
private ContainmentModel m_Model;
@@ -62,65 +61,27 @@
private HttpRequestHandler m_HandlerComponent;
private ContainmentModel m_Container;

- public ModelHandler()
- {
- m_Started = false;
- }
-
/**
- * Enable the logging system.
- *
- * @metro.logger name="http"
- */
- public void enableLogging( Logger logger )
- {
- m_Logger = logger;
- }
-
- public Logger getLogger()
- {
- return m_Logger;
- }
-
- /**
- * Contextulaization of the listener by the container during
- * which we are supplied with the root composition model for
- * the application.
- *
- * @param ctx the supplied listener context
- *
- * @exception ContextException if a contextualization error occurs
- *
+ * @metro.logger name="http.modelhandler"
* @metro.entry key="urn:composition:containment.model"
* type="net.dpml.composition.model.ContainmentModel"
*
* @metro.entry key="urn:metro:name"
* type="java.lang.String"
- */
- public void contextualize( Context ctx )
- throws ContextException
- {
- m_Model = (ContainmentModel) ctx.get(
"urn:composition:containment.model" );
- m_Name = (String) ctx.get( "urn:metro:name" );
- }
-
- /**
* @metro.dependency type="net.dpml.http.HttpContextService"
* key="httpcontext"
*/
- public void service( ServiceManager man )
- throws ServiceException
+ public ModelHandler(Logger logger, Context ctx, Parameters params,
ServiceManager man)
+ throws ContextException, ServiceException, ParameterException
{
+ m_Logger = logger;
m_Context = (HttpContextService) man.lookup( "httpcontext" );
- }
-
- public void parameterize( Parameters params )
- throws ParameterException
- {
+ m_Started = false;
+ m_Model = (ContainmentModel) ctx.get(
"urn:composition:containment.model" );
+ m_Name = (String) ctx.get( "urn:metro:name" );
+
m_Index = params.getParameterAsInteger( "handler-index", -1 );
-
m_ContextPath = params.getParameter( "context-path", "/" );
-
m_ComponentPath = params.getParameter( "target" );
}

@@ -140,13 +101,7 @@
HttpRequest request, HttpResponse response )
throws IOException
{
- getLogger().info( "ModelHandler arg1: " + pathInContext + ", " +
pathParams );
- getLogger().info( "ModelHandler arg2: " + request.getPath() );
-
- getLogger().info( "ModelHandler ContextPath: " + m_ContextPath );
- getLogger().info( "ModelHandler ComponentPath: " + m_ComponentPath );
- getLogger().info( "ModelHandler Container: " + m_Container );
- getLogger().info( "ModelHandler Component: " + m_HandlerComponent );
+ m_Logger.info( "Delegating to: " + m_HandlerComponent );

if( pathInContext.startsWith( m_ContextPath ) )
{
@@ -233,16 +188,16 @@

if( m_HandlerComponent != null )
{
- getLogger().warn( "Internal error. New component added at the
same path, without a modelRemoved() event: " + path );
+ m_Logger.warn( "Internal error. New component added at the same
path, without a modelRemoved() event: " + path );
}

try
{
m_HandlerComponent = (HttpRequestHandler) cmodel.resolve();
- getLogger().info( "HttpRequestHandler added: " + path );
+ m_Logger.info( "HttpRequestHandler added: " + path );
} catch( Exception e )
{
- getLogger().error( "Unable to resolve " + path, e );
+ m_Logger.error( "Unable to resolve " + path, e );
}
}

@@ -265,7 +220,7 @@
if( path.equals( m_ComponentPath ) )
{
m_HandlerComponent = null;
- getLogger().info( "HttpRequestHandler removed: " + path );
+ m_Logger.info( "HttpRequestHandler removed: " + path );
}
}
}

Modified:
development/main/planet/facilities/http/impl/src/main/net/dpml/http/impl/MsieSslHandler.java
==============================================================================
---
development/main/planet/facilities/http/impl/src/main/net/dpml/http/impl/MsieSslHandler.java
(original)
+++
development/main/planet/facilities/http/impl/src/main/net/dpml/http/impl/MsieSslHandler.java
Sat Dec 25 23:25:12 2004
@@ -35,52 +35,27 @@
*/
public class MsieSslHandler
extends org.mortbay.http.handler.MsieSslHandler
- implements Startable, Parameterizable, LogEnabled,
- Serviceable, Contextualizable
+ implements Startable
{
private Logger m_Logger;
private HttpContextService m_Context;
private int m_Index;

- public MsieSslHandler()
- {
- }
-
/**
- * Enable the logging system.
- *
* @metro.logger name="http"
- */
- public void enableLogging( Logger logger )
- {
- m_Logger = logger;
- }
-
- public Logger getLogger()
- {
- return m_Logger;
- }
-
- /**
- * Contextulaization of the Handler.
- *
- * @param ctx the supplied listener context
- *
- * @exception ContextException if a contextualization error occurs
- *
* @metro.entry key="urn:metro:name"
* type="java.lang.String"
+ * @metro.dependency type="net.dpml.http.HttpContextService"
+ * key="http-context"
*/
- public void contextualize( Context ctx )
- throws ContextException
+ public MsieSslHandler( Logger logger, Context ctx, Parameters params,
ServiceManager man )
+ throws ContextException, ServiceException
{
+ m_Logger = logger;
+ m_Context = (HttpContextService) man.lookup( "http-context" );
String name = (String) ctx.get( "urn:metro:name" );
setName( name );
- }
-
- public void parameterize( Parameters params )
- throws ParameterException
- {
+
m_Index = params.getParameterAsInteger( "handler-index", -1 );

String agent = params.getParameter( "user-agent-substring", null );
@@ -88,16 +63,6 @@
setUserAgentSubString( agent );
}

- /**
- * @metro.dependency type="net.dpml.http.HttpContextService"
- * key="http-context"
- */
- public void service( ServiceManager man )
- throws ServiceException
- {
- m_Context = (HttpContextService) man.lookup( "http-context" );
- }
-
public void start()
throws Exception
{
@@ -107,7 +72,8 @@
m_Context.addHandler( this );
if( m_Logger.isDebugEnabled() )
m_Logger.debug( "Starting MsieSslHandler: " + this );
- super.start();
+ if( ! isStarted() )
+ super.start();
}

public void stop()
@@ -115,7 +81,8 @@
{
if( m_Logger.isDebugEnabled() )
m_Logger.debug( "Stopping MsieSslHandler: " + this );
- super.stop();
+ if( isStarted() )
+ super.stop();
m_Context.removeHandler( this );
}
}

Modified:
development/main/planet/facilities/http/impl/src/main/net/dpml/http/impl/NcsaRequestLog.java
==============================================================================
---
development/main/planet/facilities/http/impl/src/main/net/dpml/http/impl/NcsaRequestLog.java
(original)
+++
development/main/planet/facilities/http/impl/src/main/net/dpml/http/impl/NcsaRequestLog.java
Sat Dec 25 23:25:12 2004
@@ -29,14 +29,9 @@
* @metro.service type="org.mortbay.http.RequestLog"
*/
public class NcsaRequestLog extends NCSARequestLog
- implements RequestLog, Parameterizable, Startable
+ implements RequestLog
{
- public NcsaRequestLog()
- {
- }
-
- public void parameterize( Parameters params )
- throws ParameterException
+ public NcsaRequestLog(Parameters params)
{
boolean append = params.getParameterAsBoolean( "append", false );
setAppend( append );
@@ -73,15 +68,4 @@
if( retain > 0 )
setRetainDays( retain );
}
-
- public void start()
- throws Exception
- {
- super.start();
- }
-
- public void stop()
- {
- super.stop();
- }
}

Modified:
development/main/planet/facilities/http/impl/src/main/net/dpml/http/impl/NotFoundHandler.java
==============================================================================
---
development/main/planet/facilities/http/impl/src/main/net/dpml/http/impl/NotFoundHandler.java
(original)
+++
development/main/planet/facilities/http/impl/src/main/net/dpml/http/impl/NotFoundHandler.java
Sat Dec 25 23:25:12 2004
@@ -35,63 +35,29 @@
*/
public class NotFoundHandler
extends org.mortbay.http.handler.NotFoundHandler
- implements Startable, Parameterizable, LogEnabled,
- Serviceable, Contextualizable
+ implements Startable
{
private Logger m_Logger;
private HttpContextService m_Context;
private int m_Index;

- public NotFoundHandler()
- {
- }
-
/**
- * Enable the logging system.
- *
* @metro.logger name="http"
- */
- public void enableLogging( Logger logger )
- {
- m_Logger = logger;
- }
-
- public Logger getLogger()
- {
- return m_Logger;
- }
-
- /**
- * Contextulaization of the Handler.
- *
- * @param ctx the supplied listener context
- *
- * @exception ContextException if a contextualization error occurs
- *
* @metro.entry key="urn:metro:name"
* type="java.lang.String"
- */
- public void contextualize( Context ctx )
- throws ContextException
- {
- String name = (String) ctx.get( "urn:metro:name" );
- setName( name );
- }
-
- public void parameterize( Parameters params )
- throws ParameterException
- {
- m_Index = params.getParameterAsInteger( "handler-index", -1 );
- }
-
- /**
* @metro.dependency type="net.dpml.http.HttpContextService"
* key="http-context"
*/
- public void service( ServiceManager man )
- throws ServiceException
+ public NotFoundHandler(Logger logger, Context ctx, Parameters params,
ServiceManager man )
+ throws ContextException, ServiceException
{
+ m_Logger = logger;
m_Context = (HttpContextService) man.lookup( "http-context" );
+
+ String name = (String) ctx.get( "urn:metro:name" );
+ setName( name );
+
+ m_Index = params.getParameterAsInteger( "handler-index", -1 );
}

public void start()
@@ -103,15 +69,17 @@
m_Context.addHandler( this );
if( m_Logger.isDebugEnabled() )
m_Logger.debug( "Starting NotFoundHandler: " + this );
- super.start();
+ if( ! isStarted() )
+ super.start();
}

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

Modified:
development/main/planet/facilities/http/impl/src/main/net/dpml/http/impl/NullHandler.java
==============================================================================
---
development/main/planet/facilities/http/impl/src/main/net/dpml/http/impl/NullHandler.java
(original)
+++
development/main/planet/facilities/http/impl/src/main/net/dpml/http/impl/NullHandler.java
Sat Dec 25 23:25:12 2004
@@ -35,63 +35,27 @@
*/
public class NullHandler
extends org.mortbay.http.handler.NullHandler
- implements Startable, Parameterizable, LogEnabled,
- Serviceable, Contextualizable
+ implements Startable
{
private Logger m_Logger;
private HttpContextService m_Context;
private int m_Index;

- public NullHandler()
- {
- }
-
/**
- * Enable the logging system.
- *
* @metro.logger name="http"
- */
- public void enableLogging( Logger logger )
- {
- m_Logger = logger;
- }
-
- public Logger getLogger()
- {
- return m_Logger;
- }
-
- /**
- * Contextulaization of the Handler.
- *
- * @param ctx the supplied listener context
- *
- * @exception ContextException if a contextualization error occurs
- *
* @metro.entry key="urn:metro:name"
* type="java.lang.String"
- */
- public void contextualize( Context ctx )
- throws ContextException
- {
- String name = (String) ctx.get( "urn:metro:name" );
- setName( name );
- }
-
- public void parameterize( Parameters params )
- throws ParameterException
- {
- m_Index = params.getParameterAsInteger( "handler-index", -1 );
- }
-
- /**
* @metro.dependency type="net.dpml.http.HttpContextService"
* key="http-context"
*/
- public void service( ServiceManager man )
- throws ServiceException
+ public NullHandler(Logger logger, Context ctx, Parameters params,
ServiceManager man )
+ throws ContextException, ServiceException
{
+ m_Logger = logger;
m_Context = (HttpContextService) man.lookup( "http-context" );
+ String name = (String) ctx.get( "urn:metro:name" );
+ setName( name );
+ m_Index = params.getParameterAsInteger( "handler-index", -1 );
}

public void start()
@@ -103,7 +67,8 @@
m_Context.addHandler( this );
if( m_Logger.isDebugEnabled() )
m_Logger.debug( "Starting NullHandler: " + this );
- super.start();
+ if( ! isStarted() )
+ super.start();
}

public void stop()
@@ -111,7 +76,8 @@
{
if( m_Logger.isDebugEnabled() )
m_Logger.debug( "Stopping NullHandler: " + this );
- super.stop();
+ if( isStarted() )
+ super.stop();
m_Context.removeHandler( this );
}
}

Modified:
development/main/planet/facilities/http/impl/src/main/net/dpml/http/impl/ProxyHandler.java
==============================================================================
---
development/main/planet/facilities/http/impl/src/main/net/dpml/http/impl/ProxyHandler.java
(original)
+++
development/main/planet/facilities/http/impl/src/main/net/dpml/http/impl/ProxyHandler.java
Sat Dec 25 23:25:12 2004
@@ -35,52 +35,27 @@
*/
public class ProxyHandler
extends org.mortbay.http.handler.ProxyHandler
- implements Startable, Parameterizable, LogEnabled,
- Serviceable, Contextualizable
+ implements Startable
{
private Logger m_Logger;
private HttpContextService m_Context;
private int m_Index;

- public ProxyHandler()
- {
- }
-
/**
- * Enable the logging system.
- *
* @metro.logger name="http"
- */
- public void enableLogging( Logger logger )
- {
- m_Logger = logger;
- }
-
- public Logger getLogger()
- {
- return m_Logger;
- }
-
- /**
- * Contextulaization of the Handler.
- *
- * @param ctx the supplied listener context
- *
- * @exception ContextException if a contextualization error occurs
- *
* @metro.entry key="urn:metro:name"
* type="java.lang.String"
+ * @metro.dependency type="net.dpml.http.HttpContextService"
+ * key="http-context"
*/
- public void contextualize( Context ctx )
- throws ContextException
+ public ProxyHandler( Logger logger, Context ctx, Parameters params,
ServiceManager man )
+ throws ContextException, ServiceException
{
+ m_Logger = logger;
+ m_Context = (HttpContextService) man.lookup( "http-context" );
String name = (String) ctx.get( "urn:metro:name" );
setName( name );
- }
-
- public void parameterize( Parameters params )
- throws ParameterException
- {
+
m_Index = params.getParameterAsInteger( "handler-index", -1 );

String whitelist = params.getParameter( "proxy-host-white-list",
null );
@@ -98,16 +73,6 @@
}
}

- /**
- * @metro.dependency type="net.dpml.http.HttpContextService"
- * key="http-context"
- */
- public void service( ServiceManager man )
- throws ServiceException
- {
- m_Context = (HttpContextService) man.lookup( "http-context" );
- }
-
public void start()
throws Exception
{
@@ -117,7 +82,8 @@
m_Context.addHandler( this );
if( m_Logger.isDebugEnabled() )
m_Logger.debug( "Starting ProxyHandler: " + this );
- super.start();
+ if( ! isStarted() )
+ super.start();
}

public void stop()
@@ -125,7 +91,8 @@
{
if( m_Logger.isDebugEnabled() )
m_Logger.debug( "Stopping ProxyHandler: " + this );
- super.stop();
+ if( isStarted() )
+ super.stop();
m_Context.removeHandler( this );
}
}

Modified:
development/main/planet/facilities/http/impl/src/main/net/dpml/http/impl/ResourceHandler.java
==============================================================================
---
development/main/planet/facilities/http/impl/src/main/net/dpml/http/impl/ResourceHandler.java
(original)
+++
development/main/planet/facilities/http/impl/src/main/net/dpml/http/impl/ResourceHandler.java
Sat Dec 25 23:25:12 2004
@@ -35,52 +35,27 @@
*/
public class ResourceHandler
extends org.mortbay.http.handler.ResourceHandler
- implements Startable, Parameterizable, LogEnabled,
- Serviceable, Contextualizable
+ implements Startable
{
private Logger m_Logger;
private HttpContextService m_Context;
private int m_Index;

- public ResourceHandler()
- {
- }
-
/**
- * Enable the logging system.
- *
* @metro.logger name="http"
- */
- public void enableLogging( Logger logger )
- {
- m_Logger = logger;
- }
-
- public Logger getLogger()
- {
- return m_Logger;
- }
-
- /**
- * Contextulaization of the Handler.
- *
- * @param ctx the supplied listener context
- *
- * @exception ContextException if a contextualization error occurs
- *
+ * @metro.dependency type="net.dpml.http.HttpContextService"
+ * key="http-context"
* @metro.entry key="urn:metro:name"
* type="java.lang.String"
*/
- public void contextualize( Context ctx )
- throws ContextException
+ public ResourceHandler(Logger logger, Context ctx, Parameters params,
ServiceManager man )
+ throws ContextException, ServiceException
{
+ m_Logger = logger;
+ m_Context = (HttpContextService) man.lookup( "http-context" );
String name = (String) ctx.get( "urn:metro:name" );
setName( name );
- }
-
- public void parameterize( Parameters params )
- throws ParameterException
- {
+
boolean ranges = params.getParameterAsBoolean( "accept-ranges",
false );
setAcceptRanges( ranges );

@@ -104,16 +79,6 @@
}
}

- /**
- * @metro.dependency type="net.dpml.http.HttpContextService"
- * key="http-context"
- */
- public void service( ServiceManager man )
- throws ServiceException
- {
- m_Context = (HttpContextService) man.lookup( "http-context" );
- }
-
public void start()
throws Exception
{
@@ -123,7 +88,8 @@
m_Context.addHandler( this );
if( m_Logger.isDebugEnabled() )
m_Logger.debug( "Starting ResourceHandler: " + this );
- super.start();
+ if( ! isStarted() )
+ super.start();
}

public void stop()
@@ -131,7 +97,8 @@
{
if( m_Logger.isDebugEnabled() )
m_Logger.debug( "Stopping ResourceHandler: " + this );
- super.stop();
+ if( isStarted() )
+ super.stop();
m_Context.removeHandler( this );
}
}

Modified:
development/main/planet/facilities/http/impl/src/main/net/dpml/http/impl/RootNotFoundHandler.java
==============================================================================
---
development/main/planet/facilities/http/impl/src/main/net/dpml/http/impl/RootNotFoundHandler.java
(original)
+++
development/main/planet/facilities/http/impl/src/main/net/dpml/http/impl/RootNotFoundHandler.java
Sat Dec 25 23:25:12 2004
@@ -18,8 +18,6 @@
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;
@@ -27,7 +25,6 @@
import net.dpml.http.HttpContextService;
import net.dpml.service.ServiceException;
import net.dpml.service.ServiceManager;
-import net.dpml.service.Serviceable;

/**
* @metro.component name="http-rootnotfound-handler" lifestyle="singleton"
@@ -35,63 +32,28 @@
*/
public class RootNotFoundHandler
extends org.mortbay.http.handler.RootNotFoundHandler
- implements Startable, Parameterizable, LogEnabled,
- Serviceable, Contextualizable
+ implements Startable
{
private Logger m_Logger;
private HttpContextService m_Context;
private int m_Index;

- public RootNotFoundHandler()
- {
- }
-
/**
- * Enable the logging system.
- *
* @metro.logger name="http"
- */
- public void enableLogging( Logger logger )
- {
- m_Logger = logger;
- }
-
- public Logger getLogger()
- {
- return m_Logger;
- }
-
- /**
- * Contextulaization of the Handler.
- *
- * @param ctx the supplied listener context
- *
- * @exception ContextException if a contextualization error occurs
- *
* @metro.entry key="urn:metro:name"
* type="java.lang.String"
- */
- public void contextualize( Context ctx )
- throws ContextException
- {
- String name = (String) ctx.get( "urn:metro:name" );
- setName( name );
- }
-
- public void parameterize( Parameters params )
- throws ParameterException
- {
- m_Index = params.getParameterAsInteger( "handler-index", -1 );
- }
-
- /**
* @metro.dependency type="net.dpml.http.HttpContextService"
* key="http-context"
*/
- public void service( ServiceManager man )
- throws ServiceException
+ public RootNotFoundHandler( Logger logger, Context ctx, Parameters
params, ServiceManager man )
+ throws ContextException, ServiceException
{
+ m_Logger = logger;
m_Context = (HttpContextService) man.lookup( "http-context" );
+
+ String name = (String) ctx.get( "urn:metro:name" );
+ setName( name );
+ m_Index = params.getParameterAsInteger( "handler-index", -1 );
}

public void start()
@@ -103,7 +65,8 @@
m_Context.addHandler( this );
if( m_Logger.isDebugEnabled() )
m_Logger.debug( "Starting RootNotFoundHandler: " + this );
- super.start();
+ if( ! isStarted() )
+ super.start();
}

public void stop()
@@ -111,7 +74,8 @@
{
if( m_Logger.isDebugEnabled() )
m_Logger.debug( "Stopping RootNotFoundHandler: " + this );
- super.stop();
+ if( isStarted() )
+ super.stop();
m_Context.removeHandler( this );
}
}

Modified:
development/main/planet/facilities/http/impl/src/main/net/dpml/http/impl/SecurityHandler.java
==============================================================================
---
development/main/planet/facilities/http/impl/src/main/net/dpml/http/impl/SecurityHandler.java
(original)
+++
development/main/planet/facilities/http/impl/src/main/net/dpml/http/impl/SecurityHandler.java
Sat Dec 25 23:25:12 2004
@@ -35,69 +35,33 @@
*/
public class SecurityHandler
extends org.mortbay.http.handler.SecurityHandler
- implements Startable, Parameterizable, LogEnabled,
- Serviceable, Contextualizable
+ implements Startable
{
private Logger m_Logger;
private HttpContextService m_Context;
private int m_Index;

- public SecurityHandler()
- {
- }
-
/**
- * Enable the logging system.
- *
* @metro.logger name="http"
- */
- public void enableLogging( Logger logger )
- {
- m_Logger = logger;
- }
-
- public Logger getLogger()
- {
- return m_Logger;
- }
-
- /**
- * Contextulaization of the Handler.
- *
- * @param ctx the supplied listener context
- *
- * @exception ContextException if a contextualization error occurs
- *
* @metro.entry key="urn:metro:name"
* type="java.lang.String"
- */
- public void contextualize( Context ctx )
- throws ContextException
- {
- String name = (String) ctx.get( "urn:metro:name" );
- setName( name );
- }
-
- public void parameterize( Parameters params )
- throws ParameterException
- {
- m_Index = params.getParameterAsInteger( "handler-index", -1 );
- }
-
- /**
* @metro.dependency type="net.dpml.http.HttpContextService"
* key="http-context"
* @metro.dependency type="org.mortbay.http.Authenticator"
* key="authenticator"
*/
- public void service( ServiceManager man )
- throws ServiceException
+ public SecurityHandler( Logger logger, Context ctx, Parameters params,
ServiceManager man )
+ throws ContextException, ServiceException
{
- m_Context = (HttpContextService) man.lookup( "http-context" );
-
// The dependency on Authenticator is to ensure that the
Authenticator
// has been assigned to the HttpContext before the SecurityHandler
// is being started, since it otherwise will set another
Authenticator.
+ m_Context = (HttpContextService) man.lookup( "http-context" );
+
+ m_Logger = logger;
+ String name = (String) ctx.get( "urn:metro:name" );
+ setName( name );
+ m_Index = params.getParameterAsInteger( "handler-index", -1 );
}

public void start()
@@ -109,7 +73,8 @@
m_Context.addHandler( this );
if( m_Logger.isDebugEnabled() )
m_Logger.debug( "Starting SecurityHandler: " + this );
- super.start();
+ if( ! isStarted() )
+ super.start();
}

public void stop()
@@ -117,7 +82,8 @@
{
if( m_Logger.isDebugEnabled() )
m_Logger.debug( "Stopping SecurityHandler: " + this );
- super.stop();
+ if( isStarted() )
+ super.stop();
m_Context.removeHandler( this );
}
}

Modified:
development/main/planet/facilities/http/impl/src/main/net/dpml/http/impl/ServletHandler.java
==============================================================================
---
development/main/planet/facilities/http/impl/src/main/net/dpml/http/impl/ServletHandler.java
(original)
+++
development/main/planet/facilities/http/impl/src/main/net/dpml/http/impl/ServletHandler.java
Sat Dec 25 23:25:12 2004
@@ -21,8 +21,6 @@
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;
@@ -30,61 +28,41 @@
import net.dpml.http.HttpContextService;
import net.dpml.service.ServiceException;
import net.dpml.service.ServiceManager;
-import net.dpml.service.Serviceable;
import org.mortbay.jetty.servlet.SessionManager;

/**
* @metro.component name="http-servlet-handler" lifestyle="singleton"
* @metro.service type="org.mortbay.http.HttpHandler"
*/
-public class ServletHandler
- extends org.mortbay.jetty.servlet.ServletHandler
- implements Startable, Parameterizable, LogEnabled,
- Serviceable, Contextualizable, Configurable
+public class ServletHandler extends org.mortbay.jetty.servlet.ServletHandler
+ implements Configurable, Startable
{
private Logger m_Logger;
private HttpContextService m_Context;
private int m_Index;

- public ServletHandler()
- {
- }
-
/**
- * Enable the logging system.
- *
* @metro.logger name="http"
- */
- public void enableLogging( Logger logger )
- {
- m_Logger = logger;
- }
-
- public Logger getLogger()
- {
- return m_Logger;
- }
-
- /**
- * Contextulaization of the Handler.
- *
- * @param ctx the supplied listener context
- *
- * @exception ContextException if a contextualization error occurs
- *
+ * @metro.dependency type="net.dpml.http.HttpContextService"
+ * key="http-context"
+ * @metro.dependency type="org.mortbay.jetty.servlet.SessionManager"
+ * key="session-manager" optional="true"
* @metro.entry key="urn:metro:name"
- * type="java.lang.String"
+ * type="java.lang.String"
*/
- public void contextualize( Context ctx )
- throws ContextException
+ public ServletHandler( Logger logger, Context ctx, Parameters params,
ServiceManager man )
+ throws ServiceException, ContextException
{
+ m_Logger = logger;
+ m_Context = (HttpContextService) man.lookup( "http-context" );
+ if( man.hasService( "session-manager" ) )
+ {
+ SessionManager sm = (SessionManager) man.lookup(
"session-manager" );
+ setSessionManager( sm );
+ }
String name = (String) ctx.get( "urn:metro:name" );
setName( name );
- }
-
- public void parameterize( Parameters params )
- throws ParameterException
- {
+
m_Index = params.getParameterAsInteger( "handler-index", -1 );

boolean useCookies = params.getParameterAsBoolean( "using-cookies",
false );
@@ -127,24 +105,7 @@
}
}

- /**
- * @metro.dependency type="net.dpml.http.HttpContextService"
- * key="http-context"
- * @metro.dependency type="org.mortbay.jetty.servlet.SessionManager"
- * key="session-manager" optional="true"
- */
- public void service( ServiceManager man )
- throws ServiceException
- {
- m_Context = (HttpContextService) man.lookup( "http-context" );
- if( man.hasService( "session-manager" ) )
- {
- SessionManager sm = (SessionManager) man.lookup(
"session-manager" );
- setSessionManager( sm );
- }
- }
-
- public void start()
+ protected void doStart()
throws Exception
{
if( m_Index >= 0 )
@@ -153,15 +114,17 @@
m_Context.addHandler( this );
if( m_Logger.isDebugEnabled() )
m_Logger.debug( "Starting ServletHandler: " + this );
- super.start();
+ if( ! isStarted() )
+ super.doStart();
}

- public void stop()
- throws InterruptedException
+ protected void doStop()
+ throws Exception
{
if( m_Logger.isDebugEnabled() )
m_Logger.debug( "Stopping ServletHandler: " + this );
- super.stop();
+ if( isStarted() )
+ super.doStop();
m_Context.removeHandler( this );
}
}

Modified:
development/main/planet/facilities/http/impl/src/main/net/dpml/http/impl/SetResponseHeadersHandler.java
==============================================================================
---
development/main/planet/facilities/http/impl/src/main/net/dpml/http/impl/SetResponseHeadersHandler.java
(original)
+++
development/main/planet/facilities/http/impl/src/main/net/dpml/http/impl/SetResponseHeadersHandler.java
Sat Dec 25 23:25:12 2004
@@ -16,6 +16,7 @@
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;
@@ -37,52 +38,26 @@
*/
public class SetResponseHeadersHandler
extends org.mortbay.http.handler.SetResponseHeadersHandler
- implements Startable, Parameterizable, LogEnabled,
- Serviceable, Contextualizable
+ implements Configurable, Startable
{
private Logger m_Logger;
private HttpContextService m_Context;
private int m_Index;

- public SetResponseHeadersHandler()
- {
- }
-
/**
- * Enable the logging system.
- *
* @metro.logger name="http"
- */
- public void enableLogging( Logger logger )
- {
- m_Logger = logger;
- }
-
- public Logger getLogger()
- {
- return m_Logger;
- }
-
- /**
- * Contextulaization of the Handler.
- *
- * @param ctx the supplied listener context
- *
- * @exception ContextException if a contextualization error occurs
- *
* @metro.entry key="urn:metro:name"
* type="java.lang.String"
+ * @metro.dependency type="net.dpml.http.HttpContextService"
+ * key="http-context"
*/
- public void contextualize( Context ctx )
- throws ContextException
+ public SetResponseHeadersHandler( Logger logger, Context ctx, Parameters
params, ServiceManager man )
+ throws ContextException, ServiceException
{
+ m_Logger = logger;
+ m_Context = (HttpContextService) man.lookup( "http-context" );
String name = (String) ctx.get( "urn:metro:name" );
setName( name );
- }
-
- public void parameterize( Parameters params )
- throws ParameterException
- {
m_Index = params.getParameterAsInteger( "handler-index", -1 );

}
@@ -110,16 +85,6 @@
setHeaderValue( name.getValue(), value.getValue() );
}

- /**
- * @metro.dependency type="net.dpml.http.HttpContextService"
- * key="http-context"
- */
- public void service( ServiceManager man )
- throws ServiceException
- {
- m_Context = (HttpContextService) man.lookup( "http-context" );
- }
-
public void start()
throws Exception
{
@@ -129,7 +94,8 @@
m_Context.addHandler( this );
if( m_Logger.isDebugEnabled() )
m_Logger.debug( "Starting SetResponseHeadersHandler: " + this );
- super.start();
+ if( ! isStarted() )
+ super.start();
}

public void stop()
@@ -137,7 +103,8 @@
{
if( m_Logger.isDebugEnabled() )
m_Logger.debug( "Stopping SetResponseHeadersHandler: " + this );
- super.stop();
+ if( isStarted() )
+ super.stop();
m_Context.removeHandler( this );
}
}

Modified:
development/main/planet/facilities/http/impl/src/main/net/dpml/http/impl/SocketListener.java
==============================================================================
---
development/main/planet/facilities/http/impl/src/main/net/dpml/http/impl/SocketListener.java
(original)
+++
development/main/planet/facilities/http/impl/src/main/net/dpml/http/impl/SocketListener.java
Sat Dec 25 23:25:12 2004
@@ -16,7 +16,6 @@
package net.dpml.http.impl;

import net.dpml.activity.Startable;
-import net.dpml.logging.LogEnabled;
import net.dpml.logging.Logger;
import net.dpml.parameters.ParameterException;
import net.dpml.parameters.Parameterizable;
@@ -24,7 +23,6 @@
import net.dpml.http.HttpService;
import net.dpml.service.ServiceException;
import net.dpml.service.ServiceManager;
-import net.dpml.service.Serviceable;
import org.mortbay.http.HttpListener;

/** Wrapper for the Jetty SocketListener.
@@ -33,28 +31,23 @@
* @metro.service type="org.mortbay.http.HttpListener"
*/
public class SocketListener extends org.mortbay.http.SocketListener
- implements Parameterizable, Startable, Serviceable, LogEnabled,
HttpListener
+ implements Parameterizable, HttpListener, Startable
{
private HttpService m_HttpServer;
private Logger m_Logger;

- public SocketListener()
- {
- }
-
/**
- * Enable the logging system.
- *
* @metro.logger name="http"
+ * @metro.dependency type="net.dpml.http.HttpService"
+ * key="server"
+ *
*/
- public void enableLogging( Logger logger )
+ public SocketListener(Logger logger, ServiceManager man)
+ throws ServiceException
{
m_Logger = logger;
- }
-
- public Logger getLogger()
- {
- return m_Logger;
+ m_HttpServer = (HttpService) man.lookup( "server" );
+ m_HttpServer.addListener( this );
}

public void parameterize( Parameters params )
@@ -111,23 +104,13 @@

}

- /**
- * @metro.dependency type="net.dpml.http.HttpService"
- * key="server"
- */
- public void service( ServiceManager man )
- throws ServiceException
- {
- m_HttpServer = (HttpService) man.lookup( "server" );
- }
-
public void start()
throws Exception
{
if( m_Logger.isDebugEnabled() )
m_Logger.debug( "Starting socket: " + this );
- m_HttpServer.addListener( this );
- super.start();
+ if( ! isStarted() )
+ super.start();
}

public void stop()
@@ -135,7 +118,8 @@
{
if( m_Logger.isDebugEnabled() )
m_Logger.debug( "Stopping socket: " + this );
- super.stop();
+ if( isStarted() )
+ super.stop();
m_HttpServer.removeListener( this );
}
}

Modified:
development/main/planet/facilities/http/impl/src/main/net/dpml/http/impl/SystemMimeTypes.java
==============================================================================
---
development/main/planet/facilities/http/impl/src/main/net/dpml/http/impl/SystemMimeTypes.java
(original)
+++
development/main/planet/facilities/http/impl/src/main/net/dpml/http/impl/SystemMimeTypes.java
Sat Dec 25 23:25:12 2004
@@ -33,18 +33,13 @@
* @metro.service type="net.dpml.http.MimeTypes"
*/
public class SystemMimeTypes
- implements Parameterizable, Initializable, MimeTypes
+ implements Initializable, MimeTypes
{
private String m_Filename;
private HashMap m_MimeTypeToExtMap;
private HashMap m_ExtToMimeTypeMap;

- public SystemMimeTypes()
- {
- }
-
- public void parameterize( Parameters params )
- throws ParameterException
+ public SystemMimeTypes(Parameters params)
{
m_Filename = params.getParameter( "filename", "/etc/mime.types" );
}

Modified:
development/main/planet/facilities/http/impl/src/main/net/dpml/http/impl/WebApplicationContext.java
==============================================================================
---
development/main/planet/facilities/http/impl/src/main/net/dpml/http/impl/WebApplicationContext.java
(original)
+++
development/main/planet/facilities/http/impl/src/main/net/dpml/http/impl/WebApplicationContext.java
Sat Dec 25 23:25:12 2004
@@ -42,41 +42,24 @@
*/
public class WebApplicationContext
extends org.mortbay.jetty.servlet.WebApplicationContext
- implements LogEnabled, Contextualizable, Serviceable, Startable,
- Disposable, Configurable, HttpContextService
+ implements Startable, Serviceable, Disposable, Configurable,
HttpContextService
{
private HttpService m_HttpServer;
private boolean m_Graceful;
private Logger m_Logger;


- public HttpContext getHttpContext()
- {
- return this;
- }
-
- public Logger getLogger()
- {
- return m_Logger;
- }
-
- /**
- * @metro.logger name="http"
- */
- public void enableLogging( Logger logger )
- {
- m_Logger = logger;
- }
-
/**
+ * @metro.logger name="http.webapp"
* @metro.entry key="urn:metro:temp"
- * type="java.io.File"
+ * type="java.io.File"
* @metro.entry key="urn:metro:classloader"
- * type="java.lang.ClassLoader"
+ * type="java.lang.ClassLoader"
*/
- public void contextualize( Context ctx )
+ public WebApplicationContext( Logger logger, Context ctx )
throws ContextException
{
+ m_Logger = logger;
File tmpDir = (File) ctx.get( "urn:metro:temp" );
tmpDir.mkdirs();
setTempDirectory( tmpDir );
@@ -86,6 +69,12 @@
setParentClassLoader( cl );
}

+
+ public HttpContext getHttpContext()
+ {
+ return this;
+ }
+
/**
* @metro.dependency type="net.dpml.http.HttpService"
* key="server"
@@ -96,7 +85,7 @@
* @metro.dependency type="org.mortbay.http.UserRealm"
* key="realm" optional="true"
* @metro.dependency type="org.mortbay.http.RequestLog"
- * key="request-log"
+ * key="request-log" optional="true"
*/
public void service( ServiceManager man )
throws ServiceException
@@ -106,29 +95,26 @@
if( man.hasService( "authenticator" ) )
{
Authenticator authenticator = (Authenticator) man.lookup(
"authenticator" );
- if( authenticator != null )
- setAuthenticator( authenticator );
+ setAuthenticator( authenticator );
}

if( man.hasService( "realm" ) )
{
UserRealm userRealm = (UserRealm) man.lookup( "realm" );
- if( userRealm != null )
- {
- setRealm( userRealm );
- setRealmName( userRealm.getName() ); // Is this necessary?
- }
-
+ setRealm( userRealm );
+ setRealmName( userRealm.getName() ); // Is this necessary?
}

- RequestLog requestLog = (RequestLog) man.lookup( "request-log" );
- setRequestLog( requestLog );
+ if( man.hasService( "request-log" ) )
+ {
+ RequestLog requestLog = (RequestLog) man.lookup( "request-log" );
+ setRequestLog( requestLog );
+ }

if( man.hasService( "mimetypes" ) )
{
MimeTypes mimeTypes = (MimeTypes) man.lookup( "mimetypes" );
- if( mimeTypes != null )
- setMimeMap( mimeTypes.getExtensionMap() );
+ setMimeMap( mimeTypes.getExtensionMap() );
}
}

@@ -230,7 +216,6 @@
String host = hosts[i].getValue();
addVirtualHost( host );
}
-
}

private void configureWelcomeFiles( net.dpml.configuration.Configuration
conf )
@@ -241,30 +226,22 @@
addWelcomeFile( files[i].getValue() );
}

- public void start()
+ protected void doStart()
throws Exception
{
if( m_Logger.isDebugEnabled() )
m_Logger.debug( "Starting context: " + this );
m_HttpServer.addContext( this );
- super.start();
+ super.doStart();
}

- public void stop()
- throws InterruptedException
+ protected void doStop()
+ throws Exception
{
if( m_Logger.isDebugEnabled() )
m_Logger.debug( "Stopping context: " + this );
-
-
- // The following is need due to strange delegation between the
- // methods stop() and stop( boolean ) in the superclasses are
- // inaccurately implemented, and an endless loop will result
- // unless the isStarted() method is checked.
- if( isStarted() )
- super.stop( m_Graceful );
-
m_HttpServer.removeContext( this );
+ super.doStop();
}

public void dispose()

Modified: development/main/planet/facilities/http/index.xml
==============================================================================
--- development/main/planet/facilities/http/index.xml (original)
+++ development/main/planet/facilities/http/index.xml Sat Dec 25 23:25:12
2004
@@ -89,6 +89,7 @@
<include key="jsp-api" runtime="true" build="false" />
<include key="jasper-runtime" runtime="true" build="false" />
<include key="jasper-compiler" runtime="true" build="false" />
+ <include key="xercesImpl" runtime="true" build="false" />
</dependencies>
<plugins>
<include key="dpml-meta-tools"/>
@@ -166,65 +167,81 @@

<resource>
<info>
- <name>commons-lang</name>
- <version>2.0</version>
- <group>commons-lang</group>
+ <name>commons-lang</name>
+ <version>2.0</version>
+ <group>commons-lang</group>
</info>
</resource>

<resource>
<info>
- <name>commons-logging</name>
- <version>1.0.4</version>
- <group>commons-logging</group>
+ <name>commons-logging</name>
+ <version>1.0.4</version>
+ <group>commons-logging</group>
</info>
</resource>

<resource>
<info>
- <name>hivemind</name>
- <version>1.0</version>
- <group>hivemind</group>
+ <name>hivemind</name>
+ <version>1.0</version>
+ <group>hivemind</group>
+ </info>
+ </resource>
+
+ <resource>
+ <info>
+ <name>hivemind-lib</name>
+ <version>1.0</version>
+ <group>hivemind</group>
+ </info>
+ </resource>
+
+ <resource>
+ <info>
+ <name>oro</name>
+ <version>2.0.6</version>
+ <group>oro</group>
</info>
</resource>

<resource>
<info>
- <name>hivemind-lib</name>
- <version>1.0</version>
- <group>hivemind</group>
+ <name>javassist</name>
+ <version>2.6</version>
+ <group>jboss</group>
</info>
</resource>

<resource>
<info>
- <name>oro</name>
- <version>2.0.6</version>
- <group>oro</group>
+ <name>servletapi</name>
+ <version>2.3</version>
+ <group>servletapi</group>
</info>
</resource>

<resource>
<info>
- <name>javassist</name>
- <version>2.6</version>
- <group>jboss</group>
+ <name>ognl</name>
+ <version>2.6.3</version>
+ <group>ognl</group>
</info>
</resource>

<resource>
<info>
- <name>servletapi</name>
- <version>2.3</version>
- <group>servletapi</group>
+ <name>saxon</name>
+ <version>6.5.3</version>
+ <group>saxon</group>
</info>
</resource>

<resource>
<info>
- <name>ognl</name>
- <version>2.6.3</version>
- <group>ognl</group>
+ <name>xercesImpl</name>
+ <version>2.6.2</version>
+ <group>xerces</group>
</info>
</resource>




  • svn commit: r1291 - in development/main/planet/facilities/http: . blocks/context blocks/demo blocks/hash-basic blocks/hash-clientcert blocks/hash-digest blocks/hash-form blocks/server blocks/servlet blocks/static blocks/webappserver blocks/webappserver/etc/deliverables/confs examples/hangman/etc examples/hangman/etc/deliverables/confs examples/hangman/src/main/tutorial/hangman examples/hangman/src/web impl/src/main/net/dpml/http/impl, niclas, 12/25/2004

Archive powered by MHonArc 2.6.24.

Top of Page