Skip to Content.
Sympa Menu

notify-dpml - r1392 - in trunk/main: depot/tools/builder/src/main/net/dpml/tools/tasks metro/component/src/main/net/dpml/component metro/model/src/main/net/dpml/metro/data metro/model/src/main/net/dpml/metro/info metro/model/src/test/net/dpml/metro/data/test metro/runtime/src/main/net/dpml/metro/runtime planet/http planet/http/impl/etc/prefs/keystores planet/http/impl/src planet/http/impl/src/main/net/dpml/http planet/http/impl/src/test planet/http/impl/src/test/net planet/http/impl/src/test/net/dpml planet/http/impl/src/test/net/dpml/http planet/http/server transit/core/src/main/net/dpml/lang

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: r1392 - in trunk/main: depot/tools/builder/src/main/net/dpml/tools/tasks metro/component/src/main/net/dpml/component metro/model/src/main/net/dpml/metro/data metro/model/src/main/net/dpml/metro/info metro/model/src/test/net/dpml/metro/data/test metro/runtime/src/main/net/dpml/metro/runtime planet/http planet/http/impl/etc/prefs/keystores planet/http/impl/src planet/http/impl/src/main/net/dpml/http planet/http/impl/src/test planet/http/impl/src/test/net planet/http/impl/src/test/net/dpml planet/http/impl/src/test/net/dpml/http planet/http/server transit/core/src/main/net/dpml/lang
  • Date: Sat, 22 Apr 2006 22:04:07 +0200

Author: mcconnell
Date: 2006-04-22 22:03:59 +0200 (Sat, 22 Apr 2006)
New Revision: 1392

Added:
trunk/main/planet/http/impl/etc/prefs/keystores/demo.cer
trunk/main/planet/http/impl/etc/prefs/keystores/trust.keystore
trunk/main/planet/http/impl/src/test/
trunk/main/planet/http/impl/src/test/net/
trunk/main/planet/http/impl/src/test/net/dpml/
trunk/main/planet/http/impl/src/test/net/dpml/http/
trunk/main/planet/http/impl/src/test/net/dpml/http/ErrorStreamReader.java
trunk/main/planet/http/impl/src/test/net/dpml/http/OutputStreamReader.java
trunk/main/planet/http/impl/src/test/net/dpml/http/SSLTest.java
trunk/main/planet/http/impl/src/test/net/dpml/http/StreamReader.java
Modified:
trunk/main/depot/tools/builder/src/main/net/dpml/tools/tasks/PartTask.java
trunk/main/metro/component/src/main/net/dpml/component/Composition.java
trunk/main/metro/model/src/main/net/dpml/metro/data/Composite.java
trunk/main/metro/model/src/main/net/dpml/metro/info/PartReference.java

trunk/main/metro/model/src/test/net/dpml/metro/data/test/ComponentDirectiveTestCase.java

trunk/main/metro/runtime/src/main/net/dpml/metro/runtime/DefaultComposition.java
trunk/main/planet/http/impl/src/main/net/dpml/http/SslSocketConnector.java
trunk/main/planet/http/module.xml
trunk/main/planet/http/server/project.xml
trunk/main/transit/core/src/main/net/dpml/lang/Part.java
trunk/main/transit/core/src/main/net/dpml/lang/PartDecoder.java
Log:
1. add support for part loading without cache check
2. resolve issue in composition equality evaluation
3. some transient content in the http package related to trust management

