continuum-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From eveni...@apache.org
Subject svn commit: r725818 [2/2] - in /continuum/branches/continuum-osgi-prototype: ./ continuum-app/ continuum-app/src/ continuum-app/src/main/ continuum-app/src/main/assembly/ continuum-app/src/main/resources/ continuum-build-plugin/ continuum-build-plugin/...
Date Thu, 11 Dec 2008 21:21:09 GMT
Added: continuum/branches/continuum-osgi-prototype/continuum-plugin-api/src/main/java/org/apache/continuum/plugin/api/PreUpdateSourcesPlugin.java
URL: http://svn.apache.org/viewvc/continuum/branches/continuum-osgi-prototype/continuum-plugin-api/src/main/java/org/apache/continuum/plugin/api/PreUpdateSourcesPlugin.java?rev=725818&view=auto
==============================================================================
--- continuum/branches/continuum-osgi-prototype/continuum-plugin-api/src/main/java/org/apache/continuum/plugin/api/PreUpdateSourcesPlugin.java
(added)
+++ continuum/branches/continuum-osgi-prototype/continuum-plugin-api/src/main/java/org/apache/continuum/plugin/api/PreUpdateSourcesPlugin.java
Thu Dec 11 13:21:06 2008
@@ -0,0 +1,13 @@
+package org.apache.continuum.plugin.api;
+
+import org.apache.continuum.plugin.api.context.ProjectInformation;
+
+/**
+ * @author <a href="mailto:evenisse@apache.org">Emmanuel Venisse</a>
+ * @version $Id$
+ */
+public interface PreUpdateSourcesPlugin
+    extends Plugin
+{
+    void execute( ProjectInformation projectInformation );
+}

Propchange: continuum/branches/continuum-osgi-prototype/continuum-plugin-api/src/main/java/org/apache/continuum/plugin/api/PreUpdateSourcesPlugin.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: continuum/branches/continuum-osgi-prototype/continuum-plugin-api/src/main/java/org/apache/continuum/plugin/api/PreUpdateSourcesPlugin.java
------------------------------------------------------------------------------
    svn:keywords = "Author Date Id Revision"

Added: continuum/branches/continuum-osgi-prototype/continuum-plugin-api/src/main/java/org/apache/continuum/plugin/api/SendNotificationPlugin.java
URL: http://svn.apache.org/viewvc/continuum/branches/continuum-osgi-prototype/continuum-plugin-api/src/main/java/org/apache/continuum/plugin/api/SendNotificationPlugin.java?rev=725818&view=auto
==============================================================================
--- continuum/branches/continuum-osgi-prototype/continuum-plugin-api/src/main/java/org/apache/continuum/plugin/api/SendNotificationPlugin.java
(added)
+++ continuum/branches/continuum-osgi-prototype/continuum-plugin-api/src/main/java/org/apache/continuum/plugin/api/SendNotificationPlugin.java
Thu Dec 11 13:21:06 2008
@@ -0,0 +1,16 @@
+package org.apache.continuum.plugin.api;
+
+import org.apache.continuum.model.BuildResult;
+import org.apache.continuum.model.ScmResult;
+import org.apache.continuum.plugin.api.context.ProjectInformation;
+
+/**
+ * @author <a href="mailto:evenisse@apache.org">Emmanuel Venisse</a>
+ * @version $Id$
+ */
+public interface SendNotificationPlugin
+    extends Plugin
+{
+    // (with a new parameter List<BuildReport> buildReports ?)
+    void execute( ProjectInformation projectInformation, ScmResult scmResult, BuildResult
buildResult );
+}

Propchange: continuum/branches/continuum-osgi-prototype/continuum-plugin-api/src/main/java/org/apache/continuum/plugin/api/SendNotificationPlugin.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: continuum/branches/continuum-osgi-prototype/continuum-plugin-api/src/main/java/org/apache/continuum/plugin/api/SendNotificationPlugin.java
------------------------------------------------------------------------------
    svn:keywords = "Author Date Id Revision"

