Skip to Content.
Sympa Menu

notify-dpml - svn commit: r1329 - in development/main/planet: components facilities/http/api/src/main/net/dpml/http facilities/http/blocks facilities/http/blocks/context facilities/http/blocks/hash-basic facilities/http/blocks/hash-clientcert facilities/http/blocks/hash-digest facilities/http/blocks/hash-form facilities/http/blocks/server facilities/http/blocks/servlet facilities/http/blocks/static facilities/http/blocks/webappserver facilities/http/examples facilities/http/examples/hello facilities/http/examples/hello/etc/deliverables/realms facilities/http/examples/hello/src/main/net/dpml/playground facilities/http/impl/etc facilities/http/impl/etc/deliverables facilities/http/impl/etc/deliverables/realms facilities/http/impl/src/main/net/dpml/http/impl facilities/http/spi/src/main/net/dpml/http facilities/http/test/src/main/test/http facilities/jmx/mx4j/src/main/net/dpml/jmx/mx4j facilities/jmx/spi/src/main/net/dpml/jmx/spi facilities/reflector

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: r1329 - in development/main/planet: components facilities/http/api/src/main/net/dpml/http facilities/http/blocks facilities/http/blocks/context facilities/http/blocks/hash-basic facilities/http/blocks/hash-clientcert facilities/http/blocks/hash-digest facilities/http/blocks/hash-form facilities/http/blocks/server facilities/http/blocks/servlet facilities/http/blocks/static facilities/http/blocks/webappserver facilities/http/examples facilities/http/examples/hello facilities/http/examples/hello/etc/deliverables/realms facilities/http/examples/hello/src/main/net/dpml/playground facilities/http/impl/etc facilities/http/impl/etc/deliverables facilities/http/impl/etc/deliverables/realms facilities/http/impl/src/main/net/dpml/http/impl facilities/http/spi/src/main/net/dpml/http facilities/http/test/src/main/test/http facilities/jmx/mx4j/src/main/net/dpml/jmx/mx4j facilities/jmx/spi/src/main/net/dpml/jmx/spi facilities/reflector
  • Date: Fri, 31 Dec 2004 03:29:08 +0100

Author: niclas
Date: Fri Dec 31 03:29:07 2004
New Revision: 1329

Added:
development/main/planet/components/

development/main/planet/facilities/http/examples/hello/etc/deliverables/realms/

development/main/planet/facilities/http/examples/hello/etc/deliverables/realms/users.realm
development/main/planet/facilities/http/impl/etc/
development/main/planet/facilities/http/impl/etc/deliverables/
development/main/planet/facilities/http/impl/etc/deliverables/realms/

development/main/planet/facilities/http/impl/etc/deliverables/realms/default.realm

development/main/planet/facilities/http/impl/etc/deliverables/realms/jdbc.realm
Removed:

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
Modified:
development/main/planet/facilities/http/blocks/context/build.xml
development/main/planet/facilities/http/blocks/hash-basic/build.xml
development/main/planet/facilities/http/blocks/hash-clientcert/build.xml
development/main/planet/facilities/http/blocks/hash-digest/build.xml
development/main/planet/facilities/http/blocks/hash-form/build.xml
development/main/planet/facilities/http/blocks/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/webappserver/build.xml
development/main/planet/facilities/http/examples/hello/README.TXT
development/main/planet/facilities/http/examples/hello/build.xml

development/main/planet/facilities/http/examples/hello/src/main/net/dpml/playground/HelloComponent.java
development/main/planet/facilities/http/examples/index.xml

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/ModelHandler.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/ServletHandler.java

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

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

development/main/planet/facilities/http/test/src/main/test/http/TestComponent.java

development/main/planet/facilities/jmx/mx4j/src/main/net/dpml/jmx/mx4j/MX4JComponentRegistrationManager.java

development/main/planet/facilities/jmx/spi/src/main/net/dpml/jmx/spi/AbstractJMXComponentRegistrationManager.java
development/main/planet/facilities/reflector/README.TXT
Log:
Clean-up in planet, fixing up several facilities, trying to update README doc
and changes to the Http facility.

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 Fri
Dec 31 03:29:07 2004
@@ -23,28 +23,29 @@