Modified:
trunk/main/depot/tools/builder/src/main/net/dpml/tools/tasks/PartTask.java
===================================================================
---
trunk/main/depot/tools/builder/src/main/net/dpml/tools/tasks/PartTask.java
2006-04-20 19:59:01 UTC (rev 1391)
+++
trunk/main/depot/tools/builder/src/main/net/dpml/tools/tasks/PartTask.java
2006-04-22 20:03:59 UTC (rev 1392)
@@ -121,7 +121,7 @@
{
try
{
- Part existing = Part.load( new URI( file.toURL().toString()
) );
+ Part existing = Part.load( file.toURI(), false );
if( part.equals( existing ) )
{
return;

Modified:
trunk/main/metro/component/src/main/net/dpml/component/Composition.java
===================================================================
--- trunk/main/metro/component/src/main/net/dpml/component/Composition.java
2006-04-20 19:59:01 UTC (rev 1391)
+++ trunk/main/metro/component/src/main/net/dpml/component/Composition.java
2006-04-22 20:03:59 UTC (rev 1392)
@@ -35,8 +35,9 @@
*/
public abstract class Composition extends Part
{
- private Directive m_directive;
- private Controller m_controller;
+ private final Directive m_directive;
+ private final Controller m_controller;
+
private Model m_model;

/**
@@ -53,6 +54,15 @@
{
super( logger, info, classpath );

+ if( null == directive )
+ {
+ throw new NullPointerException( "directive" );
+ }
+ if( null == controller )
+ {
+ throw new NullPointerException( "controller" );
+ }
+
m_directive = directive;
m_controller = controller;
}
@@ -155,4 +165,39 @@
Component component = newComponent();
return component.getProvider().getValue( true );
}
+
+ /**
+ * Return true if this object is equal to the supplied object.
+ * @return the equality status
+ */
+ public boolean equals( Object other )
+ {
+ if( super.equals( other ) && ( other instanceof Composition ) )
+ {
+ Composition composite = (Composition) other;
+ if( !m_directive.equals( composite.m_directive )
+ {
+ return false;
+ }
+ else
+ {
+ return m_controller.equals( composite.m_controller )
+ }
+ else
+ {
+ return false;
+ }
+ }
+
+ /**
+ * Return the hashcode for the instance.
+ * @return the instance hashcode
+ */
+ public int hashCode()
+ {
+ int hash = super.hashCode();
+ hash ^= m_directive.hashCode();
+ hash ^= m_controller.hashCode();
+ return hash;
+ }
}

Modified: trunk/main/metro/model/src/main/net/dpml/metro/data/Composite.java
===================================================================
--- trunk/main/metro/model/src/main/net/dpml/metro/data/Composite.java
2006-04-20 19:59:01 UTC (rev 1391)
+++ trunk/main/metro/model/src/main/net/dpml/metro/data/Composite.java
2006-04-22 20:03:59 UTC (rev 1392)
@@ -62,5 +62,33 @@
{
return m_directive;
}
+
+ /**
+ * Return true if this object is equal to the supplied object.
+ * @return the equality status
+ */
+ public boolean equals( Object other )
+ {
+ if( super.equals( other ) && ( other instanceof Composite ) )
+ {
+ Composite composite = (Composite) other;
+ return m_directive.equals( composite.m_directive );
+ }
+ else
+ {
+ return false;
+ }
+ }
+
+ /**
+ * Return the hashcode for the instance.
+ * @return the instance hashcode
+ */
+ public int hashCode()
+ {
+ int hash = super.hashCode();
+ hash ^= m_directive.hashCode();
+ return hash;
+ }
}


Modified:
trunk/main/metro/model/src/main/net/dpml/metro/info/PartReference.java
===================================================================
--- trunk/main/metro/model/src/main/net/dpml/metro/info/PartReference.java
2006-04-20 19:59:01 UTC (rev 1391)
+++ trunk/main/metro/model/src/main/net/dpml/metro/info/PartReference.java
2006-04-22 20:03:59 UTC (rev 1392)
@@ -110,7 +110,7 @@
}
else
{
- return m_directive.equals( reference.getDirective() );
+ return m_directive.equals( reference.m_directive );
}
}
}

Modified:
trunk/main/metro/model/src/test/net/dpml/metro/data/test/ComponentDirectiveTestCase.java
===================================================================
---
trunk/main/metro/model/src/test/net/dpml/metro/data/test/ComponentDirectiveTestCase.java
2006-04-20 19:59:01 UTC (rev 1391)
+++
trunk/main/metro/model/src/test/net/dpml/metro/data/test/ComponentDirectiveTestCase.java
2006-04-22 20:03:59 UTC (rev 1392)
@@ -22,6 +22,7 @@
import net.dpml.metro.data.CategoriesDirective;
import net.dpml.metro.data.CategoryDirective;
import net.dpml.metro.data.ContextDirective;
+import net.dpml.metro.data.ValueDirective;
import net.dpml.metro.info.CollectionPolicy;
import net.dpml.metro.info.LifestylePolicy;
import net.dpml.metro.info.PartReference;
@@ -58,7 +59,14 @@
m_lifestyle = LifestylePolicy.SINGLETON;
m_classname = ComponentDirectiveTestCase.class.getName();
m_categories = new CategoriesDirective( new CategoryDirective[0] );
- m_context = new ContextDirective( new PartReference[0] );
+ m_context =
+ new ContextDirective(
+ new PartReference[]
+ {
+ new PartReference( "abc", new ValueDirective( "abc" ) ),
+ new PartReference( "def", new ValueDirective( "def" ) )
+ }
+ );
m_parts = new PartReference[0];
m_directive =
new ComponentDirective(
@@ -216,4 +224,32 @@
{
assertEquals( "context", m_context,
m_directive.getContextDirective() );
}
+
+ /**
+ * Test equality.
+ */
+ public void testEquality()
+ {
+ ContextDirective context =
+ new ContextDirective(
+ new PartReference[]
+ {
+ new PartReference( "abc", new ValueDirective( "abc" ) ),
+ new PartReference( "def", new ValueDirective( "xyz" ) )
+ }
+ );
+
+ ComponentDirective a = new ComponentDirective(
+ m_name, m_activation, m_collection, m_lifestyle, m_classname,
+ m_categories, m_context, m_parts );
+
+ ComponentDirective b = new ComponentDirective(
+ m_name, m_activation, m_collection, m_lifestyle, m_classname,
+ m_categories, context, m_parts );
+
+ if( a.equals( b ) )
+ {
+ fail( "non-equal directives return true for equals" );
+ }
+ }
}

Modified:
trunk/main/metro/runtime/src/main/net/dpml/metro/runtime/DefaultComposition.java
===================================================================
---
trunk/main/metro/runtime/src/main/net/dpml/metro/runtime/DefaultComposition.java
2006-04-20 19:59:01 UTC (rev 1391)
+++
trunk/main/metro/runtime/src/main/net/dpml/metro/runtime/DefaultComposition.java
2006-04-22 20:03:59 UTC (rev 1392)
@@ -81,4 +81,32 @@
ComponentEncoder encoder = new ComponentEncoder();
encoder.writeComponent( writer, m_directive, pad );
}
+
+ /**
+ * Return true if this object is equal to the supplied object.
+ * @return the equality status
+ */
+ public boolean equals( Object other )
+ {
+ if( super.equals( other ) && ( other instanceof DefaultComposition )
)
+ {
+ DefaultComposition composite = (DefaultComposition) other;
+ return m_directive.equals( composite.m_directive );
+ }
+ else
+ {
+ return false;
+ }
+ }
+
+ /**
+ * Return the hashcode for the instance.
+ * @return the instance hashcode
+ */
+ public int hashCode()
+ {
+ int hash = super.hashCode();
+ hash ^= m_directive.hashCode();
+ return hash;
+ }
}