Added: continuum/branches/continuum-osgi-prototype/continuum-plugin-api/src/main/java/org/apache/continuum/plugin/api/UpdateSourcesPlugin.java
URL: http://svn.apache.org/viewvc/continuum/branches/continuum-osgi-prototype/continuum-plugin-api/src/main/java/org/apache/continuum/plugin/api/UpdateSourcesPlugin.java?rev=725818&view=auto
==============================================================================
--- continuum/branches/continuum-osgi-prototype/continuum-plugin-api/src/main/java/org/apache/continuum/plugin/api/UpdateSourcesPlugin.java
(added)
+++ continuum/branches/continuum-osgi-prototype/continuum-plugin-api/src/main/java/org/apache/continuum/plugin/api/UpdateSourcesPlugin.java
Thu Dec 11 13:21:06 2008
@@ -0,0 +1,14 @@
+package org.apache.continuum.plugin.api;
+
+import org.apache.continuum.model.ScmResult;
+import org.apache.continuum.plugin.api.context.ProjectInformation;
+
+/**
+ * @author <a href="mailto:evenisse@apache.org">Emmanuel Venisse</a>
+ * @version $Id$
+ */
+public interface UpdateSourcesPlugin
+    extends Plugin
+{
+    void execute( ProjectInformation projectInformation, ScmResult scmResult );
+}

Propchange: continuum/branches/continuum-osgi-prototype/continuum-plugin-api/src/main/java/org/apache/continuum/plugin/api/UpdateSourcesPlugin.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: continuum/branches/continuum-osgi-prototype/continuum-plugin-api/src/main/java/org/apache/continuum/plugin/api/UpdateSourcesPlugin.java
------------------------------------------------------------------------------
    svn:keywords = "Author Date Id Revision"

Added: continuum/branches/continuum-osgi-prototype/continuum-plugin-api/src/main/java/org/apache/continuum/plugin/api/builder/Builder.java
URL: http://svn.apache.org/viewvc/continuum/branches/continuum-osgi-prototype/continuum-plugin-api/src/main/java/org/apache/continuum/plugin/api/builder/Builder.java?rev=725818&view=auto
==============================================================================
--- continuum/branches/continuum-osgi-prototype/continuum-plugin-api/src/main/java/org/apache/continuum/plugin/api/builder/Builder.java
(added)
+++ continuum/branches/continuum-osgi-prototype/continuum-plugin-api/src/main/java/org/apache/continuum/plugin/api/builder/Builder.java
Thu Dec 11 13:21:06 2008
@@ -0,0 +1,11 @@
+package org.apache.continuum.plugin.api.builder;
+
+/**
+ * @author <a href="mailto:evenisse@apache.org">Emmanuel Venisse</a>
+ * @version $Id$
+ */
+public interface Builder
+{
+    void execute( int projectId, int buildDef );
+}
+

Propchange: continuum/branches/continuum-osgi-prototype/continuum-plugin-api/src/main/java/org/apache/continuum/plugin/api/builder/Builder.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: continuum/branches/continuum-osgi-prototype/continuum-plugin-api/src/main/java/org/apache/continuum/plugin/api/builder/Builder.java
------------------------------------------------------------------------------
    svn:keywords = "Author Date Id Revision"

