Skip to Content.
Sympa Menu

notify-dpml - svn commit: r1504 - in development/main/transit: handler/etc/test/trusted/dpml/test/metas handler/etc/test/trusted/dpml/test/plugins handler/src/main/net/dpml/transit/artifact handler/src/main/net/dpml/transit/monitors handler/src/main/net/dpml/transit/repository handler/src/test handler/src/test/net/dpml/transit/artifact handler/src/test/net/dpml/transit/repository plugin/src/main/net/dpml/transit/control

notify-dpml AT lists.ibiblio.org

Subject: DPML Notify

List archive

Chronological Thread  
  • From: niclas AT netcompartner.com
  • To: notify-dpml AT lists.ibiblio.org
  • Subject: svn commit: r1504 - in development/main/transit: handler/etc/test/trusted/dpml/test/metas handler/etc/test/trusted/dpml/test/plugins handler/src/main/net/dpml/transit/artifact handler/src/main/net/dpml/transit/monitors handler/src/main/net/dpml/transit/repository handler/src/test handler/src/test/net/dpml/transit/artifact handler/src/test/net/dpml/transit/repository plugin/src/main/net/dpml/transit/control
  • Date: Sun, 16 Jan 2005 19:53:23 +0100

Author: niclas
Date: Sun Jan 16 19:53:22 2005
New Revision: 1504

Added:
development/main/transit/handler/etc/test/trusted/dpml/test/plugins/
- copied from r1498,
development/main/transit/handler/etc/test/trusted/dpml/test/metas/
Removed:
development/main/transit/handler/etc/test/trusted/dpml/test/metas/
Modified:

development/main/transit/handler/etc/test/trusted/dpml/test/plugins/sample.meta

development/main/transit/handler/src/main/net/dpml/transit/artifact/MimeTypeHandler.java

development/main/transit/handler/src/main/net/dpml/transit/monitors/ConnectionMonitorRouter.java

development/main/transit/handler/src/main/net/dpml/transit/repository/Plugin.java

development/main/transit/handler/src/main/net/dpml/transit/repository/PropertiesPlugin.java

development/main/transit/handler/src/main/net/dpml/transit/repository/Repository.java

development/main/transit/handler/src/main/net/dpml/transit/repository/StandardLoader.java

development/main/transit/handler/src/main/net/dpml/transit/repository/package.html
development/main/transit/handler/src/test/meta.properties

development/main/transit/handler/src/test/net/dpml/transit/artifact/MimeHandlerTestCase.java

development/main/transit/handler/src/test/net/dpml/transit/repository/PropertiesPluginTestCase.java

development/main/transit/plugin/src/main/net/dpml/transit/control/CommandHandler.java
Log:
Making the transition from meta to plugin, and subversion requires me to
commit before I can proceed with the final changes.

Modified:
development/main/transit/handler/etc/test/trusted/dpml/test/plugins/sample.meta
==============================================================================
---
development/main/transit/handler/etc/test/trusted/dpml/test/metas/sample.meta
(original)
+++
development/main/transit/handler/etc/test/trusted/dpml/test/plugins/sample.meta
Sun Jan 16 19:53:22 2005
@@ -1,9 +1,9 @@

#
-# Meta classifier.
+# Specification classifier.
#
-meta.domain = net.dpml
-meta.version = 1.0
+dpml.plugin.meta.namespace = net.dpml
+dpml.plugin.meta.version = 1.0

#
# Artifact descriptor.

Modified:
development/main/transit/handler/src/main/net/dpml/transit/artifact/MimeTypeHandler.java
==============================================================================
---
development/main/transit/handler/src/main/net/dpml/transit/artifact/MimeTypeHandler.java
(original)
+++
development/main/transit/handler/src/main/net/dpml/transit/artifact/MimeTypeHandler.java
Sun Jan 16 19:53:22 2005
@@ -1,17 +1,17 @@
-/*
+/*
* Copyright 2004 Niclas Hedhman.
*
* 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
- *
+ * 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.
*/
@@ -33,12 +33,11 @@
* Static mime type table of artifact types to mimetype strings.
*/
private static final HashMap MIME_TYPES = new HashMap();
-
+
static
{
MIME_TYPES.put( "block", "text/x-dpml-block" );
MIME_TYPES.put( "plugin", "text/x-dpml-plugin" );
- MIME_TYPES.put( "meta", "text/x-dpml-meta" );
MIME_TYPES.put( "conf", "text/x-dpml-conf" );
MIME_TYPES.put( "jar", "application/x-jar" );
MIME_TYPES.put( "zip", "application/x-zip" );
@@ -47,7 +46,7 @@
MIME_TYPES.put( "gif", "image/gif" );
MIME_TYPES.put( "jpg", "image/jpg" );
}
-
+
/**
* Return the mimetype given a artifact type.
* @param artifactType the artifact type such as "block", "jar", etc.
@@ -57,8 +56,8 @@
{
return (String) MIME_TYPES.get( artifactType );
}
-
- /**
+
+ /**
* Returns the number of MimeTypes that has been defined.
*
* Only for use with testcases.

Modified:
development/main/transit/handler/src/main/net/dpml/transit/monitors/ConnectionMonitorRouter.java
==============================================================================
---
development/main/transit/handler/src/main/net/dpml/transit/monitors/ConnectionMonitorRouter.java
(original)
+++
development/main/transit/handler/src/main/net/dpml/transit/monitors/ConnectionMonitorRouter.java
Sun Jan 16 19:53:22 2005
@@ -1,17 +1,17 @@
-/*
+/*
* Copyright 2004 Niclas Hedhman.
*
* 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
- *
+ * 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.
*/
@@ -21,7 +21,7 @@
import java.net.URL;

