Skip to Content.
Sympa Menu

notify-dpml - svn commit: r1261 - in development/main/planet/facilities/http: . api api/src/main/net/dpml/http api/src/main/net/dpml/planet/http blocks blocks/context blocks/demo blocks/demo/src/main/net/dpml/planet/playground blocks/hash-basic blocks/hash-clientcert blocks/hash-digest blocks/hash-form blocks/server blocks/servlet blocks/static blocks/tapestry blocks/webappserver blocks/webappserver/etc blocks/webappserver/etc/deliverables blocks/webappserver/etc/deliverables/confs examples/hangman examples/hangman/etc/deliverables examples/hangman/etc/deliverables/confs impl impl/src/etc impl/src/main impl/src/main/net/dpml/http impl/src/main/net/dpml/http/impl impl/src/main/net/dpml/planet/http spi spi/src/main/net/dpml/http spi/src/main/net/dpml/planet/http test test/src/main/test/http util util/src/main/net/dpml/http util/src/main/net/dpml/planet/http

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: r1261 - in development/main/planet/facilities/http: . api api/src/main/net/dpml/http api/src/main/net/dpml/planet/http blocks blocks/context blocks/demo blocks/demo/src/main/net/dpml/planet/playground blocks/hash-basic blocks/hash-clientcert blocks/hash-digest blocks/hash-form blocks/server blocks/servlet blocks/static blocks/tapestry blocks/webappserver blocks/webappserver/etc blocks/webappserver/etc/deliverables blocks/webappserver/etc/deliverables/confs examples/hangman examples/hangman/etc/deliverables examples/hangman/etc/deliverables/confs impl impl/src/etc impl/src/main impl/src/main/net/dpml/http impl/src/main/net/dpml/http/impl impl/src/main/net/dpml/planet/http spi spi/src/main/net/dpml/http spi/src/main/net/dpml/planet/http test test/src/main/test/http util util/src/main/net/dpml/http util/src/main/net/dpml/planet/http
  • Date: Thu, 23 Dec 2004 00:24:29 +0100

Author: niclas
Date: Thu Dec 23 00:24:29 2004
New Revision: 1261

Added:
development/main/planet/facilities/http/api/src/main/net/dpml/http/
- copied from r1258,
development/main/planet/facilities/http/api/src/main/net/dpml/planet/http/

development/main/planet/facilities/http/blocks/webappserver/etc/deliverables/

development/main/planet/facilities/http/blocks/webappserver/etc/deliverables/confs/

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

development/main/planet/facilities/http/examples/hangman/etc/deliverables/confs/

development/main/planet/facilities/http/examples/hangman/etc/deliverables/confs/webapp.conf
development/main/planet/facilities/http/impl/src/main/mimetypes.xconfig
(contents, props changed)
development/main/planet/facilities/http/impl/src/main/net/dpml/http/
- copied from r1258,
development/main/planet/facilities/http/impl/src/main/net/dpml/planet/http/
development/main/planet/facilities/http/spi/src/main/net/dpml/http/
- copied from r1258,
development/main/planet/facilities/http/spi/src/main/net/dpml/planet/http/
development/main/planet/facilities/http/util/src/main/net/dpml/http/
- copied from r1258,
development/main/planet/facilities/http/util/src/main/net/dpml/planet/http/
Removed:
development/main/planet/facilities/http/api/src/main/net/dpml/planet/http/
development/main/planet/facilities/http/blocks/webappserver/etc/config.xml

development/main/planet/facilities/http/blocks/webappserver/etc/webapp-server.block

development/main/planet/facilities/http/blocks/webappserver/etc/webdefaults.xml
development/main/planet/facilities/http/impl/src/etc/
development/main/planet/facilities/http/impl/src/main/net/dpml/planet/http/
development/main/planet/facilities/http/spi/src/main/net/dpml/planet/http/
development/main/planet/facilities/http/util/src/main/net/dpml/planet/http/
Modified:
development/main/planet/facilities/http/README.TXT
development/main/planet/facilities/http/api/build.xml

development/main/planet/facilities/http/api/src/main/net/dpml/http/HttpRequestHandler.java

development/main/planet/facilities/http/api/src/main/net/dpml/http/HttpRequestHandlerException.java
development/main/planet/facilities/http/blocks/build.xml
development/main/planet/facilities/http/blocks/context/build.xml
development/main/planet/facilities/http/blocks/demo/README.TXT
development/main/planet/facilities/http/blocks/demo/build.xml

development/main/planet/facilities/http/blocks/demo/src/main/net/dpml/planet/playground/HelloComponent.java
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/index.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/tapestry/build.xml
development/main/planet/facilities/http/blocks/webappserver/build.xml
development/main/planet/facilities/http/examples/hangman/build.xml
development/main/planet/facilities/http/impl/build.xml

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/ConfigurationMimeTypes.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/StringUtils.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/spi/build.xml

development/main/planet/facilities/http/spi/src/main/net/dpml/http/HttpContextService.java

development/main/planet/facilities/http/spi/src/main/net/dpml/http/HttpService.java

development/main/planet/facilities/http/spi/src/main/net/dpml/http/MimeTypes.java
development/main/planet/facilities/http/test/build.xml

development/main/planet/facilities/http/test/src/main/test/http/TestComponent.java
development/main/planet/facilities/http/util/build.xml
Log:
Some more progress, cleaning up and so on...

Modified: development/main/planet/facilities/http/README.TXT
==============================================================================
--- development/main/planet/facilities/http/README.TXT (original)
+++ development/main/planet/facilities/http/README.TXT Thu Dec 23 00:24:29
2004
@@ -6,7 +6,7 @@

To start the http server:

- $ metro artifact:block:dpml/planet/http/dpml-http-test.block
+ $ metro artifact:block:dpml/http/dpml-http-test

To see the result:


Modified: development/main/planet/facilities/http/api/build.xml
==============================================================================
--- development/main/planet/facilities/http/api/build.xml (original)
+++ development/main/planet/facilities/http/api/build.xml Thu Dec 23
00:24:29 2004
@@ -16,7 +16,7 @@
* limitations under the License.
-->

-<project name="dpml-planet-http-api" default="install" basedir="."
+<project name="dpml-http-api" default="install" basedir="."
xmlns:magic="antlib:net.dpml.magic"
xmlns:x="plugin:dpml/magic/dpml-magic-core" >

<magic:import uri="artifact:template:dpml/magic/standard"/>

Modified:
development/main/planet/facilities/http/api/src/main/net/dpml/http/HttpRequestHandler.java
==============================================================================
---
development/main/planet/facilities/http/api/src/main/net/dpml/planet/http/HttpRequestHandler.java
(original)
+++
development/main/planet/facilities/http/api/src/main/net/dpml/http/HttpRequestHandler.java
Thu Dec 23 00:24:29 2004
@@ -1,19 +1,19 @@
/*
* Copyright 2004 Niclas Hedman.
- *
+ *
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-package net.dpml.planet.http;
+package net.dpml.http;

import java.io.IOException;

@@ -23,8 +23,8 @@
/**
* Defines the method that all http handlers must implement.
*
- * <p>A http handler is a component that runs within a
- * container that implements support for HTTP requests and
+ * <p>A http handler is a component that runs within a
+ * container that implements support for HTTP requests and
* response generation.</p>
*
* @author <a href="mailto:dev-dpml AT lists.ibiblio.org";>The Digital Product
Meta Library</a>
@@ -32,7 +32,7 @@
public interface HttpRequestHandler
{
/**
- * Called by the container to allow the handler to respond to
+ * Called by the container to allow the handler to respond to
* a request in a manner that parrallels the Servlet model.
* <p>This method is only called after the component has been fully
deployed.
*
@@ -42,8 +42,8 @@
* @param response the <code>ServletResponse</code> object that contains
* the handler's response
*
- * @exception ServletException if an exception occurs that interferes
- * with the handlers normal operation
+ * @exception HttpRequestHandlerException if an exception occurs that
interferes
+ * with the handlers normal operation
*
* @exception IOException if an input or output exception occurs
*

Modified:
development/main/planet/facilities/http/api/src/main/net/dpml/http/HttpRequestHandlerException.java
==============================================================================
---
development/main/planet/facilities/http/api/src/main/net/dpml/planet/http/HttpRequestHandlerException.java
(original)
+++
development/main/planet/facilities/http/api/src/main/net/dpml/http/HttpRequestHandlerException.java
Thu Dec 23 00:24:29 2004
@@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-package net.dpml.planet.http;
+package net.dpml.http;

/**
* Exception to indicate that there was a http handler related error.

Modified: development/main/planet/facilities/http/blocks/build.xml
==============================================================================
--- development/main/planet/facilities/http/blocks/build.xml (original)
+++ development/main/planet/facilities/http/blocks/build.xml Thu Dec 23
00:24:29 2004
@@ -16,7 +16,7 @@
* limitations under the License.
-->

-<project name="dpml-planet-http-blocks" default="default" basedir="."
+<project name="dpml-http-blocks" default="default" basedir="."
xmlns:magic="antlib:net.dpml.magic" >

<magic:import uri="artifact:template:dpml/magic/reactor"/>

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 Thu
Dec 23 00:24:29 2004
@@ -16,33 +16,33 @@
* limitations under the License.
-->

-<project name="dpml-planet-http-context" default="install" basedir="."
+<project name="dpml-http-context" default="install" basedir="."
xmlns:magic="antlib:net.dpml.magic"
xmlns:x="plugin:dpml/magic/dpml-magic-core" >

<magic:import uri="artifact:template:dpml/magic/standard"/>

<target name="build" depends="standard.build">
<x:block name="default-context">
- <x:component name="context"
class="net.dpml.planet.http.impl.HttpContextImpl" />
- <x:component name="security-handler"
class="net.dpml.planet.http.impl.SecurityHandler" />
+ <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.planet.http.impl.ResourceHandler" >
+ <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.planet.http.impl.NotFoundHandler" />
+ <x:component name="notfound-handler"
class="net.dpml.http.impl.NotFoundHandler" />

- <x:component name="errorpage-handler"
class="net.dpml.planet.http.impl.ErrorPageHandler" >
+ <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.planet.http.impl.NcsaRequestLog" >
+ <x:component name="request-log"
class="net.dpml.http.impl.NcsaRequestLog" >
<x:parameters>
<x:parameter name="filename" value="logs/request.log" />
<x:parameter name="append" value="true" />

Modified: development/main/planet/facilities/http/blocks/demo/README.TXT
==============================================================================
--- development/main/planet/facilities/http/blocks/demo/README.TXT
(original)
+++ development/main/planet/facilities/http/blocks/demo/README.TXT Thu
Dec 23 00:24:29 2004
@@ -12,7 +12,7 @@
<x:block name="demo">
<x:include name="server"
artifact="block:avalon/http/avalon-http-server#SNAPSHOT"/>
<x:include name="static-context"
artifact="block:avalon/http/avalon-http-static#SNAPSHOT"/>
- <x:component name="hello"
class="net.dpml.planet.playground.HelloComponent"/>
+ <x:component name="hello" class="net.dpml.playground.HelloComponent"/>
</x:block>

The block is configured using the a targets file. The file includes three
target

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 Thu
Dec 23 00:24:29 2004
@@ -16,7 +16,7 @@
* limitations under the License.
-->

-<project name="dpml-planet-http-demo" default="install" basedir="."
+<project name="dpml-http-demo" default="install" basedir="."
xmlns:magic="antlib:net.dpml.magic"
xmlns:x="plugin:dpml/magic/dpml-magic-core" >

<magic:import uri="artifact:template:dpml/magic/standard"/>
@@ -24,16 +24,16 @@
<target name="build" depends="standard.build">

<x:property name="server.uri"
- key="dpml-planet-http-server" feature="uri"/>
+ key="dpml-http-server" feature="uri"/>
<x:property name="static.uri"
- key="dpml-planet-http-static" feature="uri"/>
+ key="dpml-http-static" feature="uri"/>
<x:property name="hash.uri"
- key="dpml-planet-http-hash-basic" feature="uri"/>
+ key="dpml-http-hash-basic" feature="uri"/>

<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.planet.playground.HelloComponent"/>
+ <x:component name="hello" class="net.dpml.playground.HelloComponent"/>
<x:include name="authentication" uri="${hash.uri}"/>
</x:block>


Modified:
development/main/planet/facilities/http/blocks/demo/src/main/net/dpml/planet/playground/HelloComponent.java
==============================================================================
---
development/main/planet/facilities/http/blocks/demo/src/main/net/dpml/planet/playground/HelloComponent.java
(original)
+++
development/main/planet/facilities/http/blocks/demo/src/main/net/dpml/planet/playground/HelloComponent.java
Thu Dec 23 00:24:29 2004
@@ -24,7 +24,7 @@
import java.util.Date;

import net.dpml.logging.Logger;
-import net.dpml.planet.http.HttpRequestHandler;
+import net.dpml.http.HttpRequestHandler;

import org.mortbay.http.HttpRequest;
import org.mortbay.http.HttpResponse;
@@ -33,7 +33,7 @@
* HTTP Handler component that receives and processes http requests.
*
* @metro.component name="test" lifestyle="thread"
- * @metro.service type="net.dpml.planet.http.HttpRequestHandler"
+ * @metro.service type="net.dpml.http.HttpRequestHandler"
*
* @author <a href="mailto:dev-dpml AT lists.ibiblio.org";>The Digital Product
Meta Library</a>
*/

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 Thu
Dec 23 00:24:29 2004
@@ -16,14 +16,14 @@
* limitations under the License.
-->

-<project name="dpml-planet-http-hash-basic" default="install" basedir="."
+<project name="dpml-http-hash-basic" default="install" basedir="."
xmlns:magic="antlib:net.dpml.magic"
xmlns:x="plugin:dpml/magic/dpml-magic-core" >

<magic:import uri="artifact:template:dpml/magic/standard"/>

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

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
Thu Dec 23 00:24:29 2004
@@ -16,20 +16,20 @@
* limitations under the License.
-->

-<project name="dpml-planet-http-hash-clientcert" default="install"
basedir="."
+<project name="dpml-http-hash-clientcert" default="install" basedir="."
xmlns:magic="antlib:net.dpml.magic"
xmlns:x="plugin:dpml/magic/dpml-magic-core" >

<magic:import uri="artifact:template:dpml/magic/standard"/>

<target name="build" depends="standard.build">
<x:block name="hash-clientcert-auth">
- <x:component name="realm"
class="net.dpml.planet.http.impl.HashUserRealm" >
+ <x:component name="realm" class="net.dpml.http.impl.HashUserRealm" >
<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.planet.http.impl.ClientCertAuthenticator" />
+ <x:component name="authenticator"
class="net.dpml.http.impl.ClientCertAuthenticator" />
</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
Thu Dec 23 00:24:29 2004
@@ -16,14 +16,14 @@
* limitations under the License.
-->

-<project name="dpml-planet-http-hash-digest" default="install" basedir="."
+<project name="dpml-http-hash-digest" default="install" basedir="."
xmlns:magic="antlib:net.dpml.magic"
xmlns:x="plugin:dpml/magic/dpml-magic-core" >

<magic:import uri="artifact:template:dpml/magic/standard"/>

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

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 Thu
Dec 23 00:24:29 2004
@@ -16,20 +16,20 @@
* limitations under the License.
-->

-<project name="dpml-planet-http-hash-form" default="install" basedir="."
+<project name="dpml-http-hash-form" default="install" basedir="."
xmlns:magic="antlib:net.dpml.magic"
xmlns:x="plugin:dpml/magic/dpml-magic-core" >

<magic:import uri="artifact:template:dpml/magic/standard"/>

<target name="build" depends="standard.build">
<x:block name="hash-form-auth">
- <x:component name="realm"
class="net.dpml.planet.http.impl.HashUserRealm" >
+ <x:component name="realm" class="net.dpml.http.impl.HashUserRealm" >
<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.planet.http.impl.FormAuthenticator" >
+ <x:component name="authenticator"
class="net.dpml.http.impl.FormAuthenticator" >
<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/index.xml
==============================================================================
--- development/main/planet/facilities/http/blocks/index.xml (original)
+++ development/main/planet/facilities/http/blocks/index.xml Thu Dec 23
00:24:29 2004
@@ -24,42 +24,43 @@
<info>
<group>dpml/http</group>
<name>dpml-http-context</name>
- <version>1.0.0</version>
- <status>SNAPSHOT</status>
<type>block</type>
</info>
+ <dependencies>
+ <include key="dpml-http-impl" />
+ </dependencies>
</project>

<project basedir="webappserver">
<info>
<group>dpml/http</group>
<name>dpml-http-webappserver</name>
- <version>1.0.0</version>
- <status>SNAPSHOT</status>
<type>block</type>
</info>
+ <dependencies>
+ <include key="dpml-http-impl" />
+ </dependencies>
</project>

<project basedir="server">
<info>
<group>dpml/http</group>
<name>dpml-http-server</name>
- <version>1.0.0</version>
- <status>SNAPSHOT</status>
<type>block</type>
</info>
+ <dependencies>
+ <include key="dpml-http-impl" />
+ </dependencies>
</project>

<project basedir="hash-basic">
<info>
<group>dpml/http</group>
<name>dpml-http-hash-basic</name>
- <version>1.0.0</version>
<type>block</type>
- <status>SNAPSHOT</status>
</info>
<dependencies>
- <!--include key="avalon-framework-api" runtime="false"/-->
+ <include key="dpml-http-impl" />
</dependencies>
</project>

@@ -67,12 +68,10 @@
<info>
<group>dpml/http</group>
<name>dpml-http-hash-form</name>
- <version>1.0.0</version>
<type>block</type>
- <status>SNAPSHOT</status>
</info>
<dependencies>
- <!--include key="avalon-framework-api" runtime="false"/-->
+ <include key="dpml-http-impl" />
</dependencies>
</project>