Added: continuum/branches/continuum-osgi-prototype/continuum-plugin-api/src/main/java/org/apache/continuum/plugin/api/builder/Phase.java
URL: http://svn.apache.org/viewvc/continuum/branches/continuum-osgi-prototype/continuum-plugin-api/src/main/java/org/apache/continuum/plugin/api/builder/Phase.java?rev=725818&view=auto
==============================================================================
--- continuum/branches/continuum-osgi-prototype/continuum-plugin-api/src/main/java/org/apache/continuum/plugin/api/builder/Phase.java
(added)
+++ continuum/branches/continuum-osgi-prototype/continuum-plugin-api/src/main/java/org/apache/continuum/plugin/api/builder/Phase.java
Thu Dec 11 13:21:06 2008
@@ -0,0 +1,58 @@
+package org.apache.continuum.plugin.api.builder;
+
+/**
+ * @author <a href="mailto:evenisse@apache.org">Emmanuel Venisse</a>
+ * @version $Id$
+ */
+public class Phase
+{
+    public static final Phase PRE_UPDATE_SOURCES = new Phase( "pre-update-sources" );
+
+    public static final Phase UPDATE_SOURCES = new Phase( "update-sources" );
+
+    public static final Phase POST_UPDATE_SOURCES = new Phase( "post-update-sources" );
+
+    public static final Phase PRE_BUILD_PROJECT = new Phase( "pre-build-project" );
+
+    public static final Phase BUILD_PROJECT = new Phase( "build-project" );
+
+    public static final Phase POST_BUILD_PROJECT = new Phase( "post-build-project" );
+
+    public static final Phase PRE_DEPLOY_ARTIFACTS = new Phase( "pre-deploy-artifacts" );
+
+    public static final Phase DEPLOY_ARTIFACTS = new Phase( "deploy-artifacts" );
+
+    public static final Phase POST_DEPLOY_ARTIFACTS = new Phase( "post-deploy-artifacts"
);
+
+    public static final Phase PRE_BUILD_REPORTS = new Phase( "pre-build-reports" );
+
+    public static final Phase BUILD_REPORTS = new Phase( "build-reports" );
+
+    public static final Phase POST_BUILD_REPORTS = new Phase( "post-build-reports" );
+
+    public static final Phase PRE_SEND_NOTIFICATIONS = new Phase( "pre-send-notifications"
);
+
+    public static final Phase SEND_NOTIFICATIONS = new Phase( "send-notifications" );
+
+    public static final Phase POST_SEND_NOTIFICATIONS = new Phase( "post-send-notifications"
);
+
+    public static final Phase END_BUILD = new Phase( "end-build" );
+
+    private String name;
+
+    private Phase( String name )
+    {
+        this.name = name;
+    }
+
+    public String getName()
+    {
+        return name;
+    }
+
+    @Override
+    public String toString()
+    {
+        return getName();
+    }
+}

Propchange: continuum/branches/continuum-osgi-prototype/continuum-plugin-api/src/main/java/org/apache/continuum/plugin/api/builder/Phase.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: continuum/branches/continuum-osgi-prototype/continuum-plugin-api/src/main/java/org/apache/continuum/plugin/api/builder/Phase.java
------------------------------------------------------------------------------
    svn:keywords = "Author Date Id Revision"

Added: continuum/branches/continuum-osgi-prototype/continuum-plugin-api/src/main/java/org/apache/continuum/plugin/api/context/ProjectInformation.java
URL: http://svn.apache.org/viewvc/continuum/branches/continuum-osgi-prototype/continuum-plugin-api/src/main/java/org/apache/continuum/plugin/api/context/ProjectInformation.java?rev=725818&view=auto
==============================================================================
--- continuum/branches/continuum-osgi-prototype/continuum-plugin-api/src/main/java/org/apache/continuum/plugin/api/context/ProjectInformation.java
(added)
+++ continuum/branches/continuum-osgi-prototype/continuum-plugin-api/src/main/java/org/apache/continuum/plugin/api/context/ProjectInformation.java
Thu Dec 11 13:21:06 2008
@@ -0,0 +1,73 @@
+package org.apache.continuum.plugin.api.context;
+
+import org.apache.continuum.model.ProjectGroup;
+import org.apache.continuum.model.BuildDefinitionTemplate;
+
+/**
+ * @author <a href="mailto:evenisse@apache.org">Emmanuel Venisse</a>
+ * @version $Id$
+ */
+public class ProjectInformation
+{
+    // defined constants m2,m1,ant,shell etc...
+    private ProjectType type;
+
+    private ProjectGroup projectGroup;
+
+    private BuildDefinitionTemplate buildDefTemplate;
+
+    // for non maven projects
+    private String name;
+
+    private String version;
+
+    public ProjectType getType()
+    {
+        return type;
+    }
+
+    public void setType( ProjectType type )
+    {
+        this.type = type;
+    }
+
+    public ProjectGroup getProjectGroup()
+    {
+        return projectGroup;
+    }
+
+    public void setProjectGroup( ProjectGroup projectGroup )
+    {
+        this.projectGroup = projectGroup;
+    }
+
+    public BuildDefinitionTemplate getBuildDefTemplate()
+    {
+        return buildDefTemplate;
+    }
+
+    public void setBuildDefTemplate( BuildDefinitionTemplate buildDefTemplate )
+    {
+        this.buildDefTemplate = buildDefTemplate;
+    }
+
+    public String getName()
+    {
+        return name;
+    }
+
+    public void setName( String name )
+    {
+        this.name = name;
+    }
+
+    public String getVersion()
+    {
+        return version;
+    }
+
+    public void setVersion( String version )
+    {
+        this.version = version;
+    }
+}

