bloritsch 2003/04/04 08:17:56
Modified: fortress/src/java/org/apache/avalon/fortress/impl
AbstractContainer.java
Log:
allow the user to override the map type or size
Revision Changes Path
1.19 +21 -3
avalon-excalibur/fortress/src/java/org/apache/avalon/fortress/impl/AbstractContainer.java
Index: AbstractContainer.java
===================================================================
RCS file:
/home/cvs/avalon-excalibur/fortress/src/java/org/apache/avalon/fortress/impl/AbstractContainer.java,v
retrieving revision 1.18
retrieving revision 1.19
diff -u -r1.18 -r1.19
--- AbstractContainer.java 4 Apr 2003 16:09:44 -0000 1.18
+++ AbstractContainer.java 4 Apr 2003 16:17:56 -0000 1.19
@@ -272,7 +272,7 @@
*
* @param metaData the information needed to construct a ComponentHandler for
the component
* @throws IllegalArgumentException if the classname defined by the meta data
- * argument is undefined within the scope of the role manager
+ * argument is undefined within the scope of the role manager
* @throws Exception if unable to create a Handler for the component
*/
protected void addComponent( final ComponentHandlerMetaData metaData )
@@ -309,7 +309,7 @@
// Initialize the hintMap if it doesn't exist yet.
if( null == hintMap )
{
- hintMap = new StaticBucketMap();
+ hintMap = createHintMap();
hintMap.put( DEFAULT_ENTRY, handler );
m_mapper.put( role, hintMap );
}
@@ -481,6 +481,24 @@
}
return value;
+ }
+
+ /**
+ * Create the hint map for a role. The map may have to take care for
thread-safety.
+ * By default a StaticBucketMap is created, but you may change the
implementation
+ * or increment the number of buckets according your needs.
+ *
+ * <div>
+ * <span style="font-weight:strong;text-color: red;">WARNING:</span>
+ * This Map must be threadsafe, so either use the
+ * <code>StaticBucketMap</code> or a synchronized <code>Map</code>.
+ * Otherwise you will experience erratic behavior due to the nature
+ * of the asyncronous component management.
+ * </div>
+ */
+ protected Map createHintMap()
+ {
+ return new StaticBucketMap();
}
/**
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]