Added: trunk/main/planet/http/impl/etc/prefs/keystores/demo.cer
===================================================================
--- trunk/main/planet/http/impl/etc/prefs/keystores/demo.cer 2006-04-20
19:59:01 UTC (rev 1391)
+++ trunk/main/planet/http/impl/etc/prefs/keystores/demo.cer 2006-04-22
20:03:59 UTC (rev 1392)
@@ -0,0 +1,13 @@
+-----BEGIN CERTIFICATE-----
+MIICRDCCAa0CBERHG3UwDQYJKoZIhvcNAQEEBQAwaTEQMA4GA1UEBhMHVW5rbm93bjEQMA4GA1UE
+CBMHVW5rbm93bjEQMA4GA1UEBxMHVW5rbm93bjEQMA4GA1UEChMHVW5rbm93bjEQMA4GA1UECxMH
+VW5rbm93bjENMAsGA1UEAxMEZGVtbzAeFw0wNjA0MjAwNTI2MTNaFw0wNjA3MTkwNTI2MTNaMGkx
+EDAOBgNVBAYTB1Vua25vd24xEDAOBgNVBAgTB1Vua25vd24xEDAOBgNVBAcTB1Vua25vd24xEDAO
+BgNVBAoTB1Vua25vd24xEDAOBgNVBAsTB1Vua25vd24xDTALBgNVBAMTBGRlbW8wgZ8wDQYJKoZI
+hvcNAQEBBQADgY0AMIGJAoGBALf3O1LFJYPgQF4JIukJfjjAP516JLnQQFvCjpUnio/t31XghPhv
+1qr6IoGf7H8ofTUWgwi3+WkZ3y2rFzv2XG/vCN1TQxc8rf9KHXmRq+vtxZ03GiHszPurerJVX8eJ
+DMZxxfDKJN7lOze3K9DB3lOA2tO3FwSdpKu5CT/1Ca2bAgMBAAEwDQYJKoZIhvcNAQEEBQADgYEA
+Z0C4O0Y+GpafzKeCdkF1QkE2BpyD7Nv91M2NMfYvzLwHwCu1rGw9B91Iuap8DJP9SQaA8Hg8wKz7
+fv5G91BZV3Aw/j09iHB7p1WCJw2yfwVrUI/to/nv9siKVIMx505e6n8Fysc7gsNTt+ZUVZg2bWWi
+YTDVg5FnXPEjcDiPFCo=
+-----END CERTIFICATE-----

Added: trunk/main/planet/http/impl/etc/prefs/keystores/trust.keystore
===================================================================
(Binary files differ)


Property changes on:
trunk/main/planet/http/impl/etc/prefs/keystores/trust.keystore
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream

Modified:
trunk/main/planet/http/impl/src/main/net/dpml/http/SslSocketConnector.java
===================================================================
---
trunk/main/planet/http/impl/src/main/net/dpml/http/SslSocketConnector.java
2006-04-20 19:59:01 UTC (rev 1391)
+++
trunk/main/planet/http/impl/src/main/net/dpml/http/SslSocketConnector.java
2006-04-22 20:03:59 UTC (rev 1392)
@@ -15,8 +15,31 @@
*/
package net.dpml.http;

+import java.io.File;
+import java.io.IOException;
+import java.io.InputStream;
import java.net.URI;
+import java.net.URL;
+import java.security.SecureRandom;
+import java.security.KeyStore;
+import java.security.NoSuchAlgorithmException;
+import java.security.KeyStoreException;
+import java.security.cert.CertificateException;
+import java.security.UnrecoverableKeyException;
+import java.security.NoSuchProviderException;

+import javax.net.ssl.KeyManager;
+import javax.net.ssl.KeyManagerFactory;
+import javax.net.ssl.TrustManager;
+import javax.net.ssl.TrustManagerFactory;
+import javax.net.ssl.SSLContext;
+import javax.net.ssl.SSLServerSocketFactory;
+
+import net.dpml.transit.Artifact;
+
+import org.mortbay.resource.Resource;
+import org.mortbay.jetty.security.Password;
+
/**
* SSL socket connector.
* @author <a href="@PUBLISHER-URL@">@PUBLISHER-NAME@</a>
@@ -34,7 +57,15 @@
private static final int CONFIDENTIAL_PORT = 0;
private static final int INTEGRAL_PORT = 0;
private static final boolean ASSUME_SHORT_DISPATCH = false;
+ private static final String KEYSTORE_TYPE = "JKS";
+ private static final String PROTOCOL = "TLS";
+ private static final String ALGORITHM = "SunX509";

+ private transient Context m_context;
+ private transient Password m_certificatePassword;
+ private transient Password m_keystorePassword;
+ private transient Password m_trustPassword;
+
/**
* SSL connector context definition.
*/
@@ -47,18 +78,18 @@
String[] getCipherSuites( String[] suites );

/**
- * Return the certificate password.
+ * Return the keystore password.
* @param password implementation defined default value
* @return the supplied value unless overriden in the deployment
configuration
*/
- String getPassword( String password );
+ String getKeyStorePassword( String password );

/**
- * Return the keystore password.
+ * Return the certificate password.
* @param password implementation defined default value
* @return the supplied value unless overriden in the deployment
configuration
*/
- String getKeyPassword( String password );
+ String getCertificatePassword( String password );

/**
* Return the keystore algorithm.
@@ -68,7 +99,14 @@
String getAlgorithm( String algorithm );

/**
- * Return the keystore protocol.
+ * Return the keystore type.
+ * @param type implementation defined default value
+ * @return the supplied value unless overriden in the deployment
configuration
+ */
+ String getKeyStoreType( String type );
+
+ /**
+ * Return the SSL protocol.
* @param protocol implementation defined default value
* @return the supplied value unless overriden in the deployment
configuration
*/
@@ -79,16 +117,9 @@
* @param keystore implementation defined default value
* @return the supplied value unless overriden in the deployment
configuration
*/
- URI getKeystore( URI keystore );
+ URI getKeyStore( URI keystore );

