Skip to Content.
Sympa Menu

notify-dpml - svn commit: r1517 - in development/main: central/site/src/docs/products/magic/tasks magic/core/src/main/net/dpml/magic/tasks transit/handler/src/main/net/dpml/lang transit/handler/src/main/net/dpml/transit transit/handler/src/main/net/dpml/transit/adapter transit/handler/src/main/net/dpml/transit/artifact transit/handler/src/main/net/dpml/transit/repository transit/handler/src/main/net/dpml/transit/util transit/plugin/src/main/net/dpml/transit/control util/exception/src/main/net/dpml/exception

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: r1517 - in development/main: central/site/src/docs/products/magic/tasks magic/core/src/main/net/dpml/magic/tasks transit/handler/src/main/net/dpml/lang transit/handler/src/main/net/dpml/transit transit/handler/src/main/net/dpml/transit/adapter transit/handler/src/main/net/dpml/transit/artifact transit/handler/src/main/net/dpml/transit/repository transit/handler/src/main/net/dpml/transit/util transit/plugin/src/main/net/dpml/transit/control util/exception/src/main/net/dpml/exception
  • Date: Mon, 17 Jan 2005 15:01:28 +0100

Author: niclas
Date: Mon Jan 17 15:01:27 2005
New Revision: 1517

Added:
development/main/transit/handler/src/main/net/dpml/lang/

development/main/transit/handler/src/main/net/dpml/lang/NullArgumentException.java
- copied, changed from r1514,
development/main/util/exception/src/main/net/dpml/exception/NullArgumentException.java
Removed:

development/main/util/exception/src/main/net/dpml/exception/NullArgumentException.java
Modified:
development/main/central/site/src/docs/products/magic/tasks/export.xml
development/main/magic/core/src/main/net/dpml/magic/tasks/FeatureTask.java
development/main/transit/handler/src/main/net/dpml/transit/Transit.java

development/main/transit/handler/src/main/net/dpml/transit/adapter/ExceptionHelper.java

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

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

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

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

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

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

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

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

development/main/transit/handler/src/main/net/dpml/transit/util/Dictionary.java

development/main/transit/plugin/src/main/net/dpml/transit/control/CommandHandler.java
Log:
Moved NullArgumentException into transit, net.dpml.lang package, and changed
all relevant NullPointerExceptions in Transit to use that exception instead.

Modified:
development/main/central/site/src/docs/products/magic/tasks/export.xml
==============================================================================
--- development/main/central/site/src/docs/products/magic/tasks/export.xml
(original)
+++ development/main/central/site/src/docs/products/magic/tasks/export.xml
Mon Jan 17 15:01:27 2005
@@ -4,16 +4,16 @@
<properties>
<author email="mcconnell AT dpml.net">Stephen McConnell</author>
<title>DPML Magic</title>
- </properties>
+ </properties>

<body>
<section name="Export Task">

<p>
- The export task generates a descriptor for a plugin compliant with
- the Transit specification. This descriptor is a property file
- containing main class information and a staged classloader
description.
- Classpath references will be group relative to API, SPI and IMPL
+ The export task generates a descriptor for a plugin compliant with
+ the Transit specification. This descriptor is a property file
+ containing main class information and a staged classloader description.
+ Classpath references will be group relative to API, SPI and IMPL
runtime dependencies.
</p>

@@ -25,11 +25,11 @@
</pre>

<p><i>Sample plugin descriptor:</i></p>
-
+
<pre>

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

Modified:
development/main/magic/core/src/main/net/dpml/magic/tasks/FeatureTask.java
==============================================================================
---
development/main/magic/core/src/main/net/dpml/magic/tasks/FeatureTask.java
(original)
+++
development/main/magic/core/src/main/net/dpml/magic/tasks/FeatureTask.java
Mon Jan 17 15:01:27 2005
@@ -197,7 +197,7 @@
}

//
- // do platform convertion
+ // do platform conversion
//

StringBuffer buffer = new StringBuffer();

Copied:
development/main/transit/handler/src/main/net/dpml/lang/NullArgumentException.java
(from r1514,
development/main/util/exception/src/main/net/dpml/exception/NullArgumentException.java)
==============================================================================
---
development/main/util/exception/src/main/net/dpml/exception/NullArgumentException.java
(original)
+++
development/main/transit/handler/src/main/net/dpml/lang/NullArgumentException.java
Mon Jan 17 15:01:27 2005
@@ -1,22 +1,22 @@
-/*
+/*
* Copyright 2005 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.
*/

-package net.dpml.exception;
+package net.dpml.lang;


