continuum-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From eveni...@apache.org
Subject svn commit: r372492 - in /maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum: DefaultContinuum.java utils/PlexusContainerManager.java
Date Thu, 26 Jan 2006 09:31:24 GMT
Author: evenisse
Date: Thu Jan 26 01:31:19 2006
New Revision: 372492

URL: http://svn.apache.org/viewcvs?rev=372492&view=rev
Log:
Add a little utility class. I don't know if we'll use it for now.

Added:
    maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/utils/PlexusContainerManager.java
  (with props)
Modified:
    maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/DefaultContinuum.java

Modified: maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/DefaultContinuum.java
URL: http://svn.apache.org/viewcvs/maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/DefaultContinuum.java?rev=372492&r1=372491&r2=372492&view=diff
==============================================================================
--- maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/DefaultContinuum.java
(original)
+++ maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/DefaultContinuum.java
Thu Jan 26 01:31:19 2006
@@ -47,11 +47,17 @@
 import org.apache.maven.continuum.store.ContinuumObjectNotFoundException;
 import org.apache.maven.continuum.store.ContinuumStore;
 import org.apache.maven.continuum.store.ContinuumStoreException;
+import org.apache.maven.continuum.utils.PlexusContainerManager;
 import org.apache.maven.continuum.utils.ProjectSorter;
 import org.apache.maven.continuum.utils.WorkingDirectoryService;
+import org.codehaus.plexus.PlexusContainer;
+import org.codehaus.plexus.PlexusConstants;
 import org.codehaus.plexus.action.Action;
 import org.codehaus.plexus.action.ActionManager;
 import org.codehaus.plexus.action.ActionNotFoundException;
+import org.codehaus.plexus.context.Context;
+import org.codehaus.plexus.context.ContextException;
+import org.codehaus.plexus.personality.plexus.lifecycle.phase.Contextualizable;
 import org.codehaus.plexus.logging.AbstractLogEnabled;
 import org.codehaus.plexus.personality.plexus.lifecycle.phase.Initializable;
 import org.codehaus.plexus.personality.plexus.lifecycle.phase.InitializationException;
@@ -83,7 +89,7 @@
  */
 public class DefaultContinuum
     extends AbstractLogEnabled
-    implements Continuum, Initializable, Startable
+    implements Continuum, Contextualizable, Initializable, Startable
 {
     /**
      * @plexus.requirement
@@ -1781,6 +1787,14 @@
             
             getLogger().info( " " + project.getId() + ":" + project.getName() + ":" + project.getExecutorId()
);
         }
+    }
+
+    public void contextualize( Context context )
+        throws ContextException
+    {
+        PlexusContainer container = (PlexusContainer) context.get( PlexusConstants.PLEXUS_KEY
);
+
+        PlexusContainerManager.getInstance().setContainer( container );
     }
 
     public void start()

Added: maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/utils/PlexusContainerManager.java
URL: http://svn.apache.org/viewcvs/maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/utils/PlexusContainerManager.java?rev=372492&view=auto
==============================================================================
--- maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/utils/PlexusContainerManager.java
(added)
+++ maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/utils/PlexusContainerManager.java
Thu Jan 26 01:31:19 2006
@@ -0,0 +1,54 @@
+package org.apache.maven.continuum.utils;
+
+/*
+ * Copyright 2005 The Apache Software Foundation.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+import org.codehaus.plexus.PlexusContainer;
+
+/**
+ * @author <a href="mailto:evenisse@apache.org">Emmanuel Venisse</a>
+ * @version $Id$
+ */
+public class PlexusContainerManager
+{
+    private PlexusContainer container;
+
+    private static PlexusContainerManager instance;
+
+    private PlexusContainerManager()
+    {
+    }
+    public static synchronized PlexusContainerManager getInstance()
+    {
+        if ( instance == null )
+        {
+            instance = new PlexusContainerManager();
+        }
+
+        return instance;
+    }
+
+    public PlexusContainer getContainer()
+    {
+        return container;
+    }
+
+    public void setContainer( PlexusContainer container )
+    {
+        this.container = container;
+    }
+}
\ No newline at end of file

Propchange: maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/utils/PlexusContainerManager.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/utils/PlexusContainerManager.java
------------------------------------------------------------------------------
    svn:keywords = "Author Date Id Revision"



Mime
View raw message