<target name="build" depends="standard.build">
<x:block name="default-context">
- <x:component name="context" class="net.dpml.http.impl.HttpContextImpl"
activation="startup" />
- <x:component name="security-handler"
class="net.dpml.http.impl.SecurityHandler" activation="startup" />
+ <x:service type="net.dpml.http.HttpContextService"
source="authenticator" />
+ <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" activation="startup" >
+ <x:component name="resource-handler"
class="net.dpml.http.impl.ResourceHandler" >
<x:parameters>
<x:parameter name="allow-directory" value="true" />
<x:parameter name="allow-methods" value="GET" />
</x:parameters>
</x:component>

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

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

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

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 Fri
Dec 31 03:29:07 2004
@@ -23,13 +23,14 @@

<target name="build" depends="standard.build">
<x:block name="hash-basic-auth">
- <x:component name="realm" class="net.dpml.http.impl.HashUserRealm"
activation="startup" >
+ <x:service type="org.mortbay.http.Authenticator"
source="authenticator" />
+ <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:parameter name="name" value="Metro" />
+ <x:parameter name="realm-uri"
value="artifact:realm:dpml/http/default" />
</x:parameters>
</x:component>
- <x:component name="authenticator"
class="org.mortbay.http.BasicAuthenticator" activation="startup" />
+ <x:component name="authenticator"
class="org.mortbay.http.BasicAuthenticator" />
</x:block>
</target>


Modified:
development/main/planet/facilities/http/blocks/hash-clientcert/build.xml
==============================================================================
--- development/main/planet/facilities/http/blocks/hash-clientcert/build.xml
(original)
+++ development/main/planet/facilities/http/blocks/hash-clientcert/build.xml
Fri Dec 31 03:29:07 2004
@@ -23,13 +23,14 @@

<target name="build" depends="standard.build">
<x:block name="hash-clientcert-auth">
- <x:component name="realm" class="net.dpml.http.impl.HashUserRealm"
activation="startup" >
+ <x:service type="org.mortbay.http.Authenticator"
source="authenticator" />
+ <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:parameter name="name" value="Metro" />
+ <x:parameter name="realm-uri"
value="artifact:realm:dpml/http/default" />
</x:parameters>
</x:component>
- <x:component name="authenticator"
class="net.dpml.http.impl.ClientCertAuthenticator" activation="startup" />
+ <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
Fri Dec 31 03:29:07 2004
@@ -23,13 +23,14 @@

<target name="build" depends="standard.build">
<x:block name="hash-digest-auth">
- <x:component name="realm" class="net.dpml.http.impl.HashUserRealm"
activation="startup" >
+ <x:service type="org.mortbay.http.Authenticator"
source="authenticator" />
+ <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:parameter name="name" value="Metro" />
+ <x:parameter name="realm-uri"
value="artifact:realm:dpml/http/default" />
</x:parameters>
</x:component>
- <x:component name="authenticator"
class="org.mortbay.http.DigestAuthenticator" activation="startup" />
+ <x:component name="authenticator"
class="org.mortbay.http.DigestAuthenticator" />
</x:block>
</target>


Modified: development/main/planet/facilities/http/blocks/hash-form/build.xml
==============================================================================
--- development/main/planet/facilities/http/blocks/hash-form/build.xml
(original)
+++ development/main/planet/facilities/http/blocks/hash-form/build.xml Fri
Dec 31 03:29:07 2004
@@ -23,13 +23,14 @@

