mcconnell 2003/01/29 09:50:27
Modified: merlin/src/java/org/apache/avalon/merlin/service
DefaultRegistry.java
Log:
Added some error handling on base URL creation.
Revision Changes Path
1.5 +25 -4
avalon-sandbox/merlin/src/java/org/apache/avalon/merlin/service/DefaultRegistry.java
Index: DefaultRegistry.java
===================================================================
RCS file:
/home/cvs/avalon-sandbox/merlin/src/java/org/apache/avalon/merlin/service/DefaultRegistry.java,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -r1.4 -r1.5
--- DefaultRegistry.java 9 Jan 2003 15:20:00 -0000 1.4
+++ DefaultRegistry.java 29 Jan 2003 17:50:27 -0000 1.5
@@ -106,13 +106,25 @@
* handles the once only establishment of the service URL protocol
* handler and registers this instance as the root of the service
* management naming context hierachy.
+ */
+ public DefaultRegistry( )
+ throws NullPointerException, MalformedURLException
+ {
+ this( "localhost" );
+ }
+
+ /**
+ * Creation of a new service management context. The implementation
+ * handles the once only establishment of the service URL protocol
+ * handler and registers this instance as the root of the service
+ * management naming context hierachy.
*
* @param domain the host domain name
* @exception NullPointerException if the supplied domain name is null
- * @exception MalformedURLException if the supplied domain name is inconsistent
+ * @exception ServiceRuntimeException if an unexpected establishment error
occurs
*/
public DefaultRegistry( final String domain )
- throws NullPointerException, MalformedURLException
+ throws NullPointerException, ServiceException
{
if( domain == null )
{
@@ -127,7 +139,16 @@
// handler is already registered
}
- m_base = new URL( "native", domain, -1, "/" );
+ try
+ {
+ m_base = new URL( "native", domain, -1, "/" );
+ }
+ catch( Throwable e )
+ {
+ final String error =
+ "Unexpected error while attempting to establish the base URL for
domain: " + domain;
+ throw new ServiceRuntimeException( error, e );
+ }
}
/**
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]