@@ -80,12 +79,10 @@
<info>
<group>dpml/http</group>
<name>dpml-http-hash-clientcert</name>
- <version>1.0.0</version>
<type>block</type>
- <status>SNAPSHOT</status>
</info>
<dependencies>
- <!--include key="avalon-framework-api" runtime="false"/-->
+ <include key="dpml-http-impl" />
</dependencies>
</project>

@@ -93,12 +90,10 @@
<info>
<group>dpml/http</group>
<name>dpml-http-hash-digest</name>
- <version>1.0.0</version>
<type>block</type>
- <status>SNAPSHOT</status>
</info>
<dependencies>
- <!--include key="avalon-framework-api" runtime="false"/-->
+ <include key="dpml-http-impl" />
</dependencies>
</project>

@@ -106,9 +101,7 @@
<info>
<group>dpml/http</group>
<name>dpml-http-demo</name>
- <version>1.0.0</version>
<type>jar</type>
- <status>SNAPSHOT</status>
</info>
<dependencies>
<include key="dpml-http-impl" />
@@ -123,10 +116,11 @@
<info>
<group>dpml/http</group>
<name>dpml-http-static</name>
- <version>1.0.0</version>
<type>block</type>
- <status>SNAPSHOT</status>
</info>
+ <dependencies>
+ <include key="dpml-http-impl" />
+ </dependencies>
</project>

<project basedir="servlet">
@@ -134,24 +128,9 @@
<group>dpml/http</group>
<name>dpml-http-servlet</name>
<type>block</type>
- <version>1.0.0</version>
- <type>block</type>
- <status>SNAPSHOT</status>
- </info>
- </project>
-
- <project basedir="examples">
- <info>
- <group>dpml/http</group>
- <name>dpml-http-examples</name>
- <version>1.0.0</version>
- <type>jar</type>
- <status>SNAPSHOT</status>
</info>
<dependencies>
- <include key="servletapi" />
- <include key="dpml-http-server"/>
- <include key="dpml-http-servlet"/>
+ <include key="dpml-http-impl" />
</dependencies>
</project>

@@ -159,10 +138,10 @@
<info>
<group>dpml/http/examples/tapestry</group>
<name>dpml-http-examples-tapestry</name>
- <version>1.0.0</version>
<type>block</type>
</info>
<dependencies>
+ <include key="dpml-http-impl" />
<include key="servletapi" />
<include key="tapestry" />
</dependencies>

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 Thu
Dec 23 00:24:29 2004
@@ -16,17 +16,17 @@
* limitations under the License.
-->

-<project name="dpml-planet-http-server" default="install" basedir="."
+<project name="dpml-http-server" default="install" basedir="."
xmlns:magic="antlib:net.dpml.magic"
xmlns:x="plugin:dpml/magic/dpml-magic-core" >

<magic:import uri="artifact:template:dpml/magic/standard"/>

<target name="build" depends="standard.build">
<x:block name="http-server">
- <x:service type="net.dpml.planet.http.HttpService"
source="httpserver"/>
- <x:component name="socketlistener"
class="net.dpml.planet.http.impl.SocketListener" />
- <x:component name="ssllistener"
class="net.dpml.planet.http.impl.JsseListener" />
- <x:component name="httpserver"
class="net.dpml.planet.http.impl.HttpServerImpl" />
+ <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: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 Thu
Dec 23 00:24:29 2004
@@ -16,24 +16,24 @@
* limitations under the License.
-->

-<project name="dpml-planet-http-servlet" default="install" basedir="."
+<project name="dpml-http-servlet" default="install" basedir="."
xmlns:magic="antlib:net.dpml.magic"
xmlns:x="plugin:dpml/magic/dpml-magic-core" >

<magic:import uri="artifact:template:dpml/magic/standard"/>

<target name="build" depends="standard.build">
<x:block name="servlet">
- <x:component name="context"
class="net.dpml.planet.http.impl.HttpContextImpl"/>
- <x:component name="security-handler"
class="net.dpml.planet.http.impl.SecurityHandler"/>
- <x:component name="servlets"
class="net.dpml.planet.http.impl.ServletHandler" />
- <x:component name="resource-handler"
class="net.dpml.planet.http.impl.ResourceHandler">
+ <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: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.planet.http.impl.NotFoundHandler"/>
- <x:component name="request-log"
class="net.dpml.planet.http.impl.NcsaRequestLog">
+ <x:component name="notfound-handler"
class="net.dpml.http.impl.NotFoundHandler"/>
+ <x:component name="request-log"
class="net.dpml.http.impl.NcsaRequestLog">
<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 Thu
Dec 23 00:24:29 2004
@@ -16,24 +16,24 @@
* limitations under the License.
-->

-<project name="dpml-planet-http-static" default="install" basedir="."
+<project name="dpml-http-static" default="install" basedir="."
xmlns:magic="antlib:net.dpml.magic"
xmlns:x="plugin:dpml/magic/dpml-magic-core" >

<magic:import uri="artifact:template:dpml/magic/standard"/>

<target name="build" depends="standard.build">
<x:block name="static">
- <x:component name="context"
class="net.dpml.planet.http.impl.HttpContextImpl"/>
- <x:component name="security-handler"
class="net.dpml.planet.http.impl.SecurityHandler"/>
- <x:component name="resource-handler"
class="net.dpml.planet.http.impl.ResourceHandler">
+ <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: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.planet.http.impl.ForwardHandler"/>
- <x:component name="notfound-handler"
class="net.dpml.planet.http.impl.NotFoundHandler"/>
- <x:component name="request-log"
class="net.dpml.planet.http.impl.NcsaRequestLog">
+ <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:parameters>
<x:parameter name="filename" value="static_request.log"/>
<x:parameter name="append" value="true"/>

Modified: development/main/planet/facilities/http/blocks/tapestry/build.xml
==============================================================================
--- development/main/planet/facilities/http/blocks/tapestry/build.xml
(original)
+++ development/main/planet/facilities/http/blocks/tapestry/build.xml Thu
Dec 23 00:24:29 2004
@@ -22,14 +22,13 @@
<magic:import uri="artifact:template:dpml/magic/standard"/>

<target name="build" depends="standard.build">
+ <x:property name="webappserver.uri"
+ key="dpml-http-webappserver" feature="block"/>
+
<x:block name="tapestry-example">
- <x:component name="socketlistener"
class="net.dpml.planet.http.impl.SocketListener" />
- <x:component name="httpserver"
class="net.dpml.planet.http.impl.HttpServerImpl" />
-
- <x:include name="web-context"
uri="artifact:block:dpml/planet/http/dpml-planet-http-webcontext#SNAPSHOT" />
- <x:include name="static-context"
uri="artifact:block:dpml/planet/http/dpml-planet-http-static#SNAPSHOT" />
-
+ <x:include name="webapp-server" uri="${webappserver.uri}" />
</x:block>
+
</target>

</project>

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
Thu Dec 23 00:24:29 2004
@@ -16,7 +16,7 @@
* limitations under the License.
-->

-<project name="dpml-planet-http-webappserver" default="install" basedir="."
+<project name="dpml-http-webappserver" default="install" basedir="."
xmlns:magic="antlib:net.dpml.magic"
xmlns:x="plugin:dpml/magic/dpml-magic-core" >

<magic:import uri="artifact:template:dpml/magic/standard"/>
@@ -24,31 +24,32 @@
<target name="build" depends="standard.build">

<x:property name="server.uri"
- key="dpml-planet-http-server" feature="block"/>
+ key="dpml-http-server" feature="block"/>

<x:block name="webapp">
<x:include name="server" uri="${server.uri}"/>

- <x:component name="context"
class="net.dpml.planet.http.impl.WebContextImpl" />
- <x:component name="security-handler"
class="net.dpml.planet.http.impl.SecurityHandler" />
+ <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.planet.http.impl.ResourceHandler" >
+ <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.planet.http.impl.NotFoundHandler" />
+ <x:component name="notfound-handler"
class="net.dpml.http.impl.NotFoundHandler" />

- <x:component name="errorpage-handler"
class="net.dpml.planet.http.impl.ErrorPageHandler" >
+ <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.planet.http.impl.NcsaRequestLog" >
+-->
+ <x:component name="request-log"
class="net.dpml.http.impl.NcsaRequestLog" >
<x:parameters>
<x:parameter name="filename" value="logs/request.log" />
<x:parameter name="append" value="true" />