<target name="build" depends="standard.build">
<x:block name="hash-form-auth">
- <x:component name="realm" class="net.dpml.http.impl.HashUserRealm"
activation="startup" >
+ <x:service type="org.mortbay.http.Authenticator"
source="authenticator" />
+ <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:parameter name="name" value="Metro" />
+ <x:parameter name="realm-uri"
value="artifact:realm:dpml/http/default" />
</x:parameters>
</x:component>
- <x:component name="authenticator"
class="net.dpml.http.impl.FormAuthenticator" activation="startup" >
+ <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 Fri Dec 31
03:29:07 2004
@@ -24,7 +24,7 @@
<info>
<group>dpml/http</group>
<name>dpml-http-context</name>
- <version>1.0.0</version>
+ <version>1.0</version>
<type>block</type>
</info>
<dependencies>
@@ -36,7 +36,7 @@
<info>
<group>dpml/http</group>
<name>dpml-http-webappserver</name>
- <version>1.0.0</version>
+ <version>1.0</version>
<type>block</type>
</info>
<dependencies>
@@ -48,7 +48,7 @@
<info>
<group>dpml/http</group>
<name>dpml-http-server</name>
- <version>1.0.0</version>
+ <version>1.0</version>
<type>block</type>
</info>
<dependencies>
@@ -60,7 +60,7 @@
<info>
<group>dpml/http</group>
<name>dpml-http-hash-basic</name>
- <version>1.0.0</version>
+ <version>1.0</version>
<type>block</type>
</info>
<dependencies>
@@ -72,7 +72,7 @@
<info>
<group>dpml/http</group>
<name>dpml-http-hash-form</name>
- <version>1.0.0</version>
+ <version>1.0</version>
<type>block</type>
</info>
<dependencies>
@@ -84,7 +84,7 @@
<info>
<group>dpml/http</group>
<name>dpml-http-hash-clientcert</name>
- <version>1.0.0</version>
+ <version>1.0</version>
<type>block</type>
</info>
<dependencies>
@@ -96,7 +96,7 @@
<info>
<group>dpml/http</group>
<name>dpml-http-hash-digest</name>
- <version>1.0.0</version>
+ <version>1.0</version>
<type>block</type>
</info>
<dependencies>
@@ -108,7 +108,7 @@
<info>
<group>dpml/http</group>
<name>dpml-http-static</name>
- <version>1.0.0</version>
+ <version>1.0</version>
<type>block</type>
</info>
<dependencies>
@@ -120,7 +120,7 @@
<info>
<group>dpml/http</group>
<name>dpml-http-servlet</name>
- <version>1.0.0</version>
+ <version>1.0</version>
<type>block</type>
</info>
<dependencies>
@@ -132,7 +132,7 @@
<info>
<group>dpml/http</group>
<name>dpml-http-tapestry</name>
- <version>1.0.0</version>
+ <version>1.0</version>
<type>block</type>
</info>
<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 Fri
Dec 31 03:29:07 2004
@@ -24,14 +24,14 @@
<target name="build" depends="standard.build">
<x:block name="http-server">
<x:service type="net.dpml.http.HttpService" source="httpserver"/>
- <x:component name="socketlistener"
class="net.dpml.http.impl.SocketListener" activation="startup" />
+ <x:component name="socketlistener"
class="net.dpml.http.impl.SocketListener" />

<!-- Need to setup the KeyStore and set the system properties for user/pass
to the
KeyStore. See Jetty manual for details.
<x:component name="ssllistener"
class="net.dpml.http.impl.JsseListener" activation="startup" />
-->

- <x:component name="httpserver"
class="net.dpml.http.impl.HttpServerImpl" activation="startup" />
+ <x: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 Fri
Dec 31 03:29:07 2004
@@ -23,17 +23,18 @@

<target name="build" depends="standard.build">
<x:block name="servlet">
- <x:component name="context" class="net.dpml.http.impl.HttpContextImpl"
activation="startup" />
- <x:component name="security-handler"
class="net.dpml.http.impl.SecurityHandler" activation="startup" />
- <x:component name="servlets" class="net.dpml.http.impl.ServletHandler"
activation="startup" />
- <x:component name="resource-handler"
class="net.dpml.http.impl.ResourceHandler" activation="startup" >
+ <x:service type="net.dpml.http.ServletHandler" source="context" />
+ <x:component name="context" class="net.dpml.http.impl.HttpContextImpl"
/>
+ <x:component name="security-handler"
class="net.dpml.http.impl.SecurityHandler" />
+ <x:component name="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.http.impl.NotFoundHandler" activation="startup" />
- <x:component name="request-log"
class="net.dpml.http.impl.NcsaRequestLog" activation="startup" >
+ <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 Fri
Dec 31 03:29:07 2004
@@ -23,17 +23,18 @@

<target name="build" depends="standard.build">
<x:block name="static">
- <x:component name="context" class="net.dpml.http.impl.HttpContextImpl"
activation="startup" />
- <x:component name="security-handler"
class="net.dpml.http.impl.SecurityHandler" activation="startup" />
- <x:component name="resource-handler"
class="net.dpml.http.impl.ResourceHandler" activation="startup" >
+ <x:service type="net.dpml.http.HttpContextService" source="context" />
+ <x:component name="context" class="net.dpml.http.impl.HttpContextImpl"
/>
+ <x:component name="security-handler"
class="net.dpml.http.impl.SecurityHandler" />
+ <x:component name="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.http.impl.ForwardHandler" activation="startup" />
- <x:component name="notfound-handler"
class="net.dpml.http.impl.NotFoundHandler" activation="startup" />
- <x:component name="request-log"
class="net.dpml.http.impl.NcsaRequestLog" activation="startup" >
+ <x: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/webappserver/build.xml
==============================================================================
--- development/main/planet/facilities/http/blocks/webappserver/build.xml
(original)
+++ development/main/planet/facilities/http/blocks/webappserver/build.xml
Fri Dec 31 03:29:07 2004
@@ -32,7 +32,7 @@
<x:component name="context"
class="net.dpml.http.impl.WebApplicationContext" />
<x:component name="request-log"
class="net.dpml.http.impl.NcsaRequestLog" >
<x:parameters>
- <x:parameter name="filename" value="logs/request.log" />
+ <x:parameter name="filename"
value="${dpml.home}/logs/http/request.log" />
<x:parameter name="append" value="true" />
<x:parameter name="extended" value="true" />
</x:parameters>

