Skip to Content.
Sympa Menu

notify-dpml - svn commit: r2882 - 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: r2882 - development/main/test/components/http/impl/src/main/net/dpml/http/impl
  • Date: Fri, 17 Jun 2005 17:16:42 -0400

Author: mcconnell AT dpml.net
Date: Fri Jun 17 17:16:42 2005
New Revision: 2882

Modified:

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

Modified:
development/main/test/components/http/impl/src/main/net/dpml/http/impl/JsseListener.java
==============================================================================
---
development/main/test/components/http/impl/src/main/net/dpml/http/impl/JsseListener.java
(original)
+++
development/main/test/components/http/impl/src/main/net/dpml/http/impl/JsseListener.java
Fri Jun 17 17:16:42 2005
@@ -18,15 +18,8 @@
import java.io.IOException;

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.http.HttpService;
-import net.dpml.service.ServiceException;
-import net.dpml.service.ServiceManager;
-import net.dpml.service.Serviceable;
import org.mortbay.http.HttpListener;

/** Wrapper for the Jetty SocketListener.
@@ -35,8 +28,32 @@
* @metro.service type="org.mortbay.http.HttpListener"
*/
public class JsseListener extends org.mortbay.http.SunJsseListener
- implements Parameterizable, HttpListener, Startable
+ implements HttpListener, Startable
{
+ public interface Context
+ {
+ HttpService getServer();
+ int getBufferReserve( int value );
+ int getBufferSize( int value );
+ int getConfidentialPort( int value );
+ String getConfidentialScheme( String value );
+ String getDefaultScheme( String value );
+ int getIntegralPort( int value );
+ String getIntegralScheme( String value );
+ String getHostName( String value );
+ int getPort( int value );
+ int getLowResourcePersistMs( int value );
+ boolean getIdentifyListenerPolicy( boolean value );
+ boolean getNeedClientAuthentication( boolean value );
+ boolean getUseDefaultTrustStore( boolean value );
+ String getKeyPassword( String value );
+ String getKeyStore( String value );
+ String getKeystoreProviderClass( String value );
+ String getKeystoreProviderName( String value );
+ String setKeystoreType( String value );
+ String getPassword( String value );
+ }
+
private HttpService m_HttpServer;
private Logger m_logger;

@@ -46,117 +63,151 @@
* @metro.dependency type="net.dpml.http.HttpService"
* key="server"
*/
- public JsseListener( Logger logger, ServiceManager man )
- throws ServiceException
+ public JsseListener( Logger logger, Context context )
{
m_logger = logger;
- m_HttpServer = (HttpService) man.lookup( "server" );
+ m_HttpServer = (HttpService) context.getServer();
m_HttpServer.addListener( this );
- }

- public void parameterize( Parameters params )
- throws ParameterException
- {
- int reserve = params.getParameterAsInteger( "buffer-reserve", -1 );
+ int reserve = context.getBufferReserve( -1 );
if( reserve > 0 )
+ {
setBufferReserve( reserve );
+ }

- int size = params.getParameterAsInteger( "buffer-size", -1 );
+ int reserve = context.getBufferSize( -1 );
if( size > 0 )
+ {
setBufferSize( size );
+ }

- int confPort = params.getParameterAsInteger( "confidential-port", -1
);
+ int confPort = context.getConfidentialPort( -1 );
if( confPort > 0 )
+ {
setConfidentialPort( confPort );
+ }

- String confScheme = params.getParameter( "confidential-scheme", null
);
+ String confScheme = context.getConfidentialScheme( null );
if( confScheme != null )
+ {
setConfidentialScheme( confScheme );
+ }

- String defScheme = params.getParameter( "default-scheme", null );
- if( defScheme != null )
- setDefaultScheme( defScheme );
+ String defaultScheme = context.getDefaultScheme( null );
+ if( defaultScheme != null )
+ {
+ setDefaultScheme( defaultScheme );
+ }

- int integralPort = params.getParameterAsInteger( "integral-port", -1
);
+ int integralPort = context.getIntegralPort( -1 );
if( integralPort > 0 )
+ {
setIntegralPort( integralPort );
+ }

- String integralScheme = params.getParameter( "integral-scheme", null
);
+ String integralScheme = context.getIntegralScheme( null );
if( integralScheme != null )
+ {
setIntegralScheme( integralScheme );
+ }

- String host = params.getParameter( "hostname", null );
+ String host = context.getHostName( null );
try
{
if( host != null )
+ {
setHost( host );
- } catch( java.net.UnknownHostException e )
+ }
+ }
+ catch( java.net.UnknownHostException e )
{
throw new ParameterException( "Unknown hostname: " + host );
}

- int port = params.getParameterAsInteger( "port", 8443 );
+ int port = context.getPort( 8080 );
setPort( port );

- int lowResMs = params.getParameterAsInteger(
"low-resource-persist-ms", -1 );
+ int lowResMs = context.getLowResourcePersistMs( -1 );
if( lowResMs > 0 )
+ {
setLowResourcePersistTimeMs( lowResMs );
+ }

- boolean identify = params.getParameterAsBoolean(
"identify-listener", false );
+ boolean identify = context.getIdentifyListenerPolicy( false );
setIdentifyListener( identify );

- boolean needClientAuth = params.getParameterAsBoolean(
"need-client-authentication", false );
+ boolean needClientAuth = context.getNeedClientAuthentication( false
);
setNeedClientAuth( needClientAuth );

- boolean useDefTrustStore = params.getParameterAsBoolean(
"use-default-trust-store", false );
+ boolean useDefTrustStore = context.getUseDefaultTrustStore( false );
setUseDefaultTrustStore( useDefTrustStore );

- String keyPass = params.getParameter( "key-password", null );
+ String keyPass = context.getKeyPassword( null );
if( keyPass != null )
+ {
setKeyPassword( keyPass );
+ }

- String keyStore = params.getParameter( "key-store", null );
+ String keyStore = context.getKeyStore( null );
if( keyStore != null )
- setKeystore( keyStore );
+ {
+ setKeyStore( keyStore );
+ }

- String keyStoreProviderClass = params.getParameter(
"key-store-provider-class", null );
+ String keyStoreProviderClass = context.getKeystoreProviderClass(
null );
if( keyStoreProviderClass != null )
+ {
setKeystoreProviderClass( keyStoreProviderClass );
+ }

- String keyStoreProviderName = params.getParameter(
"key-store-provider-name", null );
+ String keyStoreProviderName = context.getKeystoreProviderName( null
);
if( keyStoreProviderName != null )
+ {
setKeystoreProviderName( keyStoreProviderName );
+ }

- String keyStoreType = params.getParameter( "key-store-type", null );
+ String keyStoreType = context.setKeystoreType( null );
if( keyStoreType != null )
+ {
setKeystoreType( keyStoreType );
+ }

- String password = params.getParameter( "password", "" );
+ String password = context.getPassword( "" );
setPassword( password );
}

- public void start()
- throws Exception
+ public void start() throws Exception
{
if( m_logger.isDebugEnabled() )
+ {
m_logger.debug( "Starting SSL socket: " + this );
+ }
try
{
if( ! isStarted() )
+ {
super.start();
- } catch( IOException e )
+ }
+ }
+ catch( IOException e )
{
- m_logger.warn( "Unable to start SSL. Possibly missing password
to KeyStore or an invalid KeyStore." );
+ final String error =
+ "Unable to start SSL. "
+ + "Possibly missing password to KeyStore or an invalid
KeyStore." ;
+ m_logger.warn( error );
}
}

- public void stop()
- throws InterruptedException
+ public void stop() throws InterruptedException
{
if( m_logger.isDebugEnabled() )
+ {
m_logger.debug( "Stopping SSL socket: " + this );
+ }
if( isStarted() )
+ {
super.stop();
+ }
m_HttpServer.removeListener( this );
}
}



  • svn commit: r2882 - 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