Propchange: continuum/branches/continuum-osgi-prototype/continuum-plugin-api/src/main/java/org/apache/continuum/plugin/api/context/ProjectInformation.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: continuum/branches/continuum-osgi-prototype/continuum-plugin-api/src/main/java/org/apache/continuum/plugin/api/context/ProjectInformation.java
------------------------------------------------------------------------------
    svn:keywords = "Author Date Id Revision"

Added: continuum/branches/continuum-osgi-prototype/continuum-plugin-api/src/main/java/org/apache/continuum/plugin/api/context/ProjectType.java
URL: http://svn.apache.org/viewvc/continuum/branches/continuum-osgi-prototype/continuum-plugin-api/src/main/java/org/apache/continuum/plugin/api/context/ProjectType.java?rev=725818&view=auto
==============================================================================
--- continuum/branches/continuum-osgi-prototype/continuum-plugin-api/src/main/java/org/apache/continuum/plugin/api/context/ProjectType.java
(added)
+++ continuum/branches/continuum-osgi-prototype/continuum-plugin-api/src/main/java/org/apache/continuum/plugin/api/context/ProjectType.java
Thu Dec 11 13:21:06 2008
@@ -0,0 +1,28 @@
+package org.apache.continuum.plugin.api.context;
+
+/**
+ * @author <a href="mailto:evenisse@apache.org">Emmanuel Venisse</a>
+ * @version $Id$
+ */
+public class ProjectType
+{
+    public static final ProjectType ANT = new ProjectType( "ant" );
+
+    public static final ProjectType MAVEN_1 = new ProjectType( "maven1" );
+
+    public static final ProjectType MAVEN_2 = new ProjectType( "maven2" );
+
+    public static final ProjectType SHELL = new ProjectType( "shell" );
+
+    private String name;
+
+    private ProjectType( String name )
+    {
+        this.name = name;
+    }
+
+    public String getName()
+    {
+        return name;
+    }
+}

Propchange: continuum/branches/continuum-osgi-prototype/continuum-plugin-api/src/main/java/org/apache/continuum/plugin/api/context/ProjectType.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: continuum/branches/continuum-osgi-prototype/continuum-plugin-api/src/main/java/org/apache/continuum/plugin/api/context/ProjectType.java
------------------------------------------------------------------------------
    svn:keywords = "Author Date Id Revision"

Added: continuum/branches/continuum-osgi-prototype/continuum-plugin-api/src/main/java/org/apache/continuum/plugin/api/context/ScmInformation.java
URL: http://svn.apache.org/viewvc/continuum/branches/continuum-osgi-prototype/continuum-plugin-api/src/main/java/org/apache/continuum/plugin/api/context/ScmInformation.java?rev=725818&view=auto
==============================================================================
--- continuum/branches/continuum-osgi-prototype/continuum-plugin-api/src/main/java/org/apache/continuum/plugin/api/context/ScmInformation.java
(added)
+++ continuum/branches/continuum-osgi-prototype/continuum-plugin-api/src/main/java/org/apache/continuum/plugin/api/context/ScmInformation.java
Thu Dec 11 13:21:06 2008
@@ -0,0 +1,44 @@
+package org.apache.continuum.plugin.api.context;
+
+/**
+ * @author <a href="mailto:evenisse@apache.org">Emmanuel Venisse</a>
+ * @version $Id$
+ */
+public class ScmInformation
+{
+    private String scmUrl;
+
+    private String scmUsername;
+
+    private String scmPassword;
+
+    public String getScmUrl()
+    {
+        return scmUrl;
+    }
+
+    public void setScmUrl( String scmUrl )
+    {
+        this.scmUrl = scmUrl;
+    }
+
+    public String getScmUsername()
+    {
+        return scmUsername;
+    }
+
+    public void setScmUsername( String scmUsername )
+    {
+        this.scmUsername = scmUsername;
+    }
+
+    public String getScmPassword()
+    {
+        return scmPassword;
+    }
+
+    public void setScmPassword( String scmPassword )
+    {
+        this.scmPassword = scmPassword;
+    }
+}

Propchange: continuum/branches/continuum-osgi-prototype/continuum-plugin-api/src/main/java/org/apache/continuum/plugin/api/context/ScmInformation.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: continuum/branches/continuum-osgi-prototype/continuum-plugin-api/src/main/java/org/apache/continuum/plugin/api/context/ScmInformation.java
------------------------------------------------------------------------------
    svn:keywords = "Author Date Id Revision"