Modified: development/main/planet/facilities/http/examples/hello/README.TXT
==============================================================================
--- development/main/planet/facilities/http/examples/hello/README.TXT
(original)
+++ development/main/planet/facilities/http/examples/hello/README.TXT Fri
Dec 31 03:29:07 2004
@@ -79,13 +79,13 @@

Executing the block from the local filesystem:

- $ metro target/deliverables/blocks/dpml-http-demo-1.0.0.block
-config target/config.xml
+ $ metro target/deliverables/blocks/dpml-http-demo-1.0.0.block
-config target/deliverables/confs/hello.conf

But why not utilize the extremely powerful artifact: protocol, and the
fact
that everything is built as artifacts. This provides command-lines that
are
independent of where on the local file system the command is executed;

- $ metro artifact:block:dpml/http/examples/hello/hello#2.0.0 -config
artifact:conf:dpml/http/examples/hangman/webapp
+ $ metro
artifact:block:dpml/http/examples/hello/dpml-http-hello#2.0.0 -config
artifact:conf:dpml/http/examples/hello/hello

To check the running applicaion, open a browser and enter the following
url;


Modified: development/main/planet/facilities/http/examples/hello/build.xml
==============================================================================
--- development/main/planet/facilities/http/examples/hello/build.xml
(original)
+++ development/main/planet/facilities/http/examples/hello/build.xml Fri
Dec 31 03:29:07 2004
@@ -23,12 +23,9 @@

<target name="build" depends="standard.build">

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

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

Added:
development/main/planet/facilities/http/examples/hello/etc/deliverables/realms/users.realm
==============================================================================
--- (empty file)
+++
development/main/planet/facilities/http/examples/hello/etc/deliverables/realms/users.realm
Fri Dec 31 03:29:07 2004
@@ -0,0 +1 @@
+

Modified:
development/main/planet/facilities/http/examples/hello/src/main/net/dpml/playground/HelloComponent.java
==============================================================================
---
development/main/planet/facilities/http/examples/hello/src/main/net/dpml/playground/HelloComponent.java
(original)
+++
development/main/planet/facilities/http/examples/hello/src/main/net/dpml/playground/HelloComponent.java
Fri Dec 31 03:29:07 2004
@@ -23,9 +23,15 @@
import java.io.PrintWriter;
import java.util.Date;

+import net.dpml.context.Context;
+import net.dpml.context.ContextException;
import net.dpml.logging.Logger;
-import net.dpml.http.HttpRequestHandler;
+import net.dpml.service.ServiceException;
+import net.dpml.service.ServiceManager;
+import net.dpml.http.HttpContextService;

+import org.mortbay.http.HttpContext;
+import org.mortbay.http.HttpHandler;
import org.mortbay.http.HttpRequest;
import org.mortbay.http.HttpResponse;

