[jboss-svn-commits] JBL Code SVN: r23480 - in labs/jbossesb/workspace/skeagh: api and 16 other directories.

jboss-svn-commits at lists.jboss.org jboss-svn-commits at lists.jboss.org
Thu Oct 16 16:54:44 EDT 2008


Author: tfennelly
Date: 2008-10-16 16:54:43 -0400 (Thu, 16 Oct 2008)
New Revision: 23480

Added:
   labs/jbossesb/workspace/skeagh/container/osgi/src/
   labs/jbossesb/workspace/skeagh/container/osgi/src/main/
   labs/jbossesb/workspace/skeagh/container/osgi/src/main/java/
   labs/jbossesb/workspace/skeagh/container/osgi/src/main/java/org/
   labs/jbossesb/workspace/skeagh/container/osgi/src/main/java/org/jboss/
   labs/jbossesb/workspace/skeagh/container/osgi/src/main/java/org/jboss/esb/
   labs/jbossesb/workspace/skeagh/container/osgi/src/main/java/org/jboss/esb/osgi/
   labs/jbossesb/workspace/skeagh/container/osgi/src/main/java/org/jboss/esb/osgi/BundleResourceLocator.java
   labs/jbossesb/workspace/skeagh/container/osgi/src/main/java/org/jboss/esb/osgi/DeploymentRegistry.java
   labs/jbossesb/workspace/skeagh/container/osgi/src/main/java/org/jboss/esb/osgi/EsbServiceDeploymentActivator.java
   labs/jbossesb/workspace/skeagh/container/osgi/src/main/java/org/jboss/esb/osgi/package.html
   labs/jbossesb/workspace/skeagh/container/osgi/src/main/resources/
   labs/jbossesb/workspace/skeagh/container/osgi/src/test/
   labs/jbossesb/workspace/skeagh/container/osgi/src/test/java/
   labs/jbossesb/workspace/skeagh/container/osgi/src/test/java/org/
   labs/jbossesb/workspace/skeagh/container/osgi/src/test/java/org/jboss/
   labs/jbossesb/workspace/skeagh/container/osgi/src/test/java/org/jboss/esb/
   labs/jbossesb/workspace/skeagh/container/osgi/src/test/java/org/jboss/esb/osgi/
   labs/jbossesb/workspace/skeagh/container/osgi/src/test/resources/
Removed:
   labs/jbossesb/workspace/skeagh/api/osgi.bnd
   labs/jbossesb/workspace/skeagh/container/osgi/api/
   labs/jbossesb/workspace/skeagh/container/osgi/runtime/
   labs/jbossesb/workspace/skeagh/examples/helloworld/osgi.bnd
   labs/jbossesb/workspace/skeagh/routing/jms/osgi.bnd
Modified:
   labs/jbossesb/workspace/skeagh/api/pom.xml
   labs/jbossesb/workspace/skeagh/container/osgi/pom.xml
   labs/jbossesb/workspace/skeagh/examples/helloworld/pom.xml
   labs/jbossesb/workspace/skeagh/examples/pom.xml
   labs/jbossesb/workspace/skeagh/pom.xml
   labs/jbossesb/workspace/skeagh/routing/jms/pom.xml
Log:
Cleaning up OSGi some more... removing the .bnd files and moving bundling info into maven config.  The .bnd files are little error prone.

Deleted: labs/jbossesb/workspace/skeagh/api/osgi.bnd
===================================================================
--- labs/jbossesb/workspace/skeagh/api/osgi.bnd	2008-10-16 17:56:57 UTC (rev 23479)
+++ labs/jbossesb/workspace/skeagh/api/osgi.bnd	2008-10-16 20:54:43 UTC (rev 23480)
@@ -1,9 +0,0 @@
-#-----------------------------------------------------------------
-# Use this file to add customized Bnd instructions for the bundle
-#-----------------------------------------------------------------
-
-Export-Package: org.jboss.esb.api.annotations.*, \
-org.jboss.esb.api.context.*, \
-org.jboss.esb.api.message.*, \
-org.jboss.esb.api.exception.*, \
-org.jboss.esb.api.service.*

Modified: labs/jbossesb/workspace/skeagh/api/pom.xml
===================================================================
--- labs/jbossesb/workspace/skeagh/api/pom.xml	2008-10-16 17:56:57 UTC (rev 23479)
+++ labs/jbossesb/workspace/skeagh/api/pom.xml	2008-10-16 20:54:43 UTC (rev 23480)
@@ -12,6 +12,23 @@
     <artifactId>jbossesb-api</artifactId>
     <version>${jboss.esb.version}</version>
     <url>http://www.jboss.org/jbossesb/</url>
