cocoon-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cziege...@apache.org
Subject svn commit: rev 55210 - cocoon/branches/BRANCH_2_1_X/src/java/org/apache/cocoon/components
Date Thu, 21 Oct 2004 08:02:36 GMT
Author: cziegeler
Date: Thu Oct 21 01:02:35 2004
New Revision: 55210

Modified:
   cocoon/branches/BRANCH_2_1_X/src/java/org/apache/cocoon/components/LifecycleHelper.java
Log:
Deprecate some methods and add missing (non-deprecated) ones

Modified: cocoon/branches/BRANCH_2_1_X/src/java/org/apache/cocoon/components/LifecycleHelper.java
==============================================================================
--- cocoon/branches/BRANCH_2_1_X/src/java/org/apache/cocoon/components/LifecycleHelper.java
(original)
+++ cocoon/branches/BRANCH_2_1_X/src/java/org/apache/cocoon/components/LifecycleHelper.java
Thu Oct 21 01:02:35 2004
@@ -38,38 +38,35 @@
  * Utility class for setting up Avalon components. Similar to Excalibur's
  * <code>DefaultComponentFactory</code>, but on existing objects.
  * <p>
- * To be moved to Avalon ?
  *
  * @author <a href="mailto:sylvain@apache.org">Sylvain Wallez</a>
- * @version CVS $Id: LifecycleHelper.java,v 1.7 2004/03/05 13:02:45 bdelacretaz Exp $
+ * @version CVS $Id$
  */