@@ -33,25 +39,31 @@
* HTTP Handler component that receives and processes http requests.
*
* @metro.component name="test" lifestyle="thread"
- * @metro.service type="net.dpml.http.HttpRequestHandler"
+ * @metro.service type="org.mortbay.http.HttpHandler"
*
* @author <a href="mailto:dev-dpml AT lists.ibiblio.org";>The Digital Product
Meta Library</a>
*/
-public class HelloComponent implements HttpRequestHandler
+public class HelloComponent
+ implements HttpHandler
{
- //----------------------------------------------------------
- // state
- //----------------------------------------------------------
-
private Logger m_logger;
-
- //----------------------------------------------------------
- // constructor
- //----------------------------------------------------------
-
- public HelloComponent( Logger logger )
+ private boolean m_Started;
+ private HttpContext m_Context;
+ private String m_Name;
+
+
+ /**
+ * @metro.dependency type="net.dpml.http.HttpContextService"
key="context"
+ * @metro.entry key="urn:metro:name"
+ * type="java.lang.String"
+ */
+ public HelloComponent( Logger logger, ServiceManager man, Context ctx )
+ throws ContextException, ServiceException
{
m_logger = logger;
+ HttpContextService httpCtx = (HttpContextService) man.lookup(
"context" );
+ httpCtx.addHandler( 2, this );
+ m_Name = (String) ctx.get( "urn:metro:name" );
}

//----------------------------------------------------------
@@ -87,4 +99,34 @@
writer.println("</html>");
writer.flush();
}
+
+ public String getName()
+ {
+ return m_Name;
+ }
+
+ public void initialize( HttpContext context )
+ {
+ m_Context = context;
+ }
+
+ public HttpContext getHttpContext()
+ {
+ return m_Context;
+ }
+
+ public void start()
+ {
+ m_Started = true;
+ }
+
+ public void stop()
+ {
+ m_Started = false;
+ }
+
+ public boolean isStarted()
+ {
+ return m_Started;
+ }
}

Modified: development/main/planet/facilities/http/examples/index.xml
==============================================================================
--- development/main/planet/facilities/http/examples/index.xml (original)
+++ development/main/planet/facilities/http/examples/index.xml Fri Dec 31
03:29:07 2004
@@ -28,6 +28,8 @@
<type>jar</type>
</info>
<dependencies>
+ <include key="dpml-service-api" />
+ <include key="dpml-logging-api" />
<include key="dpml-http-impl" />
<include key="servletapi" />
</dependencies>
@@ -42,8 +44,6 @@
<name>hangman-api</name>
<version>2.0.0</version>
</info>
- <dependencies>
- </dependencies>
</project>

<project basedir="hangman/app">

Added:
development/main/planet/facilities/http/impl/etc/deliverables/realms/default.realm
==============================================================================
--- (empty file)
+++
development/main/planet/facilities/http/impl/etc/deliverables/realms/default.realm
Fri Dec 31 03:29:07 2004
@@ -0,0 +1,26 @@
+#
+# This file defines users passwords and roles for a HashUserRealm
+#
+# The format is
+# <username>: <password>[,<rolename> ...]
+#
+# Passwords may be clear text, obfuscated or checksummed. The class
+# org.mortbay.util.Password should be used to generate obfuscated
+# passwords or password checksums
+#
+# If DIGEST Authentication is used, the password must be in a recoverable
+# format, either plain text or OBF:.
+#
+
+# password for admin = yabadabadoo
+admin: CRYPT:mdMT8jT.4cbd6,server-administrator,content-administrator,admin
+
+# password for metro = yabadabadoo
+metro: CRYPT:CEHcfuUVr1oQs,server-administrator,content-administrator,admin
+
+# password for niclas = dropdead
+niclas: CRYPT:/JclO8RNM.J/M,user
+
+# password for mcconnell = oxymoron
+mcconnell: CRYPT:UScm1BBmnFmG6,user
+

Added:
development/main/planet/facilities/http/impl/etc/deliverables/realms/jdbc.realm
==============================================================================
--- (empty file)
+++
development/main/planet/facilities/http/impl/etc/deliverables/realms/jdbc.realm
Fri Dec 31 03:29:07 2004
@@ -0,0 +1,71 @@
+#
+# This is a sample properties file for the org.mortbay.http.JdbcRealm
+# implemtation of the UserRealm interface. This allows Jetty users
authentication
+# to work from a database.
+#
+# +-------+ +------------+ +-------+
+# | users | | user_roles | | roles |
+# +-------+ +------------+ +-------+
+# | id | /| user_id |\ | id |
+# | user -------| role_id |------- role |
+# | pwd | \| |/ | |
+# +-------+ +------------+ +-------+
+#
+#
+# 'cachetime' is a time in seconds to cache positive database
+# lookups in internal hash table. Set to 0 to disable caching.
+#
+#
+# For MySQL:
+#
+# create table users
+# (
+# id integer primary key,
+# username varchar(100) not null unique key,
+# pwd varchar(20) not null
+# );
+#
+# create table roles
+# (
+# id integer primary key,
+# role varchar(100) not null unique key
+# );
+#
+# create table user_roles
+# (
+# user_id integer not null,
+# role_id integer not null,
+# unique key (user_id, role_id),
+# index(user_id)
+# );
+#
+# I'm not sure unique key with a first component of user_id will be
+# user by MySQL in query, so additional index wouldn't hurt.
+#
+# To test JDBC implementation:
+#
+# mysql> insert into users values (1, 'admin', 'password');
+# mysql> insert into roles values (1, 'server-administrator');
+# mysql> insert into roles values (2, 'content-administrator');
+# mysql> insert into user_roles values (1, 1);
+# mysql> insert into user_roles values (1, 2);
+#
+# Replace HashUserRealm in etc/admin.xml with JDBCUserRealm and
+# set path to properties file.
+#
+jdbcdriver = org.gjt.mm.mysql.Driver
+url = jdbc:mysql://localhost/jetty
+username = jetty
+password = pwd
+usertable = users
+usertablekey = id
+usertableuserfield = username
+usertablepasswordfield = pwd
+roletable = roles
+roletablekey = id
+roletablerolefield = role
+userroletable = user_roles
+userroletableuserkey = user_id
+userroletablerolekey = role_id
+cachetime = 300
+