Added:
development/main/planet/facilities/http/blocks/webappserver/etc/deliverables/confs/webapp-defaults.conf
==============================================================================
--- (empty file)
+++
development/main/planet/facilities/http/blocks/webappserver/etc/deliverables/confs/webapp-defaults.conf
Thu Dec 23 00:24:29 2004
@@ -0,0 +1,258 @@
+<?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";>
+
+<!-- =====================================================================
-->
+<!-- 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 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>
+ <description>
+ Default web.xml file.
+ This file is applied to a Web application before it's own
WEB_INF/web.xml file
+ </description>
+
+
+
+ <!-- ====================================================================
-->
+ <!-- Context params to control Session Cookies
-->
+ <!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
-->
+ <!-- UNCOMMENT TO ACTIVATE
+ <context-param>
+ <param-name>org.mortbay.jetty.servlet.SessionDomain</param-name>
+ <param-value>127.0.0.1</param-value>
+ </context-param>
+
+ <context-param>
+ <param-name>org.mortbay.jetty.servlet.SessionPath</param-name>
+ <param-value>/</param-value>
+ </context-param>
+
+ <context-param>
+ <param-name>org.mortbay.jetty.servlet.MaxAge</param-name>
+ <param-value>-1</param-value>
+ </context-param>
+ -->
+
+
+
+ <!-- ====================================================================
-->
+ <!-- The default servlet.
-->
+ <!-- This servlet, normally mapped to /, provides the handling for static
-->
+ <!-- content, OPTION and TRACE methods for the context.
-->
+ <!-- The following initParameters are supported:
-->
+ <!--
-->
+ <!-- acceptRanges If true, range requests and responses are
-->
+ <!-- supported
-->
+ <!--
-->
+ <!-- dirAllowed If true, directory listings are returned if no
-->
+ <!-- welcome file is found. Else 403 Forbidden.
-->
+ <!--
-->
+ <!-- putAllowed If true, the PUT method is allowed
-->
+ <!--
-->
+ <!-- delAllowed If true, the DELETE method is allowed
-->
+ <!--
-->
+ <!-- redirectWelcome If true, redirect welcome file requests
-->
+ <!-- else use request dispatcher forwards
-->
+ <!--
-->
+ <!-- minGzipLength If set to a positive integer, then static content
-->
+ <!-- larger than this will be served as gzip content
-->
+ <!-- encoded if a matching resource is found ending
-->
+ <!-- with ".gz"
-->
+ <!--
-->
+ <!-- resoureBase Can be set to replace the context resource base
-->
+ <!--
-->
+ <!-- The MOVE method is allowed if PUT and DELETE are allowed
-->
+ <!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
-->
+ <servlet>
+ <servlet-name>default</servlet-name>
+ <servlet-class>org.mortbay.jetty.servlet.Default</servlet-class>
+ <init-param>
+ <param-name>acceptRanges</param-name>
+ <param-value>true</param-value>
+ </init-param>
+ <init-param>
+ <param-name>dirAllowed</param-name>
+ <param-value>true</param-value>
+ </init-param>
+ <init-param>
+ <param-name>putAllowed</param-name>
+ <param-value>false</param-value>
+ </init-param>
+ <init-param>
+ <param-name>delAllowed</param-name>
+ <param-value>false</param-value>
+ </init-param>
+ <init-param>
+ <param-name>redirectWelcome</param-name>
+ <param-value>false</param-value>
+ </init-param>
+ <init-param>
+ <param-name>minGzipLength</param-name>
+ <param-value>8192</param-value>
+ </init-param>
+ <load-on-startup>0</load-on-startup>
+ </servlet>
+
+ <!-- ====================================================================
-->
+ <!-- JSP Servlet
-->
+ <!-- This is the jasper JSP servlet from the jakarta project
-->
+ <!-- The following initParameters are supported:
-->
+ <!--
-->
+ <!-- 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]
-->
+ <!--
-->
+ <!-- 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]
-->
+ <!--
-->
+ <!-- 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
-->
+ <!-- FATAL, ERROR, WARNING, INFORMATION, and DEBUG.
-->
+ <!-- [WARNING]
-->
+ <!--
-->
+ <!-- mappedfile Should we generate static content with one
-->
+ <!-- print statement per input line, to ease
-->
+ <!-- debugging? [false]
-->
+ <!--
-->
+ <!-- scratchdir What scratch directory should we use when
-->
+ <!-- compiling JSP pages? [default work directory
-->
+ <!-- for the current web application]
-->
+ <!--
-->
+ <!-- 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".
-->
+ <!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
-->
+ <servlet>
+ <servlet-name>jsp</servlet-name>
+ <servlet-class>org.apache.jasper.servlet.JspServlet</servlet-class>
+ <load-on-startup>0</load-on-startup>
+ </servlet>
+
+ <!-- ====================================================================
-->
+ <!-- Dynamic Servlet Invoker.
-->
+ <!-- This servlet invokes anonymous servlets that have not been defined
-->
+ <!-- in the web.xml or by other means. The first element of the pathInfo
-->
+ <!-- of a request passed to the envoker is treated as a servlet name for
-->
+ <!-- an existing servlet, or as a class name of a new servlet.
-->
+ <!-- This servlet is normally mapped to /servlet/*
-->
+ <!-- This servlet support the following initParams:
-->
+ <!--
-->
+ <!-- nonContextServlets If false, the invoker can only load
-->
+ <!-- servlets from the contexts classloader.
-->
+ <!-- This is false by default and setting this
-->
+ <!-- to true may have security implications.
-->
+ <!--
-->
+ <!-- verbose If true, log dynamic loads
-->
+ <!--
-->
+ <!-- * All other parameters are copied to the
-->
+ <!-- each dynamic servlet as init parameters
-->
+ <!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
-->
+ <servlet>
+ <servlet-name>invoker</servlet-name>
+ <servlet-class>org.mortbay.jetty.servlet.Invoker</servlet-class>
+ <init-param>
+ <param-name>verbose</param-name>
+ <param-value>false</param-value>
+ </init-param>
+ <init-param>
+ <param-name>nonContextServlets</param-name>
+ <param-value>false</param-value>
+ </init-param>
+ <init-param>
+ <param-name>dynamicParam</param-name>
+ <param-value>anyValue</param-value>
+ </init-param>
+ <load-on-startup>0</load-on-startup>
+ </servlet>
+
+ <!-- ====================================================================
-->
+ <servlet-mapping>
+ <servlet-name>default</servlet-name>
+ <url-pattern>/</url-pattern>
+ </servlet-mapping>
+
+ <!-- ====================================================================
-->
+ <servlet-mapping>
+ <servlet-name>jsp</servlet-name>
+ <url-pattern>*.jsp</url-pattern>
+ </servlet-mapping>
+
+ <!-- ====================================================================
-->
+ <servlet-mapping>
+ <servlet-name>jsp</servlet-name>
+ <url-pattern>*.jspf</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>
+ </session-config>
+
+ <!-- ====================================================================
-->
+ <!-- Default MIME mappings
-->
+ <!-- The default MIME mappings are provided by the mime.properties
-->
+ <!-- resource in the org.mortbay.jetty.jar file. Additional or modified
-->
+ <!-- mappings may be specified here
-->
+ <!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
-->
+ <!-- UNCOMMENT TO ACTIVATE
+ <mime-mapping>
+ <extension>mysuffix</extension>
+ <mime-type>mymime/type</mime-type>
+ </mime-mapping>
+ -->
+
+ <!-- ====================================================================
-->
+ <welcome-file-list>
+ <welcome-file>index.html</welcome-file>
+ <welcome-file>index.htm</welcome-file>
+ <welcome-file>index.jsp</welcome-file>
+ </welcome-file-list>
+
+</web-app>

Modified: development/main/planet/facilities/http/examples/hangman/build.xml
==============================================================================
--- development/main/planet/facilities/http/examples/hangman/build.xml
(original)
+++ development/main/planet/facilities/http/examples/hangman/build.xml Thu
Dec 23 00:24:29 2004
@@ -22,13 +22,6 @@
<magic:import uri="artifact:template:dpml/magic/standard"/>

<target name="build" depends="standard.build">
- <x:property name="webappserver.uri"
- key="dpml-planet-http-server" feature="block"/>
-
- <x:block name="hangman-app" >
- <x:include name="webapp-server" uri="${webappserver.uri}" />
- </x:block>
-
<mkdir dir="target/deliverables/wars/" />

<war destfile="target/deliverables/wars/hangman.war"
webxml="etc/web.xml">

Added:
development/main/planet/facilities/http/examples/hangman/etc/deliverables/confs/webapp.conf
==============================================================================
--- (empty file)
+++
development/main/planet/facilities/http/examples/hangman/etc/deliverables/confs/webapp.conf
Thu Dec 23 00:24:29 2004
@@ -0,0 +1,30 @@
+<?xml version="1.0" encoding="ISO-8859-1"?>
+<!--
+ * Copyright 2004 Stephen J. McConnell.
+ * Copyright 2004 Niclas Hedman.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.dpml.net/central/about/legal/
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+-->
+
+<targets>
+
+ <target path="/webapp/context">
+ <configuration>
+
<web-application>artifact:war:dpml/http/dpml-http-webapp-demo</web-application>
+ <context-path>/</context-path>
+
<defaults-descriptor>artifact:conf:dpml/http/dpml-http-webappserver</defaults-descriptor>
+ </configuration>
+ </target>
+
+</targets>
+

Modified: development/main/planet/facilities/http/impl/build.xml
==============================================================================
--- development/main/planet/facilities/http/impl/build.xml (original)
+++ development/main/planet/facilities/http/impl/build.xml Thu Dec 23
00:24:29 2004
@@ -16,94 +16,9 @@
* limitations under the License.
-->

-<project name="dpml-planet-http-impl" default="install" basedir="."
+<project name="dpml-http-impl" default="install" basedir="."
xmlns:magic="antlib:net.dpml.magic"
xmlns:x="plugin:dpml/magic/dpml-magic-core" >

<magic:import uri="artifact:template:dpml/magic/standard"/>

- <target name="build" depends="standard.build">
-
- <x:block name="default-context">
- <x:component name="context"
class="net.dpml.planet.http.impl.HttpContextImpl" />
- <x:component name="security-handler"
class="net.dpml.planet.http.impl.SecurityHandler" />
-
- <x:component name="resource-handler"
class="net.dpml.planet.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.planet.http.impl.NotFoundHandler" />
-
- <x:component name="errorpage-handler"
class="net.dpml.planet.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.planet.http.impl.NcsaRequestLog" >
- <x:parameters>
- <x:parameter name="filename" value="logs/request.log" />
- <x:parameter name="append" value="true" />
- <x:parameter name="extended" value="true" />
- </x:parameters>
- </x:component>
- </x:block>
-
-
- <x:block name="default-server">
- <x:component name="socketlistener"
class="net.dpml.planet.http.impl.SocketListener" />
- <x:component name="ssllistener"
class="net.dpml.planet.http.impl.JsseListener" />
- <x:component name="ajplistener"
class="net.dpml.planet.http.impl.Ajp13Listener" />
- <x:component name="httpserver"
class="net.dpml.planet.http.impl.HttpServerImpl" />
- </x:block>
-
- <x:block name="hash-basic-auth">
- <x:component name="realm"
class="net.dpml.planet.http.impl.HashUserRealm" >
- <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:block>
-
- <x:block name="hash-digest-auth" >
- <x:component name="realm"
class="net.dpml.planet.http.impl.HashUserRealm" >
- <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:block>
-
- <x:block name="hash-clientcert-auth" >
- <x:component name="realm"
class="net.dpml.planet.http.impl.HashUserRealm" >
- <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.planet.http.impl.ClientCertAuthenticator" />
- </x:block>
-
- <x:block name="hash-form-auth" >
- <x:component name="realm"
class="net.dpml.planet.http.impl.HashUserRealm" >
- <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.planet.http.impl.FormAuthenticator" >
- <x:parameters>
- <x:parameter name="login-page" value="/login.html" />
- <x:parameter name="error-page" value="/login_error.html" />
- </x:parameters>
- </x:component>
- </x:block>
- </target>
-
</project>

Added: development/main/planet/facilities/http/impl/src/main/mimetypes.xconfig
==============================================================================
--- (empty file)
+++ development/main/planet/facilities/http/impl/src/main/mimetypes.xconfig
Thu Dec 23 00:24:29 2004
@@ -0,0 +1,477 @@
+
+ <configuration>
+ <mimetypes>
+ <type>
+ <mime>text/plain</mime>
+ <ext>txt</ext>
+ </type>
+ <type>
+ <mime>application/andrew-inset</mime>
+ <ext>ez</ext>
+ </type>
+ <type>
+ <mime>application/mac-binhex40</mime>
+ <ext>hqx</ext>
+ </type>
+ <type>
+ <mime>application/mac-compactpro</mime>
+ <ext>cpt</ext>
+ </type>
+ <type>
+ <mime>application/msword</mime>
+ <ext>doc</ext>
+ </type>
+ <type>
+ <mime>application/octet-stream</mime>
+ <ext>bin</ext>
+ <ext>dms</ext>
+ <ext>lha</ext>
+ <ext>lzh</ext>
+ <ext>exe</ext>
+ <ext>class</ext>
+ <ext>so</ext>
+ <ext>dll</ext>
+ </type>
+ <type>
+ <mime>application/oda</mime>
+ <ext>oda</ext>
+ </type>
+ <type>
+ <mime>application/pdf</mime>
+ <ext>pdf</ext>
+ </type>
+ <type>
+ <mime>application/postscript</mime>
+ <ext>ai</ext>
+ <ext>eps</ext>
+ <ext>ps</ext>
+ </type>
+ <type>
+ <mime>application/rtf</mime>
+ <ext>rtf</ext>
+ </type>
+ <type>
+ <mime>application/smil</mime>
+ <ext>smi</ext>
+ <ext>smil</ext>
+ </type>
+ <type>
+ <mime>application/vnd.mif</mime>
+ <ext>mif</ext>
+ </type>
+ <type>
+ <mime>application/vnd.ms-excel</mime>
+ <ext>xls</ext>
+ </type>
+ <type>
+ <mime>application/vnd.ms-powerpoint</mime>
+ <ext>ppt</ext>
+ </type>
+ <type>
+ <mime>application/vnd.wap.wbxml</mime>
+ <ext>wbxml</ext>
+ </type>
+ <type>
+ <mime>application/vnd.wap.wmlc</mime>
+ <ext>wmlc</ext>
+ </type>
+ <type>
+ <mime>application/vnd.wap.wmlscriptc</mime>
+ <ext>wmlsc</ext>
+ </type>
+ <type>
+ <mime>application/x-bcpio</mime>
+ <ext>bcpio</ext>
+ </type>
+ <type>
+ <mime>application/x-bzip2</mime>
+ <ext>bz2</ext>
+ </type>
+ <type>
+ <mime>application/x-cdlink</mime>
+ <ext>vcd</ext>
+ </type>
+ <type>
+ <mime>application/x-chess-pgn</mime>
+ <ext>pgn</ext>
+ </type>
+ <type>
+ <mime>application/x-cpio</mime>
+ <ext>cpio</ext>
+ </type>
+ <type>
+ <mime>application/x-csh</mime>
+ <ext>csh</ext>
+ </type>
+ <type>
+ <mime>application/x-director</mime>
+ <ext>dcr</ext>
+ <ext>dir</ext>
+ <ext>dxr</ext>
+ </type>
+ <type>
+ <mime>application/x-dvi</mime>
+ <ext>dvi</ext>
+ </type>
+ <type>
+ <mime>application/x-futuresplash</mime>
+ <ext>spl</ext>
+ </type>
+ <type>
+ <mime>application/x-gtar</mime>
+ <ext>gtar</ext>
+ </type>
+ <type>
+ <mime>application/x-gzip</mime>
+ <ext>gz</ext>
+ <ext>tgz</ext>
+ </type>
+ <type>
+ <mime>application/x-hdf</mime>
+ <ext>hdf</ext>
+ </type>
+ <type>
+ <mime>application/x-javascript</mime>
+ <ext>js</ext>
+ </type>
+ <type>
+ <mime>application/x-kword</mime>
+ <ext>kwd</ext>
+ <ext>kwt</ext>
+ </type>
+ <type>
+ <mime>application/x-kspread</mime>
+ <ext>ksp</ext>
+ </type>
+ <type>
+ <mime>application/x-kpresenter</mime>
+ <ext>kpr</ext>
+ <ext>kpt</ext>
+ </type>
+ <type>
+ <mime>application/x-kchart</mime>
+ <ext>chrt</ext>
+ </type>
+ <type>
+ <mime>application/x-killustrator</mime>
+ <ext>kil</ext>
+ </type>
+ <type>
+ <mime>application/x-koan</mime>
+ <ext>skp</ext>
+ <ext>skd</ext>
+ <ext>skt</ext>
+ <ext>skm</ext>
+ </type>
+ <type>
+ <mime>application/x-latex</mime>
+ <ext>latex</ext>
+ </type>
+ <type>
+ <mime>application/x-netcdf</mime>
+ <ext>nc</ext>
+ <ext>cdf</ext>
+ </type>
+ <type>
+ <mime>application/x-ogg</mime>
+ <ext>ogg</ext>
+ </type>
+ <type>
+ <mime>application/x-rpm</mime>
+ <ext>rpm</ext>
+ </type>
+ <type>
+ <mime>application/x-sh</mime>
+ <ext>sh</ext>
+ </type>
+ <type>
+ <mime>application/x-shar</mime>
+ <ext>shar</ext>
+ </type>
+ <type>
+ <mime>application/x-shockwave-flash</mime>
+ <ext>swf</ext>
+ </type>
+ <type>
+ <mime>application/x-stuffit</mime>
+ <ext>sit</ext>
+ </type>
+ <type>
+ <mime>application/x-sv4cpio</mime>
+ <ext>sv4cpio</ext>
+ </type>
+ <type>
+ <mime>application/x-sv4crc</mime>
+ <ext>sv4crc</ext>
+ </type>
+ <type>
+ <mime>application/x-tar</mime>
+ <ext>tar</ext>
+ </type>
+ <type>
+ <mime>application/x-tcl</mime>
+ <ext>tcl</ext>
+ </type>
+ <type>
+ <mime>application/x-tex</mime>
+ <ext>tex</ext>
+ </type>
+ <type>
+ <mime>application/x-texinfo</mime>
+ <ext>texinfo</ext>
+ <ext>texi</ext>
+ </type>
+ <type>
+ <mime>application/x-troff</mime>
+ <ext>t</ext>
+ <ext>tr</ext>
+ <ext>roff</ext>
+ </type>
+ <type>
+ <mime>application/x-troff-man</mime>
+ <ext>man</ext>
+ </type>
+ <type>
+ <mime>application/x-troff-me</mime>
+ <ext>me</ext>
+ </type>
+ <type>
+ <mime>application/x-troff-ms</mime>
+ <ext>ms</ext>
+ </type>
+ <type>
+ <mime>application/x-ustar</mime>
+ <ext>ustar</ext>
+ </type>
+ <type>
+ <mime>application/x-wais-source</mime>
+ <ext>src</ext>
+ </type>
+ <type>
+ <mime>application/xhtml+xml</mime>
+ <ext>xhtml</ext>
+ <ext>xht</ext>
+ </type>
+ <type>
+ <mime>application/zip</mime>
+ <ext>zip</ext>
+ </type>
+ <type>
+ <mime>audio/basic</mime>
+ <ext>au</ext>
+ <ext>snd</ext>
+ </type>
+ <type>
+ <mime>audio/midi</mime>
+ <ext>mid</ext>
+ <ext>midi</ext>
+ <ext>kar</ext>
+ </type>
+ <type>
+ <mime>audio/mpeg</mime>
+ <ext>mpga</ext>
+ <ext>mp2</ext>
+ <ext>mp3</ext>
+ </type>
+ <type>
+ <mime>audio/x-aiff</mime>
+ <ext>aif</ext>
+ <ext>aiff</ext>
+ <ext>aifc</ext>
+ </type>
+ <type>
+ <mime>audio/x-mpegurl</mime>
+ <ext>m3u</ext>
+ </type>
+ <type>
+ <mime>audio/x-pn-realaudio</mime>
+ <ext>ram</ext>
+ <ext>rm</ext>
+ </type>
+<!-- conflicts with Linux RPM files
+ <type>
+ <mime>audio/x-pn-realaudio-plugin</mime>
+ <ext>rpm</ext>
+ </type>
+-->
+ <type>
+ <mime>audio/x-realaudio</mime>
+ <ext>ra</ext>
+ </type>
+ <type>
+ <mime>audio/x-wav</mime>
+ <ext>wav</ext>
+ </type>
+ <type>
+ <mime>chemical/x-pdb</mime>
+ <ext>pdb</ext>
+ </type>
+ <type>
+ <mime>chemical/x-xyz</mime>
+ <ext>xyz</ext>
+ </type>
+ <type>
+ <mime>image/bmp</mime>
+ <ext>bmp</ext>
+ </type>
+ <type>
+ <mime>image/gif</mime>
+ <ext>gif</ext>
+ </type>
+ <type>
+ <mime>image/ief</mime>
+ <ext>ief</ext>
+ </type>
+ <type>
+ <mime>image/jpeg</mime>
+ <ext>jpeg</ext>
+ <ext>jpg</ext>
+ <ext>jpe</ext>
+ </type>
+ <type>
+ <mime>image/png</mime>
+ <ext>png</ext>
+ </type>
+ <type>
+ <mime>image/tiff</mime>
+ <ext>tiff</ext>
+ <ext>tif</ext>
+ </type>
+ <type>
+ <mime>image/vnd.djvu</mime>
+ <ext>djvu</ext>
+ <ext>djv</ext>
+ </type>
+ <type>
+ <mime>image/vnd.wap.wbmp</mime>
+ <ext>wbmp</ext>
+ </type>
+ <type>
+ <mime>image/x-cmu-raster</mime>
+ <ext>ras</ext>
+ </type>
+ <type>
+ <mime>image/x-portable-anymap</mime>
+ <ext>pnm</ext>
+ </type>
+ <type>
+ <mime>image/x-portable-bitmap</mime>
+ <ext>pbm</ext>
+ </type>
+ <type>
+ <mime>image/x-portable-graymap</mime>
+ <ext>pgm</ext>
+ </type>
+ <type>
+ <mime>image/x-portable-pixmap</mime>
+ <ext>ppm</ext>
+ </type>
+ <type>
+ <mime>image/x-rgb</mime>
+ <ext>rgb</ext>
+ </type>
+ <type>
+ <mime>image/x-xbitmap</mime>
+ <ext>xbm</ext>
+ </type>
+ <type>
+ <mime>image/x-xpixmap</mime>
+ <ext>xpm</ext>
+ </type>
+ <type>
+ <mime>image/x-xwindowdump</mime>
+ <ext>xwd</ext>
+ </type>
+ <type>
+ <mime>model/iges</mime>
+ <ext>igs</ext>
+ <ext>iges</ext>
+ </type>
+ <type>
+ <mime>model/mesh</mime>
+ <ext>msh</ext>
+ <ext>mesh</ext>
+ <ext>silo</ext>
+ </type>
+ <type>
+ <mime>model/vrml</mime>
+ <ext>wrl</ext>
+ <ext>vrml</ext>
+ </type>
+ <type>
+ <mime>text/css</mime>
+ <ext>css</ext>
+ </type>
+ <type>
+ <mime>text/html</mime>
+ <ext>html</ext>
+ <ext>htm</ext>
+ </type>
+ <type>
+ <mime>text/plain</mime>
+ <ext>asc</ext>
+ <ext>txt</ext>
+ </type>
+ <type>
+ <mime>text/richtext</mime>
+ <ext>rtx</ext>
+ </type>
+ <type>
+ <mime>text/rtf</mime>
+ <ext>rtf</ext>
+ </type>
+ <type>
+ <mime>text/sgml</mime>
+ <ext>sgml</ext>
+ <ext>sgm</ext>
+ </type>
+ <type>
+ <mime>text/tab-separated-values</mime>
+ <ext>tsv</ext>
+ </type>
+ <type>
+ <mime>text/vnd.wap.wml</mime>
+ <ext>wml</ext>
+ </type>
+ <type>
+ <mime>text/vnd.wap.wmlscript</mime>
+ <ext>wmls</ext>
+ </type>
+ <type>
+ <mime>text/x-setext</mime>
+ <ext>etx</ext>
+ </type>
+ <type>
+ <mime>text/xml</mime>
+ <ext>xml</ext>
+ <ext>xsl</ext>
+ </type>
+ <type>
+ <mime>video/mpeg</mime>
+ <ext>mpeg</ext>
+ <ext>mpg</ext>
+ <ext>mpe</ext>
+ </type>
+ <type>
+ <mime>video/quicktime</mime>
+ <ext>qt</ext>
+ <ext>mov</ext>
+ </type>
+ <type>
+ <mime>video/vnd.mpegurl</mime>
+ <ext>mxu</ext>
+ </type>
+ <type>
+ <mime>video/x-msvideo</mime>
+ <ext>avi</ext>
+ </type>
+ <type>
+ <mime>video/x-sgi-movie</mime>
+ <ext>movie</ext>
+ </type>
+ <type>
+ <mime>x-conference/x-cooltalk</mime>
+ <ext>ice</ext>
+ </type>
+ </mimetypes>
+ </configuration>

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/planet/http/impl/Ajp13Listener.java
(original)
+++
development/main/planet/facilities/http/impl/src/main/net/dpml/http/impl/Ajp13Listener.java
Thu Dec 23 00:24:29 2004
@@ -1,35 +1,30 @@
/*
* Copyright 2004 Niclas Hedman.
- *
+ *
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-package net.dpml.planet.http.impl;
+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;
import net.dpml.parameters.Parameters;
-
-import net.dpml.service.Serviceable;
+import net.dpml.http.HttpService;
import net.dpml.service.ServiceException;
import net.dpml.service.ServiceManager;
-
-import net.dpml.planet.http.HttpService;
-
+import net.dpml.service.Serviceable;
import org.mortbay.http.HttpListener;

/** Wrapper for the Jetty SocketListener.
@@ -42,11 +37,11 @@
{
private HttpService m_HttpServer;
private Logger m_Logger;
-
+
public Ajp13Listener()
{
}
-
+
/**
* Enable the logging system.
*
@@ -56,39 +51,39 @@
{
m_Logger = logger;
}
-
+
public Logger getLogger()
{
return m_Logger;
}
-
+
public void parameterize( Parameters params )
throws ParameterException
{
int reserve = params.getParameterAsInteger( "buffer-reserve", -1 );
if( reserve > 0 )
setBufferReserve( reserve );
-
+
int size = params.getParameterAsInteger( "buffer-size", -1 );
if( size > 0 )
setBufferSize( size );
-
+
int confPort = params.getParameterAsInteger( "confidential-port", -1
);
if( confPort > 0 )
setConfidentialPort( confPort );
-
+
String confScheme = params.getParameter( "confidential-scheme", null
);
if( confScheme != null )
setConfidentialScheme( confScheme );
-
+
int integralPort = params.getParameterAsInteger( "integral-port", -1
);
if( integralPort > 0 )
setIntegralPort( integralPort );
-
+
String integralScheme = params.getParameter( "integral-scheme", null
);
if( integralScheme != null )
setIntegralScheme( integralScheme );
-
+
String host = params.getParameter( "hostname", null );
try
{
@@ -98,18 +93,18 @@
{
throw new ParameterException( "Unknown hostname: " + host );
}
-
+
int port = params.getParameterAsInteger( "port", 8080 );
setPort( port );
-
+
boolean identify = params.getParameterAsBoolean(
"identify-listener", false );
setIdentifyListener( identify );
-
-
+
+
}
-
+
/**
- * @metro.dependency type="net.dpml.planet.http.HttpService"
+ * @metro.dependency type="net.dpml.http.HttpService"
* key="server"
*/
public void service( ServiceManager man )
@@ -117,7 +112,7 @@
{
m_HttpServer = (HttpService) man.lookup( "server" );
}
-
+
public void start()
throws Exception
{
@@ -126,7 +121,7 @@
m_HttpServer.addListener( this );
super.start();
}
-
+
public void stop()
throws InterruptedException
{
@@ -135,5 +130,5 @@
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/planet/http/impl/ClientCertAuthenticator.java
(original)
+++
development/main/planet/facilities/http/impl/src/main/net/dpml/http/impl/ClientCertAuthenticator.java
Thu Dec 23 00:24:29 2004
@@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-package net.dpml.planet.http.impl;
+package net.dpml.http.impl;

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

Modified:
development/main/planet/facilities/http/impl/src/main/net/dpml/http/impl/ConfigurationMimeTypes.java
==============================================================================
---
development/main/planet/facilities/http/impl/src/main/net/dpml/planet/http/impl/ConfigurationMimeTypes.java
(original)
+++
development/main/planet/facilities/http/impl/src/main/net/dpml/http/impl/ConfigurationMimeTypes.java
Thu Dec 23 00:24:29 2004
@@ -1,51 +1,51 @@
/*
* Copyright 2004 Niclas Hedman.
- *
+ *
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-package net.dpml.planet.http.impl;
+package net.dpml.http.impl;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.Map;
-
import net.dpml.configuration.Configurable;
import net.dpml.configuration.Configuration;
import net.dpml.configuration.ConfigurationException;
-
-import net.dpml.planet.http.MimeTypes;
+import net.dpml.http.MimeTypes;

/**
* @metro.component name="mimetypes-configuration" lifestyle="singleton"
- * @metro.service type="net.dpml.planet.http.MimeTypes"
+ * @metro.service type="net.dpml.http.MimeTypes"
*/
public class ConfigurationMimeTypes
implements Configurable, MimeTypes
{
private HashMap m_MimeTypeToExtMap;
private HashMap m_ExtToMimeTypeMap;
-
+
public ConfigurationMimeTypes()
{
+ m_MimeTypeToExtMap = new HashMap();
+ m_ExtToMimeTypeMap = new HashMap();
}
-
+
public void configure( Configuration conf )
throws ConfigurationException
{
Configuration typesConf = conf.getChild( "mimetypes" );
configureTypes( typesConf );
}
-
+
private void configureTypes( Configuration conf )
throws ConfigurationException
{
@@ -55,7 +55,7 @@
configureType( children[i] );
}
}
-
+
private void configureType( Configuration conf )
throws ConfigurationException
{
@@ -72,17 +72,17 @@
extList.toArray( exts );
m_MimeTypeToExtMap.put( mime, exts );
}
-
+
public Map getExtensionMap()
{
return m_ExtToMimeTypeMap;
}
-
+
public String getMimeType( String extension )
{
return (String) m_ExtToMimeTypeMap.get( extension );
}
-
+
public String[] getExtensions( String mimetype )
{
String[] result = (String[]) m_MimeTypeToExtMap.get( mimetype );
@@ -90,5 +90,5 @@
result = new String[0];
return result;
}
-}
-
+}
+

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/planet/http/impl/DumpHandler.java
(original)
+++
development/main/planet/facilities/http/impl/src/main/net/dpml/http/impl/DumpHandler.java
Thu Dec 23 00:24:29 2004
@@ -1,56 +1,51 @@
/*
* Copyright 2004 Niclas Hedman.
- *
+ *
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-package net.dpml.planet.http.impl;
+package net.dpml.http.impl;

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

/**
* @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,
+ extends org.mortbay.http.handler.DumpHandler
+ implements Startable, Parameterizable, LogEnabled,
Serviceable, Contextualizable
{
private Logger m_Logger;
private HttpContextService m_Context;
private int m_Index;
-
+
public DumpHandler()
{
}
-
+
/**
* Enable the logging system.
*
@@ -60,12 +55,12 @@
{
m_Logger = logger;
}
-
- public Logger getLogger()
+
+ public Logger getLogger()
{
return m_Logger;
}
-
+
/**
* Contextulaization of the Handler.
*
@@ -73,10 +68,10 @@
*
* @exception ContextException if a contextualization error occurs
*
- * @metro.entry key="urn:metro:name"
- * type="java.lang.String"
+ * @metro.entry key="urn:metro:name"
+ * type="java.lang.String"
*/
- public void contextualize( Context ctx )
+ public void contextualize( Context ctx )
throws ContextException
{
String name = (String) ctx.get( "urn:metro:name" );
@@ -89,16 +84,16 @@
m_Index = params.getParameterAsInteger( "handler-index", -1 );
}