Added: continuum/branches/continuum-osgi-prototype/continuum-plugin-manager/pom.xml
URL: http://svn.apache.org/viewvc/continuum/branches/continuum-osgi-prototype/continuum-plugin-manager/pom.xml?rev=725818&view=auto
==============================================================================
--- continuum/branches/continuum-osgi-prototype/continuum-plugin-manager/pom.xml (added)
+++ continuum/branches/continuum-osgi-prototype/continuum-plugin-manager/pom.xml Thu Dec 11
13:21:06 2008
@@ -0,0 +1,37 @@
+<project>
+  <modelVersion>4.0.0</modelVersion>
+  <parent>
+    <groupId>org.apache.continuum</groupId>
+    <artifactId>continuum-plugins</artifactId>
+    <version>1.4-SNAPSHOT</version>
+  </parent>
+  <artifactId>continuum-plugin-manager</artifactId>
+
+  <dependencies>
+    <dependency>
+      <groupId>org.apache.continuum</groupId>
+      <artifactId>continuum-plugin-api</artifactId>
+      <version>1.4-SNAPSHOT</version>
+    </dependency>
+    <dependency>
+      <groupId>org.apache.felix</groupId>
+      <artifactId>org.apache.felix.main</artifactId>
+      <version>1.2.2</version>
+    </dependency>
+  </dependencies>
+
+  <build>
+    <plugins>
+      <plugin>
+        <groupId>org.apache.maven.plugins</groupId>
+        <artifactId>maven-compiler-plugin</artifactId>
+        <version>2.0.2</version>
+        <configuration>
+          <source>1.5</source>
+          <target>1.5</target>
+        </configuration>
+      </plugin>
+    </plugins>
+  </build>
+</project>
+

Propchange: continuum/branches/continuum-osgi-prototype/continuum-plugin-manager/pom.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: continuum/branches/continuum-osgi-prototype/continuum-plugin-manager/pom.xml
------------------------------------------------------------------------------
    svn:keywords = "Author Date Id Revision"

Added: continuum/branches/continuum-osgi-prototype/continuum-plugin-manager/src/main/java/org/apache/continuum/plugin/manager/BuilderTracker.java
URL: http://svn.apache.org/viewvc/continuum/branches/continuum-osgi-prototype/continuum-plugin-manager/src/main/java/org/apache/continuum/plugin/manager/BuilderTracker.java?rev=725818&view=auto
==============================================================================
--- continuum/branches/continuum-osgi-prototype/continuum-plugin-manager/src/main/java/org/apache/continuum/plugin/manager/BuilderTracker.java
(added)
+++ continuum/branches/continuum-osgi-prototype/continuum-plugin-manager/src/main/java/org/apache/continuum/plugin/manager/BuilderTracker.java
Thu Dec 11 13:21:06 2008
@@ -0,0 +1,18 @@
+package org.apache.continuum.plugin.manager;
+
+import org.apache.continuum.plugin.api.builder.Builder;
+import org.osgi.framework.BundleContext;
+import org.osgi.util.tracker.ServiceTracker;
+
+/**
+ * @author <a href="mailto:evenisse@apache.org">Emmanuel Venisse</a>
+ * @version $Id$
+ */
+public class BuilderTracker
+    extends ServiceTracker
+{
+    public BuilderTracker( BundleContext bundleContext )
+    {
+        super( bundleContext, Builder.class.getName(), null );
+    }
+}

Propchange: continuum/branches/continuum-osgi-prototype/continuum-plugin-manager/src/main/java/org/apache/continuum/plugin/manager/BuilderTracker.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: continuum/branches/continuum-osgi-prototype/continuum-plugin-manager/src/main/java/org/apache/continuum/plugin/manager/BuilderTracker.java
------------------------------------------------------------------------------
    svn:keywords = "Author Date Id Revision"