Modified:
development/main/planet/facilities/http/impl/src/main/net/dpml/http/impl/HashUserRealm.java
==============================================================================
---
development/main/planet/facilities/http/impl/src/main/net/dpml/http/impl/HashUserRealm.java
(original)
+++
development/main/planet/facilities/http/impl/src/main/net/dpml/http/impl/HashUserRealm.java
Fri Dec 31 03:29:07 2004
@@ -33,13 +33,13 @@
String realmName = params.getParameter( "name" );
setName( realmName );

- String filename = params.getParameter( "filename" );
+ String uri = params.getParameter( "realm-uri" );
try
{
- load( filename );
+ load( uri );
} catch( IOException e )
{
- throw new ParameterException( "Unable to read file: " +
filename, e );
+ throw new ParameterException( "Unable to read realm from " +
uri, 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/http/impl/HttpContextImpl.java
(original)
+++
development/main/planet/facilities/http/impl/src/main/net/dpml/http/impl/HttpContextImpl.java
Fri Dec 31 03:29:07 2004
@@ -34,6 +34,7 @@
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;

@@ -73,7 +74,7 @@
{
return this;
}
-
+
/**
* @metro.dependency type="net.dpml.http.HttpService"
* key="server"

Modified:
development/main/planet/facilities/http/impl/src/main/net/dpml/http/impl/ModelHandler.java
==============================================================================
---
development/main/planet/facilities/http/impl/src/main/net/dpml/http/impl/ModelHandler.java
(original)
+++
development/main/planet/facilities/http/impl/src/main/net/dpml/http/impl/ModelHandler.java
Fri Dec 31 03:29:07 2004
@@ -32,7 +32,6 @@
import net.dpml.parameters.Parameterizable;
import net.dpml.parameters.Parameters;
import net.dpml.http.HttpContextService;
-import net.dpml.http.HttpRequestHandler;
import net.dpml.service.ServiceException;
import net.dpml.service.ServiceManager;
import net.dpml.service.Serviceable;
@@ -58,7 +57,7 @@
private String m_ContextPath;
private String m_ComponentPath;

- private HttpRequestHandler m_HandlerComponent;
+ private HttpHandler m_HandlerComponent;
private ContainmentModel m_Container;

/**
@@ -124,7 +123,7 @@
ComponentModel component = (ComponentModel) m_Container.getModel(
componentName );

m_Container.addCompositionListener( this );
- m_HandlerComponent = (HttpRequestHandler) component.resolve();
+ m_HandlerComponent = (HttpHandler) component.resolve();
}

public void dispose()
@@ -192,8 +191,8 @@

try
{
- m_HandlerComponent = (HttpRequestHandler) cmodel.resolve();
- m_Logger.info( "HttpRequestHandler added: " + path );
+ m_HandlerComponent = (HttpHandler) cmodel.resolve();
+ m_Logger.info( "HttpHandler added: " + path );
} catch( Exception e )
{
m_Logger.error( "Unable to resolve " + path, e );
@@ -219,7 +218,7 @@
if( path.equals( m_ComponentPath ) )
{
m_HandlerComponent = null;
- m_Logger.info( "HttpRequestHandler removed: " + path );
+ m_Logger.info( "HttpHandler removed: " + path );
}
}
}

Modified:
development/main/planet/facilities/http/impl/src/main/net/dpml/http/impl/NcsaRequestLog.java
==============================================================================
---
development/main/planet/facilities/http/impl/src/main/net/dpml/http/impl/NcsaRequestLog.java
(original)
+++
development/main/planet/facilities/http/impl/src/main/net/dpml/http/impl/NcsaRequestLog.java
Fri Dec 31 03:29:07 2004
@@ -19,6 +19,9 @@
import net.dpml.parameters.ParameterException;
import net.dpml.parameters.Parameterizable;
import net.dpml.parameters.Parameters;
+
+import net.dpml.transit.util.PropertyResolver;
+
import org.mortbay.http.NCSARequestLog;
import org.mortbay.http.RequestLog;

@@ -47,7 +50,10 @@

String filename = params.getParameter( "filename", null );
if( filename != null )
+ {
+ filename = PropertyResolver.resolve( System.getProperties(),
filename );
setFilename( filename );
+ }

String dateformat = params.getParameter( "dateformat", null );
if( dateformat != null )

Modified:
development/main/planet/facilities/http/impl/src/main/net/dpml/http/impl/ServletHandler.java
==============================================================================
---
development/main/planet/facilities/http/impl/src/main/net/dpml/http/impl/ServletHandler.java
(original)
+++
development/main/planet/facilities/http/impl/src/main/net/dpml/http/impl/ServletHandler.java
Fri Dec 31 03:29:07 2004
@@ -15,6 +15,8 @@
*/
package net.dpml.http.impl;

+import javax.servlet.ServletContext;
+
import net.dpml.activity.Startable;
import net.dpml.composition.model.ContainmentModel;
import net.dpml.configuration.Configurable;
@@ -136,7 +138,8 @@
*/
public void addServletContextEntry( String entryName, Object
contextObject )
{
- getServletContext().setAttribute( entryName, contextObject );
+ ServletContext ctx = getServletContext();
+ ctx.setAttribute( entryName, contextObject );
}
}


Modified:
development/main/planet/facilities/http/impl/src/main/net/dpml/http/impl/WebApplicationContext.java
==============================================================================
---
development/main/planet/facilities/http/impl/src/main/net/dpml/http/impl/WebApplicationContext.java
(original)
+++
development/main/planet/facilities/http/impl/src/main/net/dpml/http/impl/WebApplicationContext.java
Fri Dec 31 03:29:07 2004
@@ -35,6 +35,7 @@
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;

@@ -263,13 +264,6 @@
{
ServletContext ctx = getServletHandler().getServletContext();
ctx.setAttribute( entryName, contextObject );
-System.out.println( "NICLAS***********************************" );
-System.out.println( ctx );
-java.util.Enumeration names = ctx.getAttributeNames();
-while( names.hasMoreElements() )
- System.out.println( names.nextElement() );
-System.out.println( "----------------------------------------" );
-
}
}