/**
- * Return the keystore type.
- * @param type implementation defined default value
- * @return the supplied value unless overriden in the deployment
configuration
- */
- String getKeystoreType( String type );
-
- /**
* Return the 'want-client-authentication' policy.
* @param flag implementation defined default value
* @return the supplied value unless overriden in the deployment
configuration
@@ -101,8 +132,45 @@
* @return the supplied value unless overriden in the deployment
configuration
*/
boolean getNeedClientAuth( boolean flag );
+
+ /**
+ * Return the SSL context provider.
+ * @param provider implementation defined default value
+ * @return the supplied value unless overriden in the deployment
configuration
+ */
+ String getProvider( String provider );
+
+ // extras
+
+ /**
+ * Return the keystore algorithm.
+ * @param algorithm implementation defined default value
+ * @return the supplied value unless overriden in the deployment
configuration
+ */
+ String getTrustAlgorithm( String algorithm );
+
+ /**
+ * Return the keystore location uri.
+ * @param uri implementation defined default value
+ * @return the supplied value unless overriden in the deployment
configuration
+ */
+ URI getTrustStore( URI uri );
+
+ /**
+ * Return the keystore type.
+ * @param type implementation defined default value
+ * @return the supplied value unless overriden in the deployment
configuration
+ */
+ String getTrustStoreType( String type );
+
+ /**
+ * Return the trust store password.
+ * @param password implementation defined default value
+ * @return the supplied value unless overriden in the deployment
configuration
+ */
+ String getTrustStorePassword( String password );
}
-
+
/**
* Creation of a new ssl connector.
* @param context the deployment context
@@ -112,6 +180,8 @@
{
super();

+ m_context = context;
+
String host = context.getHost( null );
if( null != host )
{
@@ -156,43 +226,43 @@

// SslSocketConnector$Context

- String password = context.getPassword( null );
- if( null != password )
+ String certificatePassword = context.getCertificatePassword( null );
+ if( null != certificatePassword )
{
- setPassword( password );
+ m_certificatePassword =
+ Password.getPassword( KEYPASSWORD_PROPERTY,
certificatePassword, null );
+ setKeyPassword( certificatePassword );
}

- String keyPassword = context.getKeyPassword( null );
- if( null != keyPassword )
+ String keystorePassword = context.getKeyStorePassword( null );
+ if( null != keystorePassword )
{
- setKeyPassword( keyPassword );
+ m_keystorePassword = Password.getPassword( PASSWORD_PROPERTY,
keystorePassword, null );
+ setPassword( keystorePassword );
}

- String algorithm = context.getAlgorithm( null );
- if( null != algorithm )
- {
- setAlgorithm( algorithm );
- }
+ String algorithm = context.getAlgorithm( ALGORITHM );
+ setAlgorithm( algorithm );

- String protocol = context.getProtocol( null );
- if( null != protocol )
- {
- setProtocol( protocol );
- }
+ String protocol = context.getProtocol( PROTOCOL );
+ setProtocol( protocol );

- URI keystore = context.getKeystore( null );
+ URI keystore = context.getKeyStore( null );
if( null != keystore )
{
String keystorePath = keystore.toASCIIString();
setKeystore( keystorePath );
}

- String keystoreType = context.getKeystoreType( null );
- if( null != keystoreType )
+ String provider = context.getProvider( null );
+ if( null != provider )
{
- setKeystoreType( keystoreType );
+ setProvider( provider );
}

+ String keystoreType = context.getKeyStoreType( KEYSTORE_TYPE );
+ setKeystoreType( keystoreType );
+
boolean wantClientAuth = context.getWantClientAuth( false );
setWantClientAuth( wantClientAuth );

@@ -205,4 +275,100 @@
setCipherSuites( suites );
}
}
+
+ protected SSLServerSocketFactory createFactory()
+ throws Exception
+ {
+ final SSLContext context = getSSLContext();
+ KeyManager[] keyManagers = getKeyManagers();
+ TrustManager[] trustManagers = getTrustManagers();
+ System.out.println( "# TRUST: " + trustManagers.length );
+ SecureRandom random = new SecureRandom();
+ context.init( keyManagers, trustManagers, random );
+ //context.init( keyManagers, null, random );
+ return context.getServerSocketFactory();
+ }
+
+ private KeyManager[] getKeyManagers() throws Exception
+ {
+ final String algorithm = getAlgorithm();
+ final KeyManagerFactory factory = KeyManagerFactory.getInstance(
algorithm );
+ final KeyStore store = loadKeyStore();
+ final char[] password = toCharArray( m_certificatePassword );
+ factory.init( store, password );
+ return factory.getKeyManagers();
+ }
+
+ private KeyStore loadKeyStore() throws Exception
+ {
+ final String type = getKeystoreType();
+ final KeyStore keyStore = KeyStore.getInstance( type );
+ final char[] password = toCharArray( m_keystorePassword );
+ final String keyStorePath = getKeystore();
+ final InputStream input = Resource.newResource( keyStorePath
).getInputStream();
+ keyStore.load( input, password );
+ return keyStore;
+ }
+
+ private KeyStore loadTrustStore() throws Exception
+ {
+ final String type = m_context.getTrustStoreType( KEYSTORE_TYPE );
+ final KeyStore store = KeyStore.getInstance( type );
+ final char[] password = toCharArray( m_trustPassword );
+ URI uri = m_context.getTrustStore( null );
+ if( null != uri )
+ {
+ URL url = Artifact.toURL( uri );
+ final InputStream input = Resource.newResource( url
).getInputStream();
+ store.load( input, password );
+ return store;
+ }
+ else
+ {
+ return null;
+ }
+ }
+
+ private TrustManager[] getTrustManagers() throws Exception
+ {
+ final String algorithm = m_context.getTrustAlgorithm( ALGORITHM );
+ final TrustManagerFactory factory = TrustManagerFactory.getInstance(
algorithm );
+ final KeyStore store = loadTrustStore();
+ if( store != null )
+ {
+ factory.init( store );
+ return factory.getTrustManagers();
+ }
+ else
+ {
+ return null;
+ }
+ }
+
+ private char[] toCharArray( Password value )
+ {
+ if( null == value )
+ {
+ return null;
+ }
+ else
+ {
+ return value.toString().toCharArray();
+ }
+ }
+
+ private SSLContext getSSLContext() throws NoSuchAlgorithmException,
NoSuchProviderException
+ {
+ final String protocol = getProtocol();
+ final String provider = getProvider();
+ if( null == provider )
+ {
+ return SSLContext.getInstance( protocol );
+ }
+ else
+ {
+ return SSLContext.getInstance( protocol, provider );
+ }
+ }
}
+

Added:
trunk/main/planet/http/impl/src/test/net/dpml/http/ErrorStreamReader.java
===================================================================
--- trunk/main/planet/http/impl/src/test/net/dpml/http/ErrorStreamReader.java
2006-04-20 19:59:01 UTC (rev 1391)
+++ trunk/main/planet/http/impl/src/test/net/dpml/http/ErrorStreamReader.java
2006-04-22 20:03:59 UTC (rev 1392)
@@ -0,0 +1,64 @@
+/*
+ * Copyright 2006 Stephen J. 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.http;
+
+import java.io.IOException;
+import java.io.BufferedReader;
+import java.io.InputStream;
+import java.io.InputStreamReader;
+
+/**
+ * Stream reader utility class.
+ *
+ * @author <a href="@PUBLISHER-URL@">@PUBLISHER-NAME@</a>
+ * @version @PROJECT-VERSION@
+ */
+public class ErrorStreamReader extends StreamReader
+{
+ /**
+ * Creation of a process output reader.
+ * @param logger the assigned logging channel
+ * @param input the subprocess input stream
+ */
+ public ErrorStreamReader( InputStream input )
+ {
+ super( input );
+ }
+
+ /**
+ * Start the stream reader.
+ */
+ public void run()
+ {
+ try
+ {
+ InputStreamReader isr = new InputStreamReader( getInputStream()
);
+ BufferedReader reader = new BufferedReader( isr );
+ String line = null;
+ while( ( line = reader.readLine() ) != null )
+ {
+ System.out.println( "# " + line );
+ }
+ }
+ catch( IOException e )
+ {
+ e.printStackTrace();
+ }
+ }
+}

