Skip to Content.
Sympa Menu

notify-dpml - r994 - in trunk/main: . planet planet/web planet/web/server planet/web/server/src planet/web/server/src/main planet/web/server/src/main/net planet/web/server/src/main/net/dpml planet/web/server/src/main/net/dpml/web planet/web/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: r994 - in trunk/main: . planet planet/web planet/web/server planet/web/server/src planet/web/server/src/main planet/web/server/src/main/net planet/web/server/src/main/net/dpml planet/web/server/src/main/net/dpml/web planet/web/server/src/main/net/dpml/web/server
  • Date: Mon, 30 Jan 2006 17:03:12 +0100

Author: mcconnell
Date: 2006-01-30 17:03:12 +0100 (Mon, 30 Jan 2006)
New Revision: 994

Added:
trunk/main/planet/web/
trunk/main/planet/web/module.xml
trunk/main/planet/web/server/
trunk/main/planet/web/server/src/
trunk/main/planet/web/server/src/main/
trunk/main/planet/web/server/src/main/net/
trunk/main/planet/web/server/src/main/net/dpml/
trunk/main/planet/web/server/src/main/net/dpml/web/
trunk/main/planet/web/server/src/main/net/dpml/web/server/
trunk/main/planet/web/server/src/main/net/dpml/web/server/Server.java
Modified:
trunk/main/build.xml
Log:
tweaking

Modified: trunk/main/build.xml
===================================================================
--- trunk/main/build.xml 2006-01-30 15:58:48 UTC (rev 993)
+++ trunk/main/build.xml 2006-01-30 16:03:12 UTC (rev 994)
@@ -159,6 +159,13 @@
</target>

<target name="prefs" depends="prepare">
+ <property name="prefs.transit" location="${prefs}/dpml/transit"/>
+ <mkdir dir="${prefs.transit}"/>
+ <copy todir="${prefs.transit}" filtering="false">
+ <fileset dir="transit/core/target/prefs">
+ <include name="**/*"/>
+ </fileset>
+ </copy>
<property name="prefs.tools" location="${prefs}/dpml/tools"/>
<mkdir dir="${prefs.tools}"/>
<copy todir="${prefs.tools}" filtering="false">

Added: trunk/main/planet/web/module.xml
===================================================================
--- trunk/main/planet/web/module.xml 2006-01-30 15:58:48 UTC (rev 993)
+++ trunk/main/planet/web/module.xml 2006-01-30 16:03:12 UTC (rev 994)
@@ -0,0 +1,20 @@
+<?xml version="1.0" encoding="ISO-8859-1"?>
+
+<module name="web">
+
+ <types>
+ <type id="module" alias="true"/>
+ </types>
+
+ <project name="dpml-http-server" basedir="server">
+ <types>
+ <type id="jar"/>
+ </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"/>
+ </dependencies>
+ </project>
+
+</module>

Added: 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-30 15:58:48 UTC (rev 993)
+++ trunk/main/planet/web/server/src/main/net/dpml/web/server/Server.java
2006-01-30 16:03:12 UTC (rev 994)
@@ -0,0 +1,101 @@
+/*
+ * 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.logging.Logger;
+
+import org.mortbay.thread.ThreadPool;
+import org.mortbay.jetty.RequestLog;
+import org.mortbay.jetty.Handler;
+
+/**
+ * HTTP server implementation.
+ */
+public class Server extends org.mortbay.jetty.Server
+{
+ /**
+ * Component context.
+ */
+ public interface Context
+ {
+ /**
+ * Get the thread pool.
+ * @param pool the fallback thread pool (may be null)
+ * @return the thread pool
+ */
+ 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 );
+
+ /**
+ * Get the request log.
+ * @param handler the fallback not-found handler
+ * @return the resolved 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 );
+ }
+
+ private final Logger m_logger;
+ private final Context m_context;
+
+ /**
+ * Creation of a new HTTP server implementation.
+ * @param logger the assigned logging channel
+ * @param context the assigned deployment context
+ */
+ public Server( Logger logger, Context context )
+ {
+ super();
+
+ m_logger = logger;
+ m_context = context;
+
+ ThreadPool pool = context.getThreadPool( null );
+ if( null != pool )
+ {
+ setThreadPool( pool );
+ }
+
+ RequestLog log = context.getRequestLog( null );
+ if( null != log )
+ {
+ setRequestLog( log );
+ }
+
+ Handler handler = context.getNotFoundHandler( null );
+ if( null != handler )
+ {
+ setNotFoundHandler( handler );
+ }
+
+ boolean policy = context.getShutdownPolicy( false );
+ if( !policy )
+ {
+ setStopAtShutdown( policy );
+ }
+ }
+}




  • r994 - in trunk/main: . planet planet/web planet/web/server planet/web/server/src planet/web/server/src/main planet/web/server/src/main/net planet/web/server/src/main/net/dpml planet/web/server/src/main/net/dpml/web planet/web/server/src/main/net/dpml/web/server, mcconnell at BerliOS, 01/30/2006

Archive powered by MHonArc 2.6.24.

Top of Page