Skip to Content.
Sympa Menu

notify-dpml - r999 - in trunk/main/planet/web: . server server/etc server/etc/prefs server/etc/prefs/keystore server/etc/prefs/propertiess server/etc/prefs/xmls server/src/main/net/dpml/web/server

notify-dpml AT lists.ibiblio.org

Subject: DPML Notify

List archive

Chronological Thread  
  • From: mcconnell at BerliOS <mcconnell AT mail.berlios.de>
  • To: notify-dpml AT lists.ibiblio.org
  • Subject: r999 - in trunk/main/planet/web: . server server/etc server/etc/prefs server/etc/prefs/keystore server/etc/prefs/propertiess server/etc/prefs/xmls server/src/main/net/dpml/web/server
  • Date: Tue, 31 Jan 2006 06:20:46 +0100

Author: mcconnell
Date: 2006-01-31 06:20:44 +0100 (Tue, 31 Jan 2006)
New Revision: 999

Added:
trunk/main/planet/web/server/build.xml
trunk/main/planet/web/server/etc/
trunk/main/planet/web/server/etc/prefs/
trunk/main/planet/web/server/etc/prefs/keystore/
trunk/main/planet/web/server/etc/prefs/keystore/jetty.keystore
trunk/main/planet/web/server/etc/prefs/propertiess/
trunk/main/planet/web/server/etc/prefs/propertiess/realm.properties
trunk/main/planet/web/server/etc/prefs/xmls/
trunk/main/planet/web/server/etc/prefs/xmls/jetty.xml

trunk/main/planet/web/server/src/main/net/dpml/web/server/ContextHandler.java
Modified:
trunk/main/planet/web/module.xml
trunk/main/planet/web/server/src/main/net/dpml/web/server/Server.java
Log:
experimental content using Jetty 6

Modified: trunk/main/planet/web/module.xml
===================================================================
--- trunk/main/planet/web/module.xml 2006-01-31 05:06:55 UTC (rev 998)
+++ trunk/main/planet/web/module.xml 2006-01-31 05:20:44 UTC (rev 999)
@@ -9,11 +9,13 @@
<project name="dpml-http-server" basedir="server">
<types>
<type id="jar"/>
+ <type id="part"/>
</types>
<dependencies>
<include ref="dpml/util/dpml-logging-api"/>
<include urn="artifact:jar:servletapi/servletapi#2.4" tag="public"/>
- <include urn="artifact:jar:jetty/jetty#SNAPSHOT"/>
+ <include urn="artifact:jar:jetty/jetty#6.0.0-20060131"/>
+ <include ref="dpml/transit/dpml-transit-main"/>
</dependencies>
</project>


Added: trunk/main/planet/web/server/build.xml
===================================================================
--- trunk/main/planet/web/server/build.xml 2006-01-31 05:06:55 UTC (rev
998)
+++ trunk/main/planet/web/server/build.xml 2006-01-31 05:20:44 UTC (rev
999)
@@ -0,0 +1,69 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!--
+ * Copyright 2004-2005 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.
+-->
+
+<project default="install"
+ xmlns:transit="antlib:net.dpml.transit" xmlns:depot="dpml:depot" >
+
+ <transit:import uri="local:template:dpml/tools/standard"/>
+
+ <target name="build" depends="standard.build">
+ <depot:plugin uri="link:plugin:dpml/metro/dpml-metro-tools" urn="metro"/>
+ <type xmlns="metro" name="server" class="net.dpml.web.server.Server"
threadsafe="true">
+ <services>
+ <service class="org.mortbay.jetty.Server"/>
+ </services>
+ <state>
+ <trigger event="initialization">
+ <transition name="init" target="started">
+ <operation name="startup" method="start"/>
+ </transition>
+ </trigger>
+ <state name="started">
+ <transition name="stop" target="../stopped">
+ <operation name="stop" method="stop"/>
+ </transition>
+ <trigger event="termination">
+ <apply id="stop"/>
+ </trigger>
+ </state>
+ <state name="stopped">
+ <transition name="start" target="../started">
+ <operation name="start" method="start"/>
+ </transition>
+ </state>
+ </state>
+ </type>
+ <component xmlns="metro" type="net.dpml.web.server.Server"
activation="true" collection="hard"/>
+ <catalog xmlns="metro" title="Test Catalog">
+ <fileset dir="${basedir}">
+ <include name="**/target/classes/main/**/*.type"/>
+ </fileset>
+ </catalog>
+ </target>
+
+ <target name="install" depends="standard.install">
+ <property name="prefs" location="${dpml.prefs}/dpml/planet/web"/>
+ <mkdir dir="${prefs}"/>
+ <copy toDir="${prefs}">
+ <fileset dir="target/prefs">
+ <include name="**/*"/>
+ </fileset>
+ </copy>
+ </target>
+
+</project>