-	<packaging>jar</packaging>
+    <packaging>bundle</packaging>
 
+    <build>
+        <plugins>
+            <plugin>
+                <groupId>org.apache.felix</groupId>
+                <artifactId>maven-bundle-plugin</artifactId>
+                <version>1.4.0</version>
+                <extensions>true</extensions>
+                <configuration>
+                    <instructions>
+                        <Export-Package>org.jboss.esb.api.*</Export-Package>
+                        <Import-Package>!org.jboss.esb.*</Import-Package>
+                    </instructions>
+                </configuration>
+            </plugin>
+        </plugins>
+    </build>
+
 </project>

Modified: labs/jbossesb/workspace/skeagh/container/osgi/pom.xml
===================================================================
--- labs/jbossesb/workspace/skeagh/container/osgi/pom.xml	2008-10-16 17:56:57 UTC (rev 23479)
+++ labs/jbossesb/workspace/skeagh/container/osgi/pom.xml	2008-10-16 20:54:43 UTC (rev 23480)
@@ -8,15 +8,48 @@
         <version>5.0-SNAPSHOT</version>
     </parent>
     <groupId>jboss.jbossesb</groupId>
-    <artifactId>jbossesb-osgi</artifactId>
-    <version>5.0-SNAPSHOT</version>
-    <packaging>pom</packaging>
-    <name>JBoss ESB OSGi (Base POM)</name>
+    <artifactId>jbossesb-osgi-runtime</artifactId>
+    <packaging>bundle</packaging>
+	<version>${jboss.esb.version}</version>
+    <name>JBoss ESB OSGi Runtime</name>
     <url>http://www.jboss.org/jbossesb/</url>
 
-    <modules>
-        <module>api</module>
-        <module>runtime</module>
-    </modules>
-    
+    <dependencies>
+        <dependency>
+            <groupId>org.osgi</groupId>
+            <artifactId>osgi_R4_core</artifactId>
+            <version>1.0</version>
+            <scope>provided</scope>
+            <optional>true</optional>
+        </dependency>
+        <dependency>
+            <groupId>org.osgi</groupId>
+            <artifactId>osgi_R4_compendium</artifactId>
+            <version>1.0</version>
+            <scope>provided</scope>
+            <optional>true</optional>
+        </dependency>
+    </dependencies>
+
+    <build>
+        <plugins>
+            <plugin>
+                <groupId>org.apache.felix</groupId>
+                <artifactId>maven-bundle-plugin</artifactId>
+                <version>1.4.0</version>
+                <extensions>true</extensions>
+                <configuration>
+                    <instructions>
+                        <Export-Package>org.jboss.esb.test</Export-Package>
+                        <Private-Package>org.jboss.esb.osgi</Private-Package>
+                        <Import-Package>org.jboss.esb.api.*, *;resolution:=optional</Import-Package> <!-- TODO: Replace global import with explicit package imports? -->
+                        <Bundle-Activator>org.jboss.esb.osgi.EsbServiceDeploymentActivator</Bundle-Activator>
+                        <Embed-Dependency>quartz, xpp3_min, xstream, freemarker, jbossesb-commons, jbossesb-rt, mvel, milyn-commons, milyn-smooks-core, milyn-smooks-javabean, commons-lang, commons-logging, log4j</Embed-Dependency>
+                        <Embed-Transitive>true</Embed-Transitive>
+                    </instructions>
+                </configuration>
+            </plugin>
+        </plugins>
+    </build>
+
 </project>

