You are viewing a plain text version of this content. The canonical link for it is here.
Posted to cvs@avalon.apache.org by bl...@apache.org on 2002/06/18 01:34:53 UTC
cvs commit: jakarta-avalon/src/proposal/avalon5/org/apache/framework/component/impl DefaultComponentLocator.java
bloritsch 2002/06/17 16:34:53
Modified: src/proposal/avalon5/org/apache/framework/activity
Initializable.java
src/proposal/avalon5/org/apache/framework/component
ComponentException.java
src/proposal/avalon5/org/apache/framework/component/impl
DefaultComponentLocator.java
Added: src/proposal/avalon5/org/apache/framework/activity
Disposable.java
Log:
changes that we so far agree upon
Revision Changes Path
1.2 +1 -10 jakarta-avalon/src/proposal/avalon5/org/apache/framework/activity/Initializable.java
Index: Initializable.java
===================================================================
RCS file: /home/cvs/jakarta-avalon/src/proposal/avalon5/org/apache/framework/activity/Initializable.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- Initializable.java 31 Mar 2002 13:27:56 -0000 1.1
+++ Initializable.java 17 Jun 2002 23:34:53 -0000 1.2
@@ -9,8 +9,7 @@
/**
* The Initializable interface is used by components that need to
- * allocate resources prior to them becoming active and/or
- * deallocate and dispose resources prior to their destruction.
+ * allocate resources prior to them becoming active.
*
* @author <a href="mailto:fede@apache.org">Federico Barbieri</a>
* @author <a href="mailto:pier@apache.org">Pierpaolo Fumagalli</a>
@@ -28,12 +27,4 @@
*/
void initialize()
throws Exception;
-
- /**
- * The dispose operation is called at the end of a components lifecycle.
- * This method will be called after Startable.stop() method (if implemented
- * by component). Components use this method to release and destroy any
- * resources that the Component owns.
- */
- void dispose();
}
1.1 jakarta-avalon/src/proposal/avalon5/org/apache/framework/activity/Disposable.java
Index: Disposable.java
===================================================================
/*
* Copyright (C) The Apache Software Foundation. All rights reserved.
*
* This software is published under the terms of the Apache Software License
* version 1.1, a copy of which has been included with this distribution in
* the LICENSE.txt file.
*/
package org.apache.framework.activity;
/**
* The Disposable interface is used when components need to
* deallocate and dispose resources prior to their destruction.
*
* @author <a href="mailto:fede@apache.org">Federico Barbieri</a>
* @author <a href="mailto:pier@apache.org">Pierpaolo Fumagalli</a>
* @author <a href="mailto:stefano@apache.org">Stefano Mazzocchi</a>
* @author <a href="mailto:peter@apache.org">Peter Donald</a>
* @author <a href="mailto:bloritsch@apache.org">Berin Loritsch</a>
*/
public interface Disposable
{
/**
* The dispose operation is called at the end of a components lifecycle.
* This method will be called after Startable.stop() method (if implemented
* by component). Components use this method to release and destroy any
* resources that the Component owns.
*/
void dispose();
}
1.4 +18 -4 jakarta-avalon/src/proposal/avalon5/org/apache/framework/component/ComponentException.java
Index: ComponentException.java
===================================================================
RCS file: /home/cvs/jakarta-avalon/src/proposal/avalon5/org/apache/framework/component/ComponentException.java,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- ComponentException.java 14 Jun 2002 01:55:52 -0000 1.3
+++ ComponentException.java 17 Jun 2002 23:34:53 -0000 1.4
@@ -9,7 +9,7 @@
/**
* The exception thrown to indicate a problem with service.
- * It is usually thrown by ComponentManager or ServiceManager.
+ * It is usually thrown by ComponentLocator.
*
* @author <a href="mailto:peter@apache.org">Peter Donald</a>
* @author <a href="mailto:fumagalli@exoffice.com">Pierpaolo Fumagalli</a>
@@ -24,15 +24,20 @@
* The Throwable that caused this exception to be thrown.
*/
private final Throwable m_throwable;
+
+ /**
+ * The role request that caused the exception.
+ */
+ private final String m_role;
/**
* Construct a new <code>ComponentException</code> instance.
*
* @param message the exception message
*/
- public ComponentException( final String message )
+ public ComponentException( final String role, final String message )
{
- this( message, null );
+ this( role, message, null );
}
/**
@@ -41,10 +46,11 @@
* @param message the exception message
* @param throwable the throwable
*/
- public ComponentException( final String message, final Throwable throwable )
+ public ComponentException( final String role, final String message, final Throwable throwable )
{
super( message );
m_throwable = throwable;
+ m_role = role;
}
/**
@@ -55,5 +61,13 @@
public final Throwable getCause()
{
return m_throwable;
+ }
+
+ /**
+ * Retrieve the role that caused the exception.
+ */
+ public final String getRole()
+ {
+ return m_role;
}
}
1.2 +1 -1 jakarta-avalon/src/proposal/avalon5/org/apache/framework/component/impl/DefaultComponentLocator.java
Index: DefaultComponentLocator.java
===================================================================
RCS file: /home/cvs/jakarta-avalon/src/proposal/avalon5/org/apache/framework/component/impl/DefaultComponentLocator.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- DefaultComponentLocator.java 13 Jun 2002 21:49:33 -0000 1.1
+++ DefaultComponentLocator.java 17 Jun 2002 23:34:53 -0000 1.2
@@ -85,7 +85,7 @@
}
else
{
- throw new ComponentException( "Unable to provide implementation for " + role );
+ throw new ComponentException( role, "Unable to provide implementation." );
}
}
--
To unsubscribe, e-mail: <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>