/**
- * A commection monitor implemetation that routes connection notification
requests
+ * A commection monitor implementation that routes connection notification
requests
* to registered listeners.
*/
public class ConnectionMonitorRouter extends AbstractMonitorRouter
@@ -57,7 +57,7 @@
monitor.connectionOpened( url );
}
}
-
+
/**
* Notify registered monitors of a connection started event.
* @param url the target url
@@ -71,7 +71,7 @@
monitor.connectStarted( url );
}
}
-
+
/**
* Notify registered monitors of a connection completed event.
* @param url the target url
@@ -85,7 +85,7 @@
monitor.connectCompleted( url );
}
}
-
+
/**
* Add a monitor to the set of registered monitors.
* @param monitor the monitor to add
@@ -102,4 +102,4 @@
}
}
}
-
+

Modified:
development/main/transit/handler/src/main/net/dpml/transit/repository/Plugin.java
==============================================================================
---
development/main/transit/handler/src/main/net/dpml/transit/repository/Plugin.java
(original)
+++
development/main/transit/handler/src/main/net/dpml/transit/repository/Plugin.java
Sun Jan 16 19:53:22 2005
@@ -1,18 +1,18 @@
-/*
+/*
* Copyright 2004 Stephen J. McConnell.
* Copyright 2004 Niclas Hedhman.
*
* 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
- *
+ * 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.
*/
@@ -22,9 +22,9 @@
import java.net.URI;

/**
- * A Plugin class contains immutable data about an plugin based on meta data
reoilved
- * from a 'mata' artifact.
- *
+ * A Plugin class contains immutable data about a plugin based on meta data
resolved
+ * from a 'plugin' artifact.
+ *
* @author <a href="mailto:dev-dpml AT lists.ibiblio.org";>The Digital Product
Meta Library</a>
* @version $Id: Plugin.java 183 2004-10-23 16:53:31Z niclas $
*/
@@ -34,17 +34,17 @@
* Key used to designate an api classloader entry.
*/
static final String API_KEY = "api";
-
+
/**
* Key used to designate an spi classloader entry.
*/
static final String SPI_KEY = "spi";
-
+
/**
* Key used to designate an impl classloader entry.
*/
static final String IMPL_KEY = "impl";
-
+
/**
* Return the uri to the plugin descriptor.
* @return the plugin uri
@@ -52,16 +52,16 @@
URI getURI();

/**
- * Return the meta data domain value.
- * @return the domain
+ * Return the plugin data specification namespace value.
+ * @return the namespace
*/
- String getDomain();
+ String getSpecificationNamespace();

/**
- * Return the meta data version
+ * Return the plugin data version
* @return the version
*/
- String getVersion();
+ String getSpecificationVersion();

/**
* Return the build identifier
@@ -83,17 +83,17 @@

/**
* Return the implementation dependencies
- *
+ *
* @param key either 'api', 'spi' or 'impl', but use the API_KEY, SPI_KEY
and
* IMPL_KEY constants for maximum future compatibility.
- *
+ *
* @return the uris matching the key
*/
URI[] getDependencies( String key );

/**
* Return the aggregated set of dependency uris.
- *
+ *
* @return the dependency artifacts
*/
URI[] getDependencies();