Added: labs/jbossesb/workspace/skeagh/container/osgi/src/main/java/org/jboss/esb/osgi/BundleResourceLocator.java
===================================================================
--- labs/jbossesb/workspace/skeagh/container/osgi/src/main/java/org/jboss/esb/osgi/BundleResourceLocator.java	                        (rev 0)
+++ labs/jbossesb/workspace/skeagh/container/osgi/src/main/java/org/jboss/esb/osgi/BundleResourceLocator.java	2008-10-16 20:54:43 UTC (rev 23480)
@@ -0,0 +1,160 @@
+/*
+ * JBoss, Home of Professional Open Source Copyright 2008, Red Hat Middleware
+ * LLC, and individual contributors by the @authors tag. See the copyright.txt
+ * in the distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it under the
+ * terms of the GNU Lesser General Public License as published by the Free
+ * Software Foundation; either version 2.1 of the License, or (at your option)
+ * any later version.
+ *
+ * This software is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
+ * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
+ * details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this software; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA, or see the FSF
+ * site: http://www.fsf.org.
+ */
+package org.jboss.esb.osgi;
+
+import org.jboss.esb.classpath.ClassUtil;
+import org.jboss.esb.api.context.ResourceLocator;
+import org.osgi.framework.Bundle;
+
+import java.io.IOException;
+import java.io.InputStream;
+import java.net.URL;
+import java.util.Enumeration;
+
+/**
+ * BundleResourceLocator is an OSGi implementation of ResourceLocator.
+ * <p/>
+ * This locator will look for and load resources by first looking in
+ * the bundles classpath. Does this violate the OSGi classloading?
+ *
+ * @author <a href="mailto:dbevenius at jboss.com">Daniel Bevenius</a>
+ *
+ */
+public class BundleResourceLocator implements ResourceLocator
+{
+    /**
+     * The OSGi BundleContext instance.
+     */
+    private final Bundle bundle;
+    /**
+     * Bundle ClassLoader.
+     */
+    private BundleClassLoader classLoader;
+
+    /**
+     * Creates and instance and stores the passed-in BundleContext.
+     *
+     * @param bundle - the OSGi Bundle.
+     */
+    public BundleResourceLocator(final Bundle bundle)
+    {
+        this.bundle = bundle;
+        classLoader = new BundleClassLoader(bundle, getClass().getClassLoader());
+    }
+
+    /**
+     * Load the specified class. Ignores the callers classloader.
+     *
+     * @param className The name of the class to load.
+     * @param caller    The class of the caller. Ignored
+     * @return Class The specified class.
+     * @throws ClassNotFoundException If the class cannot be found.
+     */
+    public final Class<?> forName(final String className, final Class<?> caller) throws ClassNotFoundException
+    {
+        try
+        {
+            return forName(className);
+        }
+        catch (final ClassNotFoundException e)
+        {
+            // fallback to normal classloading
+            return ClassUtil.forName(className, caller);
+        }
+    }
+
+    /**
+     * Load the specified class.
+     *
+     * @param className The name of the class to load.
+     * @return Class The specified class.
+     * @throws ClassNotFoundException If the class cannot be found.
+     */
+    public final Class<?> forName(final String className) throws ClassNotFoundException
+    {
+        return bundle.loadClass(className);
+    }
+
+    /**
+     * Get a resource from the callers classpath.
+     *
+     * @param resourceName - the name of the resource to be retrieved.
+     * @param caller - the class of the caller. The classes classloader will be used to search for the resource.
+     *
+     * @return InputStream - the InputStream for the resource.
+     */
+    public final InputStream getResourceAsStream(final String resourceName, final Class<?> caller)
+    {
+        final URL entry = bundle.getEntry(resourceName);
+        if (entry != null)
+        {
+            try
+            {
+                return entry.openStream();
+            }
+            catch (final IOException ignore)
+            {
+                ignore.printStackTrace();
+                // ignore. Will fallback to normal classloading
+            }
+        }
+        return ClassUtil.getResourceAsStream(resourceName, caller);
+    }
+
+    /**
+     * Get the underlying classloader.
+     * @return The underlying ClassLoader.
+     */
+    public final ClassLoader getClassLoader()
+    {
+        return classLoader;
+    }
+
+    /**
+     * Bundle ClassLoader.
+     * @author <a href="mailto:tom.fennelly at jboss.com">tom.fennelly at jboss.com</a>
+     */
+    public class BundleClassLoader extends ClassLoader
+    {
+        private Bundle bundle;
+
+        public BundleClassLoader(final Bundle bundle, final ClassLoader parent)
+        {
+            super(parent);
+            this.bundle = bundle;
+        }
+
+        protected Class<?> findClass(String name) throws ClassNotFoundException
+        {
+            return bundle.loadClass(name);
+        }
+
+        protected URL findResource(String name)
+        {
+            return bundle.getResource(name);
+        }
+
+        protected Enumeration<URL> findResources(String name) throws IOException
+        {
+            return bundle.getResources(name);
+        }
+    }
+}


Property changes on: labs/jbossesb/workspace/skeagh/container/osgi/src/main/java/org/jboss/esb/osgi/BundleResourceLocator.java
___________________________________________________________________
Name: svn:eol-style
   + native