Added: trunk/main/planet/web/server/etc/prefs/keystore/jetty.keystore
===================================================================
(Binary files differ)


Property changes on:
trunk/main/planet/web/server/etc/prefs/keystore/jetty.keystore
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream

Added: trunk/main/planet/web/server/etc/prefs/propertiess/realm.properties
===================================================================
--- trunk/main/planet/web/server/etc/prefs/propertiess/realm.properties
2006-01-31 05:06:55 UTC (rev 998)
+++ trunk/main/planet/web/server/etc/prefs/propertiess/realm.properties
2006-01-31 05:20:44 UTC (rev 999)
@@ -0,0 +1,21 @@
+#
+# 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:.
+#
+jetty: MD5:164c88b302622e17050af52c89945d44,user
+admin: CRYPT:adpexzg3FUZAk,server-administrator,content-administrator,admin
+other: OBF:1xmk1w261u9r1w1c1xmq
+plain: plain
+user: password
+
+# This entry is for digest auth. The credential is a MD5 hash of
username:realmname:password
+digest: MD5:6e120743ad67abfbc385bc2bb754e297

Added: trunk/main/planet/web/server/etc/prefs/xmls/jetty.xml
===================================================================
--- trunk/main/planet/web/server/etc/prefs/xmls/jetty.xml 2006-01-31
05:06:55 UTC (rev 998)
+++ trunk/main/planet/web/server/etc/prefs/xmls/jetty.xml 2006-01-31
05:20:44 UTC (rev 999)
@@ -0,0 +1,214 @@
+<?xml version="1.0"?>
+<!DOCTYPE Configure PUBLIC "-//Mort Bay Consulting//DTD Configure//EN"
"http://jetty.mortbay.org/configure.dtd";>
+
+
+<!-- =============================================================== -->
+<!-- Configure the Jetty Server -->
+<!-- =============================================================== -->
+<Configure id="Server" class="org.mortbay.jetty.Server">
+
+ <!-- =========================================================== -->
+ <!-- Initialize management framework -->
+ <!-- =========================================================== -->
+ <!--
+ <Call id="MBeanServer" class="javax.management.MBeanServerFactory"
name="createMBeanServer">
+ <Arg>org.mortbay.jetty</Arg>
+ </Call>
+ <Get id="Container" name="container"/>
+ <New class="org.mortbay.management.MBeanContainer">
+ <Arg><Ref id="MBeanServer" /></Arg>
+ <Arg><Ref id="Container"/></Arg>
+ <Set name="managementPort">8082</Set>
+ <Call name="start" />
+ </New>
+ -->
+
+ <!-- =========================================================== -->
+ <!-- Server Thread Pool -->
+ <!-- =========================================================== -->
+ <Set name="ThreadPool">
+ <New class="org.mortbay.thread.BoundedThreadPool">
+ <Set name="minThreads">10</Set>
+ <Set name="maxThreads">100</Set>
+ </New>
+ </Set>
+
+ <!-- =========================================================== -->
+ <!-- Set connectors -->
+ <!-- =========================================================== -->
+ <!-- One of each type! -->
+ <!-- =========================================================== -->
+ <Set name="connectors">
+ <Array type="org.mortbay.jetty.Connector">
+
+ <!-- Use this connector if NIO is not available.
+ <Item>
+ <New class="org.mortbay.jetty.bio.SocketConnector">
+ <Set name="port">8080</Set>
+ <Set name="maxIdleTime">50000</Set>
+ </New>
+ </Item>
+ -->
+
+ <!-- Use this connector for few very active connections.
+ <Item>
+ <New class="org.mortbay.jetty.nio.BlockingChannelConnector">
+ <Set name="port">8080</Set>
+ </New>
+ </Item>
+ -->
+
+ <!-- Use this connector for many frequently idle connections
+ and for threadless continuations.
+ -->
+ <Item>
+ <New class="org.mortbay.jetty.nio.SelectChannelConnector">
+ <Set name="port">8080</Set>
+ <Set name="maxIdleTime">50000</Set>
+ <Set name="Acceptors">10</Set>
+ </New>
+ </Item>
+
+ <!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
-->
+ <!-- Add a HTTPS SSL listener on port 8443
-->
+ <!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
-->
+ <!--
+ <Item>
+ <New class="org.mortbay.jetty.security.SslSocketConnector">
+ <Set name="Port">8443</Set>
+ <Set name="maxIdleTime">30000</Set>
+ <Set name="Keystore"><SystemProperty name="jetty.home"
default="." />/etc/keystore</Set>
+ <Set name="Password">OBF:1vny1zlo1x8e1vnw1vn61x8g1zlu1vn4</Set>
+ <Set name="KeyPassword">OBF:1u2u1wml1z7s1z7a1wnl1u2g</Set>
+ </New>
+ </Item>
+ -->
+ </Array>
+ </Set>
+
+ <!-- =========================================================== -->
+ <!-- Set handlers -->
+ <!-- =========================================================== -->
+ <Set name="handlers">
+ <Array type="org.mortbay.jetty.Handler">
+
+ <!-- ======================================================= -->
+ <!-- Configure a test web application with web.xml -->
+ <!-- ======================================================= -->
+
+ <!-- REMOVED PENDING PROPER SETUP -->
+ <!--
+ <Item>
+ <New id="testWebAppContext"
class="org.mortbay.jetty.webapp.WebAppContext">
+ <Set name="contextPath">/test</Set>
+ <Set name="war">./webapps/test</Set>
+ <Set name="VirtualHosts"><Array
type="java.lang.String"></Array></Set>
+ <Get name="SessionHandler">
+ <Set name="SessionManager"><New
class="org.mortbay.jetty.servlet.HashSessionManager"/></Set>
+ </Get>
+ </New>
+ </Item>
+ -->
+
+ <!-- ======================================================= -->
+ <!-- Configure a context directly - no XML parser required -->
+ <!-- ======================================================= -->
+ <Item>
+ <New id="javadocContext"
class="net.dpml.web.server.ContextHandler">
+ <Set name="contextPath">/docs</Set>
+ <Set name="resourceBase">${dpml.data}/docs</Set>
+ <Set name="handler">
+ <New id="javadocServletHandler"
class="org.mortbay.jetty.servlet.ServletHandler">
+ <Set name="servlets">
+ <Array type="org.mortbay.jetty.servlet.ServletHolder">
+ <Item>
+ <New
class="org.mortbay.jetty.servlet.ServletHolder">
+ <Set name="name">Default</Set>
+ <Set
name="className">org.mortbay.jetty.servlet.DefaultServlet</Set>
+ </New>
+ </Item>
+ </Array>
+ </Set>
+
+ <Set name="servletMappings">
+ <Array type="org.mortbay.jetty.servlet.ServletMapping">
+ <Item>
+ <New
class="org.mortbay.jetty.servlet.ServletMapping">
+ <Set name="pathSpec">/</Set>
+ <Set name="servletName">Default</Set>
+ </New>
+ </Item>
+ </Array>
+ </Set>
+ </New>
+ </Set>
+ </New>
+ </Item>
+
+ </Array>
+ </Set>
+
+
+ <!-- REMOVED PENDING PROPER SETUP -->
+
+ <!-- =========================================================== -->
+ <!-- Additional contexts not defined above -->
+ <!-- =========================================================== -->
+ <!--
+ <Call class="org.mortbay.jetty.webapp.WebAppContext"
name="addWebApplications">
+ <Arg><Ref id="Server"/></Arg>
+ <Arg>./webapps</Arg>
+ <Arg>org/mortbay/jetty/webapp/webdefault.xml</Arg>
+ <Arg type="boolean">True</Arg>
+ <Arg type="boolean">True</Arg>
+ </Call>
+ -->
+
+ <!-- REMOVED PENDING PROPER SETUP -->
+ <!-- =========================================================== -->
+ <!-- Configure Realms -->
+ <!-- =========================================================== -->
+ <!--
+ <Set name="UserRealms">
+ <Array type="org.mortbay.jetty.security.UserRealm">
+ <Item>
+ <New class="org.mortbay.jetty.security.HashUserRealm">
+ <Set name="name">Test Realm</Set>
+ <Set name="config">etc/realm.properties</Set>
+ </New>
+ </Item>
+ </Array>
+ </Set>
+ -->
+
+ <!-- =========================================================== -->
+ <!-- Configure Request Log -->
+ <!-- =========================================================== -->
+ <!-- uncomment for a request log (and create logs directory)
+ <Set name="requestLog">
+ <New id="requestLogImpl" class="org.mortbay.jetty.NCSARequestLog">
+ <Arg><SystemProperty name="jetty.home"
default="."/>/logs/yyyy_mm_dd.request.log</Arg>
+ <Set name="retainDays">90</Set>
+ <Set name="append">true</Set>
+ <Set name="extended">false</Set>
+ <Set name="LogTimeZone">GMT</Set>
+ </New>
+ </Set>
+ -->
+
+ <!-- =========================================================== -->
+ <!-- Start the server -->
+ <!-- =========================================================== -->
+ <Set name="stopAtShutdown">true</Set>
+ <Call name="start"/>
+
+</Configure>
+
+
+
+
+
+
+
+
+

