donaldp 2002/11/10 03:38:41
Modified: fortress/src/java/org/apache/excalibur/fortress/handler
AbstractComponentHandler.java
Log:
Aquire services via ServiceManager rather
than some a combination of context and constructor
Revision Changes Path
1.39 +12 -22
jakarta-avalon-excalibur/fortress/src/java/org/apache/excalibur/fortress/handler/AbstractComponentHandler.java
Index: AbstractComponentHandler.java
===================================================================
RCS file:
/home/cvs/jakarta-avalon-excalibur/fortress/src/java/org/apache/excalibur/fortress/handler/AbstractComponentHandler.java,v
retrieving revision 1.38
retrieving revision 1.39
diff -u -r1.38 -r1.39
--- AbstractComponentHandler.java 10 Nov 2002 03:25:31 -0000 1.38
+++ AbstractComponentHandler.java 10 Nov 2002 11:38:41 -0000 1.39
@@ -53,11 +53,10 @@
import org.apache.avalon.framework.activity.Disposable;
import org.apache.avalon.framework.activity.Initializable;
import org.apache.avalon.framework.container.ContainerUtil;
-import org.apache.avalon.framework.context.Context;
-import org.apache.avalon.framework.context.ContextException;
-import org.apache.avalon.framework.context.Contextualizable;
import org.apache.avalon.framework.logger.Logger;
-import org.apache.excalibur.fortress.ContainerConstants;
+import org.apache.avalon.framework.service.ServiceException;
+import org.apache.avalon.framework.service.ServiceManager;
+import org.apache.avalon.framework.service.Serviceable;
import org.apache.excalibur.instrument.AbstractInstrumentable;
import org.apache.excalibur.instrument.Instrumentable;
import org.apache.excalibur.mpool.ObjectFactory;
@@ -74,13 +73,13 @@
*/
public abstract class AbstractComponentHandler
extends AbstractInstrumentable
- implements Contextualizable, Initializable, Disposable, ComponentHandler
+ implements Serviceable, Initializable, Disposable, ComponentHandler
{
/**
* The instance of the ComponentFactory that creates and disposes of the
* Component
*/
- protected final ObjectFactory m_factory;
+ protected ObjectFactory m_factory;
/**
* State management boolean stating whether the Handler is initialized or
@@ -101,24 +100,15 @@
protected LoggerManager m_loggerManager;
/**
- * Create a ComponentHandler that takes care of hiding the details of
- * whether a Component is ThreadSafe, Poolable, or SingleThreaded.
- * It falls back to SingleThreaded if not specified.
- *
- * @param factory The factory used to create component
- * @throws Exception if any of the passed in members are invalid.
+ * @avalon.service interface="LoggerManager"
*/
- public AbstractComponentHandler( final ObjectFactory factory )
- throws Exception
- {
- m_factory = factory;
- }
-
- public void contextualize( final Context context )
- throws ContextException
+ public void service( ServiceManager manager )
+ throws ServiceException
{
m_loggerManager =
- (LoggerManager)context.get( ContainerConstants.LOGGER_MANAGER );
+ (LoggerManager)manager.lookup( LoggerManager.ROLE );
+ m_factory =
+ (ObjectFactory)manager.lookup( ObjectFactory.ROLE );
}
public void initialize()
--
To unsubscribe, e-mail: <mailto:avalon-cvs-unsubscribe@;jakarta.apache.org>
For additional commands, e-mail: <mailto:avalon-cvs-help@;jakarta.apache.org>