Added: labs/jbossesb/workspace/skeagh/container/osgi/src/main/java/org/jboss/esb/osgi/DeploymentRegistry.java
===================================================================
--- labs/jbossesb/workspace/skeagh/container/osgi/src/main/java/org/jboss/esb/osgi/DeploymentRegistry.java	                        (rev 0)
+++ labs/jbossesb/workspace/skeagh/container/osgi/src/main/java/org/jboss/esb/osgi/DeploymentRegistry.java	2008-10-16 20:54:43 UTC (rev 23480)
@@ -0,0 +1,180 @@
+package org.jboss.esb.osgi;
+
+import java.net.URL;
+import java.util.Dictionary;
+import java.util.HashMap;
+import java.util.Set;
+
+import org.jboss.esb.deploy.DeploymentException;
+import org.jboss.esb.deploy.DeploymentRuntime;
+import org.jboss.esb.deploy.DeploymentUtil;
+import org.osgi.framework.Bundle;
+
+/**
+ * DeploymentRegistry keeps tracks of deployed runtimes.
+ * <p/>
+ *
+ * @author <a href="mailto:dbevenius at jboss.com">Daniel Bevenius</a>
+ *
+ */
+public class DeploymentRegistry
+{
+    /**
+     * Default name of the config file.
+     */
+    private static final String DEFAULT_CONFIG_FILENAME = "/jboss-esb.xml";
+
+    /**
+     * Header that can be placed in the MANIFEST.MF file to
+     * specify a different config file name then the default one.
+     */
+    private static final String CONFIG_FILE_HEADER = "JBossESB-ConfigFile";
+
+    /**
+     * Header that can be placed in the MANIFEST.MF file to
+     * specify a different deployment name then the default, which
+     * is the bundle name.
+     */
+    private static final String DEPLOYMENT_NAME_HEADER = "JBossESB-DeploymentName";
+
+    /**
+     * Set of activated deployments.
+     */
+    private HashMap<Bundle,DeploymentRuntime> activated = new HashMap<Bundle,DeploymentRuntime>();
+
+    /**
+     * Unregisters the DeploymentRuntime.
+     *
+     * @param bundle The bundle to register.
+     */
+    public final void register(final Bundle bundle)
+    {
+        synchronized (activated)
+        {
+            if (activated.containsKey(bundle))
+            {
+                // already registered. Don't need to do anything
+                return;
+            }
+        }
+
+        final URL configUrl = getEsbConfigFile(bundle);
+        if (configUrl == null)
+        {
+            return;
+        }
+
+        try
+        {
+            //TODO: Use logging service
+            System.out.println("Found config : " + configUrl + " for bundle : " + bundle);
+            DeploymentRuntime runtime = DeploymentUtil.createRuntime(configUrl.openStream(), new BundleResourceLocator(bundle));
+            runtime.setDeploymentName(getDeploymentName(bundle));
+            runtime.deploy();
+
+            synchronized (activated)
+            {
+                activated.put(bundle, runtime);
+            }
+        }
+        catch (final Throwable t)
+        {
+            //TODO: add exception handling.
+            t.printStackTrace();
+        }
+    }
+
+    /**
+     * Unregisters the DeploymentRuntime.
+     *
+     * @param bundle the bundle.
+     */
+    public final void unregister(final Bundle bundle)
+    {
+        //TODO: Use logging service
+        System.out.println("unregister bundle: " + bundle);
+        synchronized (activated)
+        {
+            if (!activated.containsKey(bundle))
+            {
+                return;
+            }
+
+            final DeploymentRuntime deploymentRuntime = activated.get(bundle);
+            try
+            {
+                deploymentRuntime.undeploy();
+            }
+            catch (DeploymentException e)
+            {
+                //TODO: Handle exception.
+                e.printStackTrace();
+            }
+            finally
+            {
+                activated.remove(bundle);
+            }
+        }
+    }
+
+    /**
+     * Gets the Esb configuration file from the bundle.
+     *
+     * @param bundle The Bundle being activated.
+     * @return URL URL to the configuration file.
+     *
+     */
+    private URL getEsbConfigFile(final Bundle bundle)
+    {
+        String configFileName = (String) getHeader(bundle, CONFIG_FILE_HEADER);
+        if (configFileName == null)
+        {
+            configFileName = DEFAULT_CONFIG_FILENAME;
+        }
+        return bundle.getEntry(configFileName);
+    }
+
+    /**
+     * Get the deployment name from the MANIFEST header {@link DeploymentRegistry#DEPLOYMENT_NAME_HEADER}.
+     * If that header has not been set the deployment name will be set to the bundles sympolic name.
+     *
+     * @param bundle The current bundle
+     * @return String   The name of the deployment. Either the value of the deployement header or the bundles sympolic name
+     */
+    private String getDeploymentName(final Bundle bundle)
+    {
+        String deploymentName = (String) getHeader(bundle, DEPLOYMENT_NAME_HEADER);
+        if (deploymentName == null)
+        {
+            deploymentName = bundle.getSymbolicName();
+        }
+        return deploymentName;
+    }
+
+    /**
+     * Get the the specified header from the passed in bundle.
+     *
+     * @param from  The Bundle to retrieve the header from.
+     * @param headerName The header name
+     * @return String   The value of the header of null if the header has not been set.
+     */
+    private String getHeader(final Bundle from, final String headerName)
+    {
+        final Dictionary<?,?> headers = from.getHeaders();
+        return (String) headers.get(headerName);
+    }
+
+    /**
+     * Close this registry.
+     */
+    public final void close()
+    {
+        Set<Bundle> keySet = activated.keySet();
+        for (Bundle bundle : keySet)
+        {
+            unregister(bundle);
+        }
+    }
+}
+
+