Added:
trunk/main/planet/http/impl/src/test/net/dpml/http/OutputStreamReader.java
===================================================================
---
trunk/main/planet/http/impl/src/test/net/dpml/http/OutputStreamReader.java
2006-04-20 19:59:01 UTC (rev 1391)
+++
trunk/main/planet/http/impl/src/test/net/dpml/http/OutputStreamReader.java
2006-04-22 20:03:59 UTC (rev 1392)
@@ -0,0 +1,64 @@
+/*
+ * Copyright 2006 Stephen J. 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.http;
+
+import java.io.IOException;
+import java.io.BufferedReader;
+import java.io.InputStream;
+import java.io.InputStreamReader;
+
+/**
+ * Stream reader utility class.
+ *
+ * @author <a href="@PUBLISHER-URL@">@PUBLISHER-NAME@</a>
+ * @version @PROJECT-VERSION@
+ */
+public class OutputStreamReader extends StreamReader
+{
+ /**
+ * Creation of a process output reader.
+ * @param logger the assigned logging channel
+ * @param input the subprocess input stream
+ */
+ public OutputStreamReader( InputStream input )
+ {
+ super( input );
+ }
+
+ /**
+ * Start the stream reader.
+ */
+ public void run()
+ {
+ try
+ {
+ InputStreamReader isr = new InputStreamReader( getInputStream()
);
+ BufferedReader reader = new BufferedReader( isr );
+ String line = null;
+ while( ( line = reader.readLine() ) != null )
+ {
+ System.out.println( "$ " + line );
+ }
+ }
+ catch( IOException e )
+ {
+ e.printStackTrace();
+ }
+ }
+}