Modified:
development/main/planet/facilities/http/spi/src/main/net/dpml/http/HttpContextService.java
==============================================================================
---
development/main/planet/facilities/http/spi/src/main/net/dpml/http/HttpContextService.java
(original)
+++
development/main/planet/facilities/http/spi/src/main/net/dpml/http/HttpContextService.java
Fri Dec 31 03:29:07 2004
@@ -20,7 +20,7 @@
import org.mortbay.http.HttpHandler;

/**
- * avalon.service version="1.0"
+ * @metro.service type="net.dpml.http.HttpContextService" version="1.0"
*/
public interface HttpContextService
{

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
Fri Dec 31 03:29:07 2004
@@ -32,8 +32,8 @@
import net.dpml.configuration.ConfigurationException;
import net.dpml.configuration.Configurable;

-import net.dpml.http.HttpRequestHandler;
-
+import org.mortbay.http.HttpContext;
+import org.mortbay.http.HttpHandler;
import org.mortbay.http.HttpRequest;
import org.mortbay.http.HttpResponse;

@@ -44,7 +44,7 @@
* @metro.service type="net.dpml.http.HttpRequestHandler"
*/
public class TestComponent
- implements LogEnabled, Serviceable, Configurable, HttpRequestHandler
+ implements LogEnabled, Serviceable, Configurable, HttpHandler
{
//----------------------------------------------------------
// state
@@ -61,6 +61,10 @@
private String m_message;

private String m_name;
+
+ private HttpContext m_Context;
+
+ private boolean m_Started;

//----------------------------------------------------------
// lifecycle
@@ -133,4 +137,34 @@
writer.println("</html>");
writer.flush();
}
+
+ public String getName()
+ {
+ return m_name;
+ }
+
+ public void initialize( HttpContext context )
+ {
+ m_Context = context;
+ }
+
+ public HttpContext getHttpContext()
+ {
+ return m_Context;
+ }
+
+ public void start()
+ {
+ m_Started = true;
+ }
+
+ public void stop()
+ {
+ m_Started = false;
+ }
+
+ public boolean isStarted()
+ {
+ return m_Started;
+ }
}