- /**
- * @metro.dependency type="net.dpml.planet.http.HttpContextService"
- * key="http-context"
+ /**
+ * @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
{
@@ -110,7 +105,7 @@
m_Logger.debug( "Starting DumpHandler: " + this );
super.start();
}
-
+
public void stop()
throws InterruptedException
{
@@ -119,5 +114,5 @@
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/planet/http/impl/ErrorPageHandler.java
(original)
+++
development/main/planet/facilities/http/impl/src/main/net/dpml/http/impl/ErrorPageHandler.java
Thu Dec 23 00:24:29 2004
@@ -1,56 +1,51 @@
/*
* Copyright 2004 Niclas Hedman.
- *
+ *
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-package net.dpml.planet.http.impl;
+package net.dpml.http.impl;

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

/**
* @metro.component name="http-errorpage-handler" lifestyle="singleton"
* @metro.service type="org.mortbay.http.HttpHandler"
*/
public class ErrorPageHandler
- extends org.mortbay.http.handler.ErrorPageHandler
- implements Startable, Parameterizable, LogEnabled,
+ extends org.mortbay.http.handler.ErrorPageHandler
+ implements Startable, Parameterizable, LogEnabled,
Serviceable, Contextualizable
{
private Logger m_Logger;
private HttpContextService m_Context;
private int m_Index;
-
+
public ErrorPageHandler()
{
}
-
+
/**
* Enable the logging system.
*
@@ -60,12 +55,12 @@
{
m_Logger = logger;
}
-
- public Logger getLogger()
+
+ public Logger getLogger()
{
return m_Logger;
}
-
+
/**
* Contextulaization of the Handler.
*
@@ -73,10 +68,10 @@
*
* @exception ContextException if a contextualization error occurs
*
- * @metro.entry key="urn:metro:name"
- * type="java.lang.String"
+ * @metro.entry key="urn:metro:name"
+ * type="java.lang.String"
*/
- public void contextualize( Context ctx )
+ public void contextualize( Context ctx )
throws ContextException
{
String name = (String) ctx.get( "urn:metro:name" );
@@ -89,16 +84,16 @@
m_Index = params.getParameterAsInteger( "handler-index", -1 );
}

- /**
- * @metro.dependency type="net.dpml.planet.http.HttpContextService"
- * key="http-context"
+ /**
+ * @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
{
@@ -110,7 +105,7 @@
m_Logger.debug( "Starting ErrorPageHandler: " + this );
super.start();
}
-
+
public void stop()
throws InterruptedException
{
@@ -119,5 +114,5 @@
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/planet/http/impl/ExpiryHandler.java
(original)
+++
development/main/planet/facilities/http/impl/src/main/net/dpml/http/impl/ExpiryHandler.java
Thu Dec 23 00:24:29 2004
@@ -1,56 +1,51 @@
/*
* Copyright 2004 Niclas Hedman.
- *
+ *
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-package net.dpml.planet.http.impl;
+package net.dpml.http.impl;

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

/**
* @metro.component name="http-expiry-handler" lifestyle="singleton"
* @metro.service type="org.mortbay.http.HttpHandler"
*/
public class ExpiryHandler
- extends org.mortbay.http.handler.ExpiryHandler
- implements Startable, Parameterizable, LogEnabled,
+ extends org.mortbay.http.handler.ExpiryHandler
+ implements Startable, Parameterizable, LogEnabled,
Serviceable, Contextualizable
{
private Logger m_Logger;
private HttpContextService m_Context;
private int m_Index;
-
+
public ExpiryHandler()
{
}
-
+
/**
* Enable the logging system.
*
@@ -60,12 +55,12 @@
{
m_Logger = logger;
}
-
- public Logger getLogger()
+
+ public Logger getLogger()
{
return m_Logger;
}
-
+
/**
* Contextulaization of the Handler.
*
@@ -73,10 +68,10 @@
*
* @exception ContextException if a contextualization error occurs
*
- * @metro.entry key="urn:metro:name"
- * type="java.lang.String"
+ * @metro.entry key="urn:metro:name"
+ * type="java.lang.String"
*/
- public void contextualize( Context ctx )
+ public void contextualize( Context ctx )
throws ContextException
{
String name = (String) ctx.get( "urn:metro:name" );
@@ -87,22 +82,22 @@
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.planet.http.HttpContextService"
- * key="http-context"
+ /**
+ * @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
{
@@ -114,7 +109,7 @@
m_Logger.debug( "Starting ExpiryHandler: " + this );
super.start();
}
-
+
public void stop()
throws InterruptedException
{
@@ -123,5 +118,5 @@
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/planet/http/impl/FormAuthenticator.java
(original)
+++
development/main/planet/facilities/http/impl/src/main/net/dpml/http/impl/FormAuthenticator.java
Thu Dec 23 00:24:29 2004
@@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-package net.dpml.planet.http.impl;
+package net.dpml.http.impl;

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

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/planet/http/impl/ForwardHandler.java
(original)
+++
development/main/planet/facilities/http/impl/src/main/net/dpml/http/impl/ForwardHandler.java
Thu Dec 23 00:24:29 2004
@@ -1,60 +1,54 @@
/*
* Copyright 2004 Niclas Hedman.
- *
+ *
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-package net.dpml.planet.http.impl;
+package net.dpml.http.impl;

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

/**
* @metro.component name="http-forward-handler" lifestyle="singleton"
* @metro.service type="org.mortbay.http.HttpHandler"
*/
-public class ForwardHandler
- extends org.mortbay.http.handler.ForwardHandler
- implements Startable, Parameterizable, LogEnabled,
+public class ForwardHandler
+ extends org.mortbay.http.handler.ForwardHandler
+ implements Startable, Parameterizable, LogEnabled,
Serviceable, Contextualizable, Configurable
{
private Logger m_Logger;
private HttpContextService m_Context;
private int m_Index;
-
+
public ForwardHandler()
{
}
-
+
/**
* Enable the logging system.
*
@@ -64,12 +58,12 @@
{
m_Logger = logger;
}
-
- public Logger getLogger()
+
+ public Logger getLogger()
{
return m_Logger;
}
-
+
/**
* Contextulaization of the Handler.
*
@@ -77,10 +71,10 @@
*
* @exception ContextException if a contextualization error occurs
*
- * @metro.entry key="urn:metro:name"
- * type="java.lang.String"
+ * @metro.entry key="urn:metro:name"
+ * type="java.lang.String"
*/
- public void contextualize( Context ctx )
+ public void contextualize( Context ctx )
throws ContextException
{
String name = (String) ctx.get( "urn:metro:name" );
@@ -91,48 +85,48 @@
throws ParameterException
{
m_Index = params.getParameterAsInteger( "handler-index", -1 );
-
+
String rootForward = params.getParameter( "root-forward", null );
if( rootForward != null )
setRootForward( rootForward );
-
+
boolean queries = params.getParameterAsBoolean( "handle-queries",
false );
setHandleQueries( queries );
}

public void configure( Configuration conf )
- throws ConfigurationException
+ throws ConfigurationException
{
Configuration child = conf.getChild( "forwards" );
- configureForwards( child );
+ configureForwards( child );
}
-
+
private void configureForwards( Configuration conf )
- throws ConfigurationException
+ throws ConfigurationException
{
Configuration[] children = conf.getChildren( "forward" );
for( int i=0 ; i < children.length ; i++ )
configureForward( children[i] );
}
-
+
private void configureForward( Configuration conf )
- throws ConfigurationException
+ throws ConfigurationException
{
Configuration oldPath = conf.getChild( "from" );
Configuration newPath = conf.getChild( "to" );
addForward( oldPath.getValue(), newPath.getValue() );
}
-
- /**
- * @metro.dependency type="net.dpml.planet.http.HttpContextService"
- * key="http-context"
+
+ /**
+ * @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
{
@@ -144,7 +138,7 @@
m_Logger.debug( "Starting ForwardHandler: " + this );
super.start();
}
-
+
public void stop()
throws InterruptedException
{
@@ -153,5 +147,5 @@
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/planet/http/impl/HTAccessHandler.java
(original)
+++
development/main/planet/facilities/http/impl/src/main/net/dpml/http/impl/HTAccessHandler.java
Thu Dec 23 00:24:29 2004
@@ -1,56 +1,51 @@
/*
* Copyright 2004 Niclas Hedman.
- *
+ *
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-package net.dpml.planet.http.impl;
+package net.dpml.http.impl;

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

/**
* @metro.component name="http-htaccess-handler" lifestyle="singleton"
* @metro.service type="org.mortbay.http.HttpHandler"
*/
-public class HTAccessHandler
- extends org.mortbay.http.handler.HTAccessHandler
- implements Startable, Parameterizable, LogEnabled,
+public class HTAccessHandler
+ extends org.mortbay.http.handler.HTAccessHandler
+ implements Startable, Parameterizable, LogEnabled,
Serviceable, Contextualizable
{
private Logger m_Logger;
private HttpContextService m_Context;
private int m_Index;
-
+
public HTAccessHandler()
{
}
-
+
/**
* Enable the logging system.
*
@@ -60,12 +55,12 @@
{
m_Logger = logger;
}
-
- public Logger getLogger()
+
+ public Logger getLogger()
{
return m_Logger;
}
-
+
/**
* Contextulaization of the Handler.
*
@@ -73,10 +68,10 @@
*
* @exception ContextException if a contextualization error occurs
*
- * @metro.entry key="urn:metro:name"
- * type="java.lang.String"
+ * @metro.entry key="urn:metro:name"
+ * type="java.lang.String"
*/
- public void contextualize( Context ctx )
+ public void contextualize( Context ctx )
throws ContextException
{
String name = (String) ctx.get( "urn:metro:name" );
@@ -87,26 +82,26 @@
throws ParameterException
{
m_Index = params.getParameterAsInteger( "handler-index", -1 );
-
+
String defaultAccess = params.getParameter( "default-access", null );
if( defaultAccess != null )
setDefault( defaultAccess );
-
+
String filename = params.getParameter( "access-file", null );
if( filename != null )
setAccessFile( filename );
}

- /**
- * @metro.dependency type="net.dpml.planet.http.HttpContextService"
- * key="http-context"
+ /**
+ * @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
{
@@ -118,7 +113,7 @@
m_Logger.debug( "Starting HTAccessHandler: " + this );
super.start();
}
-
+
public void stop()
throws InterruptedException
{
@@ -127,5 +122,5 @@
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/planet/http/impl/HashSessionManager.java
(original)
+++
development/main/planet/facilities/http/impl/src/main/net/dpml/http/impl/HashSessionManager.java
Thu Dec 23 00:24:29 2004
@@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-package net.dpml.planet.http.impl;
+package net.dpml.http.impl;

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

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/planet/http/impl/HashUserRealm.java
(original)
+++
development/main/planet/facilities/http/impl/src/main/net/dpml/http/impl/HashUserRealm.java
Thu Dec 23 00:24:29 2004
@@ -1,22 +1,21 @@
/*
* Copyright 2004 Niclas Hedman.
- *
+ *
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-package net.dpml.planet.http.impl;
+package net.dpml.http.impl;

import java.io.IOException;
-
import net.dpml.parameters.ParameterException;
import net.dpml.parameters.Parameterizable;
import net.dpml.parameters.Parameters;
@@ -32,13 +31,13 @@
public HashUserRealm()
{
}
-
+
public void parameterize( Parameters params )
throws ParameterException
{
String realmName = params.getParameter( "name" );
setName( realmName );
-
+
String filename = params.getParameter( "filename" );
try
{
@@ -47,5 +46,5 @@
{
throw new ParameterException( "Unable to read file: " +
filename, e );
}
- }
-}
+ }
+}

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/planet/http/impl/HttpContextImpl.java
(original)
+++
development/main/planet/facilities/http/impl/src/main/net/dpml/http/impl/HttpContextImpl.java
Thu Dec 23 00:24:29 2004
@@ -1,75 +1,66 @@
/*
* Copyright 2004 Niclas Hedman.
- *
+ *
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-package net.dpml.planet.http.impl;
+package net.dpml.http.impl;

import java.io.File;
-
import net.dpml.activity.Disposable;
import net.dpml.activity.Startable;
-import net.dpml.activity.Initializable;
-
import net.dpml.configuration.Configurable;
import net.dpml.configuration.Configuration;
import net.dpml.configuration.ConfigurationException;
-
import net.dpml.context.Context;
import net.dpml.context.ContextException;
import net.dpml.context.Contextualizable;
-
import net.dpml.logging.LogEnabled;
import net.dpml.logging.Logger;
-
-import net.dpml.service.Serviceable;
+import net.dpml.http.HttpContextService;
+import net.dpml.http.HttpService;
+import net.dpml.http.MimeTypes;
import net.dpml.service.ServiceException;
import net.dpml.service.ServiceManager;
-
-import net.dpml.planet.http.HttpContextService;
-import net.dpml.planet.http.HttpService;
-import net.dpml.planet.http.MimeTypes;
-
+import net.dpml.service.Serviceable;
import org.mortbay.http.Authenticator;
import org.mortbay.http.HttpContext;
-import org.mortbay.http.HttpHandler;
import org.mortbay.http.RequestLog;
import org.mortbay.http.UserRealm;

/** Wrapper for the Jetty HttpContext.
*
* @metro.component name="http-context" lifestyle="singleton"
- * @metro.service type="net.dpml.planet.http.HttpContextService"
+ * @metro.service type="net.dpml.http.HttpContextService"
*/
-public class HttpContextImpl extends org.mortbay.http.HttpContext
- implements LogEnabled, Contextualizable, Serviceable, Startable,
+public class HttpContextImpl extends HttpContext
+ implements LogEnabled, Contextualizable, Serviceable, Startable,
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"
*/
@@ -77,11 +68,11 @@
{
m_Logger = logger;
}
-
- /**
- * @metro.entry key="urn:metro:temp"
+
+ /**
+ * @metro.entry key="urn:metro:temp"
* type="java.io.File"
- * @metro.entry key="urn:metro:classloader"
+ * @metro.entry key="urn:metro:classloader"
* type="java.lang.ClassLoader"
*/
public void contextualize( Context ctx )
@@ -90,35 +81,35 @@
File tmpDir = (File) ctx.get( "urn:metro:temp" );
tmpDir.mkdirs();
setTempDirectory( tmpDir );
-
+
ClassLoader cl = (ClassLoader) ctx.get( "urn:metro:classloader" );
setClassLoader( cl );
}
-
+
/**
- * @metro.dependency type="net.dpml.planet.http.HttpService"
+ * @metro.dependency type="net.dpml.http.HttpService"
* key="server"
- * @metro.dependency type="net.dpml.planet.http.MimeTypes"
+ * @metro.dependency type="net.dpml.http.MimeTypes"
* key="mimetypes" optional="true"
* @metro.dependency type="org.mortbay.http.Authenticator"
* key="authenticator" optional="true"
* @metro.dependency type="org.mortbay.http.UserRealm"
* key="realm" optional="true"
* @metro.dependency type="org.mortbay.http.RequestLog"
- * key="request-log"
+ * key="request-log"
*/
public void service( ServiceManager man )
throws ServiceException
{
m_HttpServer = (HttpService) man.lookup( "server" );
-
+
if( man.hasService( "authenticator" ) )
{
Authenticator authenticator = (Authenticator) man.lookup(
"authenticator" );
if( authenticator != null )
setAuthenticator( authenticator );
}
-
+
if( man.hasService( "realm" ) )
{
UserRealm userRealm = (UserRealm) man.lookup( "realm" );
@@ -127,12 +118,12 @@
setRealm( userRealm );
setRealmName( userRealm.getName() ); // Is this necessary?
}
-
+
}
-
+
RequestLog requestLog = (RequestLog) man.lookup( "request-log" );
setRequestLog( requestLog );
-
+
if( man.hasService( "mimetypes" ) )
{
MimeTypes mimeTypes = (MimeTypes) man.lookup( "mimetypes" );
@@ -144,37 +135,36 @@
public void configure( Configuration conf )
throws ConfigurationException
{
- Configuration virtualHostConf = conf.getChild( "virtual-host" );
- String virtualHost = virtualHostConf.getValue( null );
- addVirtualHost( virtualHost );
-
+ Configuration virtualHostConf = conf.getChild( "virtual-hosts" );
+ configureVirtualHosts( virtualHostConf );
+
Configuration contextConf = conf.getChild( "context-path" );
String contextPath = contextConf.getValue( "/" );
setContextPath( contextPath );
-
+
m_Graceful = conf.getChild( "graceful-stop" ).getValueAsBoolean(
false );
-
+
Configuration attributes = conf.getChild( "attributes" );
configureAttributes( attributes );
-
+
Configuration initParams = conf.getChild( "init-parameters" );
configureInitParameters( initParams );
-
+
Configuration welcomeFiles = conf.getChild( "welcome-files" );
configureWelcomeFiles( welcomeFiles );
-
+
String resourceBase = conf.getChild( "resource-base").getValue( "."
);
setResourceBase( resourceBase );
-
+
int maxCachedFilesize = conf.getChild( "max-cached-filesize"
).getValueAsInteger( -1 );
if( maxCachedFilesize > 0 )
- setMaxCachedFileSize( maxCachedFilesize );
-
+ setMaxCachedFileSize( maxCachedFilesize );
+
int maxCacheSize = conf.getChild( "max-cache-size"
).getValueAsInteger( -1 );
if( maxCacheSize > 0 )
- setMaxCacheSize( maxCacheSize );
+ setMaxCacheSize( maxCacheSize );
}
-
+
private void configureAttributes( Configuration conf )
throws ConfigurationException
{
@@ -182,19 +172,19 @@
for( int i = 0 ; i < children.length ; i++ )
configureAttribute( children[i] );
}
-
+
private void configureAttribute( Configuration conf )
throws ConfigurationException
{
String name = conf.getAttribute( "name" );
String value = conf.getValue();
-
+
// TODO: setAttribute() support Object as a value.
// need to figure out what that could be and introduce
// support for it.
setAttribute( name, value );
}
-
+
private void configureInitParameters( Configuration conf )
throws ConfigurationException
{
@@ -206,15 +196,17 @@
setInitParameter( name, value );
}
}
-
+
private void configureVirtualHosts( Configuration conf )
- throws ConfigurationException
{
Configuration[] hosts = conf.getChildren( "host" );
for( int i=0 ; i < hosts.length ; i++ )
- addVirtualHost( hosts[i].getValue() );
+ {
+ String host = hosts[i].getValue( null );
+ addVirtualHost( host );
+ }
}
-
+
private void configureWelcomeFiles( Configuration conf )
throws ConfigurationException
{
@@ -231,23 +223,23 @@
m_HttpServer.addContext( this );
super.start();
}
-
+
public void stop()
throws InterruptedException
{
if( m_Logger.isDebugEnabled() )
m_Logger.debug( "Stopping context: " + this );
-
- // The following is need due to strange delegation between the
+
+ // 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 );
}
-
+
public void dispose()
{
if( m_Logger.isDebugEnabled() )

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/planet/http/impl/HttpServerImpl.java
(original)
+++
development/main/planet/facilities/http/impl/src/main/net/dpml/http/impl/HttpServerImpl.java
Thu Dec 23 00:24:29 2004
@@ -1,39 +1,35 @@
/*
* Copyright 2004 Niclas Hedman.
- *
+ *
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-package net.dpml.planet.http.impl;
+package net.dpml.http.impl;

import net.dpml.activity.Disposable;
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;
import net.dpml.parameters.Parameters;
-
-import net.dpml.planet.http.HttpService;
-
+import net.dpml.http.HttpService;
import org.mortbay.http.HttpServer;
import org.mortbay.util.MultiException;

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

-
+
public HttpServerImpl()
{
}
-
+
/**
* Enable the logging system.
*
@@ -55,28 +51,28 @@
{
m_Logger = logger;
}
-
+
public Logger getLogger()
{
return m_Logger;
}
-
+
public void parameterize( Parameters params )
throws ParameterException
{
boolean trace = params.getParameterAsBoolean( "trace", false );
setTrace( trace );
-
+
boolean anonymous = params.getParameterAsBoolean( "anonymous", false
);
setAnonymous( anonymous );
-
+
m_Graceful = params.getParameterAsBoolean( "graceful-stop", false );
-
+
int reqs = params.getParameterAsInteger( "request-gc", -1 );
if( reqs > 0 )
setRequestsPerGC( reqs );
}
-
+
public void start()
throws MultiException
{
@@ -84,7 +80,7 @@
m_Logger.debug( "Starting server: " + this );
super.start();
}
-
+
public void stop()
throws InterruptedException
{
@@ -92,11 +88,11 @@
m_Logger.debug( "Stopping server: " + this );
super.stop( m_Graceful );
}
-
+
public void dispose()
{
if( m_Logger.isDebugEnabled() )
m_Logger.debug( "Disposing server: " + this );
super.destroy();
}
-}
+}

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/planet/http/impl/IPAccessHandler.java
(original)
+++
development/main/planet/facilities/http/impl/src/main/net/dpml/http/impl/IPAccessHandler.java
Thu Dec 23 00:24:29 2004
@@ -1,60 +1,53 @@
/*
* Copyright 2004 Niclas Hedman.
- *
+ *
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-package net.dpml.planet.http.impl;
+package net.dpml.http.impl;

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

/**
* @metro.component name="http-ipaccess-handler" lifestyle="singleton"
* @metro.service type="org.mortbay.http.HttpHandler"
*/
-public class IPAccessHandler
- extends org.mortbay.http.handler.IPAccessHandler
- implements Startable, Parameterizable, LogEnabled,
+public class IPAccessHandler
+ extends org.mortbay.http.handler.IPAccessHandler
+ implements Startable, Parameterizable, LogEnabled,
Serviceable, Contextualizable
{
private Logger m_Logger;
private HttpContextService m_Context;
private int m_Index;
-
+
public IPAccessHandler()
{
}
-
+
/**
* Enable the logging system.
*
@@ -64,12 +57,12 @@
{
m_Logger = logger;
}
-
- public Logger getLogger()
+
+ public Logger getLogger()
{
return m_Logger;
}
-
+
/**
* Contextulaization of the Handler.
*
@@ -77,10 +70,10 @@
*
* @exception ContextException if a contextualization error occurs
*
- * @metro.entry key="urn:metro:name"
- * type="java.lang.String"
+ * @metro.entry key="urn:metro:name"
+ * type="java.lang.String"
*/
- public void contextualize( Context ctx )
+ public void contextualize( Context ctx )
throws ContextException
{
String name = (String) ctx.get( "urn:metro:name" );
@@ -91,41 +84,41 @@
throws ParameterException
{
m_Index = params.getParameterAsInteger( "handler-index", -1 );
-
+
String standard = params.getParameter( "standard-action", null );
if( standard != null )
setStandard( standard );
}

public void configure( Configuration conf )
- throws ConfigurationException
+ throws ConfigurationException
{
Configuration child = conf.getChild( "access" );
- configureAccess( child );
+ configureAccess( child );
}
-
+
private void configureAccess( Configuration conf )
- throws ConfigurationException
+ throws ConfigurationException
{
Configuration[] allows = conf.getChildren( "allow" );
for( int i=0 ; i < allows.length ; i++ )
setAllowIP( allows[i].getValue() );
-
+
Configuration[] deny = conf.getChildren( "deny" );
for( int i=0 ; i < deny.length ; i++ )
setDenyIP( deny[i].getValue() );
}
-
- /**
- * @metro.dependency type="net.dpml.planet.http.HttpContextService"
- * key="http-context"
+
+ /**
+ * @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
{
@@ -137,7 +130,7 @@
m_Logger.debug( "Starting IPAccessHandler: " + this );
super.start();
}
-
+
public void stop()
throws InterruptedException
{
@@ -146,6 +139,6 @@
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/planet/http/impl/JaasUserRealm.java
(original)
+++
development/main/planet/facilities/http/impl/src/main/net/dpml/http/impl/JaasUserRealm.java
Thu Dec 23 00:24:29 2004
@@ -1,21 +1,19 @@
/*
* Copyright 2004 Niclas Hedman.
- *
+ *
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-package net.dpml.planet.http.impl;
-
-import java.io.IOException;
+package net.dpml.http.impl;

import net.dpml.parameters.ParameterException;
import net.dpml.parameters.Parameterizable;
@@ -32,14 +30,14 @@
public JaasUserRealm()
{
}
-
+
public void parameterize( Parameters params )
throws ParameterException
{
String realmName = params.getParameter( "name" );
setName( realmName );
-
+
String filename = params.getParameter( "login-modulename" );
setLoginModuleName( filename );
- }
-}
+ }
+}

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/planet/http/impl/JsseListener.java
(original)
+++
development/main/planet/facilities/http/impl/src/main/net/dpml/http/impl/JsseListener.java
Thu Dec 23 00:24:29 2004
@@ -1,35 +1,30 @@
/*
* Copyright 2004 Niclas Hedman.
- *
+ *
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-package net.dpml.planet.http.impl;
+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;
import net.dpml.parameters.Parameters;
-
-import net.dpml.service.Serviceable;
+import net.dpml.http.HttpService;
import net.dpml.service.ServiceException;
import net.dpml.service.ServiceManager;
-
-import net.dpml.planet.http.HttpService;
-
+import net.dpml.service.Serviceable;
import org.mortbay.http.HttpListener;

/** Wrapper for the Jetty SocketListener.
@@ -42,11 +37,11 @@
{
private HttpService m_HttpServer;
private Logger m_Logger;
-
+
public JsseListener()
{
}
-
+
/**
* Enable the logging system.
*
@@ -56,43 +51,43 @@
{
m_Logger = logger;
}
-
+
public Logger getLogger()
{
return m_Logger;
}
-
+
public void parameterize( Parameters params )
throws ParameterException
{
int reserve = params.getParameterAsInteger( "buffer-reserve", -1 );
if( reserve > 0 )
setBufferReserve( reserve );
-
+
int size = params.getParameterAsInteger( "buffer-size", -1 );
if( size > 0 )
setBufferSize( size );
-
+
int confPort = params.getParameterAsInteger( "confidential-port", -1
);
if( confPort > 0 )
setConfidentialPort( confPort );
-
+
String confScheme = params.getParameter( "confidential-scheme", null
);
if( confScheme != null )
setConfidentialScheme( confScheme );
-
+
String defScheme = params.getParameter( "default-scheme", null );
if( defScheme != null )
setDefaultScheme( defScheme );
-
+
int integralPort = params.getParameterAsInteger( "integral-port", -1
);
if( integralPort > 0 )
setIntegralPort( integralPort );
-
+
String integralScheme = params.getParameter( "integral-scheme", null
);
if( integralScheme != null )
setIntegralScheme( integralScheme );
-
+
String host = params.getParameter( "hostname", null );
try
{
@@ -102,50 +97,49 @@
{
throw new ParameterException( "Unknown hostname: " + host );
}
-
+
int port = params.getParameterAsInteger( "port", 8443 );
setPort( port );
-
+
int lowResMs = params.getParameterAsInteger(
"low-resource-persist-ms", -1 );
if( lowResMs > 0 )
setLowResourcePersistTimeMs( lowResMs );
-
+
boolean identify = params.getParameterAsBoolean(
"identify-listener", false );
setIdentifyListener( identify );
-
+
boolean needClientAuth = params.getParameterAsBoolean(
"need-client-authentication", false );
setNeedClientAuth( needClientAuth );
-
+
boolean useDefTrustStore = params.getParameterAsBoolean(
"use-default-trust-store", false );
setUseDefaultTrustStore( useDefTrustStore );
-
+
String keyPass = params.getParameter( "key-password", null );
if( keyPass != null )
setKeyPassword( keyPass );
-
+
String keyStore = params.getParameter( "key-store", null );
if( keyStore != null )
setKeystore( keyStore );
-
+
String keyStoreProviderClass = params.getParameter(
"key-store-provider-class", null );
if( keyStoreProviderClass != null )
setKeystoreProviderClass( keyStoreProviderClass );
-
+
String keyStoreProviderName = params.getParameter(
"key-store-provider-name", null );
if( keyStoreProviderName != null )
setKeystoreProviderName( keyStoreProviderName );
-
+
String keyStoreType = params.getParameter( "key-store-type", null );
if( keyStoreType != null )
setKeystoreType( keyStoreType );
-
- String password = params.getParameter( "password", null );
- if( password != null )
- setPassword( password );
+
+ String password = params.getParameter( "password", "" );
+ setPassword( password );
}
-
+
/**
- * @metro.dependency type="net.dpml.planet.http.HttpService"
+ * @metro.dependency type="net.dpml.http.HttpService"
* key="server"
*/
public void service( ServiceManager man )
@@ -153,7 +147,7 @@
{
m_HttpServer = (HttpService) man.lookup( "server" );
}
-
+
public void start()
throws Exception
{
@@ -162,7 +156,7 @@
m_HttpServer.addListener( this );
super.start();
}
-
+
public void stop()
throws InterruptedException
{
@@ -171,5 +165,5 @@
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/planet/http/impl/ModelHandler.java
(original)
+++
development/main/planet/facilities/http/impl/src/main/net/dpml/http/impl/ModelHandler.java
Thu Dec 23 00:24:29 2004
@@ -1,51 +1,42 @@
/*
* Copyright 2004 Niclas Hedman.
- *
+ *
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-package net.dpml.planet.http.impl;
+package net.dpml.http.impl;

import java.io.IOException;
-
+import net.dpml.activity.Initializable;
+import net.dpml.activity.Startable;
import net.dpml.composition.event.CompositionEvent;
import net.dpml.composition.event.CompositionListener;
-import net.dpml.composition.model.ContainmentModel;
import net.dpml.composition.model.ComponentModel;
+import net.dpml.composition.model.ContainmentModel;
import net.dpml.composition.model.DeploymentModel;
-
-import net.dpml.activity.Initializable;
-import net.dpml.activity.Startable;
-
import net.dpml.context.Context;
import net.dpml.context.ContextException;
import net.dpml.context.Contextualizable;
-
import net.dpml.logging.LogEnabled;
import net.dpml.logging.Logger;
-
import net.dpml.parameters.ParameterException;
import net.dpml.parameters.Parameterizable;
import net.dpml.parameters.Parameters;
-
-import net.dpml.service.Serviceable;
+import net.dpml.http.HttpContextService;
+import net.dpml.http.HttpRequestHandler;
import net.dpml.service.ServiceException;
import net.dpml.service.ServiceManager;
-
-import net.dpml.planet.http.HttpRequestHandler;
-import net.dpml.planet.http.HttpContextService;
-
+import net.dpml.service.Serviceable;
import org.mortbay.http.HttpContext;
-import org.mortbay.http.HttpException;
import org.mortbay.http.HttpHandler;
import org.mortbay.http.HttpRequest;
import org.mortbay.http.HttpResponse;
@@ -67,15 +58,15 @@
private int m_Index;
private String m_ContextPath;
private String m_ComponentPath;
-
+
private HttpRequestHandler m_HandlerComponent;
private ContainmentModel m_Container;
-
+
public ModelHandler()
{
m_Started = false;
}
-
+
/**
* Enable the logging system.
*
@@ -85,78 +76,78 @@
{
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
+ * 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.entry key="urn:composition:containment.model"
- * type="net.dpml.composition.model.ContainmentModel"
+ * @metro.entry key="urn:composition:containment.model"
+ * type="net.dpml.composition.model.ContainmentModel"
*
- * @metro.entry key="urn:metro:name"
- * type="java.lang.String"
+ * @metro.entry key="urn:metro:name"
+ * type="java.lang.String"
*/
- public void contextualize( Context ctx )
+ 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.planet.http.HttpContextService"
- * key="httpcontext"
+ /**
+ * @metro.dependency type="net.dpml.http.HttpContextService"
+ * key="httpcontext"
*/
public void service( ServiceManager man )
throws ServiceException
{
m_Context = (HttpContextService) man.lookup( "httpcontext" );
}
-
+
public void parameterize( Parameters params )
throws ParameterException
{
m_Index = params.getParameterAsInteger( "handler-index", -1 );
-
+
m_ContextPath = params.getParameter( "context-path", "/" );
-
+
m_ComponentPath = params.getParameter( "target" );
}
-
+
/* HttpHandler interface */
-
+
public HttpContext getHttpContext()
{
return m_Context.getHttpContext();
}
-
+
public String getName()
{
return m_Name;
}

- public void handle( String pathInContext, String pathParams,
- HttpRequest request, HttpResponse response )
+ public void handle( String pathInContext, String pathParams,
+ 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 );
-
+
if( pathInContext.startsWith( m_ContextPath ) )
{
pathInContext = pathInContext.substring( m_ContextPath.length()
);
@@ -169,28 +160,26 @@
public void initialize()
throws Exception
{
- ContainmentModel root = (ContainmentModel) m_Model;
-
int pos = m_ComponentPath.lastIndexOf( "/" );
String containerName = m_ComponentPath.substring( 0, pos );
if( "".equals( containerName ) )
containerName = "/";
String componentName = m_ComponentPath.substring( pos + 1 );
-
- m_Container = (ContainmentModel) root.getModel( containerName );
+
+ m_Container = (ContainmentModel) m_Model.getModel( containerName );
ComponentModel component = (ComponentModel) m_Container.getModel(
componentName );

- m_Container.addCompositionListener( this );
+ m_Container.addCompositionListener( this );
m_HandlerComponent = (HttpRequestHandler) component.resolve();
}
-
+
public void dispose()
{
- m_Container.removeCompositionListener( this );
+ m_Container.removeCompositionListener( this );
}
-
+
/* Jetty LifeCycle interface */
-
+
public void initialize( HttpContext context )
{
m_Logger.warn( "unhandled: initialize( " + context + " );" );
@@ -200,9 +189,9 @@
{
return m_Started;
}
-
+
/* Combined Avalon and Jetty LifeCycle interface */
-
+
public void start()
{
if( m_Logger.isDebugEnabled() )
@@ -213,7 +202,7 @@
m_Context.addHandler( this );
m_Started = true;
}
-
+
public void stop()
{
m_Started = false;
@@ -221,7 +210,7 @@
m_Logger.debug( "Stopping ModelHandler: " + this );
m_Context.removeHandler( this );
}
-
+
/* CompositionListener interface */

/**
@@ -231,22 +220,22 @@
{
if( m_Logger.isDebugEnabled() )
m_Logger.debug( "modelRemoved( " + event + " );" );
-
+
DeploymentModel dmodel = event.getChild();
-
+
if( ! ( dmodel instanceof ComponentModel ) )
return;
ComponentModel cmodel = (ComponentModel) dmodel;
-
+
String path = cmodel.getPath();
if( ! path.equals( m_ComponentPath ) )
return;
-
+
if( m_HandlerComponent != null )
{
getLogger().warn( "Internal error. New component added at the
same path, without a modelRemoved() event: " + path );
}
-
+
try
{
m_HandlerComponent = (HttpRequestHandler) cmodel.resolve();
@@ -264,14 +253,14 @@
{
if( m_Logger.isDebugEnabled() )
m_Logger.debug( "modelRemoved( " + event + " );" );
-
+
if( m_HandlerComponent == null) // No model bound to this handler.
- return;
-
+ return;
+
DeploymentModel dmodel = event.getChild();
if( ! ( dmodel instanceof ComponentModel ) )
return;
-
+
String path = dmodel.getPath();
if( path.equals( m_ComponentPath ) )
{
@@ -279,4 +268,4 @@
getLogger().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/planet/http/impl/MsieSslHandler.java
(original)
+++
development/main/planet/facilities/http/impl/src/main/net/dpml/http/impl/MsieSslHandler.java
Thu Dec 23 00:24:29 2004
@@ -1,56 +1,51 @@
/*
* Copyright 2004 Niclas Hedman.
- *
+ *
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-package net.dpml.planet.http.impl;
+package net.dpml.http.impl;

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

/**
* @metro.component name="http-msiessl-handler" lifestyle="singleton"
* @metro.service type="org.mortbay.http.HttpHandler"
*/
-public class MsieSslHandler
- extends org.mortbay.http.handler.MsieSslHandler
- implements Startable, Parameterizable, LogEnabled,
+public class MsieSslHandler
+ extends org.mortbay.http.handler.MsieSslHandler
+ implements Startable, Parameterizable, LogEnabled,
Serviceable, Contextualizable
{
private Logger m_Logger;
private HttpContextService m_Context;
private int m_Index;
-
+
public MsieSslHandler()
{
}
-
+
/**
* Enable the logging system.
*
@@ -60,12 +55,12 @@
{
m_Logger = logger;
}
-
- public Logger getLogger()
+
+ public Logger getLogger()
{
return m_Logger;
}
-
+
/**
* Contextulaization of the Handler.
*
@@ -73,10 +68,10 @@
*
* @exception ContextException if a contextualization error occurs
*
- * @metro.entry key="urn:metro:name"
- * type="java.lang.String"
+ * @metro.entry key="urn:metro:name"
+ * type="java.lang.String"
*/
- public void contextualize( Context ctx )
+ public void contextualize( Context ctx )
throws ContextException
{
String name = (String) ctx.get( "urn:metro:name" );
@@ -87,22 +82,22 @@
throws ParameterException
{
m_Index = params.getParameterAsInteger( "handler-index", -1 );
-
+
String agent = params.getParameter( "user-agent-substring", null );
if( agent != null )
setUserAgentSubString( agent );
}

- /**
- * @metro.dependency type="net.dpml.planet.http.HttpContextService"
- * key="http-context"
+ /**
+ * @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
{
@@ -114,7 +109,7 @@
m_Logger.debug( "Starting MsieSslHandler: " + this );
super.start();
}
-
+
public void stop()
throws InterruptedException
{
@@ -123,5 +118,5 @@
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/planet/http/impl/NcsaRequestLog.java
(original)
+++
development/main/planet/facilities/http/impl/src/main/net/dpml/http/impl/NcsaRequestLog.java
Thu Dec 23 00:24:29 2004
@@ -1,29 +1,24 @@
/*
* Copyright 2004 Niclas Hedman.
- *
+ *
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-package net.dpml.planet.http.impl;
+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;
import net.dpml.parameters.Parameters;
-
import org.mortbay.http.NCSARequestLog;
import org.mortbay.http.RequestLog;

@@ -45,48 +40,48 @@
{
boolean append = params.getParameterAsBoolean( "append", false );
setAppend( append );
-
+
boolean buffered = params.getParameterAsBoolean( "buffered", false );
setBuffered( buffered );
-
+
boolean extended = params.getParameterAsBoolean( "extended", false );
setExtended( extended );
-
+
boolean preferProxiedFor = params.getParameterAsBoolean(
"prefer-proxied-for", false );
setPreferProxiedForAddress( preferProxiedFor );
-
+
String filename = params.getParameter( "filename", null );
if( filename != null )
setFilename( filename );
-
+
String dateformat = params.getParameter( "dateformat", null );
if( dateformat != null )
setLogDateFormat( dateformat );
-
+
String ignorepaths = params.getParameter( "ignore-paths", null );
if( ignorepaths != null )
{
String[] paths = StringUtils.tokenize( ignorepaths );
setIgnorePaths( paths );
}
-
+
String timezone = params.getParameter( "timezone", null );
if( timezone != null )
setLogTimeZone( timezone );
-
+
int retain = params.getParameterAsInteger( "retain-days", -1 );
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/planet/http/impl/NotFoundHandler.java
(original)
+++
development/main/planet/facilities/http/impl/src/main/net/dpml/http/impl/NotFoundHandler.java
Thu Dec 23 00:24:29 2004
@@ -1,56 +1,51 @@
/*
* Copyright 2004 Niclas Hedman.
- *
+ *
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-package net.dpml.planet.http.impl;
+package net.dpml.http.impl;

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

/**
* @metro.component name="http-notfound-handler" lifestyle="singleton"
* @metro.service type="org.mortbay.http.HttpHandler"
*/
-public class NotFoundHandler
- extends org.mortbay.http.handler.NotFoundHandler
- implements Startable, Parameterizable, LogEnabled,
+public class NotFoundHandler
+ extends org.mortbay.http.handler.NotFoundHandler
+ implements Startable, Parameterizable, LogEnabled,
Serviceable, Contextualizable
{
private Logger m_Logger;
private HttpContextService m_Context;
private int m_Index;
-
+
public NotFoundHandler()
{
}
-
+
/**
* Enable the logging system.
*
@@ -60,12 +55,12 @@
{
m_Logger = logger;
}
-
- public Logger getLogger()
+
+ public Logger getLogger()
{
return m_Logger;
}
-
+
/**
* Contextulaization of the Handler.
*
@@ -73,10 +68,10 @@
*
* @exception ContextException if a contextualization error occurs
*
- * @metro.entry key="urn:metro:name"
- * type="java.lang.String"
+ * @metro.entry key="urn:metro:name"
+ * type="java.lang.String"
*/
- public void contextualize( Context ctx )
+ public void contextualize( Context ctx )
throws ContextException
{
String name = (String) ctx.get( "urn:metro:name" );
@@ -89,16 +84,16 @@
m_Index = params.getParameterAsInteger( "handler-index", -1 );
}

- /**
- * @metro.dependency type="net.dpml.planet.http.HttpContextService"
- * key="http-context"
+ /**
+ * @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
{
@@ -110,7 +105,7 @@
m_Logger.debug( "Starting NotFoundHandler: " + this );
super.start();
}
-
+
public void stop()
throws InterruptedException
{
@@ -119,4 +114,4 @@
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/planet/http/impl/NullHandler.java
(original)
+++
development/main/planet/facilities/http/impl/src/main/net/dpml/http/impl/NullHandler.java
Thu Dec 23 00:24:29 2004
@@ -1,56 +1,51 @@
/*
* Copyright 2004 Niclas Hedman.
- *
+ *
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-package net.dpml.planet.http.impl;
+package net.dpml.http.impl;

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

/**
* @metro.component name="http-null-handler" lifestyle="singleton"
* @metro.service type="org.mortbay.http.HttpHandler"
*/
-public class NullHandler
- extends org.mortbay.http.handler.NullHandler
- implements Startable, Parameterizable, LogEnabled,
+public class NullHandler
+ extends org.mortbay.http.handler.NullHandler
+ implements Startable, Parameterizable, LogEnabled,
Serviceable, Contextualizable
{
private Logger m_Logger;
private HttpContextService m_Context;
private int m_Index;
-
+
public NullHandler()
{
}
-
+
/**
* Enable the logging system.
*
@@ -60,12 +55,12 @@
{
m_Logger = logger;
}
-
- public Logger getLogger()
+
+ public Logger getLogger()
{
return m_Logger;
}
-
+
/**
* Contextulaization of the Handler.
*
@@ -73,10 +68,10 @@
*
* @exception ContextException if a contextualization error occurs
*
- * @metro.entry key="urn:metro:name"
- * type="java.lang.String"
+ * @metro.entry key="urn:metro:name"
+ * type="java.lang.String"
*/
- public void contextualize( Context ctx )
+ public void contextualize( Context ctx )
throws ContextException
{
String name = (String) ctx.get( "urn:metro:name" );
@@ -89,16 +84,16 @@
m_Index = params.getParameterAsInteger( "handler-index", -1 );
}

- /**
- * @metro.dependency type="net.dpml.planet.http.HttpContextService"
- * key="http-context"
+ /**
+ * @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
{
@@ -110,7 +105,7 @@
m_Logger.debug( "Starting NullHandler: " + this );
super.start();
}
-
+
public void stop()
throws InterruptedException
{
@@ -119,5 +114,5 @@
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/planet/http/impl/ProxyHandler.java
(original)
+++
development/main/planet/facilities/http/impl/src/main/net/dpml/http/impl/ProxyHandler.java
Thu Dec 23 00:24:29 2004
@@ -1,56 +1,51 @@
/*
* Copyright 2004 Niclas Hedman.
- *
+ *
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-package net.dpml.planet.http.impl;
+package net.dpml.http.impl;

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

/**
* @metro.component name="http-proxy-handler" lifestyle="singleton"
* @metro.service type="org.mortbay.http.HttpHandler"
*/
-public class ProxyHandler
- extends org.mortbay.http.handler.ProxyHandler
- implements Startable, Parameterizable, LogEnabled,
+public class ProxyHandler
+ extends org.mortbay.http.handler.ProxyHandler
+ implements Startable, Parameterizable, LogEnabled,
Serviceable, Contextualizable
{
private Logger m_Logger;
private HttpContextService m_Context;
private int m_Index;
-
+
public ProxyHandler()
{
}
-
+
/**
* Enable the logging system.
*
@@ -60,12 +55,12 @@
{
m_Logger = logger;
}
-
- public Logger getLogger()
+
+ public Logger getLogger()
{
return m_Logger;
}
-
+
/**
* Contextulaization of the Handler.
*
@@ -73,10 +68,10 @@
*
* @exception ContextException if a contextualization error occurs
*
- * @metro.entry key="urn:metro:name"
- * type="java.lang.String"
+ * @metro.entry key="urn:metro:name"
+ * type="java.lang.String"
*/
- public void contextualize( Context ctx )
+ public void contextualize( Context ctx )
throws ContextException
{
String name = (String) ctx.get( "urn:metro:name" );
@@ -87,14 +82,14 @@
throws ParameterException
{
m_Index = params.getParameterAsInteger( "handler-index", -1 );
-
+
String whitelist = params.getParameter( "proxy-host-white-list",
null );
if( whitelist != null )
{
String[] hosts = StringUtils.tokenize( whitelist );
setProxyHostsWhiteList( hosts );
}
-
+
String blacklist = params.getParameter( "proxy-host-black-list",
null );
if( blacklist != null )
{
@@ -103,16 +98,16 @@
}
}

- /**
- * @metro.dependency type="net.dpml.planet.http.HttpContextService"
- * key="http-context"
+ /**
+ * @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
{
@@ -124,7 +119,7 @@
m_Logger.debug( "Starting ProxyHandler: " + this );
super.start();
}
-
+
public void stop()
throws InterruptedException
{
@@ -133,5 +128,5 @@
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/planet/http/impl/ResourceHandler.java
(original)
+++
development/main/planet/facilities/http/impl/src/main/net/dpml/http/impl/ResourceHandler.java
Thu Dec 23 00:24:29 2004
@@ -1,63 +1,51 @@
/*
* Copyright 2004 Niclas Hedman.
- *
+ *
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-package net.dpml.planet.http.impl;
-
-import java.io.IOException;
+package net.dpml.http.impl;

import net.dpml.activity.Startable;
-
import net.dpml.context.Context;
import net.dpml.context.ContextException;
import net.dpml.context.Contextualizable;
-
import net.dpml.logging.LogEnabled;
import net.dpml.logging.Logger;
-
import net.dpml.parameters.ParameterException;
import net.dpml.parameters.Parameterizable;
import net.dpml.parameters.Parameters;
-
-import net.dpml.service.Serviceable;
+import net.dpml.http.HttpContextService;
import net.dpml.service.ServiceException;
import net.dpml.service.ServiceManager;
-
-import net.dpml.planet.http.HttpContextService;
-
-import org.mortbay.http.HttpException;
-import org.mortbay.http.HttpRequest;
-import org.mortbay.http.HttpResponse;
-import org.mortbay.util.Resource;
+import net.dpml.service.Serviceable;

/**
* @metro.component name="http-resource-handler" lifestyle="singleton"
* @metro.service type="org.mortbay.http.HttpHandler"
*/
-public class ResourceHandler
- extends org.mortbay.http.handler.ResourceHandler
- implements Startable, Parameterizable, LogEnabled,
+public class ResourceHandler
+ extends org.mortbay.http.handler.ResourceHandler
+ implements Startable, Parameterizable, LogEnabled,
Serviceable, Contextualizable
{
private Logger m_Logger;
private HttpContextService m_Context;
private int m_Index;
-
+
public ResourceHandler()
{
}
-
+
/**
* Enable the logging system.
*
@@ -67,12 +55,12 @@
{
m_Logger = logger;
}
-
- public Logger getLogger()
+
+ public Logger getLogger()
{
return m_Logger;
}
-
+
/**
* Contextulaization of the Handler.
*
@@ -80,10 +68,10 @@
*
* @exception ContextException if a contextualization error occurs
*
- * @metro.entry key="urn:metro:name"
- * type="java.lang.String"
+ * @metro.entry key="urn:metro:name"
+ * type="java.lang.String"
*/
- public void contextualize( Context ctx )
+ public void contextualize( Context ctx )
throws ContextException
{
String name = (String) ctx.get( "urn:metro:name" );
@@ -95,19 +83,19 @@
{
boolean ranges = params.getParameterAsBoolean( "accept-ranges",
false );
setAcceptRanges( ranges );
-
+
boolean dirAllowed = params.getParameterAsBoolean(
"allow-directory", false );
setDirAllowed( dirAllowed );

boolean redirectWelcome = params.getParameterAsBoolean(
"redirect-welcome", false );
setRedirectWelcome( redirectWelcome );

- int minGzip = params.getParameterAsInteger( "min-gzip-length", -1 );

+ int minGzip = params.getParameterAsInteger( "min-gzip-length", -1 );
if( minGzip > 0 )
setMinGzipLength( minGzip );
-
+
m_Index = params.getParameterAsInteger( "handler-index", -1 );
-
+
String allow = params.getParameter( "allow-methods", null );
if( allow != null )
{
@@ -116,16 +104,16 @@
}
}

- /**
- * @metro.dependency type="net.dpml.planet.http.HttpContextService"
- * key="http-context"
+ /**
+ * @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
{
@@ -137,7 +125,7 @@
m_Logger.debug( "Starting ResourceHandler: " + this );
super.start();
}
-
+
public void stop()
throws InterruptedException
{

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/planet/http/impl/RootNotFoundHandler.java
(original)
+++
development/main/planet/facilities/http/impl/src/main/net/dpml/http/impl/RootNotFoundHandler.java
Thu Dec 23 00:24:29 2004
@@ -1,56 +1,51 @@
/*
* Copyright 2004 Niclas Hedman.
- *
+ *
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-package net.dpml.planet.http.impl;
+package net.dpml.http.impl;

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

/**
* @metro.component name="http-rootnotfound-handler" lifestyle="singleton"
* @metro.service type="org.mortbay.http.HttpHandler"
*/
-public class RootNotFoundHandler
- extends org.mortbay.http.handler.RootNotFoundHandler
- implements Startable, Parameterizable, LogEnabled,
+public class RootNotFoundHandler
+ extends org.mortbay.http.handler.RootNotFoundHandler
+ implements Startable, Parameterizable, LogEnabled,
Serviceable, Contextualizable
{
private Logger m_Logger;
private HttpContextService m_Context;
private int m_Index;
-
+
public RootNotFoundHandler()
{
}
-
+
/**
* Enable the logging system.
*
@@ -60,12 +55,12 @@
{
m_Logger = logger;
}
-
- public Logger getLogger()
+
+ public Logger getLogger()
{
return m_Logger;
}
-
+
/**
* Contextulaization of the Handler.
*
@@ -73,10 +68,10 @@
*
* @exception ContextException if a contextualization error occurs
*
- * @metro.entry key="urn:metro:name"
- * type="java.lang.String"
+ * @metro.entry key="urn:metro:name"
+ * type="java.lang.String"
*/
- public void contextualize( Context ctx )
+ public void contextualize( Context ctx )
throws ContextException
{
String name = (String) ctx.get( "urn:metro:name" );
@@ -89,16 +84,16 @@
m_Index = params.getParameterAsInteger( "handler-index", -1 );
}

- /**
- * @metro.dependency type="net.dpml.planet.http.HttpContextService"
- * key="http-context"
+ /**
+ * @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
{
@@ -110,7 +105,7 @@
m_Logger.debug( "Starting RootNotFoundHandler: " + this );
super.start();
}
-
+
public void stop()
throws InterruptedException
{
@@ -119,5 +114,5 @@
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/planet/http/impl/SecurityHandler.java
(original)
+++
development/main/planet/facilities/http/impl/src/main/net/dpml/http/impl/SecurityHandler.java
Thu Dec 23 00:24:29 2004
@@ -1,56 +1,51 @@
/*
* Copyright 2004 Niclas Hedman.
- *
+ *
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-package net.dpml.planet.http.impl;
+package net.dpml.http.impl;

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

/**
* @metro.component name="http-security-handler" lifestyle="singleton"
* @metro.service type="org.mortbay.http.HttpHandler"
*/
-public class SecurityHandler
- extends org.mortbay.http.handler.SecurityHandler
- implements Startable, Parameterizable, LogEnabled,
+public class SecurityHandler
+ extends org.mortbay.http.handler.SecurityHandler
+ implements Startable, Parameterizable, LogEnabled,
Serviceable, Contextualizable
{
private Logger m_Logger;
private HttpContextService m_Context;
private int m_Index;
-
+
public SecurityHandler()
{
}
-
+
/**
* Enable the logging system.
*
@@ -60,12 +55,12 @@
{
m_Logger = logger;
}
-
- public Logger getLogger()
+
+ public Logger getLogger()
{
return m_Logger;
}
-
+
/**
* Contextulaization of the Handler.
*
@@ -73,10 +68,10 @@
*
* @exception ContextException if a contextualization error occurs
*
- * @metro.entry key="urn:metro:name"
- * type="java.lang.String"
+ * @metro.entry key="urn:metro:name"
+ * type="java.lang.String"
*/
- public void contextualize( Context ctx )
+ public void contextualize( Context ctx )
throws ContextException
{
String name = (String) ctx.get( "urn:metro:name" );
@@ -89,22 +84,22 @@
m_Index = params.getParameterAsInteger( "handler-index", -1 );
}

- /**
- * @metro.dependency type="net.dpml.planet.http.HttpContextService"
- * key="http-context"
+ /**
+ * @metro.dependency type="net.dpml.http.HttpContextService"
+ * key="http-context"
* @metro.dependency type="org.mortbay.http.Authenticator"
- * key="authenticator"
+ * key="authenticator"
*/
public void service( ServiceManager man )
throws 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.
}
-
+
public void start()
throws Exception
{
@@ -116,7 +111,7 @@
m_Logger.debug( "Starting SecurityHandler: " + this );
super.start();
}
-
+
public void stop()
throws InterruptedException
{
@@ -125,5 +120,5 @@
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/planet/http/impl/ServletHandler.java
(original)
+++
development/main/planet/facilities/http/impl/src/main/net/dpml/http/impl/ServletHandler.java
Thu Dec 23 00:24:29 2004
@@ -1,62 +1,55 @@
/*
* Copyright 2004 Niclas Hedman.
- *
+ *
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-package net.dpml.planet.http.impl;
+package net.dpml.http.impl;

import net.dpml.activity.Startable;
-
import net.dpml.configuration.Configurable;
import net.dpml.configuration.Configuration;
import net.dpml.configuration.ConfigurationException;
-
import net.dpml.context.Context;
import net.dpml.context.ContextException;
import net.dpml.context.Contextualizable;
-
import net.dpml.logging.LogEnabled;
import net.dpml.logging.Logger;
-
import net.dpml.parameters.ParameterException;
import net.dpml.parameters.Parameterizable;
import net.dpml.parameters.Parameters;
-
-import net.dpml.service.Serviceable;
+import net.dpml.http.HttpContextService;
import net.dpml.service.ServiceException;
import net.dpml.service.ServiceManager;
-
-import net.dpml.planet.http.HttpContextService;
-
+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,
+public class ServletHandler
+ extends org.mortbay.jetty.servlet.ServletHandler
+ implements Startable, Parameterizable, LogEnabled,
Serviceable, Contextualizable, Configurable
{
private Logger m_Logger;
private HttpContextService m_Context;
private int m_Index;
-
+
public ServletHandler()
{
}
-
+
/**
* Enable the logging system.
*
@@ -66,12 +59,12 @@
{
m_Logger = logger;
}
-
- public Logger getLogger()
+
+ public Logger getLogger()
{
return m_Logger;
}
-
+
/**
* Contextulaization of the Handler.
*
@@ -79,10 +72,10 @@
*
* @exception ContextException if a contextualization error occurs
*
- * @metro.entry key="urn:metro:name"
- * type="java.lang.String"
+ * @metro.entry key="urn:metro:name"
+ * type="java.lang.String"
*/
- public void contextualize( Context ctx )
+ public void contextualize( Context ctx )
throws ContextException
{
String name = (String) ctx.get( "urn:metro:name" );
@@ -93,10 +86,10 @@
throws ParameterException
{
m_Index = params.getParameterAsInteger( "handler-index", -1 );
-
+
boolean useCookies = params.getParameterAsBoolean( "using-cookies",
false );
setUsingCookies( useCookies );
-
+
boolean autoInitialize = params.getParameterAsBoolean(
"auto-initialize-servlets", true );
setAutoInitializeServlets( autoInitialize );
}
@@ -107,17 +100,17 @@
Configuration child = conf.getChild( "servlets" );
configureServlets( child );
}
-
+
private void configureServlets( Configuration conf )
- throws ConfigurationException
+ throws ConfigurationException
{
Configuration[] children = conf.getChildren( "servlet" );
for( int i = 0 ; i < children.length ; i++ )
configureServlet( children[i] );
}
-
+
private void configureServlet( Configuration conf )
- throws ConfigurationException
+ throws ConfigurationException
{
String path = conf.getChild( "path" ).getValue();
String classname = conf.getChild( "classname" ).getValue();
@@ -133,10 +126,10 @@
addServlet( name, path, classname );
}
}
-
- /**
- * @metro.dependency type="net.dpml.planet.http.HttpContextService"
- * key="http-context"
+
+ /**
+ * @metro.dependency type="net.dpml.http.HttpContextService"
+ * key="http-context"
* @metro.dependency type="org.mortbay.jetty.servlet.SessionManager"
* key="session-manager" optional="true"
*/
@@ -150,7 +143,7 @@
setSessionManager( sm );
}
}
-
+
public void start()
throws Exception
{
@@ -162,7 +155,7 @@
m_Logger.debug( "Starting ServletHandler: " + this );
super.start();
}
-
+
public void stop()
throws InterruptedException
{
@@ -171,5 +164,5 @@
super.stop();
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/planet/http/impl/SetResponseHeadersHandler.java
(original)
+++
development/main/planet/facilities/http/impl/src/main/net/dpml/http/impl/SetResponseHeadersHandler.java
Thu Dec 23 00:24:29 2004
@@ -1,60 +1,53 @@
/*
* Copyright 2004 Niclas Hedman.
- *
+ *
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-package net.dpml.planet.http.impl;
+package net.dpml.http.impl;

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

/**
* @metro.component name="http-setresponseheaders-handler"
lifestyle="singleton"
* @metro.service type="org.mortbay.http.HttpHandler"
*/
-public class SetResponseHeadersHandler
- extends org.mortbay.http.handler.SetResponseHeadersHandler
- implements Startable, Parameterizable, LogEnabled,
+public class SetResponseHeadersHandler
+ extends org.mortbay.http.handler.SetResponseHeadersHandler
+ implements Startable, Parameterizable, LogEnabled,
Serviceable, Contextualizable
{
private Logger m_Logger;
private HttpContextService m_Context;
private int m_Index;
-
+
public SetResponseHeadersHandler()
{
}
-
+
/**
* Enable the logging system.
*
@@ -64,12 +57,12 @@
{
m_Logger = logger;
}
-
- public Logger getLogger()
+
+ public Logger getLogger()
{
return m_Logger;
}
-
+
/**
* Contextulaization of the Handler.
*
@@ -77,10 +70,10 @@
*
* @exception ContextException if a contextualization error occurs
*
- * @metro.entry key="urn:metro:name"
- * type="java.lang.String"
+ * @metro.entry key="urn:metro:name"
+ * type="java.lang.String"
*/
- public void contextualize( Context ctx )
+ public void contextualize( Context ctx )
throws ContextException
{
String name = (String) ctx.get( "urn:metro:name" );
@@ -91,18 +84,18 @@
throws ParameterException
{
m_Index = params.getParameterAsInteger( "handler-index", -1 );
-
+
}

public void configure( Configuration conf )
- throws ConfigurationException
+ throws ConfigurationException
{
Configuration child = conf.getChild( "headers" );
- configureHeaders( child );
+ configureHeaders( child );
}
-
+
private void configureHeaders( Configuration conf )
- throws ConfigurationException
+ throws ConfigurationException
{
Configuration[] headers = conf.getChildren( "header" );
for( int i=0 ; i < headers.length ; i++ )
@@ -110,23 +103,23 @@
}

private void configureHeader( Configuration conf )
- throws ConfigurationException
+ throws ConfigurationException
{
Configuration name = conf.getChild( "name" );
Configuration value = conf.getChild( "value" );
setHeaderValue( name.getValue(), value.getValue() );
}
-
- /**
- * @metro.dependency type="net.dpml.planet.http.HttpContextService"
- * key="http-context"
+
+ /**
+ * @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
{
@@ -138,7 +131,7 @@
m_Logger.debug( "Starting SetResponseHeadersHandler: " + this );
super.start();
}
-
+
public void stop()
throws InterruptedException
{
@@ -147,7 +140,7 @@
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/planet/http/impl/SocketListener.java
(original)
+++
development/main/planet/facilities/http/impl/src/main/net/dpml/http/impl/SocketListener.java
Thu Dec 23 00:24:29 2004
@@ -1,35 +1,30 @@
/*
* Copyright 2004 Niclas Hedman.
- *
+ *
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-package net.dpml.planet.http.impl;
+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;
import net.dpml.parameters.Parameters;
-
-import net.dpml.service.Serviceable;
+import net.dpml.http.HttpService;
import net.dpml.service.ServiceException;
import net.dpml.service.ServiceManager;
-
-import net.dpml.planet.http.HttpService;
-
+import net.dpml.service.Serviceable;
import org.mortbay.http.HttpListener;

/** Wrapper for the Jetty SocketListener.
@@ -42,11 +37,11 @@
{
private HttpService m_HttpServer;
private Logger m_Logger;
-
+
public SocketListener()
{
}
-
+
/**
* Enable the logging system.
*
@@ -56,43 +51,43 @@
{
m_Logger = logger;
}
-
+
public Logger getLogger()
{
return m_Logger;
}
-
+
public void parameterize( Parameters params )
throws ParameterException
{
int reserve = params.getParameterAsInteger( "buffer-reserve", -1 );
if( reserve > 0 )
setBufferReserve( reserve );
-
+
int size = params.getParameterAsInteger( "buffer-size", -1 );
if( size > 0 )
setBufferSize( size );
-
+
int confPort = params.getParameterAsInteger( "confidential-port", -1
);
if( confPort > 0 )
setConfidentialPort( confPort );
-
+
String confScheme = params.getParameter( "confidential-scheme", null
);
if( confScheme != null )
setConfidentialScheme( confScheme );
-
+
String defScheme = params.getParameter( "default-scheme", null );
if( defScheme != null )
setDefaultScheme( defScheme );
-
+
int integralPort = params.getParameterAsInteger( "integral-port", -1
);
if( integralPort > 0 )
setIntegralPort( integralPort );
-
+
String integralScheme = params.getParameter( "integral-scheme", null
);
if( integralScheme != null )
setIntegralScheme( integralScheme );
-
+
String host = params.getParameter( "hostname", null );
try
{
@@ -102,22 +97,22 @@
{
throw new ParameterException( "Unknown hostname: " + host );
}
-
+
int port = params.getParameterAsInteger( "port", 8080 );
setPort( port );
-
+
int lowResMs = params.getParameterAsInteger(
"low-resource-persist-ms", -1 );
if( lowResMs > 0 )
setLowResourcePersistTimeMs( lowResMs );
-
+
boolean identify = params.getParameterAsBoolean(
"identify-listener", false );
setIdentifyListener( identify );
-
-
+
+
}
-
+
/**
- * @metro.dependency type="net.dpml.planet.http.HttpService"
+ * @metro.dependency type="net.dpml.http.HttpService"
* key="server"
*/
public void service( ServiceManager man )
@@ -125,7 +120,7 @@
{
m_HttpServer = (HttpService) man.lookup( "server" );
}
-
+
public void start()
throws Exception
{
@@ -134,7 +129,7 @@
m_HttpServer.addListener( this );
super.start();
}
-
+
public void stop()
throws InterruptedException
{
@@ -143,4 +138,4 @@
super.stop();
m_HttpServer.removeListener( this );
}
-}
+}

Modified:
development/main/planet/facilities/http/impl/src/main/net/dpml/http/impl/StringUtils.java
==============================================================================
---
development/main/planet/facilities/http/impl/src/main/net/dpml/planet/http/impl/StringUtils.java
(original)
+++
development/main/planet/facilities/http/impl/src/main/net/dpml/http/impl/StringUtils.java
Thu Dec 23 00:24:29 2004
@@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-package net.dpml.planet.http.impl;
+package net.dpml.http.impl;

import java.util.ArrayList;
import java.util.StringTokenizer;

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/planet/http/impl/SystemMimeTypes.java
(original)
+++
development/main/planet/facilities/http/impl/src/main/net/dpml/http/impl/SystemMimeTypes.java
Thu Dec 23 00:24:29 2004
@@ -1,41 +1,36 @@
/*
* Copyright 2004 Niclas Hedman.
- *
+ *
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-package net.dpml.planet.http.impl;
+package net.dpml.http.impl;

import java.io.BufferedReader;
import java.io.FileInputStream;
-import java.io.IOException;
import java.io.InputStreamReader;
-
import java.util.ArrayList;
import java.util.HashMap;
import java.util.Map;
import java.util.StringTokenizer;
-
import net.dpml.activity.Initializable;
-
import net.dpml.parameters.ParameterException;
import net.dpml.parameters.Parameterizable;
import net.dpml.parameters.Parameters;
-
-import net.dpml.planet.http.MimeTypes;
+import net.dpml.http.MimeTypes;

/**
* @metro.component name="mimetypes-system" lifestyle="singleton"
- * @metro.service type="net.dpml.planet.http.MimeTypes"
+ * @metro.service type="net.dpml.http.MimeTypes"
*/
public class SystemMimeTypes
implements Parameterizable, Initializable, MimeTypes
@@ -43,23 +38,23 @@
private String m_Filename;
private HashMap m_MimeTypeToExtMap;
private HashMap m_ExtToMimeTypeMap;
-
+
public SystemMimeTypes()
{
}
-
+
public void parameterize( Parameters params )
throws ParameterException
{
m_Filename = params.getParameter( "filename", "/etc/mime.types" );
}
-
+
public void initialize()
throws Exception
{
m_MimeTypeToExtMap = new HashMap();
m_ExtToMimeTypeMap = new HashMap();
-
+
FileInputStream fis = null;
InputStreamReader isr = null;
BufferedReader in = null;
@@ -68,7 +63,7 @@
fis = new FileInputStream( m_Filename );
isr = new InputStreamReader( fis );
in = new BufferedReader( isr );
-
+
String line;
while( (line = in.readLine() ) != null )
{
@@ -89,12 +84,12 @@
{
return m_ExtToMimeTypeMap;
}
-
+
public String getMimeType( String extension )
{
return (String) m_ExtToMimeTypeMap.get( extension );
}
-
+
public String[] getExtensions( String mimetype )
{
String[] result = (String[]) m_MimeTypeToExtMap.get( mimetype );
@@ -102,7 +97,7 @@
result = new String[0];
return result;
}
-
+
private void processLine( String line )
{
if( "".equals( line ) )
@@ -110,7 +105,7 @@

StringTokenizer st = new StringTokenizer( line, " ", false );
String mimetype = st.nextToken();
- ArrayList exts = new ArrayList();
+ ArrayList exts = new ArrayList();
while( st.hasMoreTokens() )
{
String extension = st.nextToken();
@@ -121,4 +116,4 @@
exts.toArray( extensions );
m_MimeTypeToExtMap.put( mimetype, exts );
}
-}
+}

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/planet/http/impl/WebApplicationContext.java
(original)
+++
development/main/planet/facilities/http/impl/src/main/net/dpml/http/impl/WebApplicationContext.java
Thu Dec 23 00:24:29 2004
@@ -1,75 +1,65 @@
/*
* Copyright 2004 Niclas Hedman.
- *
+ *
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-package net.dpml.planet.http.impl;
+package net.dpml.http.impl;

import java.io.File;
-
import net.dpml.activity.Disposable;
import net.dpml.activity.Startable;
-import net.dpml.activity.Initializable;
-
import net.dpml.configuration.Configurable;
-import net.dpml.configuration.Configuration;
import net.dpml.configuration.ConfigurationException;
-
import net.dpml.context.Context;
import net.dpml.context.ContextException;
import net.dpml.context.Contextualizable;
-
import net.dpml.logging.LogEnabled;
import net.dpml.logging.Logger;
-
-import net.dpml.service.Serviceable;
+import net.dpml.http.HttpContextService;
+import net.dpml.http.HttpService;
+import net.dpml.http.MimeTypes;
import net.dpml.service.ServiceException;
import net.dpml.service.ServiceManager;
-
-import net.dpml.planet.http.HttpContextService;
-import net.dpml.planet.http.HttpService;
-import net.dpml.planet.http.MimeTypes;
-
+import net.dpml.service.Serviceable;
import org.mortbay.http.Authenticator;
import org.mortbay.http.HttpContext;
-import org.mortbay.http.HttpHandler;
import org.mortbay.http.RequestLog;
import org.mortbay.http.UserRealm;

/**
* @metro.component name="http-web-context" lifestyle="singleton"
- * @metro.service type="net.dpml.planet.http.HttpContextService"
+ * @metro.service type="net.dpml.http.HttpContextService"
*/
-public class WebApplicationContext
+public class WebApplicationContext
extends org.mortbay.jetty.servlet.WebApplicationContext
- implements LogEnabled, Contextualizable, Serviceable, Startable,
+ implements LogEnabled, Contextualizable, Serviceable, Startable,
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"
*/
@@ -77,11 +67,11 @@
{
m_Logger = logger;
}
-
- /**
- * @metro.entry key="urn:metro:temp"
+
+ /**
+ * @metro.entry key="urn:metro:temp"
* type="java.io.File"
- * @metro.entry key="urn:metro:classloader"
+ * @metro.entry key="urn:metro:classloader"
* type="java.lang.ClassLoader"
*/
public void contextualize( Context ctx )
@@ -90,36 +80,36 @@
File tmpDir = (File) ctx.get( "urn:metro:temp" );
tmpDir.mkdirs();
setTempDirectory( tmpDir );
-
+
setClassLoaderJava2Compliant( true );
ClassLoader cl = (ClassLoader) ctx.get( "urn:metro:classloader" );
setParentClassLoader( cl );
}
-
+
/**
- * @metro.dependency type="net.dpml.planet.http.HttpService"
+ * @metro.dependency type="net.dpml.http.HttpService"
* key="server"
- * @metro.dependency type="net.dpml.planet.http.MimeTypes"
+ * @metro.dependency type="net.dpml.http.MimeTypes"
* key="mimetypes" optional="true"
* @metro.dependency type="org.mortbay.http.Authenticator"
* key="authenticator" optional="true"
* @metro.dependency type="org.mortbay.http.UserRealm"
* key="realm" optional="true"
* @metro.dependency type="org.mortbay.http.RequestLog"
- * key="request-log"
+ * key="request-log"
*/
public void service( ServiceManager man )
throws ServiceException
{
m_HttpServer = (HttpService) man.lookup( "server" );
-
+
if( man.hasService( "authenticator" ) )
{
Authenticator authenticator = (Authenticator) man.lookup(
"authenticator" );
if( authenticator != null )
setAuthenticator( authenticator );
}
-
+
if( man.hasService( "realm" ) )
{
UserRealm userRealm = (UserRealm) man.lookup( "realm" );
@@ -128,12 +118,12 @@
setRealm( userRealm );
setRealmName( userRealm.getName() ); // Is this necessary?
}
-
+
}
-
+
RequestLog requestLog = (RequestLog) man.lookup( "request-log" );
setRequestLog( requestLog );
-
+
if( man.hasService( "mimetypes" ) )
{
MimeTypes mimeTypes = (MimeTypes) man.lookup( "mimetypes" );
@@ -147,17 +137,17 @@
{
boolean ignore = conf.getChild( "ignore-jetty-web"
).getValueAsBoolean( false );
setIgnoreWebJetty( ignore );
-
+
boolean extract = conf.getChild( "extract-war" ).getValueAsBoolean(
false );
setExtractWAR( extract );
-
+
String displayName = conf.getChild( "display-name" ).getValue( null
);
if( displayName != null )
setDisplayName( displayName );
-
+
String webApp = conf.getChild( "web-application" ).getValue();
setWAR( webApp );
-
+
String defDescr = conf.getChild( "defaults-descriptor" ).getValue(
"etc/webdefaults.xml" );
setDefaultsDescriptor( defDescr );

@@ -168,38 +158,37 @@
String error = errorPageConf.getAttribute( "error" );
setErrorPage( error, uri );
}
-
+
net.dpml.configuration.Configuration virtualHostConf =
conf.getChild( "virtual-host" );
- String virtualHost = virtualHostConf.getValue( null );
- addVirtualHost( virtualHost );
-
+ configureVirtualHosts( virtualHostConf );
+
net.dpml.configuration.Configuration contextConf = conf.getChild(
"context-path" );
String contextPath = contextConf.getValue( "/" );
setContextPath( contextPath );
-
+
m_Graceful = conf.getChild( "graceful-stop" ).getValueAsBoolean(
false );
-
+
net.dpml.configuration.Configuration attributes = conf.getChild(
"attributes" );
configureAttributes( attributes );
-
+
net.dpml.configuration.Configuration initParams = conf.getChild(
"init-parameters" );
configureInitParameters( initParams );
-
+
net.dpml.configuration.Configuration welcomeFiles = conf.getChild(
"welcome-files" );
configureWelcomeFiles( welcomeFiles );
-
+
String resourceBase = conf.getChild( "resource-base").getValue( "."
);
setResourceBase( resourceBase );
-
+
int maxCachedFilesize = conf.getChild( "max-cached-filesize"
).getValueAsInteger( -1 );
if( maxCachedFilesize > 0 )
- setMaxCachedFileSize( maxCachedFilesize );
-
+ setMaxCachedFileSize( maxCachedFilesize );
+
int maxCacheSize = conf.getChild( "max-cache-size"
).getValueAsInteger( -1 );
if( maxCacheSize > 0 )
- setMaxCacheSize( maxCacheSize );
+ setMaxCacheSize( maxCacheSize );
}
-
+
private void configureAttributes( net.dpml.configuration.Configuration
conf )
throws ConfigurationException
{
@@ -207,19 +196,19 @@
for( int i = 0 ; i < children.length ; i++ )
configureAttribute( children[i] );
}
-
+
private void configureAttribute( net.dpml.configuration.Configuration
conf )
throws ConfigurationException
{
String name = conf.getAttribute( "name" );
String value = conf.getValue();
-
+
// TODO: setAttribute() support Object as a value.
// need to figure out what that could be and introduce
// support for it.
setAttribute( name, value );
}
-
+
private void configureInitParameters(
net.dpml.configuration.Configuration conf )
throws ConfigurationException
{
@@ -231,15 +220,19 @@
setInitParameter( name, value );
}
}
-
+
private void configureVirtualHosts( net.dpml.configuration.Configuration
conf )
throws ConfigurationException
{
net.dpml.configuration.Configuration[] hosts = conf.getChildren(
"host" );
for( int i=0 ; i < hosts.length ; i++ )
- addVirtualHost( hosts[i].getValue() );
+ {
+ String host = hosts[i].getValue();
+ addVirtualHost( host );
+ }
+
}
-
+
private void configureWelcomeFiles( net.dpml.configuration.Configuration
conf )
throws ConfigurationException
{
@@ -256,24 +249,24 @@
m_HttpServer.addContext( this );
super.start();
}
-
+
public void stop()
throws InterruptedException
{
if( m_Logger.isDebugEnabled() )
m_Logger.debug( "Stopping context: " + this );
-
-
- // The following is need due to strange delegation between the
+
+
+ // 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 );
}
-
+
public void dispose()
{
if( m_Logger.isDebugEnabled() )
@@ -281,5 +274,5 @@
destroy();
m_HttpServer = null;
}
-}
-
+}
+

Modified: development/main/planet/facilities/http/spi/build.xml
==============================================================================
--- development/main/planet/facilities/http/spi/build.xml (original)
+++ development/main/planet/facilities/http/spi/build.xml Thu Dec 23
00:24:29 2004
@@ -16,7 +16,7 @@
* limitations under the License.
-->

-<project name="dpml-planet-http-spi" default="install" basedir="."
+<project name="dpml-http-spi" default="install" basedir="."
xmlns:magic="antlib:net.dpml.magic" >

<magic:import uri="artifact:template:dpml/magic/standard"/>

Modified:
development/main/planet/facilities/http/spi/src/main/net/dpml/http/HttpContextService.java
==============================================================================
---
development/main/planet/facilities/http/spi/src/main/net/dpml/planet/http/HttpContextService.java
(original)
+++
development/main/planet/facilities/http/spi/src/main/net/dpml/http/HttpContextService.java
Thu Dec 23 00:24:29 2004
@@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-package net.dpml.planet.http;
+package net.dpml.http;

import org.mortbay.http.Authenticator;
import org.mortbay.http.HttpContext;

Modified:
development/main/planet/facilities/http/spi/src/main/net/dpml/http/HttpService.java
==============================================================================
---
development/main/planet/facilities/http/spi/src/main/net/dpml/planet/http/HttpService.java
(original)
+++
development/main/planet/facilities/http/spi/src/main/net/dpml/http/HttpService.java
Thu Dec 23 00:24:29 2004
@@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-package net.dpml.planet.http;
+package net.dpml.http;


import org.mortbay.http.HttpContext;
@@ -25,7 +25,7 @@
/**
* Defintion of the HttpService service contract.
*
- * @metro.service type="net.dpml.planet.http.HttpService" version="1.0"
+ * @metro.service type="net.dpml.http.HttpService" version="1.0"
*/
public interface HttpService
{

Modified:
development/main/planet/facilities/http/spi/src/main/net/dpml/http/MimeTypes.java
==============================================================================
---
development/main/planet/facilities/http/spi/src/main/net/dpml/planet/http/MimeTypes.java
(original)
+++
development/main/planet/facilities/http/spi/src/main/net/dpml/http/MimeTypes.java
Thu Dec 23 00:24:29 2004
@@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-package net.dpml.planet.http;
+package net.dpml.http;

import java.util.Map;


Modified: development/main/planet/facilities/http/test/build.xml
==============================================================================
--- development/main/planet/facilities/http/test/build.xml (original)
+++ development/main/planet/facilities/http/test/build.xml Thu Dec 23
00:24:29 2004
@@ -16,7 +16,7 @@
* limitations under the License.
-->

-<project name="dpml-planet-http-test" default="install" basedir="."
+<project name="dpml-http-test" default="install" basedir="."
xmlns:magic="antlib:net.dpml.magic"
xmlns:x="plugin:dpml/magic/dpml-magic-core" >

<magic:import uri="artifact:template:dpml/magic/standard"/>
@@ -28,7 +28,7 @@
<x:component name="secondary" profile="secondary"
class="test.http.TestComponent"/>
<x:component name="listener"
- class="net.dpml.planet.http.impl.DefaultModelListener"/>
+ class="net.dpml.http.impl.DefaultModelListener"/>
</x:block>
</target>


Modified:
development/main/planet/facilities/http/test/src/main/test/http/TestComponent.java
==============================================================================
---
development/main/planet/facilities/http/test/src/main/test/http/TestComponent.java
(original)
+++
development/main/planet/facilities/http/test/src/main/test/http/TestComponent.java
Thu Dec 23 00:24:29 2004
@@ -1,16 +1,16 @@
-/*
+/*
* Copyright 2004 Apache Software Foundation
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
+ * You may obtain a copy of the License at
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
* implied.
- *
+ *
* See the License for the specific language governing permissions and
* limitations under the License.
*/
@@ -32,16 +32,16 @@
import net.dpml.configuration.ConfigurationException;
import net.dpml.configuration.Configurable;

-import net.dpml.planet.http.HttpRequestHandler;
+import net.dpml.http.HttpRequestHandler;

import org.mortbay.http.HttpRequest;
import org.mortbay.http.HttpResponse;

/**
* HTTP Handler component that receives and processes http requests.
- *
+ *
* @metro.component name="test" lifestyle="thread"
- * @metro.service type="net.dpml.planet.http.HttpRequestHandler"
+ * @metro.service type="net.dpml.http.HttpRequestHandler"
*/
public class TestComponent
implements LogEnabled, Serviceable, Configurable, HttpRequestHandler
@@ -95,38 +95,38 @@
}


- public void handle( String path, String params,
+ public void handle( String path, String params,
HttpRequest request, HttpResponse response )
throws IOException
{
m_logger.debug( "TestComponent - Handling HTTP: " + path );
-
+
int count = m_counter.increment();
-
+
m_count++;

response.setContentType("text/html");
OutputStream out = response.getOutputStream();
OutputStreamWriter osw = new OutputStreamWriter( out, "ISO8859-1" );
PrintWriter writer = new PrintWriter( osw );
-
+
writer.println("<html>");
writer.println("<head>");
writer.println("<title>" + m_name + "</title>" );
writer.println("</head>");
writer.println("<body>" );
writer.println("<hr/>");
- writer.println("<h3>"
- + m_name
+ writer.println("<h3>"
+ + m_name
+ "</h3>");
writer.println("<hr/>");
- writer.println("<P>"
+ writer.println("<P>"
+ "local hits: " + m_count + "</br>"
+ "total hits: " + count + "</p>" );
- writer.println("<p>I'm an Avalon component.<br/>");
+ writer.println("<p>I'm a DPML Metro component.<br/>");
writer.println(
- "Here is <a href=\""
- + m_link
+ "Here is <a href=\""
+ + m_link
+ "\">a link to my mate.</a></p>");
writer.println("<hr/>");
writer.println("</body>");

Modified: development/main/planet/facilities/http/util/build.xml
==============================================================================
--- development/main/planet/facilities/http/util/build.xml (original)
+++ development/main/planet/facilities/http/util/build.xml Thu Dec 23
00:24:29 2004
@@ -16,7 +16,7 @@
* limitations under the License.
-->

-<project name="dpml-planet-http-util" default="install" basedir="."
+<project name="dpml-http-util" default="install" basedir="."
xmlns:magic="antlib:net.dpml.magic"
xmlns:x="plugin:dpml/magic/dpml-magic-core" >

<magic:import uri="artifact:template:dpml/magic/standard"/>



  • svn commit: r1261 - in development/main/planet/facilities/http: . api api/src/main/net/dpml/http api/src/main/net/dpml/planet/http blocks blocks/context blocks/demo blocks/demo/src/main/net/dpml/planet/playground blocks/hash-basic blocks/hash-clientcert blocks/hash-digest blocks/hash-form blocks/server blocks/servlet blocks/static blocks/tapestry blocks/webappserver blocks/webappserver/etc blocks/webappserver/etc/deliverables blocks/webappserver/etc/deliverables/confs examples/hangman examples/hangman/etc/deliverables examples/hangman/etc/deliverables/confs impl impl/src/etc impl/src/main impl/src/main/net/dpml/http impl/src/main/net/dpml/http/impl impl/src/main/net/dpml/planet/http spi spi/src/main/net/dpml/http spi/src/main/net/dpml/planet/http test test/src/main/test/http util util/src/main/net/dpml/http util/src/main/net/dpml/planet/http, niclas, 12/22/2004

Archive powered by MHonArc 2.6.24.

Top of Page