Added: continuum/branches/continuum-osgi-prototype/continuum-plugin-manager/src/main/java/org/apache/continuum/plugin/manager/HostActivator.java
URL: http://svn.apache.org/viewvc/continuum/branches/continuum-osgi-prototype/continuum-plugin-manager/src/main/java/org/apache/continuum/plugin/manager/HostActivator.java?rev=725818&view=auto
==============================================================================
--- continuum/branches/continuum-osgi-prototype/continuum-plugin-manager/src/main/java/org/apache/continuum/plugin/manager/HostActivator.java
(added)
+++ continuum/branches/continuum-osgi-prototype/continuum-plugin-manager/src/main/java/org/apache/continuum/plugin/manager/HostActivator.java
Thu Dec 11 13:21:06 2008
@@ -0,0 +1,48 @@
+package org.apache.continuum.plugin.manager;
+
+import org.apache.continuum.plugin.api.builder.Builder;
+import org.osgi.framework.Bundle;
+import org.osgi.framework.BundleActivator;
+import org.osgi.framework.BundleContext;
+
+/**
+ * @author <a href="mailto:evenisse@apache.org">Emmanuel Venisse</a>
+ * @version $Id$
+ */
+public class HostActivator
+    implements BundleActivator
+{
+    private BundleContext context = null;
+
+    private BuilderTracker builderTracker;
+
+    public void start( BundleContext bundleContext )
+        throws Exception
+    {
+        context = bundleContext;
+        builderTracker = new BuilderTracker( context );
+        builderTracker.open();
+    }
+
+    public void stop( BundleContext bundleContext )
+        throws Exception
+    {
+        builderTracker.close();
+        context = null;
+    }
+
+    public Bundle[] getBundles()
+    {
+        Bundle[] bundles = null;
+        if ( context != null )
+        {
+            bundles = context.getBundles();
+        }
+        return bundles;
+    }
+
+    public Builder getBuilder()
+    {
+        return (Builder) builderTracker.getService();
+    }
+}

Propchange: continuum/branches/continuum-osgi-prototype/continuum-plugin-manager/src/main/java/org/apache/continuum/plugin/manager/HostActivator.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: continuum/branches/continuum-osgi-prototype/continuum-plugin-manager/src/main/java/org/apache/continuum/plugin/manager/HostActivator.java
------------------------------------------------------------------------------
    svn:keywords = "Author Date Id Revision"