Property changes on: labs/jbossesb/workspace/skeagh/container/osgi/src/main/java/org/jboss/esb/osgi/DeploymentRegistry.java
___________________________________________________________________
Name: svn:eol-style
   + native

Added: labs/jbossesb/workspace/skeagh/container/osgi/src/main/java/org/jboss/esb/osgi/EsbServiceDeploymentActivator.java
===================================================================
--- labs/jbossesb/workspace/skeagh/container/osgi/src/main/java/org/jboss/esb/osgi/EsbServiceDeploymentActivator.java	                        (rev 0)
+++ labs/jbossesb/workspace/skeagh/container/osgi/src/main/java/org/jboss/esb/osgi/EsbServiceDeploymentActivator.java	2008-10-16 20:54:43 UTC (rev 23480)
@@ -0,0 +1,141 @@
+/*
+ * JBoss, Home of Professional Open Source Copyright 2008, Red Hat Middleware
+ * LLC, and individual contributors by the @authors tag. See the copyright.txt
+ * in the distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it under the
+ * terms of the GNU Lesser General Public License as published by the Free
+ * Software Foundation; either version 2.1 of the License, or (at your option)
+ * any later version.
+ *
+ * This software is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
+ * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
+ * details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this software; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA, or see the FSF
+ * site: http://www.fsf.org.
+ */
+package org.jboss.esb.osgi;
+
+import org.osgi.framework.Bundle;
+import org.osgi.framework.BundleActivator;
+import org.osgi.framework.BundleContext;
+import org.osgi.framework.BundleEvent;
+import org.osgi.framework.BundleListener;
+import org.osgi.service.component.ComponentContext;
+import org.osgi.service.log.LogService;
+
+/**
+ * EsbServiceDeploymentActivator is an OSGi Activator that takes care
+ * registering the EsbServiceDeployer service.
+ * <p>
+ *
+ * @author <a href="mailto:dbevenius at jboss.com">Daniel Bevenius</a>
+ */
+public class EsbServiceDeploymentActivator implements BundleActivator, BundleListener
+{
+    /**
+     * The BundleContext for this listener.
+     */
+    private BundleContext bundleContext;
+
+    /**
+     * Registry that hold the DeploymentRuntimes.
+     */
+    private DeploymentRegistry registry = new DeploymentRegistry();
+
+    /**
+     * Log service.
+     */
+    private LogService  log;
+
+    /**
+     * Activation method that will be called by the Service Component Runtime.
+     * @param cc The ComponentContext.
+     */
+    public final void activate(final ComponentContext cc)
+    {
+        System.out.println("activate...ContextClassLoader : " + Thread.currentThread().getContextClassLoader());
+        this.bundleContext = cc.getBundleContext();
+        System.out.println("activate...bundleClassLoader : " + getClass().getClassLoader());
+        log.log(LogService.LOG_DEBUG, "activate....");
+
+        bundleContext.addBundleListener(this);
+
+        // get all the currently installed bundles.
+        final Bundle[] bundles = bundleContext.getBundles();
+        for (Bundle bundle : bundles)
+        {
+            if ((bundle.getState() & (Bundle.STARTING | Bundle.ACTIVE)) != 0)
+            {
+                // register the bundles that are esb bundles.
+                registry.register(bundle);
+            }
+        }
+    }
+
+    /**
+     * Called when the OSGi Component Runtime notifies about
+     * changed bundles.
+     *
+     * @param event The event that occured. This method only handles STARTED and STOPPED events.
+     */
+    public final void bundleChanged(final BundleEvent event)
+    {
+        switch (event.getType())
+        {
+            case BundleEvent.STARTED:
+                registry.register(event.getBundle());
+                break;
+
+            case BundleEvent.STOPPED:
+                registry.unregister(event.getBundle());
+                break;
+
+            default:
+                break;
+        }
+    }
+
+    /**
+     * Starts the bundle.
+     * Will add this instance as a bundle listener, and register any bundles
+     * containing an esb configuration file.
+     *
+     * @param context The bundle context.
+     * @throws Exception If an exception occurs during startup.
+     */
+    public final void start(final BundleContext context) throws Exception
+    {
+        this.bundleContext = context;
+
+        context.addBundleListener(this);
+
+        // get all the currently installed bundles.
+        final Bundle[] bundles = context.getBundles();
+        for (final Bundle bundle : bundles)
+        {
+            if ((bundle.getState() & (Bundle.STARTING | Bundle.ACTIVE)) != 0)
+            {
+                // register and deploy the bundles that are esb bundles.
+                registry.register(bundle);
+            }
+        }
+    }
+
+    /**
+     * Stops this bundle.
+     * Will close the underlying registry of DeploymentRuntime, going
+     * through them and undeploying them.
+     *
+     * @param unused The bundle context.
+     * @throws Exception If an exception occurs during startup.
+     */
+    public final void stop(final BundleContext unused) throws Exception
+    {
+        registry.close();
+    }
+}