Added: trunk/main/planet/http/impl/src/test/net/dpml/http/SSLTest.java
===================================================================
--- trunk/main/planet/http/impl/src/test/net/dpml/http/SSLTest.java
2006-04-20 19:59:01 UTC (rev 1391)
+++ trunk/main/planet/http/impl/src/test/net/dpml/http/SSLTest.java
2006-04-22 20:03:59 UTC (rev 1392)
@@ -0,0 +1,582 @@
+/*
+ * Copyright 2006 Stephen J. 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.http;
+
+import java.io.BufferedReader;
+import java.io.IOException;
+import java.io.InputStreamReader;
+import java.io.OutputStream;
+import java.io.PrintWriter;
+import java.io.File;
+import java.net.URI;
+import java.net.Socket;
+import java.util.Arrays;
+import java.util.Random;
+
+import javax.net.ssl.SSLSocket;
+import javax.net.ssl.SSLSocketFactory;
+import javax.servlet.ServletException;
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+
+import org.mortbay.jetty.Connector;
+import org.mortbay.jetty.Handler;
+import org.mortbay.jetty.Server;
+import org.mortbay.jetty.handler.AbstractHandler;
+
+import net.dpml.http.SslSocketConnector;
+
+import junit.framework.TestCase;
+
+/**
+ * SLL Test.
+ */
+public class SSLTest
+ extends TestCase
+{
+
+ //~ Static fields/initializers
---------------------------------------------
+
+ /** The request. */
+ private static final String REQUEST1_HEADER=
+ "POST / HTTP/1.0\n"
+ + "Host: localhost\n"
+ + "Content-Type: text/xml\n"
+ + "Connection: close\n"
+ + "Content-Length: ";
+ private static final String REQUEST1_CONTENT=
+ "<?xml version=\"1.0\" encoding=\"ISO-8859-1\"?>\n"
+ + "<nimbus xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"\n";
+ + " xsi:noNamespaceSchemaLocation=\"nimbus.xsd\"
version=\"1.0\">\n"
+ + "</nimbus>";
+ private static final String REQUEST1=
+
REQUEST1_HEADER+REQUEST1_CONTENT.getBytes().length+"\n\n"+REQUEST1_CONTENT;
+
+ /** The expected response. */
+ private static final String RESPONSE1 = "HTTP/1.1 200 OK\n"
+ + "Connection: close\n"
+ + "Server: Jetty(6.0.x)\n"
+ + "\n"
+ + "Hello world\n";
+
+ // Useful constants
+ private static final long PAUSE = 10L;
+ private static final String HOST = "localhost";
+ private static final int PORT = 0;
+
+ private File m_keystore;
+ private File m_truststore;
+ private int m_port;
+
+ public void setUp() throws Exception
+ {
+ // create server keystore
+
+ File test = new File( System.getProperty( "project.test.dir" ) );
+ String name = "test.keystore";
+ m_keystore = setupKeystore( test, name );
+
+ // export trust certificate for use by the client
+
+ String cname = "test.cer";
+ File cert = setupTrustCertificate( test, name, cname );
+
+ // create clients truststore and add trusted cert
+
+ String tname = "trust.keystore";
+ m_truststore = setupTrustStore( test, tname, cname );
+
+ String keystore = m_keystore.toString();
+ String truststore = m_truststore.toString();
+
+ // setup client properties
+
+ System.setProperty( "javax.net.ssl.trustStore", truststore );
+ System.setProperty( "javax.net.ssl.trustStorePassword", "password" );
+ System.setProperty( "javax.net.ssl.keyStore", keystore );
+ System.setProperty( "javax.net.ssl.keyStorePassword", "password" );
+ }
+
+ protected void tearDown() throws Exception
+ {
+ super.tearDown();
+ Thread.sleep( 1000 );
+ }
+
+ //~ Methods
----------------------------------------------------------------
+
+ /**
+ * Test request/response under SSL connector.
+ * @throws Exception
+ * @throws InterruptedException
+ */
+ public void testSSL() throws Exception, InterruptedException
+ {
+ Server server = startServer( new HelloWorldHandler() );
+
+ SSLSocketFactory factory = (SSLSocketFactory)
SSLSocketFactory.getDefault();
+ SSLSocket client = (SSLSocket) factory.createSocket( HOST, m_port );
+ client.startHandshake();
+
+ OutputStream os = client.getOutputStream();
+ os.write( REQUEST1.getBytes() );
+ os.flush();
+ String response = readResponse( client );
+ client.close();
+ server.stop();
+ assertEquals( "response", RESPONSE1, response );
+ }
+
+ private Server startServer( Handler handler ) throws Exception
+ {
+ Server server = new Server();
+ net.dpml.http.SslSocketConnector.Context context = new
LocalContext();
+ SslSocketConnector connector = new SslSocketConnector( context );
+ server.setConnectors(new Connector[] {connector});
+ server.setHandler(handler);
+ server.start();
+ m_port = connector.getLocalPort();
+ return server;
+ }
+
+ private static class HelloWorldHandler
+ extends AbstractHandler
+ {
+ public boolean handle(String target, HttpServletRequest request,
+ HttpServletResponse response, int dispatch)
+ throws IOException, ServletException
+ {
+ response.getOutputStream().print("Hello world");
+ return true;
+ }
+ }
+
+ private static String readResponse(Socket client) throws IOException
+ {
+ BufferedReader br = null;
+ try
+ {
+ br = new BufferedReader( new InputStreamReader(
client.getInputStream() ) );
+ StringBuffer sb = new StringBuffer();
+ String line;
+ while( ( line = br.readLine() ) != null )
+ {
+ sb.append( line );
+ sb.append( '\n' );
+ }
+ return sb.toString();
+ }
+ finally
+ {
+ if( br != null )
+ {
+ br.close();
+ }
+ }
+ }
+
+ private static File setupKeystore( File test, String name ) throws
Exception
+ {
+ File keystore = new File( test, name );
+ if( !keystore.exists() )
+ {
+ String[] args =
+ new String[]
+ {
+ "keytool",
+ "-genkey",
+ "-alias",
+ "jetty",
+ "-keyalg",
+ "RSA",
+ "-keypass",
+ "password",
+ "-storepass",
+ "password",
+ "-dname",
+ "cn=Test ou=Test o=Test c=AU",
+ "-keystore",
+ name
+ };
+
+ System.out.println( "Creating keystore" );
+ Process process = Runtime.getRuntime().exec( args, new
String[0], test );
+ handleProcess( process );
+ process.waitFor();
+ }
+ else
+ {
+ System.out.println( "Using keystore: " + keystore );
+ }
+ return keystore;
+ }
+
+ private static File setupTrustCertificate( File test, String keystore,
String certNname ) throws Exception
+ {
+ File cert = new File( test, certNname );
+ if( !cert.exists() )
+ {
+ String[] args =
+ new String[]
+ {
+ "keytool",
+ "-export",
+ "-rfc",
+ "-alias",
+ "jetty",
+ "-storepass",
+ "password",
+ "-keystore",
+ keystore,
+ "-file",
+ certNname
+ };
+
+ System.out.println( "Exporting trusted certificate" );
+ Process process = Runtime.getRuntime().exec( args, new
String[0], test );
+ handleProcess( process );
+ process.waitFor();
+ }
+ else
+ {
+ System.out.println( "Using certificate: " + cert );
+ }
+ return cert;
+ }
+
+ private static File setupTrustStore( File test, String truststore,
String cert ) throws Exception
+ {
+ File trust = new File( test, truststore );
+ if( !trust.exists() )
+ {
+ String[] args =
+ new String[]
+ {
+ "keytool",
+ "-import",
+ "-file",
+ cert,
+ "-noprompt",
+ "-alias",
+ "jettycert",
+ "-storepass",
+ "password",
+ "-keypass",
+ "password",
+ "-keystore",
+ truststore
+ };
+
+ System.out.println( "Creating trust keystore" );
+ Process process = Runtime.getRuntime().exec( args, new
String[0], test );
+ handleProcess( process );
+ process.waitFor();
+ }
+ else
+ {
+ System.out.println( "Using trust store: " + trust );
+ }
+ return trust;
+ }
+
+ private static void handleProcess( Process process )
+ {
+ OutputStreamReader output = new OutputStreamReader(
process.getInputStream() );
+ ErrorStreamReader err = new ErrorStreamReader(
process.getErrorStream() );
+ output.setDaemon( true );
+ err.setDaemon( true );
+ output.start();
+ err.start();
+ }
+
+ /**
+ * SSL connector context definition.
+ */
+ public class LocalContext implements SslSocketConnector.Context
+ {
+ /**
+ * Return the connector host name.
+ * @param host implementation defined default value
+ * @return the supplied value unless overriden in the deployment
configuration
+ */
+ public String getHost( String host )
+ {
+ return HOST;
+ }
+
+ /**
+ * Return the connector port.
+ * @return the assigned connector port
+ */
+ public int getPort()
+ {
+ return PORT;
+ }
+
+ /**
+ * Return the connector header buffer size.
+ * @param size implementation defined default value
+ * @return the supplied value unless overriden in the deployment
configuration
+ */
+ public int getHeaderBufferSize( int size )
+ {
+ return size;
+ }
+
+ /**
+ * Return the maximum idle time in milliseconds.
+ * @param time implementation defined default value
+ * @return the supplied value unless overriden in the deployment
configuration
+ */
+ public int getMaxIdleTime( int time )
+ {
+ return time;
+ }
+
+ /**
+ * Return the request buffer size.
+ * @param size implementation defined default value
+ * @return the supplied value unless overriden in the deployment
configuration
+ */
+ public int getRequestBufferSize( int size )
+ {
+ return size;
+ }
+
+ /**
+ * Return the response buffer size.
+ * @param size implementation defined default value
+ * @return the supplied value unless overriden in the deployment
configuration
+ */
+ public int getResponseBufferSize( int size )
+ {
+ return size;
+ }
+
+ /**
+ * Return the accept queue size.
+ * @param size implementation defined default value
+ * @return the supplied value unless overriden in the deployment
configuration
+ */
+ public int getAcceptQueueSize( int size )
+ {
+ return size;
+ }
+
+ /**
+ * Return the number of inital acceptors.
+ * @param size implementation defined default value
+ * @return the supplied value unless overriden in the deployment
configuration
+ */
+ public int getAcceptors( int size )
+ {
+ return size;
+ }
+
+ /**
+ * Return the soLingerTime parameter value.
+ * @param time implementation defined default value
+ * @return the supplied value unless overriden in the deployment
configuration
+ */
+ public int getSoLingerTime( int time )
+ {
+ return time;
+ }
+
+ /**
+ * Return the confidential port.
+ * @param port implementation defined default value
+ * @return the supplied value unless overriden in the deployment
configuration
+ */
+ public int getConfidentialPort( int port )
+ {
+ return port;
+ }
+
+ /**
+ * Return the confidential scheme (http or https).
+ * @param scheme implementation defined default value
+ * @return the supplied value unless overriden in the deployment
configuration
+ */
+ public String getConfidentialScheme( String scheme )
+ {
+ return scheme;
+ }
+
+ /**
+ * Return the integral port.
+ * @param port implementation defined default value
+ * @return the supplied value unless overriden in the deployment
configuration
+ */
+ public int getIntegralPort( int port )
+ {
+ return port;
+ }
+
+ /**
+ * Return the integral scheme (http or https).
+ * @param scheme implementation defined default value
+ * @return the supplied value unless overriden in the deployment
configuration
+ */
+ public String getIntegralScheme( String scheme )
+ {
+ return scheme;
+ }
+
+ /**
+ * Set the cipher suites.
+ * @param suites the default suites argument
+ */
+ public String[] getCipherSuites( String[] suites )
+ {
+ return suites;
+ }
+
+ /**
+ * Return the certificate password.
+ * @param password implementation defined default value
+ * @return the supplied value unless overriden in the deployment
configuration
+ */
+ public String getCertificatePassword( String password )
+ {
+ return "password";
+ }
+
+ /**
+ * Return the keystore password.
+ * @param password implementation defined default value
+ * @return the supplied value unless overriden in the deployment
configuration
+ */
+ public String getKeyStorePassword( String password )
+ {
+ return "password";
+ }
+
+ /**
+ * Return the keystore algorithm.
+ * @param algorithm implementation defined default value
+ * @return the supplied value unless overriden in the deployment
configuration
+ */
+ public String getAlgorithm( String algorithm )
+ {
+ return algorithm;
+ }
+
+ /**
+ * Return the keystore protocol.
+ * @param protocol implementation defined default value
+ * @return the supplied value unless overriden in the deployment
configuration
+ */
+ public String getProtocol( String protocol )
+ {
+ return protocol;
+ }
+
+ /**
+ * Return the keystore location uri.
+ * @param keystore implementation defined default value
+ * @return the supplied value unless overriden in the deployment
configuration
+ */
+ public URI getKeyStore( URI keystore )
+ {
+ return m_keystore.toURI();
+ }
+
+ /**
+ * Return the keystore type.
+ * @param type implementation defined default value
+ * @return the supplied value unless overriden in the deployment
configuration
+ */
+ public String getKeyStoreType( String type )
+ {
+ return type;
+ }
+
+ /**
+ * Return the 'want-client-authentication' policy.
+ * @param flag implementation defined default value
+ * @return the supplied value unless overriden in the deployment
configuration
+ */
+ public boolean getWantClientAuth( boolean flag )
+ {
+ return flag;
+ }
+
+ /**
+ * Return the 'need-client-authentication' policy.
+ * @param flag implementation defined default value
+ * @return the supplied value unless overriden in the deployment
configuration
+ */
+ public boolean getNeedClientAuth( boolean flag )
+ {
+ return flag;
+ }
+
+ /**
+ * Return the SSL context provider.
+ * @param provider implementation defined default value
+ * @return the supplied value unless overriden in the deployment
configuration
+ */
+ public String getProvider( String provider )
+ {
+ return provider;
+ }
+
+ /**
+ * Return the keystore algorithm.
+ * @param algorithm implementation defined default value
+ * @return the supplied value unless overriden in the deployment
configuration
+ */
+ public String getTrustAlgorithm( String algorithm )
+ {
+ return algorithm;
+ }
+
+ /**
+ * Return the keystore location uri.
+ * @param uri implementation defined default value
+ * @return the supplied value unless overriden in the deployment
configuration
+ */
+ public URI getTrustStore( URI uri )
+ {
+ return m_truststore.toURI();
+ }
+
+ /**
+ * Return the keystore type.
+ * @param type implementation defined default value
+ * @return the supplied value unless overriden in the deployment
configuration
+ */
+ public String getTrustStoreType( String type )
+ {
+ return type;
+ }
+
+ /**
+ * Return the trust store password.
+ * @param password implementation defined default value
+ * @return the supplied value unless overriden in the deployment
configuration
+ */
+ public String getTrustStorePassword( String password )
+ {
+ return "password";
+ }
+ }
+}
+

