You are viewing a plain text version of this content. The canonical link for it is here.
Posted to server-dev@james.apache.org by no...@apache.org on 2003/05/21 05:28:31 UTC
cvs commit: jakarta-james/src/java/org/apache/james/mailrepository/filepair RepositoryManager.xinfo RepositoryManager.java
noel 2003/05/20 20:28:31
Modified: src/java/org/apache/james/mailrepository/filepair Tag:
branch_2_1_fcs RepositoryManager.java
Added: src/java/org/apache/james/mailrepository/filepair Tag:
branch_2_1_fcs RepositoryManager.xinfo
Log:
The file part repository classes are Serviceable, not Component. Make RepositoryManager Serviceable, too. This patch only applies to the legacy version of Avalon in the v2 branch, and does not apply to HEAD.
Revision Changes Path
No revision
No revision
1.2.2.3 +25 -20 jakarta-james/src/java/org/apache/james/mailrepository/filepair/RepositoryManager.java
Index: RepositoryManager.java
===================================================================
RCS file: /home/cvs/jakarta-james/src/java/org/apache/james/mailrepository/filepair/RepositoryManager.java,v
retrieving revision 1.2.2.2
retrieving revision 1.2.2.3
diff -u -r1.2.2.2 -r1.2.2.3
--- RepositoryManager.java 8 Mar 2003 21:54:04 -0000 1.2.2.2
+++ RepositoryManager.java 21 May 2003 03:28:31 -0000 1.2.2.3
@@ -81,6 +81,10 @@
import org.apache.avalon.framework.context.Context;
import org.apache.avalon.framework.context.Contextualizable;
import org.apache.avalon.framework.logger.AbstractLogEnabled;
+import org.apache.avalon.framework.service.ServiceException;
+import org.apache.avalon.framework.service.ServiceManager;
+import org.apache.avalon.framework.service.Serviceable;
+import org.apache.avalon.framework.container.ContainerUtil;
/**
* @phoenix:block
@@ -90,7 +94,7 @@
*/
public class RepositoryManager
extends AbstractLogEnabled
- implements Store, Contextualizable, Composable, Configurable
+ implements Store, Contextualizable, Composable, Serviceable, Configurable
{
private static final String REPOSITORY_NAME = "Repository";
private static long id = 0;
@@ -99,6 +103,7 @@
protected HashMap m_models = new HashMap();
protected HashMap m_classes = new HashMap();
protected ComponentManager m_componentManager;
+ protected ServiceManager m_serviceManager;
protected Context m_context;
public void contextualize( final Context context )
@@ -112,6 +117,12 @@
m_componentManager = componentManager;
}
+ public void service( final ServiceManager serviceManager )
+ throws ServiceException
+ {
+ m_serviceManager = serviceManager;
+ }
+
public void configure( final Configuration configuration )
throws ConfigurationException
{
@@ -166,6 +177,14 @@
return false;
}
+ public boolean isSelectable( final Object hint )
+ {
+ if( hint instanceof Configuration )
+ return true;
+ else
+ return false;
+ }
+
public Component select( final Object hint )
throws ComponentException
{
@@ -229,25 +248,11 @@
reply = (Repository)Class.forName( repClass ).newInstance();
setupLogger( reply, "repository" );
- if( reply instanceof Contextualizable )
- {
- ( (Contextualizable)reply ).contextualize( m_context );
- }
-
- if( reply instanceof Composable )
- {
- ( (Composable)reply ).compose( m_componentManager );
- }
-
- if( reply instanceof Configurable )
- {
- ( (Configurable)reply ).configure( repConf );
- }
-
- if( reply instanceof Initializable )
- {
- ( (Initializable)reply ).initialize();
- }
+ ContainerUtil.contextualize(reply, m_context);
+ ContainerUtil.compose(reply, m_componentManager);
+ ContainerUtil.service(reply, m_serviceManager);
+ ContainerUtil.configure(reply, repConf);
+ ContainerUtil.initialize(reply);
m_repositories.put( repID, reply );
m_models.put( repID, model );
No revision
No revision
1.1.2.1 +24 -0 jakarta-james/src/java/org/apache/james/mailrepository/filepair/Attic/RepositoryManager.xinfo
---------------------------------------------------------------------
To unsubscribe, e-mail: james-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: james-dev-help@jakarta.apache.org