Property changes on: labs/jbossesb/workspace/skeagh/container/osgi/src/main/java/org/jboss/esb/osgi/EsbServiceDeploymentActivator.java
___________________________________________________________________
Name: svn:eol-style
   + native

Added: labs/jbossesb/workspace/skeagh/container/osgi/src/main/java/org/jboss/esb/osgi/package.html
===================================================================
--- labs/jbossesb/workspace/skeagh/container/osgi/src/main/java/org/jboss/esb/osgi/package.html	                        (rev 0)
+++ labs/jbossesb/workspace/skeagh/container/osgi/src/main/java/org/jboss/esb/osgi/package.html	2008-10-16 20:54:43 UTC (rev 23480)
@@ -0,0 +1,8 @@
+<html>
+<head></head>
+<body>
+OSGi Handling.
+
+<h2>Package Specification</h2>
+</body>
+</html>
\ No newline at end of file

Deleted: labs/jbossesb/workspace/skeagh/examples/helloworld/osgi.bnd
===================================================================
--- labs/jbossesb/workspace/skeagh/examples/helloworld/osgi.bnd	2008-10-16 17:56:57 UTC (rev 23479)
+++ labs/jbossesb/workspace/skeagh/examples/helloworld/osgi.bnd	2008-10-16 20:54:43 UTC (rev 23480)
@@ -1,32 +0,0 @@
-#-----------------------------------------------------------------
-# Use this file to add customized Bnd instructions for the bundle
-#-----------------------------------------------------------------
-
-#
-# Embedding and exporting ActiveMQ explicitly here.  This needs to be
-# fixed.  The ActiveMQ classes should be made available through a bundle of
-# it's own and then imported here.  I had issues with running the ActiveMQ v5.0.2
-# bundle, so embedding it here for now.
-#
-
-Export-Package: org.jboss.esb.examples.helloworld, org.apache.activemq.jndi
-
-# TODO: Version imports
-# TODO: Replace global import with explicit package imports?
-Import-Package: org.jboss.esb.jms, org.jboss.esb.api.*, *;resolution:=optional
-
-Embed-Dependency: activemq-core, \
-                  backport-util-concurrent, \
-                  log4j, commons-logging, \
-                  geronimo-j2ee-management_1.1_spec
-
-Embed-Transitive: true
-
-# This property can be used to override the
-# default configuration file name.
-JBossESB-ConfigFile = /jboss-esb.xml
-
-JBossESB-DeploymentName=TestDeploymentName
-
-
-

Modified: labs/jbossesb/workspace/skeagh/examples/helloworld/pom.xml
===================================================================
--- labs/jbossesb/workspace/skeagh/examples/helloworld/pom.xml	2008-10-16 17:56:57 UTC (rev 23479)
+++ labs/jbossesb/workspace/skeagh/examples/helloworld/pom.xml	2008-10-16 20:54:43 UTC (rev 23480)
@@ -17,32 +17,6 @@
 		<felix.log.level>1</felix.log.level><!-- 4=debug -->
 	</properties>
 