/** Exception thrown when the argument to a method or constructor is
@@ -39,6 +39,8 @@
public class NullArgumentException extends IllegalArgumentException
{
/** Constructor taking the name of the argument that was null.
+ * @param argumentName the source code name of the argument that caused
+ * this exception.
*/
public NullArgumentException( String argumentName )
{

Modified:
development/main/transit/handler/src/main/net/dpml/transit/Transit.java
==============================================================================
--- development/main/transit/handler/src/main/net/dpml/transit/Transit.java
(original)
+++ development/main/transit/handler/src/main/net/dpml/transit/Transit.java
Mon Jan 17 15:01:27 2005
@@ -28,6 +28,8 @@
import java.io.OutputStreamWriter;
import java.io.PrintWriter;

+import net.dpml.lang.NullArgumentException;
+
import net.dpml.transit.artifact.SecuredTransitContext;

import net.dpml.transit.monitors.Monitor;
@@ -122,13 +124,14 @@
* @param monitor the bootstrap monitor
* @return the singleton transit instance
* @exception TransitException if an error occurs during establishment
+ * @exception NullArgumentException if the monitor argument is null.
*/
public static Transit getInstance( Monitor monitor )
- throws TransitException
+ throws TransitException, NullArgumentException
{
if( null == monitor )
{
- throw new NullPointerException( "monitor" );
+ throw new NullArgumentException( "monitor" );
}
synchronized( Transit.class )
{
@@ -220,13 +223,14 @@
* @exception TransitException if plugin deployment error occurs
* @exception URISyntaxException if the supplied uri not a valid uri
* @exception IOException if an io related error occurs
+ * @exception NullArgumentException if the uri argument is null.
*/
public Object start( URI uri, Object[] args )
- throws TransitException, URISyntaxException, IOException
+ throws TransitException, URISyntaxException, IOException,
NullArgumentException
{
if( null == uri )
{
- throw new NullPointerException( "uri" );
+ throw new NullArgumentException( "uri" );
}

m_repository = new StandardLoader();

Modified:
development/main/transit/handler/src/main/net/dpml/transit/adapter/ExceptionHelper.java
==============================================================================
---
development/main/transit/handler/src/main/net/dpml/transit/adapter/ExceptionHelper.java
(original)
+++
development/main/transit/handler/src/main/net/dpml/transit/adapter/ExceptionHelper.java
Mon Jan 17 15:01:27 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.
*/
@@ -23,6 +23,8 @@
import java.lang.reflect.Method;
import java.util.StringTokenizer;

+import net.dpml.lang.NullArgumentException;
+
/**
* General utilities supporting the packaging of exception messages.
* @author <a href="mailto:dev-dpml AT lists.ibiblio.org";>The Digital Product
Meta Library</a>
@@ -73,7 +75,7 @@
* @param stack TRUE to generate a stack trace
* @return String the formatting string
*/
- public static String packException(
+ public static String packException(
final String message, final Throwable e, boolean stack )
{
StringBuffer buffer = new StringBuffer();
@@ -90,7 +92,7 @@
* @param stack TRUE to generate a stack trace
* @return String the formatting string
*/
- public static String packException(
+ public static String packException(
final String message, final Throwable[] e, boolean stack )
{
final String lead = COMPOSITE + "(" + e.length + " entries) ";
@@ -115,7 +117,7 @@
/**
* Line separator character.
*/
- private static final String LINE_SEPARATOR =
+ private static final String LINE_SEPARATOR =
System.getProperty( "line.separator" );

/**
@@ -171,7 +173,7 @@
* @param e the exception
* @param stack TRUE to generate a stack trace
*/
- private static void packException(
+ private static void packException(
final StringBuffer buffer, int j, final String message, final
Throwable e, boolean stack )
{
if( e instanceof Error )
@@ -193,7 +195,7 @@
buffer.append( "\n" );
}

- if( e == null )
+ if( e == null )
{
return;
}
@@ -253,18 +255,20 @@
* Get a causal exception using reflection.
* @param exception the exception
* @return the causal exception
+ * @exception NullArgumentException if the exception argument is null.
*/
private static Throwable getCause( Throwable exception )
+ throws NullArgumentException
{
if( exception == null )
{
- throw new NullPointerException( "exception" );
+ throw new NullArgumentException( "exception" );
}

try
{
- Method method =
- exception.getClass().getMethod( "getCause", new Class[0] );
+ Class clazz = exception.getClass();
+ Method method = clazz.getMethod( "getCause", new Class[0] );
return (Throwable) method.invoke( exception, new Object[0] );
}
catch( Throwable e )
@@ -329,7 +333,7 @@
* Get a line of '-' characters with padded offset.
* @param lead the leading characters
* @param count the number of characters to fill
- * @return the filled out line
+ * @return the filled out line
*/
private static String getLine( String lead, int count )
{

Modified:
development/main/transit/handler/src/main/net/dpml/transit/artifact/Artifact.java
==============================================================================
---
development/main/transit/handler/src/main/net/dpml/transit/artifact/Artifact.java
(original)
+++
development/main/transit/handler/src/main/net/dpml/transit/artifact/Artifact.java
Mon Jan 17 15:01:27 2005
@@ -27,8 +27,10 @@
import java.net.URISyntaxException;
import java.net.URL;

+import net.dpml.lang.NullArgumentException;
+
/**
- * An Artifact is a utility class the handles validation of
<code>artifact</code> uri
+ * An Artifact is a utility class the handles validation of
<code>artifact</code> uri
* specifications.
*
* @author <a href="mailto:dev-dpml AT lists.ibiblio.org";>The Digital Product
Meta Library</a>
@@ -178,8 +180,8 @@
m_uri = uri;
String ssp = uri.getSchemeSpecificPart();

- if( ssp.indexOf( "//" ) > -1
- || ssp.indexOf( ":/" ) > -1
+ if( ssp.indexOf( "//" ) > -1
+ || ssp.indexOf( ":/" ) > -1
|| ssp.endsWith( "/" ) )
{
final String error =
@@ -224,29 +226,29 @@
String ver = uri.getFragment();
if( ver != null )
{
- if( ver.indexOf( '/' ) >= 0
- || ver.indexOf( '%' ) >= 0
- || ver.indexOf( '\\' ) >= 0
- || ver.indexOf( '*' ) >= 0
- || ver.indexOf( '!' ) >= 0
- || ver.indexOf( '(' ) >= 0
- || ver.indexOf( '@' ) >= 0
- || ver.indexOf( ')' ) >= 0
- || ver.indexOf( '+' ) >= 0
- || ver.indexOf( '\'' ) >= 0
- || ver.indexOf( '{' ) >= 0
- || ver.indexOf( '}' ) >= 0
- || ver.indexOf( '[' ) >= 0
- || ver.indexOf( '}' ) >= 0
- || ver.indexOf( '?' ) >= 0
- || ver.indexOf( ',' ) >= 0
- || ver.indexOf( '#' ) >= 0
+ if( ver.indexOf( '/' ) >= 0
+ || ver.indexOf( '%' ) >= 0
+ || ver.indexOf( '\\' ) >= 0
+ || ver.indexOf( '*' ) >= 0
+ || ver.indexOf( '!' ) >= 0
+ || ver.indexOf( '(' ) >= 0
+ || ver.indexOf( '@' ) >= 0
+ || ver.indexOf( ')' ) >= 0
+ || ver.indexOf( '+' ) >= 0
+ || ver.indexOf( '\'' ) >= 0
+ || ver.indexOf( '{' ) >= 0
+ || ver.indexOf( '}' ) >= 0
+ || ver.indexOf( '[' ) >= 0
+ || ver.indexOf( '}' ) >= 0
+ || ver.indexOf( '?' ) >= 0
+ || ver.indexOf( ',' ) >= 0
+ || ver.indexOf( '#' ) >= 0
|| ver.indexOf( '=' ) >= 0
)
{
- final String error =
+ final String error =
"Supplied artifact specification ["
- + uri
+ + uri
+ "] contains illegal characters in the Version part.";
throw new IllegalArgumentException( error );
}
@@ -371,7 +373,7 @@
try
{
return toURL( new Handler() );
- }
+ }
catch( Throwable e )
{
// Can not happen!
@@ -389,7 +391,7 @@
try
{
return new URL( null, m_uri.toString(), handler );
- }
+ }
catch( MalformedURLException e )
{
// Can not happen!
@@ -419,11 +421,11 @@
* @param object the object to compare with this instance
* @return the comparative order of the supplied object relative to this
* artifact
- * @exception NullPointerException if the supplied object is null
- * @exception ClassCastException if the supplied object is not an
Artifact
+ * @exception NullArgumentException if the supplied object argument is
null.
+ * @exception ClassCastException if the supplied object is not an
Artifact.
*/
public int compareTo( Object object )
- throws NullPointerException, ClassCastException
+ throws NullArgumentException, ClassCastException
{
if( object instanceof Artifact )
{
@@ -432,15 +434,15 @@
}
else if( null == object )
{
- throw new NullPointerException( "object" );
+ throw new NullArgumentException( "object" );
}
else
{
- final String error =
- "Object ["
+ final String error =
+ "Object ["
+ object.getClass().getName()
+ "] does not implement ["
- + this.getClass().getName() + "].";
+ + this.getClass().getName() + "].";
throw new ClassCastException( error );
}
}

Modified:
development/main/transit/handler/src/main/net/dpml/transit/artifact/FileCacheHandler.java
==============================================================================
---
development/main/transit/handler/src/main/net/dpml/transit/artifact/FileCacheHandler.java
(original)
+++
development/main/transit/handler/src/main/net/dpml/transit/artifact/FileCacheHandler.java
Mon Jan 17 15:01:27 2005
@@ -26,6 +26,8 @@
import java.util.Properties;
import java.util.TreeMap;

+import net.dpml.lang.NullArgumentException;
+
import net.dpml.transit.Transit;
import net.dpml.transit.TransitException;

@@ -95,16 +97,17 @@
*
* @param artifact the artifact to retrieve and cache
* @return file referencing the local resource
- * @exception IOException if an IO error occurs
- * @exception TransitException if a transit system error occurs
+ * @exception IOException if an IO error occurs.
+ * @exception TransitException if a transit system error occurs.
+ * @exception NullArgumentException if the artifact argument is null.
*/
public File getResource( Artifact artifact )
- throws IOException, TransitException
+ throws IOException, TransitException, NullArgumentException
{
CacheMonitorRouter monitor =
Transit.getInstance().getCacheMonitorRouter();
if( null == artifact )
{
- throw new NullPointerException( "artifact" );
+ throw new NullArgumentException( "artifact" );
}

if( monitor != null )

Modified:
development/main/transit/handler/src/main/net/dpml/transit/artifact/RequestIdentifier.java
==============================================================================
---
development/main/transit/handler/src/main/net/dpml/transit/artifact/RequestIdentifier.java
(original)
+++
development/main/transit/handler/src/main/net/dpml/transit/artifact/RequestIdentifier.java
Mon Jan 17 15:01:27 2005
@@ -1,18 +1,18 @@
-/*
+/*
* Copyright 2004 Niclas Hedhman, DPML
* Copyright 2005 Stephen McConnell, DPML
*
* 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,6 +21,8 @@

import java.net.InetAddress;

+import net.dpml.lang.NullArgumentException;
+
/**
* A request identifier.
*/
@@ -75,28 +77,28 @@
* @param protocol the protocol
* @param scheme the scheme
* @param prompt the prompt
- * @exception NullPointerException if address, protocol, scheme or
- * or prompt arguments are null
+ * @exception NullArgumentException if any of the address, protocol,
scheme
+ * or prompt arguments is null.
*/
- RequestIdentifier( InetAddress address, int port,
- String protocol, String scheme, String prompt )
- throws NullPointerException
+ RequestIdentifier( InetAddress address, int port, String protocol,
+ String scheme, String prompt )
+ throws NullArgumentException
{
if( address == null )
{
- throw new NullPointerException( "address" );
+ throw new NullArgumentException( "address" );
}
if( protocol == null )
{
- throw new NullPointerException( "protocol" );
+ throw new NullArgumentException( "protocol" );
}
if( scheme == null )
{
- throw new NullPointerException( "scheme" );
+ throw new NullArgumentException( "scheme" );
}
if( prompt == null )
{
- throw new NullPointerException( "prompt" );
+ throw new NullArgumentException( "prompt" );
}
m_address = address;
m_port = port;
@@ -159,7 +161,7 @@
hash = hash ^ m_scheme.hashCode();
return hash;
}
-
+
/**
* Return the string representation of this instance.
* @return the string value
@@ -181,4 +183,4 @@
return b.toString();
}
}
-
+

Modified:
development/main/transit/handler/src/main/net/dpml/transit/artifact/ResourceHostFactory.java
==============================================================================
---
development/main/transit/handler/src/main/net/dpml/transit/artifact/ResourceHostFactory.java
(original)
+++
development/main/transit/handler/src/main/net/dpml/transit/artifact/ResourceHostFactory.java
Mon Jan 17 15:01:27 2005
@@ -33,6 +33,8 @@
import java.util.ArrayList;
import java.util.Properties;

+import net.dpml.lang.NullArgumentException;
+
import net.dpml.transit.Transit;
import net.dpml.transit.TransitException;

@@ -252,13 +254,19 @@
* @param result the list of established hosts
* @param files the set of host descriptors to read
* @exception TransitException if an error occurs while reading host
descriptors
+ * @exception NullArgumentException if the files argument or the result
argument is null.
*/
private void createResourceHostsFromFiles( List result, File[] files )
- throws TransitException
+ throws TransitException, NullArgumentException
{
if( null == files )
{
- throw new NullPointerException( "files" );
+ throw new NullArgumentException( "files" );
+ }
+
+ if( null == result )
+ {
+ throw new NullArgumentException( "result" );
}

for( int i=0; i < files.length; i++ )

Modified:
development/main/transit/handler/src/main/net/dpml/transit/artifact/SecuredTransitContext.java
==============================================================================
---
development/main/transit/handler/src/main/net/dpml/transit/artifact/SecuredTransitContext.java
(original)
+++
development/main/transit/handler/src/main/net/dpml/transit/artifact/SecuredTransitContext.java
Mon Jan 17 15:01:27 2005
@@ -29,6 +29,8 @@

import java.util.Properties;

+import net.dpml.lang.NullArgumentException;
+
import net.dpml.transit.Transit;
import net.dpml.transit.TransitException;
import net.dpml.transit.monitors.Monitor;
@@ -138,13 +140,13 @@
{
return m_CONTEXT;
}
-
+
//------------------------------------------------------------------
// implementation
//------------------------------------------------------------------

/**
- * Creation of the transit context. If the transit context has already
+ * Creation of the transit context. If the transit context has already
* been established the method returns the singeton context otherwise a
new context
* is created relative to the authoritve url and returned.
*
@@ -158,16 +160,18 @@
}

/**
- * Creation of the transit context. If the transit context has already
+ * Creation of the transit context. If the transit context has already
* been established the method returns the singeton context otherwise a
new context
* is created relative to the authoritve url and returned.
*
* @param monitor the bootstrap monitor
* @return the secured transit context
* @exception TransitException if an error occurs during context creation
+ * @exception NullArgumentException if the supplied monitor is null and
an instance
+ * of this class has not been created already.
*/
public static SecuredTransitContext create( final Monitor monitor )
- throws TransitException
+ throws TransitException, NullArgumentException
{
if( m_CONTEXT != null )
{
@@ -175,7 +179,7 @@
}
if( null == monitor )
{
- throw new NullPointerException( "monitor" );
+ throw new NullArgumentException( "monitor" );
}
if( monitor.isTraceEnabled() )
{
@@ -190,7 +194,7 @@
CacheHandler ch = chFactory.createCacheHandler( hosts );
m_CONTEXT = new SecuredTransitContext( authorative, hosts, ch );
return m_CONTEXT;
- }
+ }
catch( IOException e )
{
String error = "Unable to establish the SecuredTransitContext.";
@@ -216,7 +220,7 @@
URL conf = new URL( authorative, TRANSIT_PROPERTIES_FILENAME );
Properties props = Util.readProps( conf );
setupAuthenticator( props );
- }
+ }
catch( IOException e )
{
throw new TransitException( "Unable to read Transit
configuration at " + authorative, e );
@@ -252,17 +256,17 @@
}

/**
- * Resolve the authorative url. The implementation will check for a
- * system property named "dpml.transit.authority.file". If the value
+ * Resolve the authorative url. The implementation will check for a
+ * system property named "dpml.transit.authority.file". If the value
* refers to a file then the file will be used to resolve the authority
* url by reading the property "dpml.transit.authority". If no system
* property is defined then a attempt will be made to locate the file
* ${dpml.home}/dpml.transit.authority. If this file does not exist the
* implementation will attempt to locate an authority file in the
directory
* referenced by the system property "java.ext.dirs". If not file is
found
- * the implementation will assume ${dpml.home}/transit as the authorative
+ * the implementation will assume ${dpml.home}/transit as the authorative
* root directory.
- *
+ *
* @param monitor the bootstrap monitor
* @return the authorative url
* @exception TransitException if an error occurs during authority url
creation
@@ -282,17 +286,17 @@
File authorativeFile = getCanonicalFile( new File( path ) );
if( !authorativeFile.exists() )
{
- final String error =
+ final String error =
"The System property 'dpml.transit.authority.file'
referes to the path: ["
- + authorativeFile
+ + authorativeFile
+ "] which does not exist.";
throw new TransitException( error );
- }
+ }
else
{
if( monitor.isTraceEnabled() )
{
- final String message =
+ final String message =
"using system property
'dpml.transit.authority.file' ["
+ path
+ "]";
@@ -314,9 +318,9 @@
{
if( monitor.isTraceEnabled() )
{
- final String message =
+ final String message =
"using authority file ["
- + artifactAuthFile
+ + artifactAuthFile
+ "]";
monitor.trace( message );
}
@@ -324,7 +328,7 @@
}

//
- // Otherwise fallback to checking for the authority file in the
+ // Otherwise fallback to checking for the authority file in the
// java extensions directory.
//

@@ -334,9 +338,9 @@
{
if( monitor.isTraceEnabled() )
{
- final String message =
+ final String message =
"using extension authority file ["
- + artifactAuthFile
+ + artifactAuthFile
+ "]";
monitor.trace( message );
}
@@ -344,23 +348,23 @@
}

//
- // Otherwise there is no authority file and we fallback to
- // assuming that the transit directory is the
+ // Otherwise there is no authority file and we fallback to
+ // assuming that the transit directory is the
// authority directory.
//

if( monitor.isTraceEnabled() )
{
- final String message =
+ final String message =
"using transit home as default authorative source ["
- + artifactAuthFile
+ + artifactAuthFile
+ "]";
monitor.trace( message );
}

return new File( Transit.DPML_HOME, "transit" ).toURL();

- }
+ }
catch( Exception e )
{
throw new TransitException( "Artifact AUTHORITY cannot be
established.", e );
@@ -381,9 +385,9 @@
}
catch( IOException e )
{
- final String error =
+ final String error =
"Internal error while attempting to convert the supplied file
["
- + file.toString()
+ + file.toString()
+ "] to its canonical form.";
throw new TransitException( error );
}
@@ -428,7 +432,7 @@
URL url = new URL( authority );
return url;
}
- }
+ }
finally
{
stream.close();
@@ -464,10 +468,10 @@
if( null == username )
{
return null;
- }
+ }
return new TransitAuthenticatorImpl( username, password );
}
-
+
/**
* Creation of a new request identifier.
* @param properties the transit properties
@@ -484,7 +488,7 @@
{
return null;
}
-
+
String protocol = Util.getProperty( properties, PROXY_PROTOCOL_KEY,
"http" );
String scheme = Util.getProperty( properties, PROXY_SCHEME_KEY, null
);
if( scheme == null )
@@ -496,7 +500,7 @@
{
throw new IllegalArgumentException( "Missing " +
PROXY_PROMPT_KEY + " in properties." );
}
-
+
InetAddress host = InetAddress.getByName( proxy );
String portText = Util.getProperty( properties, PROXY_PORT_KEY, "0"
);
int port = Integer.parseInt( portText );

Modified:
development/main/transit/handler/src/main/net/dpml/transit/artifact/TransitAuthenticatorImpl.java
==============================================================================
---
development/main/transit/handler/src/main/net/dpml/transit/artifact/TransitAuthenticatorImpl.java
(original)
+++
development/main/transit/handler/src/main/net/dpml/transit/artifact/TransitAuthenticatorImpl.java
Mon Jan 17 15:01:27 2005
@@ -22,6 +22,8 @@
import java.net.Authenticator;
import java.net.PasswordAuthentication;

+import net.dpml.lang.NullArgumentException;
+
/**
* Default authenticator that provides support for username password
* based authentication in conjunction with the repository proxy settings.
@@ -48,18 +50,18 @@
* Creation of a new simple authenticator.
* @param username the username
* @param password the password
- * @exception NullPointerException if either the username or password
argument is null
+ * @exception NullArgumentException if either the username or password
argument is null
*/
public TransitAuthenticatorImpl( String username, String password )
- throws NullPointerException
+ throws NullArgumentException
{
if( username == null )
{
- throw new NullPointerException( "username" );
+ throw new NullArgumentException( "username" );
}
if( password == null )
{
- throw new NullPointerException( "password" );
+ throw new NullArgumentException( "password" );
}
m_authentication = new PasswordAuthentication( username,
password.toCharArray() );
}

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
Mon Jan 17 15:01:27 2005
@@ -27,6 +27,8 @@
import java.util.ArrayList;
import java.util.Properties;

+import net.dpml.lang.NullArgumentException;
+
import net.dpml.transit.artifact.Artifact;

/**
@@ -201,15 +203,15 @@
* Creates a new PropertiesPlugin.
*
* @param attributes the plugin descriptor attributes
- * @exception NullPointerException if the supplied attributes are null
+ * @exception NullArgumentException if the supplied attributes are null
* @exception RepositoryException if an error occurs reading the
properties
*/
PropertiesPlugin( final Properties attributes )
- throws RepositoryException, NullPointerException
+ throws RepositoryException, NullArgumentException
{
if( null == attributes )
{
- throw new NullPointerException( "attributes" );
+ throw new NullArgumentException( "attributes" );
}

try

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
Mon Jan 17 15:01:27 2005
@@ -33,6 +33,8 @@
import java.util.ArrayList;
import java.util.Properties;

+import net.dpml.lang.NullArgumentException;
+
import net.dpml.transit.Transit;
import net.dpml.transit.TransitException;

@@ -93,20 +95,21 @@
*
* @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
+ * @return the plugin classloader.
+ * @exception IOException if plugin loading exception occurs.
+ * @exception NullArgumentException if the supplied uri or parent
classloader
+ * is null.
*/
public ClassLoader getPluginClassLoader( ClassLoader parent, URI uri )
- throws IOException, NullPointerException
+ throws IOException, NullArgumentException
{
if( null == uri )
{
- throw new NullPointerException( "uri" );
+ throw new NullArgumentException( "uri" );
}
if( null == parent )
{
- throw new NullPointerException( "parent" );
+ throw new NullArgumentException( "parent" );
}
try
{
@@ -131,18 +134,18 @@
* @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
+ * @exception NullArgumentException if the supplied parent classloader or
uri is null
*/
public Class getPluginClass( ClassLoader parent, URI uri )
- throws IOException, NullPointerException
+ throws IOException, NullArgumentException
{
if( null == uri )
{
- throw new NullPointerException( "uri" );
+ throw new NullArgumentException( "uri" );
}
if( null == parent )
{
- throw new NullPointerException( "parent" );
+ throw new NullArgumentException( "parent" );
}

Plugin descriptor = getPluginDescriptor( uri );
@@ -157,23 +160,23 @@
* @param args commandline arguments
* @return the plugin instance
* @exception IOException if a plugin creation error occurs
- * @exception NullPointerException if the supplied parent classloader,
+ * @exception NullArgumentException if the supplied parent classloader,
* uri or args are null
*/
public Object getPlugin( ClassLoader parent, URI uri, Object[] args )
- throws IOException, NullPointerException
+ throws IOException, NullArgumentException
{
if( null == uri )
{
- throw new NullPointerException( "uri" );
+ throw new NullArgumentException( "uri" );
}
if( null == parent )
{
- throw new NullPointerException( "parent" );
+ throw new NullArgumentException( "parent" );
}
if( null == args )
{
- throw new NullPointerException( "args" );
+ throw new NullArgumentException( "args" );
}

if( m_monitor != null )
@@ -220,19 +223,19 @@
* @param descriptor the plugin descriptor
* @return the plugin class
* @exception IOException if a cload establishement error occurs
- * @exception NullPointerException if the parent classloader or
descriptor is null
+ * @exception NullArgumentException if the parent classloader or
descriptor is null
* @exception IllegalArgumentException if the classname could not be
resolved
*/
private Class getPluginClass( ClassLoader parent, Plugin descriptor )
- throws IOException, NullPointerException, IllegalArgumentException
+ throws IOException, NullArgumentException, IllegalArgumentException
{
if( null == descriptor )
{
- throw new NullPointerException( "descriptor" );
+ throw new NullArgumentException( "descriptor" );
}
if( null == parent )
{
- throw new NullPointerException( "parent" );
+ throw new NullArgumentException( "parent" );
}

try
@@ -265,14 +268,14 @@
* @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
+ * @exception NullArgumentException if the supplied uri is null
*/
public Plugin getPluginDescriptor( URI uri )
- throws IOException, NullPointerException
+ throws IOException, NullArgumentException
{
if( null == uri )
{
- throw new NullPointerException( "uri" );
+ throw new NullArgumentException( "uri" );
}

Artifact artifact = getArtifact( uri );
@@ -307,27 +310,27 @@
* @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,
- * class or arguments are null
+ * @exception NullArgumentException if the any one of supplied
classloader, descriptor,
+ * class arguments are null
*/
private Object createPlugin( ClassLoader classloader, Plugin descriptor,
Class clazz, Object[] args )
- throws IOException, NullPointerException
+ throws IOException, NullArgumentException
{
if( null == clazz )
{
- throw new NullPointerException( "clazz" );
+ throw new NullArgumentException( "clazz" );
}
if( null == classloader )
{
- throw new NullPointerException( "classloader" );
+ throw new NullArgumentException( "classloader" );
}
if( null == descriptor )
{
- throw new NullPointerException( "descriptor" );
+ throw new NullArgumentException( "descriptor" );
}
if( null == args )
{
- throw new NullPointerException( "args" );
+ throw new NullArgumentException( "args" );
}

Constructor[] constructors = clazz.getConstructors();
@@ -464,18 +467,19 @@
* @param descriptor the plugin descriptor
* @return the classloader
* @exception IOException if a classloader construction error occurs
- * @exception NullPointerException if the supplied base or descriptr are
null
+ * @exception NullArgumentException if either the base or the descriptor
+ * argument is null.
*/
private ClassLoader createClassLoader( ClassLoader base, Plugin
descriptor )
- throws IOException, NullPointerException
+ throws IOException, NullArgumentException
{
if( null == descriptor )
{
- throw new NullPointerException( "descriptor" );
+ throw new NullArgumentException( "descriptor" );
}
if( null == base )
{
- throw new NullPointerException( "base" );
+ throw new NullArgumentException( "base" );
}

URI[] apiArtifacts = descriptor.getDependencies( Plugin.API_KEY );
@@ -588,18 +592,18 @@
* @param classname the plugin classname
* @return the factory class
* @exception RepositoryException if a factory class loading error occurs
- * @exception NullPointerException if the supplied classloader or
classname is null
+ * @exception NullArgumentException if the supplied classloader or
classname is null
*/
protected Class loadPluginClass( ClassLoader classloader, String
classname )
- throws RepositoryException, NullPointerException
+ throws RepositoryException, NullArgumentException
{
if( null == classloader )
{
- throw new NullPointerException( "classloader" );
+ throw new NullArgumentException( "classloader" );
}
if( null == classname )
{
- throw new NullPointerException( "classname" );
+ throw new NullArgumentException( "classname" );
}

try
@@ -629,14 +633,14 @@
* @return the properties associated with the artifact
* @exception RepositoryException if an error occurs while retrieving
* or building the attributes
- * @exception NullPointerException if the supplied artifact is null
+ * @exception NullArgumentException if the supplied artifact is null
*/
private Properties getAttributes( Artifact artifact )
- throws RepositoryException, NullPointerException
+ throws RepositoryException, NullArgumentException
{
if( null == artifact )
{
- throw new NullPointerException( "artifact" );
+ throw new NullArgumentException( "artifact" );
}

try

Modified:
development/main/transit/handler/src/main/net/dpml/transit/util/Dictionary.java
==============================================================================
---
development/main/transit/handler/src/main/net/dpml/transit/util/Dictionary.java
(original)
+++
development/main/transit/handler/src/main/net/dpml/transit/util/Dictionary.java
Mon Jan 17 15:01:27 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.
*/
@@ -22,6 +22,8 @@
import java.util.Map;
import java.util.Set;

+import net.dpml.lang.NullArgumentException;
+
/**
* The dictionary class is a read-only map of keyed values.
*
@@ -46,12 +48,14 @@
/**
* Creation of a new criteria instance.
* @param map the key value pairs
+ * @throws NullArgumentException if the map argument is null.
*/
public Dictionary( final Map map )
+ throws NullArgumentException
{
if( null == map )
- {
- throw new NullPointerException( "map" );
+ {
+ throw new NullArgumentException( "map" );
}
m_map = map;
}
@@ -92,13 +96,14 @@
* @param key key whose presence in this map is to be tested.
* @return <tt>true</tt> if this map contains a mapping for the specified
* key.
- *
+ *
* @throws ClassCastException if the key is of an inappropriate type for
* this map (optional).
* @throws NullPointerException if the key is <tt>null</tt> and this map
* does not not permit <tt>null</tt> keys (optional).
*/
- public boolean containsKey( Object key ) throws ClassCastException,
NullPointerException
+ public boolean containsKey( Object key )
+ throws ClassCastException, NullPointerException
{
return m_map.containsKey( key );
}
@@ -119,11 +124,12 @@
* @throws NullPointerException if the value is <tt>null</tt> and this
map
* does not not permit <tt>null</tt> values (optional).
*/
- public boolean containsValue( Object value ) throws ClassCastException,
NullPointerException
+ public boolean containsValue( Object value )
+ throws ClassCastException, NullPointerException
{
return m_map.containsValue( value );
}
-
+
/**
* Returns the value to which this map maps the specified key. Returns
* <tt>null</tt> if the map contains no mapping for this key. A return
@@ -140,27 +146,28 @@
* @param key key whose associated value is to be returned.
* @return the value to which this map maps the specified key, or
* <tt>null</tt> if the map contains no mapping for this key.
- *
+ *
* @throws ClassCastException if the key is of an inappropriate type for
* this map (optional).
* @throws NullPointerException key is <tt>null</tt> and this map does
not
* not permit <tt>null</tt> keys (optional).
- *
+ *
* @see #containsKey(Object)
*/
- public Object get( Object key ) throws ClassCastException,
NullPointerException
+ public Object get( Object key )
+ throws ClassCastException, NullPointerException
{
return m_map.get( key );
}

/**
- * The dictionary class does not support modification of the map and as
+ * The dictionary class does not support modification of the map and as
* such this implementation will allways throw an
UnsupportedOperationException.
*
* @param key key with which the specified value is to be associated.
* @param value value to be associated with the specified key.
* @return nothing.
- *
+ *
* @throws UnsupportedOperationException in all cases
*/
public Object put( Object key, Object value ) throws
UnsupportedOperationException
@@ -169,12 +176,12 @@
}

/**
- * The dictionary class does not support modification of the map and as
+ * The dictionary class does not support modification of the map and as
* such this implementation will allways throw an
UnsupportedOperationException.
*
* @param key key whose mapping is to be removed from the map.
* @return nothing
- *
+ *
* @throws UnsupportedOperationException in all cases
*/
public Object remove( Object key ) throws UnsupportedOperationException
@@ -183,11 +190,11 @@
}

/**
- * The dictionary class does not support modification of the map and as
+ * The dictionary class does not support modification of the map and as
* such this implementation will allways throw an
UnsupportedOperationException.
*
* @param map Mappings to be stored in this map.
- *
+ *
* @throws UnsupportedOperationException in all cases
*/
public void putAll( Map map ) throws UnsupportedOperationException
@@ -196,7 +203,7 @@
}

/**
- * The dictionary class does not support modification of the map and as
+ * The dictionary class does not support modification of the map and as
* such this implementation will allways throw an
UnsupportedOperationException.
*
* @throws UnsupportedOperationException in all cases

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
Mon Jan 17 15:01:27 2005
@@ -28,6 +28,8 @@

import net.dpml.cli.ArgumentHandler;

+import net.dpml.lang.NullArgumentException;
+
import net.dpml.transit.TransitException;
import net.dpml.transit.repository.Plugin;
import net.dpml.transit.repository.Repository;
@@ -360,17 +362,17 @@

/**
* Chack that a supplied object is not null. If the value is null throw
- * a NullPointerException with the name of the argument as the message
value.
+ * a NullArgumentException with the name of the argument as the message
value.
* @param key the parameter name
* @param object the parameter value
- * @exception NullPointerException of the value is null
+ * @exception NullArgumentException of the value is null
*/
private void assertNotNull( final String key, final Object object )
- throws NullPointerException
+ throws NullArgumentException
{
if( null == object )
{
- throw new NullPointerException( key );
+ throw new NullArgumentException( key );
}
}




  • svn commit: r1517 - in development/main: central/site/src/docs/products/magic/tasks magic/core/src/main/net/dpml/magic/tasks transit/handler/src/main/net/dpml/lang transit/handler/src/main/net/dpml/transit transit/handler/src/main/net/dpml/transit/adapter transit/handler/src/main/net/dpml/transit/artifact transit/handler/src/main/net/dpml/transit/repository transit/handler/src/main/net/dpml/transit/util transit/plugin/src/main/net/dpml/transit/control util/exception/src/main/net/dpml/exception, niclas, 01/17/2005

Archive powered by MHonArc 2.6.24.

Top of Page