Added: trunk/main/planet/http/impl/src/test/net/dpml/http/StreamReader.java
===================================================================
--- trunk/main/planet/http/impl/src/test/net/dpml/http/StreamReader.java
2006-04-20 19:59:01 UTC (rev 1391)
+++ trunk/main/planet/http/impl/src/test/net/dpml/http/StreamReader.java
2006-04-22 20:03:59 UTC (rev 1392)
@@ -0,0 +1,52 @@
+/*
+ * Copyright 2006 Stephen J. 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.http;
+
+import java.io.InputStream;
+
+/**
+ * Stream reader utility class.
+ *
+ * @author <a href="@PUBLISHER-URL@">@PUBLISHER-NAME@</a>
+ * @version @PROJECT-VERSION@
+ */
+abstract class StreamReader extends Thread
+{
+ private final InputStream m_input;
+
+ /**
+ * Creation of a new reader.
+ * @param logger the assigned logging channel
+ * @param input the subprocess input stream
+ */
+ public StreamReader( InputStream input )
+ {
+ m_input = input;
+ }
+
+ /**
+ * Return the input stream.
+ * @return the subprocess input stream
+ */
+ protected InputStream getInputStream()
+ {
+ return m_input;
+ }
+
+}

Modified: trunk/main/planet/http/module.xml
===================================================================
--- trunk/main/planet/http/module.xml 2006-04-20 19:59:01 UTC (rev 1391)
+++ trunk/main/planet/http/module.xml 2006-04-22 20:03:59 UTC (rev 1392)
@@ -29,6 +29,10 @@
<include
urn="artifact:jar:org/slf4j/jcl104-over-slf4j#${sl4j.version}"/>
<include urn="artifact:jar:org/slf4j/slf4j-jdk14#${sl4j.version}"/>
</runtime>
+ <test>
+ <include ref="dpml/transit/dpml-transit-main"/>
+ <include ref="ant/ant-junit"/>
+ </test>
</dependencies>
</project>


