cziegeler 02/04/25 07:40:23
Modified: component/src/java/org/apache/avalon/excalibur/component
ExcaliburComponentSelector.java
Log:
Improving hasComponent()
Revision Changes Path
1.3 +5 -17
jakarta-avalon-excalibur/component/src/java/org/apache/avalon/excalibur/component/ExcaliburComponentSelector.java
Index: ExcaliburComponentSelector.java
===================================================================
RCS file:
/home/cvs/jakarta-avalon-excalibur/component/src/java/org/apache/avalon/excalibur/component/ExcaliburComponentSelector.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- ExcaliburComponentSelector.java 10 Apr 2002 05:38:43 -0000 1.2
+++ ExcaliburComponentSelector.java 25 Apr 2002 14:40:23 -0000 1.3
@@ -33,7 +33,7 @@
*
* @author <a href="mailto:[EMAIL PROTECTED]">Berin Loritsch</a>
* @author <a href="mailto:[EMAIL PROTECTED]">Paul Russell</a>
- * @version CVS $Revision: 1.2 $ $Date: 2002/04/10 05:38:43 $
+ * @version CVS $Revision: 1.3 $ $Date: 2002/04/25 14:40:23 $
* @since 4.0
*/
public class ExcaliburComponentSelector
@@ -177,19 +177,7 @@
if( !m_initialized ) return false;
if( m_disposed ) return false;
- boolean exists = false;
-
- try
- {
- this.release( this.select( hint ) );
- exists = true;
- }
- catch( Throwable t )
- {
- // We can safely ignore all exceptions
- }
-
- return exists;
+ return m_componentHandlers.containsKey( hint );
}
/**
@@ -422,7 +410,7 @@
" but its handler could not be located." );
return;
}
-
+
// ThreadSafe components will always be using a
ThreadSafeComponentHandler,
// they will only have a single entry in the m_componentMapping map
which
// should not be removed until the ComponentManager is disposed.
All
@@ -435,7 +423,7 @@
// remove can be called.
m_componentMapping.remove( component );
}
-
+
try
{
handler.put( component );
@@ -490,7 +478,7 @@
{
return m_componentHandlers;
}
-
+
/** Add a new component to the manager.
* @param hint the hint name for the new component.
* @param component the class of this component.
--
To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>