Modified:
development/main/planet/facilities/jmx/mx4j/src/main/net/dpml/jmx/mx4j/MX4JComponentRegistrationManager.java
==============================================================================
---
development/main/planet/facilities/jmx/mx4j/src/main/net/dpml/jmx/mx4j/MX4JComponentRegistrationManager.java
(original)
+++
development/main/planet/facilities/jmx/mx4j/src/main/net/dpml/jmx/mx4j/MX4JComponentRegistrationManager.java
Fri Dec 31 03:29:07 2004
@@ -64,7 +64,7 @@
"com.sun.jndi.rmi.registry.RegistryContextFactory";
private static final String DEFAULT_HTTPADAPTER_HOST = "localhost";
private static final int DEFAULT_HTTPADAPTER_PORT =
- Integer.getInteger( "merlin.adapter.http", 8082 ).intValue();
+ Integer.getInteger( "metro.adapter.http", 8082 ).intValue();

private String m_host;
private int m_port;
@@ -219,7 +219,7 @@
{
MX4JLoggerAdapter.setLogger( getLogger() );
Log.redirectTo( new MX4JLoggerAdapter() );
- return MBeanServerFactory.createMBeanServer( "Merlin" );
+ return MBeanServerFactory.createMBeanServer( "Metro" );
}

private void stopJMXMBean( final MBeanServer mBeanServer, final String
name )

Modified:
development/main/planet/facilities/jmx/spi/src/main/net/dpml/jmx/spi/AbstractJMXComponentRegistrationManager.java
==============================================================================
---
development/main/planet/facilities/jmx/spi/src/main/net/dpml/jmx/spi/AbstractJMXComponentRegistrationManager.java
(original)
+++
development/main/planet/facilities/jmx/spi/src/main/net/dpml/jmx/spi/AbstractJMXComponentRegistrationManager.java
Fri Dec 31 03:29:07 2004
@@ -51,7 +51,7 @@

private MBeanInfoBuilder topicBuilder;
private MBeanServer m_mBeanServer;
- private String m_domain = "Merlin";
+ private String m_domain = "Metro";

public AbstractJMXComponentRegistrationManager( final Logger logger )
throws Exception

Modified: development/main/planet/facilities/reflector/README.TXT
==============================================================================
--- development/main/planet/facilities/reflector/README.TXT (original)
+++ development/main/planet/facilities/reflector/README.TXT Fri Dec 31
03:29:07 2004
@@ -1,15 +1,15 @@
-
-To build:
-
- $ cd planet/facilities/http
- $ ant
+
+To build:
+
+ $ cd planet/facilities/http
+ $ ant

To start the http server:

$ cd test
- $ merlin target/deliverables/blocks/avalon-http-test.block
-
-To see the result:
+ $ metro target/deliverables/blocks/avalon-http-test.block
+
+To see the result:

http://localhost:8080/test/primary




  • svn commit: r1329 - in development/main/planet: components facilities/http/api/src/main/net/dpml/http facilities/http/blocks facilities/http/blocks/context facilities/http/blocks/hash-basic facilities/http/blocks/hash-clientcert facilities/http/blocks/hash-digest facilities/http/blocks/hash-form facilities/http/blocks/server facilities/http/blocks/servlet facilities/http/blocks/static facilities/http/blocks/webappserver facilities/http/examples facilities/http/examples/hello facilities/http/examples/hello/etc/deliverables/realms facilities/http/examples/hello/src/main/net/dpml/playground facilities/http/impl/etc facilities/http/impl/etc/deliverables facilities/http/impl/etc/deliverables/realms facilities/http/impl/src/main/net/dpml/http/impl facilities/http/spi/src/main/net/dpml/http facilities/http/test/src/main/test/http facilities/jmx/mx4j/src/main/net/dpml/jmx/mx4j facilities/jmx/spi/src/main/net/dpml/jmx/spi facilities/reflector, niclas, 12/30/2004

Archive powered by MHonArc 2.6.24.

Top of Page