Added:
trunk/main/planet/web/server/src/main/net/dpml/web/server/ContextHandler.java
===================================================================
---
trunk/main/planet/web/server/src/main/net/dpml/web/server/ContextHandler.java
2006-01-31 05:06:55 UTC (rev 998)
+++
trunk/main/planet/web/server/src/main/net/dpml/web/server/ContextHandler.java
2006-01-31 05:20:44 UTC (rev 999)
@@ -0,0 +1,35 @@
+/*
+ * Copyright 2006 Stephen McConnell.
+ *
+ * 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.web.server;
+
+import net.dpml.transit.util.PropertyResolver;
+
+/**
+ * HTTP server implementation.
+ */
+public class ContextHandler extends org.mortbay.jetty.handler.ContextHandler
+{
+ /**
+ * @param resourceBase The base resource as a string.
+ */
+ public void setResourceBase( String resourceBase )
+ {
+ String resolved = PropertyResolver.resolve( resourceBase );
+ System.out.println( "## RESOURCE BASE: " + resolved );
+ super.setResourceBase( resolved );
+ }
+
+}

Modified:
trunk/main/planet/web/server/src/main/net/dpml/web/server/Server.java
===================================================================
--- trunk/main/planet/web/server/src/main/net/dpml/web/server/Server.java
2006-01-31 05:06:55 UTC (rev 998)
+++ trunk/main/planet/web/server/src/main/net/dpml/web/server/Server.java
2006-01-31 05:20:44 UTC (rev 999)
@@ -15,11 +15,15 @@
*/
package net.dpml.web.server;