-	<build>
-        <plugins>
-            <plugin>
-                <groupId>org.apache.activemq.tooling</groupId>
-                <artifactId>maven-activemq-plugin</artifactId>
-                <version>4.1.2</version>
-                <configuration>
-                    <configFile>./activemq.xml</configFile>
-                    <fork>false</fork>
-                </configuration>
-            </plugin>
-			<plugin>
-                <groupId>org.codehaus.mojo</groupId>
-                <artifactId>exec-maven-plugin</artifactId>
-                <configuration>
-                    <executable>java</executable>
-                    <mainClass>org.jboss.esb.examples.JmsClient</mainClass>
-					<arguments>
-						<argument>jbossesb.TestQueue</argument>
-						<!--argument>Message payload text...</argument-->
-					</arguments>
-                </configuration>
-            </plugin>
-        </plugins>
-    </build>
-
 	<dependencies>
         <dependency>
 			<groupId>log4j</groupId>
@@ -120,5 +94,54 @@
 		</dependency>
 
 	</dependencies>
-	
+
+    <build>
+        <plugins>
+            <plugin>
+                <groupId>org.apache.activemq.tooling</groupId>
+                <artifactId>maven-activemq-plugin</artifactId>
+                <version>4.1.2</version>
+                <configuration>
+                    <configFile>./activemq.xml</configFile>
+                    <fork>false</fork>
+                </configuration>
+            </plugin>
+            <plugin>
+                <groupId>org.codehaus.mojo</groupId>
+                <artifactId>exec-maven-plugin</artifactId>
+                <configuration>
+                    <executable>java</executable>
+                    <mainClass>org.jboss.esb.examples.JmsClient</mainClass>
+                    <arguments>
+                        <argument>jbossesb.TestQueue</argument>
+                        <!--argument>Message payload text...</argument-->
+                    </arguments>
+                </configuration>
+            </plugin>
+            <plugin>
+                <groupId>org.ops4j</groupId>
+                <artifactId>maven-pax-plugin</artifactId>
+                <version>1.3</version>
+                <extensions>true</extensions>
+            </plugin>
+
+            <plugin>
+                <groupId>org.apache.felix</groupId>
+                <artifactId>maven-bundle-plugin</artifactId>
+                <version>1.4.0</version>
+                <extensions>true</extensions>
+                <configuration>
+                    <instructions>
+                        <Export-Package>org.jboss.esb.examples.helloworld, org.apache.activemq.jndi</Export-Package>
+                        <Import-Package>org.jboss.esb.jms, org.jboss.esb.api.*, *;resolution:=optional</Import-Package> <!-- TODO: Replace global import with explicit package imports? -->
+                        <Embed-Dependency>activemq-core, backport-util-concurrent, log4j, commons-logging, geronimo-j2ee-management_1.1_spec</Embed-Dependency>
+                        <Embed-Transitive>true</Embed-Transitive>
+                        <JBossESB-ConfigFile>/jboss-esb.xml</JBossESB-ConfigFile>
+                        <JBossESB-DeploymentName>TestDeploymentName</JBossESB-DeploymentName>
+                    </instructions>
+                </configuration>
+            </plugin>
+        </plugins>
+    </build>
+
 </project>

Modified: labs/jbossesb/workspace/skeagh/examples/pom.xml
===================================================================
--- labs/jbossesb/workspace/skeagh/examples/pom.xml	2008-10-16 17:56:57 UTC (rev 23479)
+++ labs/jbossesb/workspace/skeagh/examples/pom.xml	2008-10-16 20:54:43 UTC (rev 23480)
@@ -1,25 +1,26 @@
 <?xml version="1.0" encoding="UTF-8"?>
-<project xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd" xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
+<project xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"
+         xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
 
-  <modelVersion>4.0.0</modelVersion>
+    <modelVersion>4.0.0</modelVersion>
 
-  <parent>
+    <parent>
+        <groupId>jboss.jbossesb</groupId>
+        <artifactId>jbossesb</artifactId>
+        <version>5.0-SNAPSHOT</version>
+    </parent>
     <groupId>jboss.jbossesb</groupId>
-    <artifactId>jbossesb</artifactId>
-	<version>5.0-SNAPSHOT</version>
-  </parent>
-  <groupId>jboss.jbossesb</groupId>
-  <artifactId>examples</artifactId>
+    <artifactId>examples</artifactId>
 