Added: continuum/branches/continuum-osgi-prototype/continuum-plugin-manager/src/main/java/org/apache/continuum/plugin/manager/PluginManager.java
URL: http://svn.apache.org/viewvc/continuum/branches/continuum-osgi-prototype/continuum-plugin-manager/src/main/java/org/apache/continuum/plugin/manager/PluginManager.java?rev=725818&view=auto
==============================================================================
--- continuum/branches/continuum-osgi-prototype/continuum-plugin-manager/src/main/java/org/apache/continuum/plugin/manager/PluginManager.java
(added)
+++ continuum/branches/continuum-osgi-prototype/continuum-plugin-manager/src/main/java/org/apache/continuum/plugin/manager/PluginManager.java
Thu Dec 11 13:21:06 2008
@@ -0,0 +1,138 @@
+package org.apache.continuum.plugin.manager;
+
+import org.apache.continuum.plugin.api.builder.Builder;
+import org.apache.felix.framework.Felix;
+import org.apache.felix.framework.cache.BundleCache;
+import org.apache.felix.framework.util.FelixConstants;
+import org.apache.felix.framework.util.StringMap;
+import org.apache.felix.main.AutoActivator;
+import org.osgi.framework.BundleActivator;
+import org.osgi.framework.BundleException;
+import org.osgi.framework.Constants;
+
+import java.io.File;
+import java.io.IOException;
+import java.io.InputStream;
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Map;
+import java.util.Properties;
+
+/**
+ * @author <a href="mailto:evenisse@apache.org">Emmanuel Venisse</a>
+ * @version $Id$
+ */
+public class PluginManager
+{
+    private Felix felix = null;
+
+    private HostActivator activator = null;
+
+    public PluginManager()
+    {
+        Runtime.getRuntime().addShutdownHook( new Thread()
+        {
+            public void run()
+            {
+                try
+                {
+                    System.out.println("Stopping the application...");
+                    if ( felix != null )
+                    {
+                        felix.stop();
+                    }
+                }
+                catch ( BundleException e )
+                {
+                    e.printStackTrace();
+                }
+            }
+        } );
+
+        Properties props = new Properties();
+        InputStream is = getClass().getClassLoader().getResourceAsStream( "osgi-manager.properties"
);
+        try
+        {
+            props.load( is );
+        }
+        catch ( IOException ioe )
+        {
+            ioe.printStackTrace();
+        }
+
+        //noinspection unchecked
+        Map<String, String> configMap = new StringMap( false );
+        configMap.put( FelixConstants.EMBEDDED_EXECUTION_PROP, "true" );
+        configMap.put( Constants.FRAMEWORK_SYSTEMPACKAGES, props.getProperty( "osgi.system-packages"
) );
+
+        StringBuilder sb = new StringBuilder();
+        File bundleSystemDir = new File( "system" );
+        if ( !bundleSystemDir.exists() )
+        {
+            bundleSystemDir.mkdirs();
+        }
+        for ( File pluginFile : bundleSystemDir.listFiles() )
+        {
+            if ( pluginFile.isFile() )
+            {
+                if ( sb.length() > 0 )
+                {
+                    sb.append( " " );
+                }
+                sb.append( pluginFile.toURI() );
+            }
+        }
+        File bundlePluginsDir = new File( "plugins" );
+        if ( !bundlePluginsDir.exists() )
+        {
+            bundlePluginsDir.mkdirs();
+        }
+        for ( File pluginFile : bundlePluginsDir.listFiles() )
+        {
+            if ( pluginFile.isFile() )
+            {
+                if ( sb.length() > 0 )
+                {
+                    sb.append( " " );
+                }
+                sb.append( pluginFile.toURI() );
+            }
+        }
+
+        System.out.println( "Autostart path : " + sb.toString() );
+        String autostart = props.getProperty( "osgi.autostart.1" ) + " " + sb.toString();
+        configMap.put( AutoActivator.AUTO_START_PROP + ".1", autostart );
+        configMap.put( BundleCache.CACHE_PROFILE_DIR_PROP, props.getProperty( "osgi.cache-directory"
) );
+
+        List<BundleActivator> activators = new ArrayList<BundleActivator>();
+        activators.add( new AutoActivator( configMap ) );
+        activator = new HostActivator();
+        activators.add( activator );
+        felix = new Felix( configMap, activators );
+        try
+        {
+            felix.start();
+        }
+        catch ( BundleException e )
+        {
+            System.err.println( "Could not create framework: " + e );
+            e.printStackTrace();
+            System.exit( -1 );
+        }
+    }
+
+    public Builder getBuilder()
+    {
+        return activator.getBuilder();
+    }
+
+    public static void main( String[] args )
+        throws Exception
+    {
+        PluginManager manager = new PluginManager();
+
+        manager.getBuilder().execute( 1, 1 );
+        //Thread.sleep( 10000 );
+        //felix.stop();
+    }
+}

Propchange: continuum/branches/continuum-osgi-prototype/continuum-plugin-manager/src/main/java/org/apache/continuum/plugin/manager/PluginManager.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: continuum/branches/continuum-osgi-prototype/continuum-plugin-manager/src/main/java/org/apache/continuum/plugin/manager/PluginManager.java
------------------------------------------------------------------------------
    svn:keywords = "Author Date Id Revision"

