Skip to Content.
Sympa Menu

notify-dpml - svn commit: r2887 - in development/main/test/components/http/impl: . src/main/net/dpml/http/impl

notify-dpml AT lists.ibiblio.org

Subject: DPML Notify

List archive

Chronological Thread  
  • From: mcconnell AT dpml.net
  • To: notify-dpml AT lists.ibiblio.org
  • Subject: svn commit: r2887 - in development/main/test/components/http/impl: . src/main/net/dpml/http/impl
  • Date: Fri, 17 Jun 2005 19:25:11 -0400

Author: mcconnell AT dpml.net
Date: Fri Jun 17 19:25:11 2005
New Revision: 2887

Modified:
development/main/test/components/http/impl/build.xml

development/main/test/components/http/impl/src/main/net/dpml/http/impl/SystemMimeTypes.java

development/main/test/components/http/impl/src/main/net/dpml/http/impl/WebApplicationContext.java
Log:
updating to FT

Modified: development/main/test/components/http/impl/build.xml
==============================================================================
--- development/main/test/components/http/impl/build.xml (original)
+++ development/main/test/components/http/impl/build.xml Fri Jun 17
19:25:11 2005
@@ -37,7 +37,7 @@
<type class="net.dpml.http.impl.HttpContextImpl" threadsafe="true"/>
<type class="net.dpml.http.impl.HttpServerImpl" threadsafe="true"/>
<type class="net.dpml.http.impl.IPAccessHandler" threadsafe="true"/>
- <type class="net.dpml.http.impl.JassUserRealm" threadsafe="true"/>
+ <type class="net.dpml.http.impl.JaasUserRealm" threadsafe="true"/>
<type class="net.dpml.http.impl.JsseListener" threadsafe="true"/>
<!--<type class="net.dpml.http.impl.ModelHandler"
threadsafe="true"/>-->
<type class="net.dpml.http.impl.MsieSslHandler" threadsafe="true"/>

Modified:
development/main/test/components/http/impl/src/main/net/dpml/http/impl/SystemMimeTypes.java
==============================================================================
---
development/main/test/components/http/impl/src/main/net/dpml/http/impl/SystemMimeTypes.java
(original)
+++
development/main/test/components/http/impl/src/main/net/dpml/http/impl/SystemMimeTypes.java
Fri Jun 17 19:25:11 2005
@@ -15,6 +15,7 @@
*/
package net.dpml.http.impl;

+import java.io.IOException;
import java.io.BufferedReader;
import java.io.FileInputStream;
import java.io.InputStreamReader;
@@ -36,7 +37,7 @@
private HashMap m_MimeTypeToExtMap;
private HashMap m_ExtToMimeTypeMap;

- public SystemMimeTypes( Context context )
+ public SystemMimeTypes( Context context ) throws IOException
{
m_Filename = context.getFilename( "/etc/mime.types" );


Modified:
development/main/test/components/http/impl/src/main/net/dpml/http/impl/WebApplicationContext.java
==============================================================================
---
development/main/test/components/http/impl/src/main/net/dpml/http/impl/WebApplicationContext.java
(original)
+++
development/main/test/components/http/impl/src/main/net/dpml/http/impl/WebApplicationContext.java
Fri Jun 17 19:25:11 2005
@@ -20,19 +20,12 @@

import net.dpml.activity.Disposable;
import net.dpml.activity.Startable;
-import net.dpml.configuration.Configurable;
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.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.service.Serviceable;
+
import org.mortbay.http.Authenticator;
import org.mortbay.http.HttpContext;
import org.mortbay.http.HttpHandler;
@@ -46,86 +39,60 @@
*/
public class WebApplicationContext
extends org.mortbay.jetty.servlet.WebApplicationContext
- implements Startable, Serviceable, Disposable, Configurable,
- HttpContextService, net.dpml.http.ServletHandler
+ implements Startable, Disposable, HttpContextService,
net.dpml.http.ServletHandler
{
+ public interface Context
+ {
+ HttpService getHttpServer();
+ MimeTypes getMimeTypes( MimeTypes value );
+ Authenticator getAuthenticator( Authenticator value );
+ UserRealm getUserRealm( UserRealm value );
+ RequestLog getRequestLog( RequestLog value );
+ File getTempDirectory();
+ }
+
private HttpService m_HttpServer;
private boolean m_Graceful;
private Logger m_logger;

-
- /**
- * @metro.logger name="http.webapp"
- * @metro.entry key="urn:metro:temp"
- * type="java.io.File"
- * @metro.entry key="urn:metro:classloader"
- * type="java.lang.ClassLoader"
- */
- public WebApplicationContext( Logger logger, Context ctx )
- throws ContextException
+ public WebApplicationContext( Logger logger, Context context,
+ net.dpml.configuration.Configuration conf ) throws
ConfigurationException
{
m_logger = logger;
- File tmpDir = (File) ctx.get( "urn:metro:temp" );
+ File tmpDir = context.getTempDirectory();
tmpDir.mkdirs();
setTempDirectory( tmpDir );
-
setClassLoaderJava2Compliant( true );
- ClassLoader cl = (ClassLoader) ctx.get( "urn:metro:classloader" );
+ ClassLoader cl = WebApplicationContext.class.getClassLoader();
setParentClassLoader( cl );
- }
-
-
- public HttpContext getHttpContext()
- {
- return this;
- }

- /**
- * @metro.dependency type="net.dpml.http.HttpService"
- * key="server"
- * @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" optional="true"
- */
- public void service( ServiceManager man )
- throws ServiceException
- {
- m_HttpServer = (HttpService) man.lookup( "server" );
+ m_HttpServer = context.getHttpServer();

- if( man.hasService( "authenticator" ) )
+ Authenticator authenticator = context.getAuthenticator( null );
+ if( authenticator != null )
{
- Authenticator authenticator = (Authenticator) man.lookup(
"authenticator" );
setAuthenticator( authenticator );
}

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

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

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

- public void configure( net.dpml.configuration.Configuration conf )
- throws ConfigurationException
- {
boolean ignore = conf.getChild( "ignore-jetty-web"
).getValueAsBoolean( false );
setIgnoreWebJetty( ignore );

@@ -180,6 +147,11 @@
setMaxCacheSize( maxCacheSize );
}

+ public HttpContext getHttpContext()
+ {
+ return this;
+ }
+
private void configureAttributes( net.dpml.configuration.Configuration
conf )
throws ConfigurationException
{



  • svn commit: r2887 - in development/main/test/components/http/impl: . src/main/net/dpml/http/impl, mcconnell, 06/17/2005

Archive powered by MHonArc 2.6.24.

Top of Page