+import java.net.URI;
+import java.net.URL;
+
import net.dpml.logging.Logger;

import org.mortbay.thread.ThreadPool;
import org.mortbay.jetty.RequestLog;
import org.mortbay.jetty.Handler;
+import org.mortbay.xml.XmlConfiguration;

/**
* HTTP server implementation.
@@ -32,31 +36,38 @@
public interface Context
{
/**
+ * Get the Jetty XML configuration uri.
+ * @param uri the default uri
+ * @return a uri referencing a Jetty configuration
+ */
+ URI getConfiguration( URI uri );
+
+ /**
* Get the thread pool.
* @param pool the fallback thread pool (may be null)
* @return the thread pool
*/
- ThreadPool getThreadPool( ThreadPool fallback );
+ //ThreadPool getThreadPool( ThreadPool fallback );

/**
* Get the request log.
* @param log the fallback request log (may be null)
* @return the resolved request log
*/
- RequestLog getRequestLog( RequestLog log );
+ //RequestLog getRequestLog( RequestLog log );

/**
* Get the request log.
* @param handler the fallback not-found handler
* @return the resolved handler
*/
- Handler getNotFoundHandler( Handler handler );
+ //Handler getNotFoundHandler( Handler handler );

/**
* Get the stop-at-shutdown policy.
* @return true if the server should be stopped at shutdown
*/
- boolean getShutdownPolicy( boolean flag );
+ //boolean getShutdownPolicy( boolean flag );
}

private final Logger m_logger;
@@ -67,13 +78,27 @@
* @param logger the assigned logging channel
* @param context the assigned deployment context
*/
- public Server( Logger logger, Context context )
+ public Server( Logger logger, Context context ) throws Exception
{
super();

m_logger = logger;
m_context = context;

+
+ URI standard = new URI( "local:xml:dpml/planet/web/jetty" );
+ URI uri = context.getConfiguration( standard );
+ if( null != uri )
+ {
+ getLogger().info( "configuration: " + uri );
+ URL url = uri.toURL();
+ XmlConfiguration config = new XmlConfiguration( url );
+ config.configure( this );
+ }
+
+ getLogger().info( "ready: " + this );
+
+ /*
ThreadPool pool = context.getThreadPool( null );
if( null != pool )
{
@@ -97,5 +122,11 @@
{
setStopAtShutdown( policy );
}
+ */
}
+
+ private Logger getLogger()
+ {
+ return m_logger;
+ }
}




  • r999 - in trunk/main/planet/web: . server server/etc server/etc/prefs server/etc/prefs/keystore server/etc/prefs/propertiess server/etc/prefs/xmls server/src/main/net/dpml/web/server, mcconnell at BerliOS, 01/31/2006

Archive powered by MHonArc 2.6.24.

Top of Page