Modified:
development/main/transit/handler/src/main/net/dpml/transit/repository/PropertiesPlugin.java
==============================================================================
---
development/main/transit/handler/src/main/net/dpml/transit/repository/PropertiesPlugin.java
(original)
+++
development/main/transit/handler/src/main/net/dpml/transit/repository/PropertiesPlugin.java
Sun Jan 16 19:53:22 2005
@@ -1,18 +1,18 @@
-/*
+/*
* Copyright 2004 Stephen J. McConnell.
* Copyright 2004 Niclas Hedhman.
*
* 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
- *
+ * 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.
*/
@@ -32,12 +32,12 @@
/**
* An implementation of a plugin descriptor based the original properties
* external format.
- *
+ *
* NOTE: This class is not to be used directly by application developers.
*
* @author <a href="mailto:mcconnell AT dpml.net";>Stephen McConnell</a>
*/
-class PropertiesPlugin
+class PropertiesPlugin
implements Plugin, Serializable
{
//-----------------------------------------------------------
@@ -52,12 +52,12 @@
/**
* key to designate the namespace of the plugin descriptor.
*/
- static final String PP_DOMAIN_KEY = "meta.domain";
+ static final String PP_NAMESPACE_KEY = "dpml.plugin.meta.namespace";

/**
* key to designate the version of the plugin descriptor.
*/
- static final String PP_META_VERSION_KEY = "meta.version";
+ static final String PP_META_VERSION_KEY = "dpml.plugin.meta.version";

/**
* key to designate the build signature of the plugin descriptor.
@@ -124,14 +124,14 @@
//-----------------------------------------------------------

/**
- * The domain identifier.
+ * The specification namespace identifier.
*/
- private final String m_domain;
+ private final String m_specificationNamespace;

/**
- * The domain version.
+ * The specification namespace version.
*/
- private final String m_domainVersion;
+ private final String m_specificationVersion;

/**
* The set of uris representing the api.
@@ -199,12 +199,12 @@

/**
* Creates a new PropertiesPlugin.
- *
- * @param attributes the meta data attributes
+ *
+ * @param attributes the plugin meta data attributes
* @exception NullPointerException if the supplied attributes are null
* @exception RepositoryException if an error occurs reading the
properties
*/
- PropertiesPlugin( final Properties attributes )
+ PropertiesPlugin( final Properties attributes )
throws RepositoryException, NullPointerException
{
if( null == attributes )
@@ -214,18 +214,18 @@

try
{
- m_domain = attributes.getProperty( PP_DOMAIN_KEY );
- if( null == m_domain )
+ m_specificationNamespace = attributes.getProperty(
PP_NAMESPACE_KEY );
+ if( null == m_specificationNamespace )
{
- final String error =
- "Missing attribute: " + PP_DOMAIN_KEY;
+ final String error =
+ "Missing attribute: " + PP_NAMESPACE_KEY;
throw new RepositoryException( error );
}

- m_domainVersion = attributes.getProperty( PP_META_VERSION_KEY );
- if( null == m_domainVersion )
+ m_specificationVersion = attributes.getProperty(
PP_META_VERSION_KEY );
+ if( null == m_specificationVersion )
{
- final String error =
+ final String error =
"Missing attribute: " + PP_META_VERSION_KEY;
throw new RepositoryException( error );
}
@@ -235,13 +235,13 @@
m_version = attributes.getProperty( PP_VERSION_KEY, "" );
m_build = attributes.getProperty( PP_SIGNATURE_KEY, "" );

- m_uri = Artifact.createArtifact( m_group, m_name, m_version,
"meta" ).toURI();
+ m_uri = Artifact.createArtifact( m_group, m_name, m_version,
"plugin" ).toURI();

}
catch( URISyntaxException e )
{
- final String error =
- "Unexpected exception during metadata creation.";
+ final String error =
+ "Unexpected exception during plugin meta data creation.";
throw new RepositoryException( error, e );
}

@@ -250,16 +250,16 @@
m_imp = buildDependents( attributes, PP_IMP_KEY );

m_factory = attributes.getProperty( PP_FACTORY_KEY );
- m_interface = attributes.getProperty( PP_EXPORT_KEY );
+ m_interface = attributes.getProperty( PP_EXPORT_KEY );
m_resource = attributes.getProperty( PP_RESOURCE_KEY );
m_urn = attributes.getProperty( PP_URN_KEY );

if( ( m_factory == null ) && ( m_resource == null ) )
{
- final String error =
+ final String error =
"Unable to resolve either the plugin attribute ["
+ PP_FACTORY_KEY
- + "] or ["
+ + "] or ["
+ PP_RESOURCE_KEY
+ "].";
throw new RepositoryException( error );
@@ -267,7 +267,7 @@
if( ( m_resource != null ) && ( m_urn == null ) )
{
attributes.list( System.out );
- final String error =
+ final String error =
"Unable to resolve the plugin attribute ["
+ PP_URN_KEY
+ "].";
@@ -289,21 +289,21 @@
}

/**
- * Return the meta data domain value.
- * @return the domain
+ * Return the plugin meta data specification value.
+ * @return the namespace of the specification
*/
- public String getDomain()
+ public String getSpecificationNamespace()
{
- return m_domain;
+ return m_specificationNamespace;
}

/**
- * Return the meta data version
+ * Return the plugin meta data version
* @return the version
*/
- public String getVersion()
+ public String getSpecificationVersion()
{
- return m_domainVersion;
+ return m_specificationVersion;
}

/**
@@ -325,9 +325,9 @@
boolean isEqual = other instanceof Plugin;
if ( isEqual )
{
- Plugin meta = (Plugin) other;
- isEqual = isEqual && m_domain.equals( meta.getDomain() );
- isEqual = isEqual && m_domainVersion.equals( meta.getVersion() );
+ Plugin plugin = (Plugin) other;
+ isEqual = isEqual && m_specificationNamespace.equals(
plugin.getSpecificationNamespace() );
+ isEqual = isEqual && m_specificationVersion.equals(
plugin.getSpecificationVersion() );
}
return isEqual;
}
@@ -340,9 +340,9 @@
{
int hash = 1;
hash >>>= THIRTEEN;
- hash ^= m_domain.hashCode();
+ hash ^= m_specificationNamespace.hashCode();
hash >>>= THIRTEEN;
- hash ^= m_domainVersion.hashCode();
+ hash ^= m_specificationVersion.hashCode();
hash >>>= THIRTEEN;
hash ^= m_group.hashCode();
hash >>>= THIRTEEN;
@@ -410,9 +410,9 @@
}
else
{
- final String error =
+ final String error =
"Invalid dependency key: " + key;
- throw new IllegalArgumentException( error );
+ throw new IllegalArgumentException( error );
}
}

@@ -449,8 +449,8 @@
*/
public String toString()
{
- return "[plugin: " + getDomain()
- + "::" + getVersion() + "]";
+ return "[plugin: " + getSpecificationNamespace()
+ + "::" + getSpecificationVersion() + "]";
}

//-----------------------------------------------------------

Modified:
development/main/transit/handler/src/main/net/dpml/transit/repository/Repository.java
==============================================================================
---
development/main/transit/handler/src/main/net/dpml/transit/repository/Repository.java
(original)
+++
development/main/transit/handler/src/main/net/dpml/transit/repository/Repository.java
Sun Jan 16 19:53:22 2005
@@ -24,7 +24,7 @@

/**
* A service that provides support for the establishment of classloaders and
plugin
- * instances based on meta data describing a classloader chain.
+ * instances based on plugin meta data describing a classloader chain.
* @author <a href="mailto:dev-dpml AT lists.ibiblio.org";>The Digital Product
Meta Library</a>
* @version $Id: Repository.java 183 2004-10-23 16:53:31Z niclas $
*/
@@ -33,7 +33,7 @@
/**
* Creates a plugin descriptor from an artifact.
*
- * @param uri the artifact reference to the plugin meta
+ * @param uri the artifact reference to the plugin meta data
* @return the plugin descriptor
* @exception IOException if a factory creation error occurs
*/

Modified:
development/main/transit/handler/src/main/net/dpml/transit/repository/StandardLoader.java
==============================================================================
---
development/main/transit/handler/src/main/net/dpml/transit/repository/StandardLoader.java
(original)
+++
development/main/transit/handler/src/main/net/dpml/transit/repository/StandardLoader.java
Sun Jan 16 19:53:22 2005
@@ -1,18 +1,18 @@
-/*
+/*
* Copyright 2004 Stephen J. McConnell.
* Copyright 2004 Niclas Hedhman.
*
* 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
- *
+ * 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.
*/
@@ -43,13 +43,13 @@
import net.dpml.transit.monitors.RepositoryMonitorRouter;

/**
- * Utility class supporting downloading of resources based on
+ * Utility class supporting downloading of resources based on
* artifact references.
- *
+ *
* @author <a href="mailto:dev-dpml AT lists.ibiblio.org";>The Digital Product
Meta Library</a>
* @version $Id: StandardLoader.java 224 2004-10-27 03:53:05Z mcconnell $
*/
-public class StandardLoader
+public class StandardLoader
implements Repository
{
//
------------------------------------------------------------------------
@@ -60,7 +60,7 @@
* The repository monitor.
*/
private final RepositoryMonitorRouter m_monitor;
-
+
//
------------------------------------------------------------------------
// constructor
//
------------------------------------------------------------------------
@@ -74,7 +74,7 @@
{
m_monitor = Transit.getInstance().getRepositoryMonitorRouter();
}
-
+
//
------------------------------------------------------------------------
// Repository
//
------------------------------------------------------------------------
@@ -87,17 +87,17 @@
{
return m_monitor;
}
-
+
/**
* Get a plugin classloader relative to a supplied uri.
- *
+ *
* @param parent the parent classloader
* @param uri the plugin uri
* @return the plugin classloader
* @exception IOException if plugin loading exception occurs
* @exception NullPointerException if the supplied uri or parent
classloader is null
*/
- public ClassLoader getPluginClassLoader( ClassLoader parent, URI uri )
+ public ClassLoader getPluginClassLoader( ClassLoader parent, URI uri )
throws IOException, NullPointerException
{
if( null == uri )
@@ -105,7 +105,7 @@
throw new NullPointerException( "uri" );
}
if( null == parent )
- {
+ {
throw new NullPointerException( "parent" );
}
try
@@ -115,25 +115,25 @@
}
catch( Exception ce )
{
- String error =
- "Unable to create a plugin classloader using ["
+ String error =
+ "Unable to create a plugin classloader using ["
+ uri
+ "].";
throw new RepositoryException( error, ce );
}
}
-
+

/**
* Get a plugin class relative to a supplied artifact.
- *
+ *
* @param parent the parent classloader
* @param uri the plugin artifact
* @return the plugin class
* @exception IOException if a class resolution error occurs
* @exception NullPointerException if the supplied parent classloader or
uri is null
*/
- public Class getPluginClass( ClassLoader parent, URI uri )
+ public Class getPluginClass( ClassLoader parent, URI uri )
throws IOException, NullPointerException
{
if( null == uri )
@@ -141,7 +141,7 @@
throw new NullPointerException( "uri" );
}
if( null == parent )
- {
+ {
throw new NullPointerException( "parent" );
}

@@ -151,13 +151,13 @@

/**
* Creates a Factory from an artifact reference.
- *
+ *
* @param parent the parent classloader
* @param uri the reference to the application
* @param args commandline arguments
* @return the plugin instance
* @exception IOException if a plugin creation error occurs
- * @exception NullPointerException if the supplied parent classloader,
+ * @exception NullPointerException if the supplied parent classloader,
* uri or args are null
*/
public Object getPlugin( ClassLoader parent, URI uri, Object[] args )
@@ -168,7 +168,7 @@
throw new NullPointerException( "uri" );
}
if( null == parent )
- {
+ {
throw new NullPointerException( "parent" );
}
if( null == args )
@@ -190,9 +190,9 @@

if( null == classname )
{
- final String error =
+ final String error =
"Supplied plugin descriptor ["
- + uri
+ + uri
+ "] does not declare a main class.";
throw new IOException( error );
}
@@ -215,7 +215,7 @@

/**
* Get a plugin class relative to a supplied descriptor.
- *
+ *
* @param parent the parent classloader
* @param descriptor the plugin descriptor
* @return the plugin class
@@ -223,7 +223,7 @@
* @exception NullPointerException if the parent classloader or
descriptor is null
* @exception IllegalArgumentException if the classname could not be
resolved
*/
- private Class getPluginClass( ClassLoader parent, Plugin descriptor )
+ private Class getPluginClass( ClassLoader parent, Plugin descriptor )
throws IOException, NullPointerException, IllegalArgumentException
{
if( null == descriptor )
@@ -251,8 +251,8 @@
}
catch( Throwable ce )
{
- final String error =
- "Unable to load the plugin class ["
+ final String error =
+ "Unable to load the plugin class ["
+ descriptor.getClassname()
+ "].";
throw new RepositoryException( error, ce );
@@ -261,14 +261,14 @@

/**
* Creates a plugin descriptor from an artifact.
- *
+ *
* @param uri the reference to the application
* @return the plugin descriptor
* @exception IOException if a plugin creation error occurs
* @exception NullPointerException if the supplied uri is null
*/
public Plugin getPluginDescriptor( URI uri )
- throws IOException, NullPointerException
+ throws IOException, NullPointerException
{
if( null == uri )
{
@@ -277,11 +277,11 @@

Artifact artifact = getArtifact( uri );

- if( !"meta".equals( artifact.getType() ) )
+ if( !"plugin".equals( artifact.getType() ) )
{
- final String error =
- "Supplied artifact [" + artifact + "] is not a 'meta' type.";
- throw new RepositoryException( error );
+ final String error =
+ "Supplied artifact [" + artifact + "] is not of a 'plugin'
type.";
+ throw new RepositoryException( error );
}
try
{
@@ -290,8 +290,8 @@
}
catch( RepositoryException ce )
{
- final String error =
- "Unable to resolve a plugin descriptor for ["
+ final String error =
+ "Unable to resolve a plugin descriptor for ["
+ artifact
+ "].";
throw new RepositoryException( error, ce );
@@ -300,18 +300,18 @@

/**
* Create a factory using a supplied class and command line arguments.
- *
+ *
* @param descriptor the plugin descriptor
* @param classloader the classloader to be used for plugin creation
* @param clazz the the factory class
* @param args the command line args
* @return the plugin instance
* @exception IOException if a plugin creation error occurs
- * @exception NullPointerException if the supplied classloader,
descriptor,
+ * @exception NullPointerException if the supplied classloader,
descriptor,
* class or arguments are null
*/
private Object createPlugin( ClassLoader classloader, Plugin descriptor,
Class clazz, Object[] args )
- throws IOException, NullPointerException
+ throws IOException, NullPointerException
{
if( null == clazz )
{
@@ -331,11 +331,11 @@
}

Constructor[] constructors = clazz.getConstructors();
- if( constructors.length < 1 )
+ if( constructors.length < 1 )
{
- final String error =
+ final String error =
"Factory class ["
- + clazz.getName()
+ + clazz.getName()
+ "] does not declare a public constructor.";
throw new RepositoryException( error );
}
@@ -349,16 +349,16 @@

Class[] classes = constructor.getParameterTypes();
Object[] arguments = new Object[ classes.length ];
-
+
//
- // sweep though the construct arguments one by one and
+ // sweep though the construct arguments one by one and
// see if we can assign a value based on the supplied parameters
//

for( int i=0; i < classes.length; i++ )
{
Class c = classes[i];
-
+
for( int j=0; j < args.length; j++ )
{
Object object = args[j];
@@ -394,11 +394,11 @@
}
else if( c.isArray() )
{
- arguments[i] = getEmptyArrayInstance( c );
+ arguments[i] = getEmptyArrayInstance( c );
}
else
{
- final String error =
+ final String error =
"Unable to resolve an argument for parameter ["
+ ( i + 1 )
+ "] requesting the ["
@@ -420,18 +420,18 @@
}
catch( InvocationTargetException e )
{
- final String error =
- "Cannot create plugin ["
- + clazz.getName()
+ final String error =
+ "Cannot create plugin ["
+ + clazz.getName()
+ "] due to an invocation failure.";
Throwable cause = e.getTargetException();
throw new RepositoryException( error, cause );
}
catch( Throwable e )
{
- final String error =
- "Cannot create plugin ["
- + clazz.getName()
+ final String error =
+ "Cannot create plugin ["
+ + clazz.getName()
+ "] due to an instantiation failure.";
throw new RepositoryException( error, e );
}
@@ -451,15 +451,15 @@
}
catch( Throwable e )
{
- final String error =
- "Internal error while attempting to construct an empty array
for the class: "
+ final String error =
+ "Internal error while attempting to construct an empty array
for the class: "
+ clazz.getName();
- throw new RepositoryException( error, e );
+ throw new RepositoryException( error, e );
}
}

/**
- * Returns a classloader based on supplied plugin metadata.
+ * Returns a classloader based on supplied plugin meta data.
* @param base the parent classloader
* @param descriptor the plugin descriptor
* @return the classloader
@@ -481,7 +481,7 @@
URI[] apiArtifacts = descriptor.getDependencies( Plugin.API_KEY );
URL[] apis = getURLs( apiArtifacts );
ClassLoader api = buildClassLoader( "api", base, apis );
-
+
URI[] spiArtifacts = descriptor.getDependencies( Plugin.SPI_KEY );
URL[] spis = getURLs( spiArtifacts );
ClassLoader spi = buildClassLoader( "spi", api, spis );
@@ -489,7 +489,7 @@
URI[] impArtifacts = descriptor.getDependencies( Plugin.IMPL_KEY );
URL[] imps = getURLs( impArtifacts );
ClassLoader classloader = buildClassLoader( "impl", spi, imps );
-
+
return classloader;
}

@@ -510,7 +510,7 @@
}

/**
- * Internal utility class to build a classloader. If the supplied url
+ * Internal utility class to build a classloader. If the supplied url
* sequence is zero length the parent classloader is returned directly.
*
* @param type the type of classloader (api, spi, impl)
@@ -561,7 +561,7 @@
URL[] urls = ( (URLClassLoader) classloader ).getURLs();
for( int i=0; i < urls.length; i++ )
{
- if( urls[i].equals( url ) )
+ if( urls[i].equals( url ) )
{
return false;
}
@@ -574,7 +574,7 @@
else
{
return isaCandidate( parent, url );
- }
+ }
}
else
{
@@ -608,26 +608,26 @@
}
catch( ClassNotFoundException e )
{
- final String error =
+ final String error =
"Could not load factory class[ " + classname + "].";
throw new RepositoryException( error, e );
}
catch( Throwable e )
{
- final String error =
- "Unexpected error while attempting to load factory class: ["
- + classname
+ final String error =
+ "Unexpected error while attempting to load factory class: ["
+ + classname
+ "].";
throw new RepositoryException( error, e );
}
}

/**
- * Return the metadata attribututes associated with an artifact.
- * @param artifact the relative artifact from which a .meta resource
will
+ * Return the meta data attribututes associated with an artifact.
+ * @param artifact the relative artifact from which a .plugin resource
will
* be resolved to establish the artifact attributes
* @return the properties associated with the artifact
- * @exception RepositoryException if an error occurs while retrieving
+ * @exception RepositoryException if an error occurs while retrieving
* or building the attributes
* @exception NullPointerException if the supplied artifact is null
*/
@@ -656,14 +656,14 @@
}
catch( Throwable e )
{
- final String error =
- "Unable to resolve metadata for ["
+ final String error =
+ "Unable to resolve plugin meta data for ["
+ artifact
+ "].";
throw new RepositoryException( error, e );
}
}
-
+
/**
* Test is the supplied file is a sanpshot file.
* @param file the file to test
@@ -697,7 +697,7 @@
{
final String error =
"Unable to convert the uri ["
- + uri
+ + uri
+ "] to an artifact.";
throw new RepositoryException( error, e );
}

Modified:
development/main/transit/handler/src/main/net/dpml/transit/repository/package.html
==============================================================================
---
development/main/transit/handler/src/main/net/dpml/transit/repository/package.html
(original)
+++
development/main/transit/handler/src/main/net/dpml/transit/repository/package.html
Sun Jan 16 19:53:22 2005
@@ -1,7 +1,7 @@

<body>
<p>
-The repository package adds support for the construction of classloaders and
the reslution of
+The repository package adds support for the construction of classloaders and
the resolution of
plugins based on metadata that describes classloader resources in terms of
artifact uris.
</p>
</body>

Modified: development/main/transit/handler/src/test/meta.properties
==============================================================================
--- development/main/transit/handler/src/test/meta.properties (original)
+++ development/main/transit/handler/src/test/meta.properties Sun Jan 16
19:53:22 2005
@@ -1,8 +1,9 @@
+
#
-# Meta classifier.
+# Specification classifier.
#
-meta.domain = net.dpml
-meta.version = 1.0
+dpml.plugin.meta.namespace = net.dpml
+dpml.plugin.meta.version = 1.0

#
# Artifact descriptor.

Modified:
development/main/transit/handler/src/test/net/dpml/transit/artifact/MimeHandlerTestCase.java
==============================================================================
---
development/main/transit/handler/src/test/net/dpml/transit/artifact/MimeHandlerTestCase.java
(original)
+++
development/main/transit/handler/src/test/net/dpml/transit/artifact/MimeHandlerTestCase.java
Sun Jan 16 19:53:22 2005
@@ -1,17 +1,17 @@
-/*
+/*
* Copyright 2004 Niclas Hedhman.
*
* 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
- *
+ * 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.
*/
@@ -26,9 +26,8 @@
{
static private String[][] TESTS = new String[][]
{
- { "block", "text/x-dpml-block" },
+ { "block", "text/x-dpml-block" },
{ "plugin", "text/x-dpml-plugin" },
- { "meta", "text/x-dpml-meta" },
{ "conf", "text/x-dpml-conf" },
{ "jar", "application/x-jar" },
{ "zip", "application/x-zip" },
@@ -37,11 +36,11 @@
{ "jpg", "image/jpg" },
{ "gif", "image/gif" }
};
-
+
static public Test suite()
{
TestSuite tests = new TestSuite();
-
+
for( int i = 0 ; i < TESTS.length ; i++ )
{
String lookup = TESTS[i][0];
@@ -55,24 +54,24 @@
tests.addTest( testcase );
return tests;
}
-
+
private String m_Lookup;
private String m_Expected;
-
+
private MimeHandlerTestCase( String name, String lookup, String expected
)
{
super( name );
m_Lookup = lookup;
m_Expected = expected;
}
-
+
public void testLookup()
throws Exception
{
String mime = MimeTypeHandler.getMimeType( m_Lookup );
assertEquals( m_Lookup, m_Expected, mime );
}
-
+
public void testSize()
{
assertEquals( "Map Size", TESTS.length,
MimeTypeHandler.getMimeTypesSize() );

Modified:
development/main/transit/handler/src/test/net/dpml/transit/repository/PropertiesPluginTestCase.java
==============================================================================
---
development/main/transit/handler/src/test/net/dpml/transit/repository/PropertiesPluginTestCase.java
(original)
+++
development/main/transit/handler/src/test/net/dpml/transit/repository/PropertiesPluginTestCase.java
Sun Jan 16 19:53:22 2005
@@ -1,17 +1,17 @@
-/*
+/*
* Copyright 2004 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
- *
+ * 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.
*/
@@ -35,11 +35,11 @@
public class PropertiesPluginTestCase extends TestCase
{
private PropertiesPlugin m_Plugin;
-
+
protected void setUp() throws Exception
{
Properties props = new Properties();
- InputStream stream = getClass().getResourceAsStream(
"/meta.properties" );
+ InputStream stream = getClass().getResourceAsStream(
"/plugin.properties" );
props.load( stream );
m_Plugin = new PropertiesPlugin( props );
}
@@ -49,21 +49,21 @@
{
Artifact artifact = Artifact.createArtifact( m_Plugin.getURI() );
assertEquals( "Artifact name", "dpml-metro-cli", artifact.getName()
);
-
- URI uri = URI.create(
"artifact:meta:dpml/metro/dpml-metro-cli#SNAPSHOT" );
+
+ URI uri = URI.create(
"artifact:plugin:dpml/metro/dpml-metro-cli#SNAPSHOT" );
assertEquals( "Artifact URI", uri, artifact.toURI() );
}

public void testDomain()
throws Exception
{
- assertEquals( "Domain", "net.dpml", m_Plugin.getDomain() );
+ assertEquals( "Domain", "net.dpml",
m_Plugin.getSpecificationNamespace() );
}

public void testVersion()
throws Exception
{
- assertEquals( "Version", "1.0", m_Plugin.getVersion() );
+ assertEquals( "Version", "1.0", m_Plugin.getSpecificationVersion() );
}

public void testBuild()
@@ -84,13 +84,13 @@
// TODO: Fix a better sample
assertEquals( "Interface", null, m_Plugin.getInterface() );
}
-
+
public void testApiDependencies()
throws Exception
{
URI[] facts = m_Plugin.getDependencies( Plugin.API_KEY );
assertEquals( "API deps", 4, facts.length );
-
+
URI uri = URI.create(
"artifact:jar:dpml/logging/dpml-logging-api#SNAPSHOT" );
assertEquals( "API Artifact URI", uri, facts[0] );
uri = URI.create(
"artifact:jar:dpml/activity/dpml-activity-api#SNAPSHOT" );
@@ -100,25 +100,25 @@
uri = URI.create(
"artifact:jar:dpml/transit/dpml-transit-main#SNAPSHOT" );
assertEquals( "API Artifact URI", uri, facts[3] );
}
-
+
public void testSpiDependencies()
throws Exception
{
URI[] facts = m_Plugin.getDependencies( Plugin.SPI_KEY );
assertEquals( "SPI deps", 2, facts.length );
-
+
URI uri = URI.create(
"artifact:jar:dpml/transit/dpml-transit-spi#SNAPSHOT" );
assertEquals( "SPI Artifact URI", uri, facts[0] );
uri = URI.create(
"artifact:jar:dpml/logging/dpml-logging-spi#SNAPSHOT" );
assertEquals( "SPI Artifact URI", uri, facts[1] );
}
-
+
public void testImplDependencies()
throws Exception
{
URI[] facts = m_Plugin.getDependencies( Plugin.IMPL_KEY );
assertEquals( "Impl deps", 5, facts.length );
-
+
URI uri = URI.create(
"artifact:jar:dpml/util/dpml-util-i18n#SNAPSHOT" );
assertEquals( "Impl Artifact URI", uri, facts[0] );
uri = URI.create(
"artifact:jar:dpml/util/dpml-util-exception#SNAPSHOT" );
@@ -130,7 +130,7 @@
uri = URI.create( "artifact:jar:dpml/metro/dpml-metro-cli#SNAPSHOT"
);
assertEquals( "Impl Artifact URI", uri, facts[4] );
}
-
+
public void testAllDependencies()
throws Exception
{
@@ -145,12 +145,12 @@
assertEquals( "API Artifact URI", uri, facts[2] );
uri = URI.create(
"artifact:jar:dpml/transit/dpml-transit-main#SNAPSHOT" );
assertEquals( "API Artifact URI", uri, facts[3] );
-
+
uri = URI.create(
"artifact:jar:dpml/transit/dpml-transit-spi#SNAPSHOT" );
assertEquals( "SPI Artifact URI", uri, facts[4] );
uri = URI.create(
"artifact:jar:dpml/logging/dpml-logging-spi#SNAPSHOT" );
assertEquals( "SPI Artifact URI", uri, facts[5] );
-
+
uri = URI.create( "artifact:jar:dpml/util/dpml-util-i18n#SNAPSHOT" );
assertEquals( "Impl Artifact URI", uri, facts[6] );
uri = URI.create(
"artifact:jar:dpml/util/dpml-util-exception#SNAPSHOT" );

Modified:
development/main/transit/plugin/src/main/net/dpml/transit/control/CommandHandler.java
==============================================================================
---
development/main/transit/plugin/src/main/net/dpml/transit/control/CommandHandler.java
(original)
+++
development/main/transit/plugin/src/main/net/dpml/transit/control/CommandHandler.java
Sun Jan 16 19:53:22 2005
@@ -52,13 +52,14 @@


/**
- * The command handler is a commandline entry point into the transit system.
It is
+ * The command handler is a commandline entry point into the transit system.
It is
* established as the root management plugin by transit using the system
property
- * "dpml.transit.bootstrap.uri" or -Xbootstrap cli option.
+ * "dpml.transit.bootstrap.uri" or -Xbootstrap cli option.
*
* @author <a href="mailto:dev@dpmlnet";>Stephen J. McConnell</a>
*/
-public final class CommandHandler implements Runnable
+public final class CommandHandler
+ implements Runnable
{
//
------------------------------------------------------------------------
// static
@@ -68,7 +69,7 @@
* Internationalization language pack.
*/
private static final Resources REZ =
- ResourceManager.getPackageResources( CommandHandler.class );
+ ResourceManager.getPackageResources( CommandHandler.class );

//
------------------------------------------------------------------------
// state
@@ -94,12 +95,12 @@
*/
private final String[] m_args;

- /**
+ /**
* The repository.
*/
private final Repository m_repository;

- /**
+ /**
* The paarameters.
*/
private final Map m_map;
@@ -225,7 +226,7 @@
}
catch( Throwable e )
{
- final String message =
+ final String message =
"Could not get: " + entry;
String error = ExceptionHelper.packException( message,
e, m_debug );
System.out.println( error );
@@ -260,7 +261,7 @@
}
catch( Throwable e )
{
- final String message =
+ final String message =
"Could not load: " + target;
String error = ExceptionHelper.packException( message, e,
m_debug );
System.out.println( error );
@@ -298,7 +299,7 @@
}
catch( Throwable e )
{
- final String message =
+ final String message =
"Could not load: " + target;
String error = ExceptionHelper.packException( message, e,
m_debug );
System.out.println( error );
@@ -323,13 +324,6 @@
{
return resolveURL( new URI( "artifact:" + uri.toString() ) );
}
- else if( "plugin".equals( scheme ) )
- {
- return resolveURL(
- new URI(
- "artifact:meta:"
- + uri.toString().substring( "plugin".length() + 1 ) ) );
- }
else
{
return uri.toURL();



  • svn commit: r1504 - in development/main/transit: handler/etc/test/trusted/dpml/test/metas handler/etc/test/trusted/dpml/test/plugins handler/src/main/net/dpml/transit/artifact handler/src/main/net/dpml/transit/monitors handler/src/main/net/dpml/transit/repository handler/src/test handler/src/test/net/dpml/transit/artifact handler/src/test/net/dpml/transit/repository plugin/src/main/net/dpml/transit/control, niclas, 01/16/2005

Archive powered by MHonArc 2.6.24.

Top of Page