-
-// FIXME : need to handle also LogEnabled.
-
 public class LifecycleHelper {
+
     /** The Logger for the component
      */
-    final private Logger m_logger;
+    final private Logger logger;
 
     /** The Context for the component
      */
-    final private Context m_context;
+    final private Context context;
 
     /** The component manager for this component.
      */
-    final private ComponentManager m_componentManager;
+    final private ComponentManager componentManager;
 
     /** The service manager for this component.
      */
-    final private ServiceManager m_serviceManager;
+    final private ServiceManager serviceManager;
 
     /** The configuration for this component.
      */
-    final private Configuration m_configuration;
+    final private Configuration configuration;
 
     /** The RoleManager for child ComponentSelectors
      */
-    final private RoleManager m_roles;
+    final private RoleManager roles;
 
     /**
      * Construct a new <code>LifecycleHelper</code> that can be used repeatedly
to
@@ -85,11 +82,12 @@
      * @param componentManager the component manager to pass to <code>Composable</code>s.
      * @param roles the <code>RoleManager</code> to pass to <code>DefaultComponentSelector</code>s.
      * @param configuration the <code>Configuration</code> object to pass to
new instances.
+     * @deprecated ComponentManager and RoleManager are deprecated
      */
     public LifecycleHelper(final Logger logger,
-                            final Context context,
-                            final ComponentManager componentManager,
-                            final RoleManager roles,
+                           final Context context,
+                           final ComponentManager componentManager,
+                           final RoleManager roles,
                            final Configuration configuration) {
         this(logger, context, null, componentManager, roles, configuration);
     }
@@ -108,11 +106,12 @@
      * @param serviceManager the service manager to pass to <code>Serviceable</code>s.
      * @param roles the <code>RoleManager</code> to pass to <code>DefaultComponentSelector</code>s.
      * @param configuration the <code>Configuration</code> object to pass to
new instances.
+     * @deprecated RoleManager is deprecated
      */
     public LifecycleHelper(final Logger logger,
-                            final Context context,
-                            final ServiceManager serviceManager,
-                            final RoleManager roles,
+                           final Context context,
+                           final ServiceManager serviceManager,
+                           final RoleManager roles,
                            final Configuration configuration) {
         this(logger, context, serviceManager, null, roles, configuration);
     }
@@ -129,22 +128,44 @@
      *        a <code>LogKitManager</code> and the configuration specifies a
logger name.
      * @param context the <code>Context</code> to pass to <code>Contexutalizable</code>s.
      * @param serviceManager the service manager to pass to <code>Serviceable</code>s.
+     * @param configuration the <code>Configuration</code> object to pass to
new instances.
+     */
+    public LifecycleHelper(final Logger logger,
+                           final Context context,
+                           final ServiceManager serviceManager,
+                           final Configuration configuration) {
+        this(logger, context, serviceManager, null, null, configuration);
+    }
+
+    /**
+     * Construct a new <code>LifecycleHelper</code> that can be used repeatedly
to
+     * setup several components. 
+     * <p>
+     * <b>Note</b> : if a parameter is <code>null</code>,
+     * the corresponding method isn't called (e.g. if <code>configuration</code>
is
+     * <code>null</code>, <code>configure()</code> isn't called).
+     *
+     * @param logger the <code>Logger</code> to pass to <code>LogEnabled</code>s,
unless there is
+     *        a <code>LogKitManager</code> and the configuration specifies a
logger name.
+     * @param context the <code>Context</code> to pass to <code>Contexutalizable</code>s.
+     * @param serviceManager the service manager to pass to <code>Serviceable</code>s.
      * @param componentManager the component manager to pass to <code>Composable</code>s.
      * @param roles the <code>RoleManager</code> to pass to <code>DefaultComponentSelector</code>s.
      * @param configuration the <code>Configuration</code> object to pass to
new instances.
+     * @deprecated ComponentManager and RoleManager are deprecated
      */
     public LifecycleHelper(final Logger logger,
-                            final Context context,
-                            final ServiceManager serviceManager,
-                            final ComponentManager componentManager,
-                            final RoleManager roles,
+                           final Context context,
+                           final ServiceManager serviceManager,
+                           final ComponentManager componentManager,
+                           final RoleManager roles,
                            final Configuration configuration) {
-        m_logger = logger;
-        m_context = context;
-        m_serviceManager = serviceManager;
-        m_componentManager = componentManager;
-        m_roles = roles;
-        m_configuration = configuration;
+        this.logger = logger;
+        this.context = context;
+        this.serviceManager = serviceManager;
+        this.componentManager = componentManager;
+        this.roles = roles;
+        this.configuration = configuration;
     }
 
 
@@ -173,24 +194,25 @@
     throws Exception {
         return setupComponent(
             component,
-            m_logger,
-            m_context,
-            m_serviceManager,
-            m_componentManager,
-            m_roles,
-            m_configuration,
+            this.logger,
+            this.context,
+            this.serviceManager,
+            this.componentManager,
+            this.roles,
+            this.configuration,
             initializeAndStart);
     }
 
     /**
      * Static equivalent to {@link #setupComponent(Object)}, to be used when there's only
one
      * component to setup.
+     * @deprecated ComponentManager and RoleManager are deprecated
      */
     public static Object setupComponent(final Object component,
-                                         final Logger logger,
-                                         final Context context,
-                                         final ComponentManager componentManager,
-                                         final RoleManager roles,
+                                        final Logger logger,
+                                        final Context context,
+                                        final ComponentManager componentManager,
+                                        final RoleManager roles,
                                         final Configuration configuration)
     throws Exception {
         return setupComponent(
@@ -205,12 +227,13 @@
 
     /**
      * Alternative setupComponent method that takes a ServiceManager instead of a ComponentManger.
+     * @deprecated RoleManager is deprecated
      */
     public static Object setupComponent(final Object component,
-                                         final Logger logger,
-                                         final Context context,
-                                         final ServiceManager serviceManager,
-                                         final RoleManager roles,
+                                        final Logger logger,
+                                        final Context context,
+                                        final ServiceManager serviceManager,
+                                        final RoleManager roles,
                                         final Configuration configuration)
     throws Exception {
         return setupComponent(
@@ -224,16 +247,36 @@
     }
 
     /**
+     * Alternative setupComponent method that takes a ServiceManager instead of a ComponentManger.
+     */
+    public static Object setupComponent(final Object component,
+                                        final Logger logger,
+                                        final Context context,
+                                        final ServiceManager serviceManager,
+                                        final Configuration configuration)
+    throws Exception {
+        return setupComponent(
+            component,
+            logger,
+            context,
+            serviceManager,
+            null,
+            configuration,
+            true);
+    }
+
+    /**
      * Static equivalent to {@link #setupComponent(Object, boolean)}, to be used when there's
only one
      * component to setup.
+     * @deprecated ComponentManager and RoleManager are deprecated
      */
     public static Object setupComponent(final Object component,
-                                         final Logger logger,
-                                         final Context context,
-                                         final ComponentManager componentManager,
-                                         final RoleManager roles,
+                                        final Logger logger,
+                                        final Context context,
+                                        final ComponentManager componentManager,
+                                        final RoleManager roles,
                                         final Configuration configuration,
-                                         final boolean initializeAndStart)
+                                        final boolean initializeAndStart)
     throws Exception {
         return setupComponent(
             component,
@@ -248,14 +291,15 @@
 
     /**
      * Alternative setupComponent method that takes a ServiceManager instead of a ComponentManger.
+     * @deprecated RoleManager is deprecated
      */
     public static Object setupComponent(final Object component,
-                                         final Logger logger,
-                                         final Context context,
-                                         final ServiceManager serviceManager,
-                                         final RoleManager roles,
+                                        final Logger logger,
+                                        final Context context,
+                                        final ServiceManager serviceManager,
+                                        final RoleManager roles,
                                         final Configuration configuration,
-                                         final boolean initializeAndStart)
+                                        final boolean initializeAndStart)
     throws Exception {
         return setupComponent(
             component,
@@ -269,8 +313,30 @@
     }
 
     /**
+     * Alternative setupComponent method that takes a ServiceManager instead of a ComponentManger.
+     */
+    public static Object setupComponent(final Object component,
+                                        final Logger logger,
+                                        final Context context,
+                                        final ServiceManager serviceManager,
+                                        final Configuration configuration,
+                                        final boolean initializeAndStart)
+    throws Exception {
+        return setupComponent(
+            component,
+            logger,
+            context,
+            serviceManager,
+            null,
+            null,
+            configuration,
+            initializeAndStart);
+    }
+
+    /**
      * Static equivalent to {@link #setupComponent(Object, boolean)}, to be used when there's
only one
      * component to setup.
+     * @deprecated ComponentManager and RoleManager are deprecated
      */
     public static Object setupComponent(final Object component,
                                  final Logger logger,

Mime
View raw message