-  <packaging>pom</packaging>
-  <version>${jboss.esb.version}</version>
+    <packaging>pom</packaging>
+    <version>${jboss.esb.version}</version>
 
-  <name>JBoss ESB Examples Modules (Base POM)</name>
+    <name>JBoss ESB Examples Modules (Base POM)</name>
 
-  <url>http://www.jboss.org/jbossesb/</url>
+    <url>http://www.jboss.org/jbossesb/</url>
 
-  <modules>
-    <module>helloworld</module>
-  </modules>
+    <modules>
+        <module>helloworld</module>
+    </modules>
 
 </project>

Modified: labs/jbossesb/workspace/skeagh/pom.xml
===================================================================
--- labs/jbossesb/workspace/skeagh/pom.xml	2008-10-16 17:56:57 UTC (rev 23479)
+++ labs/jbossesb/workspace/skeagh/pom.xml	2008-10-16 20:54:43 UTC (rev 23480)
@@ -43,22 +43,6 @@
             <scope>test</scope>
         </dependency>
 
-        <!-- osgi dependencies -->
-        <dependency>
-            <groupId>org.osgi</groupId>
-            <artifactId>osgi_R4_core</artifactId>
-            <version>1.0</version>
-            <scope>provided</scope>
-            <optional>true</optional>
-        </dependency>
-        <dependency>
-            <groupId>org.osgi</groupId>
-            <artifactId>osgi_R4_compendium</artifactId>
-            <version>1.0</version>
-            <scope>provided</scope>
-            <optional>true</optional>
-        </dependency>
-
     </dependencies>
 
     <build>
@@ -92,23 +76,6 @@
                 </executions>
             </plugin>
 
-            <plugin>
-                <groupId>org.ops4j</groupId>
-                <artifactId>maven-pax-plugin</artifactId>
-                <version>1.3</version>
-                <extensions>true</extensions>
-            </plugin>
-
-            <plugin>
-                <groupId>org.apache.felix</groupId>
-                <artifactId>maven-bundle-plugin</artifactId>
-                <version>1.4.0</version>
-                <configuration>
-                    <instructions>
-                        <_include>-osgi.bnd</_include>
-                    </instructions>
-                </configuration>
-            </plugin>
         </plugins>
 
         <resources>

Deleted: labs/jbossesb/workspace/skeagh/routing/jms/osgi.bnd
===================================================================
--- labs/jbossesb/workspace/skeagh/routing/jms/osgi.bnd	2008-10-16 17:56:57 UTC (rev 23479)
+++ labs/jbossesb/workspace/skeagh/routing/jms/osgi.bnd	2008-10-16 20:54:43 UTC (rev 23480)
@@ -1,12 +0,0 @@
-#-----------------------------------------------------------------
-# Use this file to add customized Bnd instructions for the bundle
-#-----------------------------------------------------------------
-
-Export-Package: org.jboss.esb.jms
-
-# TODO: Replace global import with explicit package imports?
-Import-Package: *;resolution:=optional
-
-Embed-Dependency: jbossesb-commons, log4j
-Embed-Transitive: true
-

Modified: labs/jbossesb/workspace/skeagh/routing/jms/pom.xml
===================================================================
--- labs/jbossesb/workspace/skeagh/routing/jms/pom.xml	2008-10-16 17:56:57 UTC (rev 23479)
+++ labs/jbossesb/workspace/skeagh/routing/jms/pom.xml	2008-10-16 20:54:43 UTC (rev 23480)
@@ -66,7 +66,26 @@
         </dependency>
         
     </dependencies>
-    
+
+    <build>
+        <plugins>
+            <plugin>
+                <groupId>org.apache.felix</groupId>
+                <artifactId>maven-bundle-plugin</artifactId>
+                <version>1.4.0</version>
+                <extensions>true</extensions>
+                <configuration>
+                    <instructions>
+                        <Export-Package>org.jboss.esb.jms</Export-Package>
+                        <Import-Package>*;resolution:=optional</Import-Package> <!-- TODO: Replace global import with explicit package imports? -->
+                        <Embed-Dependency>jbossesb-commons, log4j</Embed-Dependency>
+                        <Embed-Transitive>true</Embed-Transitive>
+                    </instructions>
+                </configuration>
+            </plugin>
+        </plugins>
+    </build>
+
     <repositories>
         <repository>
             <id>jboss</id>




More information about the jboss-svn-commits mailing list