Added: continuum/branches/continuum-osgi-prototype/continuum-plugin-manager/src/main/resources/osgi-manager.properties
URL: http://svn.apache.org/viewvc/continuum/branches/continuum-osgi-prototype/continuum-plugin-manager/src/main/resources/osgi-manager.properties?rev=725818&view=auto
==============================================================================
--- continuum/branches/continuum-osgi-prototype/continuum-plugin-manager/src/main/resources/osgi-manager.properties
(added)
+++ continuum/branches/continuum-osgi-prototype/continuum-plugin-manager/src/main/resources/osgi-manager.properties
Thu Dec 11 13:21:06 2008
@@ -0,0 +1,33 @@
+osgi.system-packages=org.xml.sax,javax.security.cert,javax.xml.parsers,org.xml.sax.helpers,javax.net.ssl;
version=1.3.0,\
+  org.osgi.framework; version=1.4.0, \
+  org.osgi.service.packageadmin; version=1.2.0, \
+  org.osgi.service.startlevel; version=1.2.0, \
+  org.osgi.service.url; version=1.0.0, \
+  org.apache.continuum.plugin.api.builder; version=1.4.0.SNAPSHOT
+
+osgi.cache-directory=cache
+
+#osgi.autostart.1=file:///${bundle.root}/training-service/1.0-SNAPSHOT/training-service-1.0-SNAPSHOT.jar
\
+#  file:///${bundle.root}/http-servlets/1.0-SNAPSHOT/http-servlets-1.0-SNAPSHOT.jar \
+#  file:///${bundle.root}/service-listener/1.0-SNAPSHOT/service-listener-1.0-SNAPSHOT.jar
\
+#  file:///${jetty.root}/jetty/6.1.7/jetty-6.1.7.jar \
+#  file:///${jetty.root}/jetty-util/6.1.7/jetty-util-6.1.7.jar \
+#  file:///${jetty.root}/servlet-api-2.5/6.1.7/servlet-api-2.5-6.1.7.jar \
+#  file:bundle/org.osgi.compendium-1.0.0.jar \
+#  file:bundle/slf4j-api-1.4.3.jar \
+#  file:bundle/slf4j-simple-1.4.3.jar \
+#  file:bundle/org.apache.felix.http.jetty-0.9.0-GRIDSHORE.jar \
+#  file:bundle/org.apache.felix.shell-1.0.0.jar \
+#  file:bundle/org.apache.felix.shell.tui-1.0.0.jar
+
+#osgi.autostart.1=file:///Users/evenisse/.m2/repository/org/apache/felix/org.osgi.compendium/1.2.0/org.osgi.compendium-1.2.0.jar
\
+#  file:///Users/evenisse/.m2/repository/org/slf4j/slf4j-api/1.4.3/slf4j-api-1.4.3.jar \
+#  file:///Users/evenisse/.m2/repository/org/slf4j/slf4j-simple/1.4.3/slf4j-simple-1.4.3.jar
\
+#  file:///Users/evenisse/.m2/repository/org/apache/felix/org.apache.felix.shell/1.0.2/org.apache.felix.shell-1.0.2.jar
\
+#  file:///Users/evenisse/.m2/repository/org/apache/felix/org.apache.felix.shell.tui/1.0.2/org.apache.felix.shell.tui-1.0.2.jar
\
+#  file:../continuum-plugin-api/target/continuum-plugin-api-1.4-SNAPSHOT.jar \
+#  file:../continuum-model/target/continuum-model-1.4-SNAPSHOT.jar \
+#  file:../continuum-builder/target/continuum-builder-1.4-SNAPSHOT.jar \
+#  file:../continuum-build-plugin/target/continuum-build-plugin-1.4-SNAPSHOT.jar \
+#  file:../continuum-commandline-notification-plugin/target/continuum-commandline-notification-plugin-1.4-SNAPSHOT.jar
+osgi.autostart.1=

Propchange: continuum/branches/continuum-osgi-prototype/continuum-plugin-manager/src/main/resources/osgi-manager.properties
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: continuum/branches/continuum-osgi-prototype/continuum-plugin-manager/src/main/resources/osgi-manager.properties
------------------------------------------------------------------------------
    svn:keywords = "Author Date Id Revision"

Added: continuum/branches/continuum-osgi-prototype/pom.xml
URL: http://svn.apache.org/viewvc/continuum/branches/continuum-osgi-prototype/pom.xml?rev=725818&view=auto
==============================================================================
--- continuum/branches/continuum-osgi-prototype/pom.xml (added)
+++ continuum/branches/continuum-osgi-prototype/pom.xml Thu Dec 11 13:21:06 2008
@@ -0,0 +1,17 @@
+<project>
+  <modelVersion>4.0.0</modelVersion>
+  <groupId>org.apache.continuum</groupId>
+  <artifactId>continuum-plugins</artifactId>
+  <version>1.4-SNAPSHOT</version>
+  <packaging>pom</packaging>
+
+  <modules>
+    <module>continuum-app</module>
+    <module>continuum-builder</module>
+    <module>continuum-model</module>
+    <module>continuum-plugin-api</module>
+    <module>continuum-plugin-manager</module>
+    <module>continuum-build-plugin</module>
+    <module>continuum-commandline-notification-plugin</module>
+  </modules>
+</project>

Propchange: continuum/branches/continuum-osgi-prototype/pom.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: continuum/branches/continuum-osgi-prototype/pom.xml
------------------------------------------------------------------------------
    svn:keywords = "Author Date Id Revision"



Mime
View raw message