Modified: trunk/main/planet/http/server/project.xml
===================================================================
--- trunk/main/planet/http/server/project.xml 2006-04-20 19:59:01 UTC (rev
1391)
+++ trunk/main/planet/http/server/project.xml 2006-04-22 20:03:59 UTC (rev
1392)
@@ -23,9 +23,11 @@
<context>
<entry key="port" value="8443"/>
<entry key="maxIdleTime" value="30000"/>
- <entry key="keystore"
value="local:keystore:dpml/planet/http/demo"/>
- <entry key="password" value="password"/>
- <entry key="keyPassword" value="password"/>
+ <entry key="keyStore"
value="local:keystore:dpml/planet/http/demo"/>
+ <entry key="keyStorePassword" value="password"/>
+ <entry key="certificatePassword" value="password"/>
+ <entry key="trustStore"
value="local:keystore:dpml/planet/http/trust"/>
+ <entry key="trustStorePassword" value="password"/>
<!--
<entry key="keystore"
value="local:keystore:dpml/planet/http/jetty"/>
<entry key="password"
value="OBF:1vny1zlo1x8e1vnw1vn61x8g1zlu1vn4"/>

Modified: trunk/main/transit/core/src/main/net/dpml/lang/Part.java
===================================================================
--- trunk/main/transit/core/src/main/net/dpml/lang/Part.java 2006-04-20
19:59:01 UTC (rev 1391)
+++ trunk/main/transit/core/src/main/net/dpml/lang/Part.java 2006-04-22
20:03:59 UTC (rev 1392)
@@ -82,10 +82,22 @@
*/
public static Part load( URI uri ) throws IOException
{
- return PartDecoder.getInstance().loadPart( uri );
+ return load( uri, true );
}

/**
+ * Load a part from an external XML source.
+ * @param uri the external part source
+ * @param cache the cache policy
+ * @return the resolved part
+ * @exception IOException of an I/O error occurs
+ */
+ public static Part load( URI uri, boolean cache ) throws IOException
+ {
+ return PartDecoder.getInstance().loadPart( uri, cache );
+ }
+
+ /**
* Creation of a new part datastructure.
* @param logger the logging channel
* @param info the info descriptor

Modified: trunk/main/transit/core/src/main/net/dpml/lang/PartDecoder.java
===================================================================
--- trunk/main/transit/core/src/main/net/dpml/lang/PartDecoder.java
2006-04-20 19:59:01 UTC (rev 1391)
+++ trunk/main/transit/core/src/main/net/dpml/lang/PartDecoder.java
2006-04-22 20:03:59 UTC (rev 1392)
@@ -74,27 +74,31 @@
/**
* Load a part from a uri.
* @param uri the part uri
+ * @param cache if true parts are cached relative to the requested uri
* @return the part definition
* @exception IOException if an IO error occurs
*/
- public Part loadPart( URI uri ) throws IOException
+ public Part loadPart( URI uri, boolean cache ) throws IOException
{
if( null == uri )
{
throw new NullPointerException( "uri" );
}
String key = buildKey( uri );
- WeakReference ref = (WeakReference) m_map.get( key );
- if( null != ref )
+ if( cache )
{
- Part part = (Part) ref.get();
- if( null != part )
+ WeakReference ref = (WeakReference) m_map.get( key );
+ if( null != ref )
{
- if( getLogger().isDebugEnabled() )
+ Part part = (Part) ref.get();
+ if( null != part )
{
- getLogger().debug( "loading part [" + uri + "] from
cache." );
+ if( getLogger().isDebugEnabled() )
+ {
+ getLogger().debug( "loading part [" + uri + "] from
cache." );
+ }
+ return part;
}
- return part;
}
}
try
@@ -106,8 +110,11 @@
final Document document = DOCUMENT_BUILDER.parse( uri );
final Element root = document.getDocumentElement();
Part value = decodePart( uri, root );
- WeakReference reference = new WeakReference( value );
- m_map.put( key, reference );
+ if( cache )
+ {
+ WeakReference reference = new WeakReference( value );
+ m_map.put( key, reference );
+ }
return value;
}
catch( Throwable e )
@@ -277,7 +284,7 @@

private Builder loadForeignBuilder( URI uri ) throws DecodingException,
Exception
{
- Part part = loadPart( uri );
+ Part part = loadPart( uri, true );
if( part instanceof Plugin )
{
Plugin plugin = (Plugin) part;




  • r1392 - in trunk/main: depot/tools/builder/src/main/net/dpml/tools/tasks metro/component/src/main/net/dpml/component metro/model/src/main/net/dpml/metro/data metro/model/src/main/net/dpml/metro/info metro/model/src/test/net/dpml/metro/data/test metro/runtime/src/main/net/dpml/metro/runtime planet/http planet/http/impl/etc/prefs/keystores planet/http/impl/src planet/http/impl/src/main/net/dpml/http planet/http/impl/src/test planet/http/impl/src/test/net planet/http/impl/src/test/net/dpml planet/http/impl/src/test/net/dpml/http planet/http/server transit/core/src/main/net/dpml/lang, mcconnell at BerliOS, 04/22/2006

Archive powered by MHonArc 2.6.24.

Top of Page