JBoss-OSGI SVN: r95283 - in projects/jboss-osgi/projects/bundles/webapp/trunk: src/main/java/org/jboss/osgi/webapp and 1 other directories.
by jboss-osgi-commits@lists.jboss.org
Author: thomas.diesler(a)jboss.com
Date: 2009-10-21 08:48:57 -0400 (Wed, 21 Oct 2009)
New Revision: 95283
Added:
projects/jboss-osgi/projects/bundles/webapp/trunk/src/main/java/org/jboss/osgi/webapp/WebAppCapability.java
projects/jboss-osgi/projects/bundles/webapp/trunk/src/main/java/org/jboss/osgi/webapp/internal/WebAppPublisherInterceptor.java
projects/jboss-osgi/projects/bundles/webapp/trunk/src/main/java/org/jboss/osgi/webapp/internal/WebXMLParserInterceptor.java
Removed:
projects/jboss-osgi/projects/bundles/webapp/trunk/src/main/java/org/jboss/osgi/webapp/internal/WebAppInterceptor.java
Modified:
projects/jboss-osgi/projects/bundles/webapp/trunk/pom.xml
projects/jboss-osgi/projects/bundles/webapp/trunk/src/main/java/org/jboss/osgi/webapp/internal/WebAppActivator.java
Log:
Distribute work over multiple interceptors
Modified: projects/jboss-osgi/projects/bundles/webapp/trunk/pom.xml
===================================================================
--- projects/jboss-osgi/projects/bundles/webapp/trunk/pom.xml 2009-10-21 12:32:49 UTC (rev 95282)
+++ projects/jboss-osgi/projects/bundles/webapp/trunk/pom.xml 2009-10-21 12:48:57 UTC (rev 95283)
@@ -21,7 +21,7 @@
<artifactId>jboss-osgi-webapp</artifactId>
<packaging>bundle</packaging>
- <version>1.0.0-SNAPSHOT</version>
+ <version>0.7.0-SNAPSHOT</version>
<!-- Parent -->
<parent>
@@ -40,13 +40,23 @@
<!-- Properties -->
<properties>
<version.jboss.osgi.deployment>1.0.0-SNAPSHOT</version.jboss.osgi.deployment>
- <version.ops4j.pax.web>0.7.1</version.ops4j.pax.web>
- <version.osgi>r4v42</version.osgi>
+ <version.ops4j.pax.base>1.2.1</version.ops4j.pax.base>
+ <version.ops4j.pax.web>0.7.0</version.ops4j.pax.web>
+ <version.osgi>4.2.0</version.osgi>
</properties>
<!-- Dependencies -->
<dependencies>
<dependency>
+ <!--
+ [TODO] Invalid maven dependency on pax base
+ http://issues.ops4j.org/browse/PAXWEB-177
+ -->
+ <groupId>org.ops4j.base</groupId>
+ <artifactId>ops4j-base-util-xml</artifactId>
+ <version>${version.ops4j.pax.base}</version>
+ </dependency>
+ <dependency>
<groupId>org.ops4j.pax.web</groupId>
<artifactId>pax-web-api</artifactId>
<version>${version.ops4j.pax.web}</version>
@@ -90,14 +100,23 @@
<instructions>
<Bundle-SymbolicName>${artifactId}</Bundle-SymbolicName>
<Bundle-Activator>org.jboss.osgi.webapp.internal.WebAppActivator</Bundle-Activator>
- <Private-Package>org.jboss.osgi.webapp.internal</Private-Package>
+ <Export-Package>
+ org.jboss.osgi.webapp;version=${version}
+ </Export-Package>
+ <Private-Package>
+ org.jboss.osgi.webapp.internal,
+ org.ops4j.pax.web.extender.war.internal,
+ </Private-Package>
<Import-Package>
javax.servlet,
javax.servlet.http,
javax.xml.parsers,
+ org.apache.commons.logging;version=1.1,
org.jboss.osgi.deployment.common;version=1.0,
org.jboss.osgi.deployment.interceptor;version=1.0,
+ org.jboss.osgi.spi.capability;version=1.0,
org.jboss.virtual,
+ org.ops4j.pax.web.service,
org.osgi.service.http,
org.osgi.framework,
org.osgi.util.tracker,
Copied: projects/jboss-osgi/projects/bundles/webapp/trunk/src/main/java/org/jboss/osgi/webapp/WebAppCapability.java (from rev 95269, projects/jboss-osgi/projects/spi/trunk/src/main/java/org/jboss/osgi/spi/capability/WebAppCapability.java)
===================================================================
--- projects/jboss-osgi/projects/bundles/webapp/trunk/src/main/java/org/jboss/osgi/webapp/WebAppCapability.java (rev 0)
+++ projects/jboss-osgi/projects/bundles/webapp/trunk/src/main/java/org/jboss/osgi/webapp/WebAppCapability.java 2009-10-21 12:48:57 UTC (rev 95283)
@@ -0,0 +1,50 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * 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.osgi.webapp;
+
+//$Id: $
+
+import org.jboss.osgi.spi.capability.Capability;
+import org.jboss.osgi.spi.capability.HttpServiceCapability;
+import org.jboss.osgi.spi.testing.OSGiRuntime;
+
+/**
+ * Adds the WebApp (WAR) capability to the {@link OSGiRuntime}
+ * under test.
+ *
+ * Dependent Capability: {@link HttpServiceCapability}
+ * Installed bundles: pax-web-extender-war.jar
+ *
+ * @author thomas.diesler(a)jboss.com
+ * @since 07-Oct-2009
+ */
+public class WebAppCapability extends Capability
+{
+ public WebAppCapability()
+ {
+ super(null);
+
+ addDependency(new HttpServiceCapability());
+
+ addBundle("bundles/jboss-osgi-webapp.jar");
+ }
+}
\ No newline at end of file
Modified: projects/jboss-osgi/projects/bundles/webapp/trunk/src/main/java/org/jboss/osgi/webapp/internal/WebAppActivator.java
===================================================================
--- projects/jboss-osgi/projects/bundles/webapp/trunk/src/main/java/org/jboss/osgi/webapp/internal/WebAppActivator.java 2009-10-21 12:32:49 UTC (rev 95282)
+++ projects/jboss-osgi/projects/bundles/webapp/trunk/src/main/java/org/jboss/osgi/webapp/internal/WebAppActivator.java 2009-10-21 12:48:57 UTC (rev 95283)
@@ -35,23 +35,33 @@
*/
public class WebAppActivator implements BundleActivator
{
- private WebAppPublisherExt publisher;
- private WebAppInterceptor interceptor;
+ private WebAppPublisherExt paxwebPublisher;
+ private WebXMLParserInterceptor webappParserInterceptor;
+ private WebAppPublisherInterceptor webappPublishInterceptor;
public void start(BundleContext context)
{
- publisher = new WebAppPublisherExt();
+ paxwebPublisher = new WebAppPublisherExt();
- interceptor = new WebAppInterceptor(context, publisher);
- interceptor.start();
+ webappParserInterceptor = new WebXMLParserInterceptor(context);
+ webappParserInterceptor.start();
+
+ webappPublishInterceptor = new WebAppPublisherInterceptor(context, paxwebPublisher);
+ webappPublishInterceptor.start();
}
public void stop(BundleContext context)
{
- if (interceptor != null)
+ if (webappParserInterceptor != null)
{
- interceptor.stop();
- interceptor = null;
+ webappParserInterceptor.stop();
+ webappParserInterceptor = null;
}
+
+ if (webappPublishInterceptor != null)
+ {
+ webappPublishInterceptor.stop();
+ webappPublishInterceptor = null;
+ }
}
}
\ No newline at end of file
Deleted: projects/jboss-osgi/projects/bundles/webapp/trunk/src/main/java/org/jboss/osgi/webapp/internal/WebAppInterceptor.java
===================================================================
--- projects/jboss-osgi/projects/bundles/webapp/trunk/src/main/java/org/jboss/osgi/webapp/internal/WebAppInterceptor.java 2009-10-21 12:32:49 UTC (rev 95282)
+++ projects/jboss-osgi/projects/bundles/webapp/trunk/src/main/java/org/jboss/osgi/webapp/internal/WebAppInterceptor.java 2009-10-21 12:48:57 UTC (rev 95283)
@@ -1,122 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2005, JBoss Inc., and individual contributors as indicated
- * 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.osgi.webapp.internal;
-
-//$Id$
-
-import java.io.IOException;
-
-import org.jboss.osgi.deployment.common.Deployment;
-import org.jboss.osgi.deployment.interceptor.AbstractLifecycleInterceptor;
-import org.jboss.osgi.deployment.interceptor.LifecycleInterceptor;
-import org.jboss.osgi.deployment.interceptor.LifecycleInterceptorException;
-import org.jboss.osgi.deployment.interceptor.LifecycleInterceptorService;
-import org.jboss.virtual.VirtualFile;
-import org.ops4j.pax.web.extender.war.internal.WebAppPublisherExt;
-import org.ops4j.pax.web.extender.war.internal.model.WebApp;
-import org.ops4j.pax.web.extender.war.internal.parser.dom.DOMWebXmlParser;
-import org.osgi.framework.Bundle;
-import org.osgi.framework.BundleContext;
-import org.osgi.framework.ServiceReference;
-import org.osgi.util.tracker.ServiceTracker;
-
-/**
- * The WebApp lifecycle interceptor.
- *
- * @author thomas.diesler(a)jboss.com
- * @since 20-Oct-2009
- */
-public class WebAppInterceptor extends AbstractLifecycleInterceptor implements LifecycleInterceptor
-{
- private BundleContext context;
- private ServiceTracker serviceTracker;
- private WebAppPublisherExt publisher;
-
- public WebAppInterceptor(BundleContext context, WebAppPublisherExt publisher)
- {
- this.context = context;
- this.publisher = publisher;
- }
-
- public void start()
- {
- final LifecycleInterceptor interceptor = this;
- serviceTracker = new ServiceTracker(context, LifecycleInterceptorService.class.getName(), null)
- {
- @Override
- public Object addingService(ServiceReference reference)
- {
- LifecycleInterceptorService service = (LifecycleInterceptorService)super.addingService(reference);
- service.addInterceptor(interceptor);
- return service;
- }
-
- @Override
- public void removedService(ServiceReference reference, Object service)
- {
- ((LifecycleInterceptorService)service).removeInterceptor(interceptor);
- super.removedService(reference, service);
- }
- };
- serviceTracker.open();
- }
-
- public void stop()
- {
- if (serviceTracker != null)
- {
- serviceTracker.close();
- serviceTracker = null;
- }
- }
-
- public void invoke(int state, Deployment dep) throws LifecycleInterceptorException
- {
- if (state == Bundle.STARTING)
- {
- try
- {
- VirtualFile root = dep.getRoot();
- VirtualFile webXML = root.getChild("/WEB-INF/web.xml");
- if (webXML != null)
- {
- DOMWebXmlParser parser = new DOMWebXmlParser();
- WebApp webApp = parser.parse(webXML.openStream());
- dep.addAttachment(WebApp.class, webApp);
- publisher.publish(webApp);
- }
- }
- catch (IOException ex)
- {
- throw new LifecycleInterceptorException("Cannot parse web.xml", ex);
- }
- }
- else if (state == Bundle.STOPPING)
- {
- WebApp webApp = dep.getAttachment(WebApp.class);
- if (webApp != null)
- {
- publisher.unpublish(webApp);
- }
- }
- }
-}
\ No newline at end of file
Added: projects/jboss-osgi/projects/bundles/webapp/trunk/src/main/java/org/jboss/osgi/webapp/internal/WebAppPublisherInterceptor.java
===================================================================
--- projects/jboss-osgi/projects/bundles/webapp/trunk/src/main/java/org/jboss/osgi/webapp/internal/WebAppPublisherInterceptor.java (rev 0)
+++ projects/jboss-osgi/projects/bundles/webapp/trunk/src/main/java/org/jboss/osgi/webapp/internal/WebAppPublisherInterceptor.java 2009-10-21 12:48:57 UTC (rev 95283)
@@ -0,0 +1,104 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * 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.osgi.webapp.internal;
+
+//$Id$
+
+import org.jboss.osgi.deployment.common.Deployment;
+import org.jboss.osgi.deployment.interceptor.AbstractLifecycleInterceptor;
+import org.jboss.osgi.deployment.interceptor.LifecycleInterceptor;
+import org.jboss.osgi.deployment.interceptor.LifecycleInterceptorException;
+import org.jboss.osgi.deployment.interceptor.LifecycleInterceptorService;
+import org.ops4j.pax.web.extender.war.internal.WebAppPublisherExt;
+import org.ops4j.pax.web.extender.war.internal.model.WebApp;
+import org.osgi.framework.Bundle;
+import org.osgi.framework.BundleContext;
+import org.osgi.framework.ServiceReference;
+import org.osgi.util.tracker.ServiceTracker;
+
+/**
+ * The WebApp lifecycle interceptor.
+ *
+ * @author thomas.diesler(a)jboss.com
+ * @since 20-Oct-2009
+ */
+public class WebAppPublisherInterceptor extends AbstractLifecycleInterceptor implements LifecycleInterceptor
+{
+ private BundleContext context;
+ private ServiceTracker serviceTracker;
+ private WebAppPublisherExt publisher;
+
+ public WebAppPublisherInterceptor(BundleContext context, WebAppPublisherExt publisher)
+ {
+ this.context = context;
+ this.publisher = publisher;
+
+ // Add the required input
+ addInput(WebApp.class);
+ }
+
+ public void start()
+ {
+ final LifecycleInterceptor interceptor = this;
+ serviceTracker = new ServiceTracker(context, LifecycleInterceptorService.class.getName(), null)
+ {
+ @Override
+ public Object addingService(ServiceReference reference)
+ {
+ LifecycleInterceptorService service = (LifecycleInterceptorService)super.addingService(reference);
+ service.addInterceptor(interceptor);
+ return service;
+ }
+
+ @Override
+ public void removedService(ServiceReference reference, Object service)
+ {
+ ((LifecycleInterceptorService)service).removeInterceptor(interceptor);
+ super.removedService(reference, service);
+ }
+ };
+ serviceTracker.open();
+ }
+
+ public void stop()
+ {
+ if (serviceTracker != null)
+ {
+ serviceTracker.close();
+ serviceTracker = null;
+ }
+ }
+
+ public void invoke(int state, Deployment dep) throws LifecycleInterceptorException
+ {
+ if (state == Bundle.STARTING)
+ {
+ WebApp webApp = dep.getAttachment(WebApp.class);
+ publisher.publish(webApp);
+ }
+ else if (state == Bundle.STOPPING)
+ {
+ WebApp webApp = dep.getAttachment(WebApp.class);
+ publisher.unpublish(webApp);
+ }
+ }
+}
\ No newline at end of file
Property changes on: projects/jboss-osgi/projects/bundles/webapp/trunk/src/main/java/org/jboss/osgi/webapp/internal/WebAppPublisherInterceptor.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Copied: projects/jboss-osgi/projects/bundles/webapp/trunk/src/main/java/org/jboss/osgi/webapp/internal/WebXMLParserInterceptor.java (from rev 95268, projects/jboss-osgi/projects/bundles/webapp/trunk/src/main/java/org/jboss/osgi/webapp/internal/WebAppInterceptor.java)
===================================================================
--- projects/jboss-osgi/projects/bundles/webapp/trunk/src/main/java/org/jboss/osgi/webapp/internal/WebXMLParserInterceptor.java (rev 0)
+++ projects/jboss-osgi/projects/bundles/webapp/trunk/src/main/java/org/jboss/osgi/webapp/internal/WebXMLParserInterceptor.java 2009-10-21 12:48:57 UTC (rev 95283)
@@ -0,0 +1,138 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * 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.osgi.webapp.internal;
+
+//$Id$
+
+import java.io.IOException;
+
+import org.jboss.osgi.deployment.common.Deployment;
+import org.jboss.osgi.deployment.interceptor.AbstractLifecycleInterceptor;
+import org.jboss.osgi.deployment.interceptor.LifecycleInterceptor;
+import org.jboss.osgi.deployment.interceptor.LifecycleInterceptorException;
+import org.jboss.osgi.deployment.interceptor.LifecycleInterceptorService;
+import org.jboss.virtual.VirtualFile;
+import org.ops4j.pax.web.extender.war.internal.model.WebApp;
+import org.ops4j.pax.web.extender.war.internal.parser.dom.DOMWebXmlParser;
+import org.osgi.framework.Bundle;
+import org.osgi.framework.BundleContext;
+import org.osgi.framework.ServiceReference;
+import org.osgi.util.tracker.ServiceTracker;
+
+/**
+ * The WebApp lifecycle interceptor.
+ *
+ * @author thomas.diesler(a)jboss.com
+ * @since 20-Oct-2009
+ */
+public class WebXMLParserInterceptor extends AbstractLifecycleInterceptor implements LifecycleInterceptor
+{
+ private BundleContext context;
+ private ServiceTracker serviceTracker;
+
+ public WebXMLParserInterceptor(BundleContext context)
+ {
+ this.context = context;
+
+ // Advertise output
+ addOutput(WebApp.class);
+ }
+
+ public void start()
+ {
+ final LifecycleInterceptor interceptor = this;
+ serviceTracker = new ServiceTracker(context, LifecycleInterceptorService.class.getName(), null)
+ {
+ @Override
+ public Object addingService(ServiceReference reference)
+ {
+ LifecycleInterceptorService service = (LifecycleInterceptorService)super.addingService(reference);
+ service.addInterceptor(interceptor);
+ return service;
+ }
+
+ @Override
+ public void removedService(ServiceReference reference, Object service)
+ {
+ ((LifecycleInterceptorService)service).removeInterceptor(interceptor);
+ super.removedService(reference, service);
+ }
+ };
+ serviceTracker.open();
+ }
+
+ public void stop()
+ {
+ if (serviceTracker != null)
+ {
+ serviceTracker.close();
+ serviceTracker = null;
+ }
+ }
+
+ public void invoke(int state, Deployment dep) throws LifecycleInterceptorException
+ {
+ if (state == Bundle.STARTING)
+ {
+ try
+ {
+ VirtualFile webXML = dep.getRoot().getChild("/WEB-INF/web.xml");
+ if (webXML != null)
+ {
+ // Create and attach the the WebApp metadata
+ WebApp webApp = createWebAppMetadata(dep, webXML);
+ dep.addAttachment(WebApp.class, webApp);
+ }
+ }
+ catch (IOException ex)
+ {
+ throw new LifecycleInterceptorException("Cannot parse web.xml", ex);
+ }
+ }
+ }
+
+ private WebApp createWebAppMetadata(Deployment dep, VirtualFile webXML) throws IOException
+ {
+ // Parse the web.xml
+ DOMWebXmlParser parser = new DOMWebXmlParser();
+ WebApp webApp = parser.parse(webXML.openStream());
+
+ // Associate the Bundle with the WebApp metadata
+ Bundle bundle = dep.getAttachment(Bundle.class);
+ webApp.setBundle(bundle);
+
+ // Set the context name as first looking for a manifest entry named Webapp-Context
+ // if not set use bundle symbolic name
+ String contextName = dep.getManifestHeader("Webapp-Context");
+ if (contextName == null)
+ {
+ contextName = bundle.getSymbolicName();
+ }
+ if ("/".equals(contextName.trim()))
+ {
+ contextName = "";
+ }
+ webApp.setContextName(contextName);
+
+ return webApp;
+ }
+}
\ No newline at end of file
16 years, 2 months
JBoss-OSGI SVN: r95279 - in projects/jboss-osgi/branches/pax182: testsuite and 1 other directory.
by jboss-osgi-commits@lists.jboss.org
Author: thomas.diesler(a)jboss.com
Date: 2009-10-21 07:55:14 -0400 (Wed, 21 Oct 2009)
New Revision: 95279
Modified:
projects/jboss-osgi/branches/pax182/pom.xml
projects/jboss-osgi/branches/pax182/testsuite/pom.xml
Log:
Upgrade to 0.7.1
Modified: projects/jboss-osgi/branches/pax182/pom.xml
===================================================================
--- projects/jboss-osgi/branches/pax182/pom.xml 2009-10-21 11:53:38 UTC (rev 95278)
+++ projects/jboss-osgi/branches/pax182/pom.xml 2009-10-21 11:55:14 UTC (rev 95279)
@@ -68,7 +68,7 @@
<version.jboss.osgi.webconsole>1.0.2</version.jboss.osgi.webconsole>
<version.jboss.osgi.xml.binding>2.0.1.SP1</version.jboss.osgi.xml.binding>
<version.ops4j.pax.base>1.2.1</version.ops4j.pax.base>
- <version.ops4j.pax.web>0.7.0</version.ops4j.pax.web>
+ <version.ops4j.pax.web>0.7.1</version.ops4j.pax.web>
<version.osgi>r4v42</version.osgi>
</properties>
Modified: projects/jboss-osgi/branches/pax182/testsuite/pom.xml
===================================================================
--- projects/jboss-osgi/branches/pax182/testsuite/pom.xml 2009-10-21 11:53:38 UTC (rev 95278)
+++ projects/jboss-osgi/branches/pax182/testsuite/pom.xml 2009-10-21 11:55:14 UTC (rev 95279)
@@ -125,11 +125,13 @@
</dependency>
<!-- Ops4J -->
- <dependency>
+
+ <!--dependency>
<groupId>org.ops4j.base</groupId>
<artifactId>ops4j-base-util-xml</artifactId>
<scope>provided</scope>
- </dependency>
+ </dependency-->
+
<dependency>
<groupId>org.ops4j.pax.web</groupId>
<artifactId>pax-web-jetty-bundle</artifactId>
16 years, 2 months
JBoss-OSGI SVN: r95276 - projects/jboss-osgi/branches.
by jboss-osgi-commits@lists.jboss.org
Author: thomas.diesler(a)jboss.com
Date: 2009-10-21 07:44:46 -0400 (Wed, 21 Oct 2009)
New Revision: 95276
Added:
projects/jboss-osgi/branches/pax182/
Log:
PAX-182 branch
Copied: projects/jboss-osgi/branches/pax182 (from rev 95275, projects/jboss-osgi/tags/jboss-osgi-1.0.0.Beta4)
16 years, 2 months
JBoss-OSGI SVN: r95272 - in projects/jboss-osgi/trunk: testsuite and 2 other directories.
by jboss-osgi-commits@lists.jboss.org
Author: thomas.diesler(a)jboss.com
Date: 2009-10-21 05:40:01 -0400 (Wed, 21 Oct 2009)
New Revision: 95272
Modified:
projects/jboss-osgi/trunk/pom.xml
projects/jboss-osgi/trunk/testsuite/example/scripts/assembly-bundles.xml
projects/jboss-osgi/trunk/testsuite/functional/scripts/assembly-bundles.xml
projects/jboss-osgi/trunk/testsuite/pom.xml
Log:
Revert back to pax-web-0.7.0
http://issues.ops4j.org/browse/PAXWEB-182
Modified: projects/jboss-osgi/trunk/pom.xml
===================================================================
--- projects/jboss-osgi/trunk/pom.xml 2009-10-21 08:56:14 UTC (rev 95271)
+++ projects/jboss-osgi/trunk/pom.xml 2009-10-21 09:40:01 UTC (rev 95272)
@@ -67,9 +67,11 @@
<version.jboss.osgi.runtime.felix>2.0.1-SNAPSHOT</version.jboss.osgi.runtime.felix>
<version.jboss.osgi.runtime.jbossas>1.0.2-SNAPSHOT</version.jboss.osgi.runtime.jbossas>
<version.jboss.osgi.spi>1.0.3-SNAPSHOT</version.jboss.osgi.spi>
+ <version.jboss.osgi.webapp>0.7.0-SNAPSHOT</version.jboss.osgi.webapp>
<version.jboss.osgi.webconsole>1.0.2</version.jboss.osgi.webconsole>
<version.jboss.osgi.xml.binding>2.0.1.SP1</version.jboss.osgi.xml.binding>
- <version.ops4j.pax.web>0.7.1</version.ops4j.pax.web>
+ <version.ops4j.pax.base>1.2.1</version.ops4j.pax.base>
+ <version.ops4j.pax.web>0.7.0</version.ops4j.pax.web>
<version.osgi>4.2.0</version.osgi>
</properties>
@@ -149,6 +151,11 @@
</dependency>
<dependency>
<groupId>org.jboss.osgi.bundles</groupId>
+ <artifactId>jboss-osgi-webapp</artifactId>
+ <version>${version.jboss.osgi.webapp}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.jboss.osgi.bundles</groupId>
<artifactId>jboss-osgi-webconsole</artifactId>
<version>${version.jboss.osgi.webconsole}</version>
</dependency>
@@ -223,6 +230,15 @@
<!-- OPS4J -->
<dependency>
+ <!--
+ [TODO] Invalid maven dependency on pax base
+ http://issues.ops4j.org/browse/PAXWEB-177
+ -->
+ <groupId>org.ops4j.base</groupId>
+ <artifactId>ops4j-base-util-xml</artifactId>
+ <version>${version.ops4j.pax.base}</version>
+ </dependency>
+ <dependency>
<groupId>org.ops4j.pax.web</groupId>
<artifactId>pax-web-extender-war</artifactId>
<version>${version.ops4j.pax.web}</version>
Modified: projects/jboss-osgi/trunk/testsuite/example/scripts/assembly-bundles.xml
===================================================================
--- projects/jboss-osgi/trunk/testsuite/example/scripts/assembly-bundles.xml 2009-10-21 08:56:14 UTC (rev 95271)
+++ projects/jboss-osgi/trunk/testsuite/example/scripts/assembly-bundles.xml 2009-10-21 09:40:01 UTC (rev 95272)
@@ -26,6 +26,7 @@
<include>*:jboss-osgi-jndi:jar</include>
<include>*:jboss-osgi-microcontainer:jar</include>
<include>*:jboss-osgi-xml-binding:jar</include>
+ <include>*:jboss-osgi-webapp:jar</include>
<include>*:org.apache.felix.configadmin:jar</include>
<include>*:org.apache.felix.log:jar</include>
<include>*:org.apache.felix.metatype:jar</include>
Modified: projects/jboss-osgi/trunk/testsuite/functional/scripts/assembly-bundles.xml
===================================================================
--- projects/jboss-osgi/trunk/testsuite/functional/scripts/assembly-bundles.xml 2009-10-21 08:56:14 UTC (rev 95271)
+++ projects/jboss-osgi/trunk/testsuite/functional/scripts/assembly-bundles.xml 2009-10-21 09:40:01 UTC (rev 95272)
@@ -26,6 +26,7 @@
<include>*:jboss-osgi-jndi:jar</include>
<include>*:jboss-osgi-microcontainer:jar</include>
<include>*:jboss-osgi-xml-binding:jar</include>
+ <include>*:jboss-osgi-webapp:jar</include>
<include>*:org.apache.felix.configadmin:jar</include>
<include>*:org.apache.felix.log:jar</include>
<include>*:org.apache.felix.metatype:jar</include>
Modified: projects/jboss-osgi/trunk/testsuite/pom.xml
===================================================================
--- projects/jboss-osgi/trunk/testsuite/pom.xml 2009-10-21 08:56:14 UTC (rev 95271)
+++ projects/jboss-osgi/trunk/testsuite/pom.xml 2009-10-21 09:40:01 UTC (rev 95272)
@@ -128,9 +128,19 @@
<artifactId>jboss-osgi-jaxb</artifactId>
<scope>provided</scope>
</dependency>
+ <dependency>
+ <groupId>org.jboss.osgi.bundles</groupId>
+ <artifactId>jboss-osgi-webapp</artifactId>
+ <scope>provided</scope>
+ </dependency>
<!-- Ops4J -->
<dependency>
+ <groupId>org.ops4j.base</groupId>
+ <artifactId>ops4j-base-util-xml</artifactId>
+ <scope>provided</scope>
+ </dependency>
+ <dependency>
<groupId>org.ops4j.pax.web</groupId>
<artifactId>pax-web-jetty-bundle</artifactId>
<scope>provided</scope>
16 years, 2 months
JBoss-OSGI SVN: r95271 - in projects/jboss-osgi/trunk: distribution/installer/src/main/resources/runtime/server/conf and 3 other directories.
by jboss-osgi-commits@lists.jboss.org
Author: thomas.diesler(a)jboss.com
Date: 2009-10-21 04:56:14 -0400 (Wed, 21 Oct 2009)
New Revision: 95271
Modified:
projects/jboss-osgi/trunk/distribution/installer/src/main/resources/jbossas/jboss-beans-jbossmc.xml
projects/jboss-osgi/trunk/distribution/installer/src/main/resources/runtime/server/conf/jboss-osgi-bootstrap.xml
projects/jboss-osgi/trunk/reactor/framework/src/main/java/org/jboss/osgi/framework/plugins/internal/FrameworkEventsPluginImpl.java
projects/jboss-osgi/trunk/testsuite/example/src/test/resources/META-INF/jboss-osgi-bootstrap.xml
projects/jboss-osgi/trunk/testsuite/functional/src/test/resources/META-INF/jboss-osgi-bootstrap.xml
Log:
Fix slf4j runtime logging
Modified: projects/jboss-osgi/trunk/distribution/installer/src/main/resources/jbossas/jboss-beans-jbossmc.xml
===================================================================
--- projects/jboss-osgi/trunk/distribution/installer/src/main/resources/jbossas/jboss-beans-jbossmc.xml 2009-10-21 08:55:06 UTC (rev 95270)
+++ projects/jboss-osgi/trunk/distribution/installer/src/main/resources/jbossas/jboss-beans-jbossmc.xml 2009-10-21 08:56:14 UTC (rev 95271)
@@ -21,8 +21,9 @@
<entry><key>org.osgi.framework.storage.clean</key><value>onFirstInit</value></entry>
<entry><key>org.osgi.framework.system.packages.extra</key><value>
- <!-- log4j -->
+ <!-- loging -->
org.apache.log4j;version=1.2,
+ org.slf4j;version=1.5,
<!-- jboss -->
org.jboss.beans.metadata.plugins;version=2.0,
Modified: projects/jboss-osgi/trunk/distribution/installer/src/main/resources/runtime/server/conf/jboss-osgi-bootstrap.xml
===================================================================
--- projects/jboss-osgi/trunk/distribution/installer/src/main/resources/runtime/server/conf/jboss-osgi-bootstrap.xml 2009-10-21 08:55:06 UTC (rev 95270)
+++ projects/jboss-osgi/trunk/distribution/installer/src/main/resources/runtime/server/conf/jboss-osgi-bootstrap.xml 2009-10-21 08:56:14 UTC (rev 95271)
@@ -22,8 +22,9 @@
<!-- [JBOSGI-145] JAXB classes are loaded from the system classpath -->
com.sun.xml.internal.bind.v2,
- <!-- log4j -->
+ <!-- loging -->
org.apache.log4j;version=1.2,
+ org.slf4j;version=1.5,
<!-- jboss -->
org.jboss.beans.metadata.plugins;version=2.0,
Modified: projects/jboss-osgi/trunk/reactor/framework/src/main/java/org/jboss/osgi/framework/plugins/internal/FrameworkEventsPluginImpl.java
===================================================================
--- projects/jboss-osgi/trunk/reactor/framework/src/main/java/org/jboss/osgi/framework/plugins/internal/FrameworkEventsPluginImpl.java 2009-10-21 08:55:06 UTC (rev 95270)
+++ projects/jboss-osgi/trunk/reactor/framework/src/main/java/org/jboss/osgi/framework/plugins/internal/FrameworkEventsPluginImpl.java 2009-10-21 08:56:14 UTC (rev 95271)
@@ -26,8 +26,10 @@
import java.security.AccessControlContext;
import java.security.AccessController;
import java.util.ArrayList;
+import java.util.HashSet;
import java.util.List;
import java.util.Map;
+import java.util.Set;
import java.util.Map.Entry;
import java.util.concurrent.ConcurrentHashMap;
import java.util.concurrent.CopyOnWriteArrayList;
@@ -63,26 +65,28 @@
// Provide logging
final Logger log = Logger.getLogger(FrameworkEventsPluginImpl.class);
- /** The executor service */
- private ExecutorService executorService;
-
- /** True for synchronous event delivery */
- private boolean synchronous;
-
/** The bundle listeners */
private final Map<Bundle, List<BundleListener>> bundleListeners = new ConcurrentHashMap<Bundle, List<BundleListener>>();
-
/** The framework listeners */
private final Map<Bundle, List<FrameworkListener>> frameworkListeners = new ConcurrentHashMap<Bundle, List<FrameworkListener>>();
-
/** The service listeners */
private final Map<Bundle, List<ServiceListenerRegistration>> serviceListeners = new ConcurrentHashMap<Bundle, List<ServiceListenerRegistration>>();
+ /** The executor service */
+ private ExecutorService executorService;
+ /** True for synchronous event delivery */
+ private boolean synchronous;
+ /** The set of bundle events taht cause an info log */
+ private Set<Integer> infoEvents = new HashSet<Integer>();
+
public FrameworkEventsPluginImpl(OSGiBundleManager bundleManager)
{
super(bundleManager);
-
- this.executorService = Executors.newCachedThreadPool();
+ executorService = Executors.newCachedThreadPool();
+ infoEvents.add(new Integer(BundleEvent.INSTALLED));
+ infoEvents.add(new Integer(BundleEvent.STARTED));
+ infoEvents.add(new Integer(BundleEvent.STOPPED));
+ infoEvents.add(new Integer(BundleEvent.UNINSTALLED));
}
public void setSynchronous(boolean synchronous)
@@ -258,7 +262,10 @@
final BundleEvent event = new OSGiBundleEvent(type, assertBundle(bundle));
final String typeName = ConstantsHelper.bundleEvent(event.getType());
- log.info("Bundle " + typeName + ": " + bundle);
+ if (infoEvents.contains(event.getType()))
+ log.info("Bundle " + typeName + ": " + bundle);
+ else
+ log.debug("Bundle " + typeName + ": " + bundle);
// Nobody is interested
if (listeners.isEmpty())
Modified: projects/jboss-osgi/trunk/testsuite/example/src/test/resources/META-INF/jboss-osgi-bootstrap.xml
===================================================================
--- projects/jboss-osgi/trunk/testsuite/example/src/test/resources/META-INF/jboss-osgi-bootstrap.xml 2009-10-21 08:55:06 UTC (rev 95270)
+++ projects/jboss-osgi/trunk/testsuite/example/src/test/resources/META-INF/jboss-osgi-bootstrap.xml 2009-10-21 08:56:14 UTC (rev 95271)
@@ -22,8 +22,9 @@
<!-- [JBOSGI-145] JAXB classes are loaded from the system classpath -->
com.sun.xml.internal.bind.v2,
- <!-- log4j -->
+ <!-- loging -->
org.apache.log4j;version=1.2,
+ org.slf4j;version=1.5,
<!-- jboss -->
org.jboss.beans.metadata.plugins;version=2.0,
Modified: projects/jboss-osgi/trunk/testsuite/functional/src/test/resources/META-INF/jboss-osgi-bootstrap.xml
===================================================================
--- projects/jboss-osgi/trunk/testsuite/functional/src/test/resources/META-INF/jboss-osgi-bootstrap.xml 2009-10-21 08:55:06 UTC (rev 95270)
+++ projects/jboss-osgi/trunk/testsuite/functional/src/test/resources/META-INF/jboss-osgi-bootstrap.xml 2009-10-21 08:56:14 UTC (rev 95271)
@@ -22,8 +22,9 @@
<!-- [JBOSGI-145] JAXB classes are loaded from the system classpath -->
com.sun.xml.internal.bind.v2,
- <!-- log4j -->
+ <!-- loging -->
org.apache.log4j;version=1.2,
+ org.slf4j;version=1.5,
<!-- jboss -->
org.jboss.beans.metadata.plugins;version=2.0,
16 years, 2 months
JBoss-OSGI SVN: r95270 - projects/jboss-osgi/projects/spi/trunk/src/main/java/org/jboss/osgi/spi/framework.
by jboss-osgi-commits@lists.jboss.org
Author: thomas.diesler(a)jboss.com
Date: 2009-10-21 04:55:06 -0400 (Wed, 21 Oct 2009)
New Revision: 95270
Modified:
projects/jboss-osgi/projects/spi/trunk/src/main/java/org/jboss/osgi/spi/framework/OSGiBootstrap.java
Log:
Resurrect boottime log
Modified: projects/jboss-osgi/projects/spi/trunk/src/main/java/org/jboss/osgi/spi/framework/OSGiBootstrap.java
===================================================================
--- projects/jboss-osgi/projects/spi/trunk/src/main/java/org/jboss/osgi/spi/framework/OSGiBootstrap.java 2009-10-21 07:49:38 UTC (rev 95269)
+++ projects/jboss-osgi/projects/spi/trunk/src/main/java/org/jboss/osgi/spi/framework/OSGiBootstrap.java 2009-10-21 08:55:06 UTC (rev 95270)
@@ -208,6 +208,7 @@
public void run()
{
// Start the framework
+ long beforeStart = System.currentTimeMillis();
try
{
framework.start();
@@ -216,7 +217,10 @@
{
throw new IllegalStateException("Cannot start framework", ex);
}
-
+
+ float diff = (System.currentTimeMillis() - beforeStart) / 1000f;
+ log.info("JBossOSGi Runtime booted in " + diff + "sec");
+
Reader br = new InputStreamReader(System.in);
try
{
16 years, 2 months
JBoss-OSGI SVN: r95269 - projects/jboss-osgi/projects/bundles/webapp/tags.
by jboss-osgi-commits@lists.jboss.org
Author: thomas.diesler(a)jboss.com
Date: 2009-10-21 03:49:38 -0400 (Wed, 21 Oct 2009)
New Revision: 95269
Removed:
projects/jboss-osgi/projects/bundles/webapp/tags/jboss-osgi-hotdeploy-1.0.0/
projects/jboss-osgi/projects/bundles/webapp/tags/jboss-osgi-hotdeploy-1.0.1/
Log:
Delete invalid tags
16 years, 2 months
JBoss-OSGI SVN: r95267 - in projects/jboss-osgi: projects/spi/trunk/src/main/java/org/jboss/osgi/spi/testing/internal and 5 other directories.
by jboss-osgi-commits@lists.jboss.org
Author: thomas.diesler(a)jboss.com
Date: 2009-10-21 03:28:16 -0400 (Wed, 21 Oct 2009)
New Revision: 95267
Modified:
projects/jboss-osgi/projects/bundles/hotdeploy/trunk/src/main/java/org/jboss/osgi/hotdeploy/internal/DeploymentScannerImpl.java
projects/jboss-osgi/projects/spi/trunk/src/main/java/org/jboss/osgi/spi/testing/internal/RemoteRuntime.java
projects/jboss-osgi/projects/spi/trunk/src/main/java/org/jboss/osgi/spi/util/BundleInfo.java
projects/jboss-osgi/trunk/distribution/installer/src/main/resources/installer/install-definition.xml
projects/jboss-osgi/trunk/reactor/deployment/src/main/java/org/jboss/osgi/deployment/deployer/AbstractDeployerService.java
projects/jboss-osgi/trunk/reactor/deployment/src/main/java/org/jboss/osgi/deployment/deployer/DeployerService.java
projects/jboss-osgi/trunk/reactor/framework/src/main/java/org/jboss/osgi/framework/bundle/OSGiBundleManager.java
projects/jboss-osgi/trunk/reactor/framework/src/main/java/org/jboss/osgi/framework/service/internal/DeployerServiceImpl.java
projects/jboss-osgi/trunk/reactor/framework/src/main/java/org/jboss/osgi/framework/service/internal/LifecycleInterceptorServiceImpl.java
Log:
Use RTE for BundleInfo, Deployment construction
Provide Depployemnt lazily
Modified: projects/jboss-osgi/projects/bundles/hotdeploy/trunk/src/main/java/org/jboss/osgi/hotdeploy/internal/DeploymentScannerImpl.java
===================================================================
--- projects/jboss-osgi/projects/bundles/hotdeploy/trunk/src/main/java/org/jboss/osgi/hotdeploy/internal/DeploymentScannerImpl.java 2009-10-21 07:26:16 UTC (rev 95266)
+++ projects/jboss-osgi/projects/bundles/hotdeploy/trunk/src/main/java/org/jboss/osgi/hotdeploy/internal/DeploymentScannerImpl.java 2009-10-21 07:28:16 UTC (rev 95267)
@@ -39,7 +39,6 @@
import org.jboss.osgi.deployment.scanner.DeploymentScannerService;
import org.osgi.framework.Bundle;
import org.osgi.framework.BundleContext;
-import org.osgi.framework.BundleException;
import org.osgi.framework.ServiceReference;
import org.osgi.framework.Version;
import org.slf4j.Logger;
@@ -104,7 +103,7 @@
String scandir = scanLocation.getAbsolutePath();
if (scandir.startsWith(osgiHome))
scandir = "..." + scandir.substring(osgiHome.length());
-
+
log.info("Start DeploymentScanner: [scandir=" + scandir + ",interval=" + scanInterval + "ms]");
scannerThread = new ScannerThread(context, this);
lastChange = System.currentTimeMillis();
@@ -132,7 +131,7 @@
if (oldDiff + newDiff > 0)
lastChange = System.currentTimeMillis();
-
+
lastScan = currScan;
scanCount++;
@@ -180,7 +179,7 @@
}
logBundleDeployments("OLD diff", diff);
-
+
// Undeploy the bundles through the DeployerService
if (diff.size() > 0)
{
@@ -194,7 +193,7 @@
log.error("Cannot undeploy bundles", ex);
}
}
-
+
return diff.size();
}
@@ -226,18 +225,18 @@
log.error("Cannot deploy bundles", ex);
}
}
-
+
return diff.size();
}
public Deployment[] getBundleDeployments()
{
List<Deployment> bundles = new ArrayList<Deployment>();
-
+
File[] listFiles = scanLocation.listFiles();
if (listFiles == null)
log.warn("Cannot list files in: " + scanLocation);
-
+
if (listFiles != null)
{
for (File file : listFiles)
@@ -246,27 +245,20 @@
Deployment dep = deploymentCache.get(bundleURL.toExternalForm());
if (dep == null)
{
- try
- {
- // hot-deploy bundles are started automatically
- dep = deployer.createDeployment(bundleURL);
- dep.setAutoStart(true);
-
- deploymentCache.put(bundleURL.toExternalForm(), dep);
- }
- catch (BundleException ex)
- {
- log.warn("Cannot obtain bundle deployment for: " + file);
- }
+ // hot-deploy bundles are started automatically
+ dep = deployer.createDeployment(bundleURL);
+ dep.setAutoStart(true);
+
+ deploymentCache.put(bundleURL.toExternalForm(), dep);
}
bundles.add(dep);
}
}
-
+
Deployment[] arr = new Deployment[bundles.size()];
return bundles.toArray(arr);
}
-
+
private void initScanner(BundleContext context)
{
scanInterval = 2000;
@@ -323,7 +315,7 @@
}
return bundle;
}
-
+
private URL toURL(File file)
{
try
Modified: projects/jboss-osgi/projects/spi/trunk/src/main/java/org/jboss/osgi/spi/testing/internal/RemoteRuntime.java
===================================================================
--- projects/jboss-osgi/projects/spi/trunk/src/main/java/org/jboss/osgi/spi/testing/internal/RemoteRuntime.java 2009-10-21 07:26:16 UTC (rev 95266)
+++ projects/jboss-osgi/projects/spi/trunk/src/main/java/org/jboss/osgi/spi/testing/internal/RemoteRuntime.java 2009-10-21 07:28:16 UTC (rev 95267)
@@ -127,7 +127,7 @@
BundleInfo.createBundleInfo(archiveURL);
return true;
}
- catch (BundleException ex)
+ catch (RuntimeException ex)
{
return false;
}
Modified: projects/jboss-osgi/projects/spi/trunk/src/main/java/org/jboss/osgi/spi/util/BundleInfo.java
===================================================================
--- projects/jboss-osgi/projects/spi/trunk/src/main/java/org/jboss/osgi/spi/util/BundleInfo.java 2009-10-21 07:26:16 UTC (rev 95266)
+++ projects/jboss-osgi/projects/spi/trunk/src/main/java/org/jboss/osgi/spi/util/BundleInfo.java 2009-10-21 07:28:16 UTC (rev 95267)
@@ -33,7 +33,6 @@
import org.jboss.virtual.VFS;
import org.jboss.virtual.VFSUtils;
import org.jboss.virtual.VirtualFile;
-import org.osgi.framework.BundleException;
import org.osgi.framework.Constants;
/**
@@ -50,7 +49,7 @@
private String symbolicName;
private String version;
- public static BundleInfo createBundleInfo(String location) throws BundleException
+ public static BundleInfo createBundleInfo(String location)
{
if (location == null)
throw new IllegalArgumentException("Location cannot be null");
@@ -91,13 +90,13 @@
}
catch (IOException e)
{
- throw new BundleException("Invalid bundle location=" + url, e);
+ throw new IllegalArgumentException("Invalid bundle location=" + url, e);
}
return new BundleInfo(root, location);
}
- public static BundleInfo createBundleInfo(URL url) throws BundleException
+ public static BundleInfo createBundleInfo(URL url)
{
if (url == null)
throw new IllegalArgumentException("URL cannot be null");
@@ -109,18 +108,18 @@
}
catch (IOException e)
{
- throw new BundleException("Invalid bundle location=" + url, e);
+ throw new IllegalArgumentException("Invalid bundle location=" + url, e);
}
return new BundleInfo(root, url.toExternalForm());
}
- public static BundleInfo createBundleInfo(VirtualFile root) throws BundleException
+ public static BundleInfo createBundleInfo(VirtualFile root)
{
return new BundleInfo(root, null);
}
- private BundleInfo(VirtualFile root, String location) throws BundleException
+ private BundleInfo(VirtualFile root, String location)
{
if (root == null)
throw new IllegalArgumentException("VirtualFile cannot be null");
@@ -148,12 +147,12 @@
}
catch (Exception ex)
{
- throw new BundleException("Cannot get manifest from: " + root, ex);
+ throw new IllegalArgumentException("Cannot get manifest from: " + root, ex);
}
symbolicName = getManifestHeader(Constants.BUNDLE_SYMBOLICNAME);
if (symbolicName == null)
- throw new BundleException("Cannot obtain Bundle-SymbolicName for: " + root);
+ throw new IllegalArgumentException("Cannot obtain Bundle-SymbolicName for: " + root);
version = getManifestHeader(Constants.BUNDLE_VERSION);
if (version == null)
Modified: projects/jboss-osgi/trunk/distribution/installer/src/main/resources/installer/install-definition.xml
===================================================================
--- projects/jboss-osgi/trunk/distribution/installer/src/main/resources/installer/install-definition.xml 2009-10-21 07:26:16 UTC (rev 95266)
+++ projects/jboss-osgi/trunk/distribution/installer/src/main/resources/installer/install-definition.xml 2009-10-21 07:28:16 UTC (rev 95267)
@@ -385,17 +385,15 @@
<fileset condition="isFelix" dir="@{deploy.artifacts.dir}/lib" targetdir="${jbossInstallPath}/server/${jbossTargetServer}/deployers/osgi.deployer"
override="true">
+ <include name="jboss-osgi-deployment.jar" />
<include name="jboss-osgi-runtime-felix.jar" />
<include name="jboss-osgi-runtime-jbossas.jar" />
<include name="org.apache.felix.framework.jar" />
</fileset>
<singlefile condition="isFelix" src="@{deploy.artifacts.dir}/resources/jbossas/jboss-beans-felix.xml" target="${jbossInstallPath}/server/${jbossTargetServer}/deployers/osgi.deployer/META-INF/jboss-osgi-jboss-beans.xml"
override="true" />
- <fileset condition="isFelix" dir="@{deploy.artifacts.dir}/lib" targetdir="${jbossInstallPath}/server/${jbossTargetServer}/deployers/osgi.deployer"
- override="true">
- <include name="jboss-osgi-runtime-jbossas.jar" />
- </fileset>
<fileset condition="isFelix" dir="@{deploy.artifacts.dir}/lib" targetdir="${jbossInstallPath}/server/${jbossTargetServer}/deploy/osgi" override="true">
+ <include name="jboss-osgi-deployment.jar" />
<include name="org.apache.felix.configadmin.jar" />
<include name="org.apache.felix.metatype.jar" />
</fileset>
@@ -408,6 +406,7 @@
<fileset condition="isEquinox" dir="@{deploy.artifacts.dir}/lib" targetdir="${jbossInstallPath}/server/${jbossTargetServer}/deployers/osgi.deployer"
override="true">
+ <include name="jboss-osgi-deployment.jar" />
<include name="jboss-osgi-runtime-equinox.jar" />
<include name="jboss-osgi-runtime-jbossas.jar" />
<include name="org.apache.equinox.framework.jar" />
@@ -415,11 +414,8 @@
</fileset>
<singlefile condition="isEquinox" src="@{deploy.artifacts.dir}/resources/jbossas/jboss-beans-equinox.xml" target="${jbossInstallPath}/server/${jbossTargetServer}/deployers/osgi.deployer/META-INF/jboss-osgi-jboss-beans.xml"
override="true" />
- <fileset condition="isEquinox" dir="@{deploy.artifacts.dir}/lib" targetdir="${jbossInstallPath}/server/${jbossTargetServer}/deployers/osgi.deployer"
- override="true">
- <include name="jboss-osgi-runtime-jbossas.jar" />
- </fileset>
<fileset condition="isEquinox" dir="@{deploy.artifacts.dir}/lib" targetdir="${jbossInstallPath}/server/${jbossTargetServer}/deploy/osgi" override="true">
+ <include name="jboss-osgi-deployment.jar" />
<include name="org.apache.felix.configadmin.jar" />
<include name="org.apache.felix.metatype.jar" />
<include name="org.eclipse.osgi.services.jar" />
@@ -430,6 +426,7 @@
<fileset condition="isJBossMC" dir="@{deploy.artifacts.dir}/lib" targetdir="${jbossInstallPath}/server/${jbossTargetServer}/deployers/osgi.deployer"
override="true">
<include name="jboss-osgi-framework.jar" />
+ <include name="jboss-osgi-deployment.jar" />
</fileset>
<singlefile condition="isJBossMC" src="@{deploy.artifacts.dir}/resources/jbossas/jboss-beans-jbossmc.xml" target="${jbossInstallPath}/server/${jbossTargetServer}/deployers/osgi.deployer/META-INF/jboss-osgi-jboss-beans.xml"
override="true" />
Modified: projects/jboss-osgi/trunk/reactor/deployment/src/main/java/org/jboss/osgi/deployment/deployer/AbstractDeployerService.java
===================================================================
--- projects/jboss-osgi/trunk/reactor/deployment/src/main/java/org/jboss/osgi/deployment/deployer/AbstractDeployerService.java 2009-10-21 07:26:16 UTC (rev 95266)
+++ projects/jboss-osgi/trunk/reactor/deployment/src/main/java/org/jboss/osgi/deployment/deployer/AbstractDeployerService.java 2009-10-21 07:28:16 UTC (rev 95267)
@@ -28,7 +28,7 @@
import org.jboss.osgi.deployment.common.Deployment;
import org.jboss.osgi.deployment.internal.DeploymentImpl;
import org.jboss.osgi.spi.util.BundleInfo;
-import org.osgi.framework.BundleException;
+import org.jboss.virtual.VirtualFile;
/**
* An abstract base implementation of the DeployerService.
@@ -38,9 +38,15 @@
*/
public abstract class AbstractDeployerService implements DeployerService
{
- public Deployment createDeployment(URL url) throws BundleException
+ public Deployment createDeployment(URL url)
{
BundleInfo info = BundleInfo.createBundleInfo(url);
return new DeploymentImpl(info);
}
+
+ public Deployment createDeployment(VirtualFile file)
+ {
+ BundleInfo info = BundleInfo.createBundleInfo(file);
+ return new DeploymentImpl(info);
+ }
}
\ No newline at end of file
Modified: projects/jboss-osgi/trunk/reactor/deployment/src/main/java/org/jboss/osgi/deployment/deployer/DeployerService.java
===================================================================
--- projects/jboss-osgi/trunk/reactor/deployment/src/main/java/org/jboss/osgi/deployment/deployer/DeployerService.java 2009-10-21 07:26:16 UTC (rev 95266)
+++ projects/jboss-osgi/trunk/reactor/deployment/src/main/java/org/jboss/osgi/deployment/deployer/DeployerService.java 2009-10-21 07:28:16 UTC (rev 95267)
@@ -29,6 +29,7 @@
import org.jboss.osgi.deployment.common.Deployment;
import org.jboss.osgi.spi.management.ObjectNameFactory;
+import org.jboss.virtual.VirtualFile;
import org.osgi.framework.BundleException;
/**
@@ -47,8 +48,13 @@
/**
* Create a deployment from the given location.
*/
- Deployment createDeployment(URL url) throws BundleException;
+ Deployment createDeployment(URL url);
+ /**
+ * Create a deployment from the given file.
+ */
+ Deployment createDeployment(VirtualFile file);
+
/**
* Deploy an array of bundles
*/
Modified: projects/jboss-osgi/trunk/reactor/framework/src/main/java/org/jboss/osgi/framework/bundle/OSGiBundleManager.java
===================================================================
--- projects/jboss-osgi/trunk/reactor/framework/src/main/java/org/jboss/osgi/framework/bundle/OSGiBundleManager.java 2009-10-21 07:26:16 UTC (rev 95266)
+++ projects/jboss-osgi/trunk/reactor/framework/src/main/java/org/jboss/osgi/framework/bundle/OSGiBundleManager.java 2009-10-21 07:28:16 UTC (rev 95267)
@@ -63,8 +63,6 @@
import org.jboss.deployers.vfs.spi.client.VFSDeploymentFactory;
import org.jboss.kernel.Kernel;
import org.jboss.logging.Logger;
-import org.jboss.osgi.deployment.common.Deployment;
-import org.jboss.osgi.deployment.internal.DeploymentImpl;
import org.jboss.osgi.framework.filter.NoFilter;
import org.jboss.osgi.framework.metadata.OSGiMetaData;
import org.jboss.osgi.framework.metadata.internal.AbstractOSGiMetaData;
@@ -75,7 +73,6 @@
import org.jboss.osgi.framework.plugins.Plugin;
import org.jboss.osgi.framework.plugins.ServicePlugin;
import org.jboss.osgi.framework.resolver.BundleResolver;
-import org.jboss.osgi.spi.util.BundleInfo;
import org.jboss.util.collection.ConcurrentSet;
import org.jboss.virtual.VFS;
import org.jboss.virtual.VFSUtils;
@@ -475,11 +472,6 @@
att.addAttachment(PROPERTY_AUTO_START, Boolean.FALSE);
att.addAttachment(PROPERTY_BUNDLE_LOCATION, location);
- // Add the deployment used by lifecycle interceptors
- BundleInfo info = BundleInfo.createBundleInfo(root);
- Deployment dep = new DeploymentImpl(info);
- att.addAttachment(Deployment.class, dep);
-
deployerClient.deploy(deployment);
try
{
Modified: projects/jboss-osgi/trunk/reactor/framework/src/main/java/org/jboss/osgi/framework/service/internal/DeployerServiceImpl.java
===================================================================
--- projects/jboss-osgi/trunk/reactor/framework/src/main/java/org/jboss/osgi/framework/service/internal/DeployerServiceImpl.java 2009-10-21 07:26:16 UTC (rev 95266)
+++ projects/jboss-osgi/trunk/reactor/framework/src/main/java/org/jboss/osgi/framework/service/internal/DeployerServiceImpl.java 2009-10-21 07:28:16 UTC (rev 95267)
@@ -35,6 +35,7 @@
import org.jboss.osgi.framework.bundle.OSGiBundleManager;
import org.jboss.osgi.framework.plugins.DeployerServicePlugin;
import org.jboss.osgi.framework.plugins.internal.AbstractServicePluginImpl;
+import org.jboss.virtual.VirtualFile;
import org.osgi.framework.BundleContext;
import org.osgi.framework.BundleException;
@@ -74,11 +75,16 @@
// do nothing
}
- public Deployment createDeployment(URL url) throws BundleException
+ public Deployment createDeployment(URL url)
{
return delegate.createDeployment(url);
}
+ public Deployment createDeployment(VirtualFile file)
+ {
+ return delegate.createDeployment(file);
+ }
+
public void deploy(Deployment[] bundleDeps) throws BundleException
{
delegate.deploy(bundleDeps);
Modified: projects/jboss-osgi/trunk/reactor/framework/src/main/java/org/jboss/osgi/framework/service/internal/LifecycleInterceptorServiceImpl.java
===================================================================
--- projects/jboss-osgi/trunk/reactor/framework/src/main/java/org/jboss/osgi/framework/service/internal/LifecycleInterceptorServiceImpl.java 2009-10-21 07:26:16 UTC (rev 95266)
+++ projects/jboss-osgi/trunk/reactor/framework/src/main/java/org/jboss/osgi/framework/service/internal/LifecycleInterceptorServiceImpl.java 2009-10-21 07:28:16 UTC (rev 95267)
@@ -23,9 +23,10 @@
//$Id$
-import org.jboss.deployers.structure.spi.DeploymentUnit;
+import org.jboss.deployers.vfs.spi.structure.VFSDeploymentUnit;
import org.jboss.logging.Logger;
import org.jboss.osgi.deployment.common.Deployment;
+import org.jboss.osgi.deployment.deployer.DeployerService;
import org.jboss.osgi.deployment.interceptor.AbstractLifecycleInterceptorService;
import org.jboss.osgi.deployment.interceptor.LifecycleInterceptor;
import org.jboss.osgi.deployment.interceptor.LifecycleInterceptorService;
@@ -35,6 +36,7 @@
import org.jboss.osgi.framework.plugins.internal.AbstractServicePluginImpl;
import org.osgi.framework.Bundle;
import org.osgi.framework.BundleContext;
+import org.osgi.framework.ServiceReference;
import org.osgi.framework.ServiceRegistration;
import org.osgi.framework.Version;
@@ -49,7 +51,7 @@
// Provide logging
final Logger log = Logger.getLogger(LifecycleInterceptorServiceImpl.class);
- private LifecycleInterceptorService service;
+ private LifecycleInterceptorService delegate;
private ServiceRegistration registration;
public LifecycleInterceptorServiceImpl(OSGiBundleManager bundleManager)
@@ -59,24 +61,28 @@
public void startService()
{
- BundleContext context = getSystemContext();
- service = new AbstractLifecycleInterceptorService()
+ final BundleContext context = getSystemContext();
+ delegate = new AbstractLifecycleInterceptorService()
{
protected Deployment getDeployment(String name, Version version)
{
OSGiBundleState bundle = (OSGiBundleState)bundleManager.getBundle(name, version);
if (bundle == null)
throw new IllegalStateException("Cannot obtain bundle for: " + name + "-" + version);
-
- DeploymentUnit unit = bundle.getDeploymentUnit();
+
+ VFSDeploymentUnit unit = (VFSDeploymentUnit)bundle.getDeploymentUnit();
Deployment dep = unit.getAttachment(Deployment.class);
if (dep == null)
- throw new IllegalStateException("Cannot obtain deployment for: " + bundle);
-
+ {
+ ServiceReference sref = context.getServiceReference(DeployerService.class.getName());
+ DeployerService service = (DeployerService)context.getService(sref);
+ dep = service.createDeployment(unit.getRoot());
+ unit.addAttachment(Deployment.class, dep);
+ }
return dep;
}
};
- registration = context.registerService(LifecycleInterceptorService.class.getName(), service, null);
+ registration = context.registerService(LifecycleInterceptorService.class.getName(), delegate, null);
}
public void stopService()
@@ -85,22 +91,25 @@
{
registration.unregister();
registration = null;
- service = null;
+ delegate = null;
}
}
public void addInterceptor(LifecycleInterceptor interceptor)
{
- service.addInterceptor(interceptor);
+ if (delegate != null)
+ delegate.addInterceptor(interceptor);
}
public void removeInterceptor(LifecycleInterceptor interceptor)
{
- service.removeInterceptor(interceptor);
+ if (delegate != null)
+ delegate.removeInterceptor(interceptor);
}
public void handleStateChange(int state, Bundle bundle)
{
- service.handleStateChange(state, bundle);
+ if (delegate != null)
+ delegate.handleStateChange(state, bundle);
}
}
\ No newline at end of file
16 years, 2 months
JBoss-OSGI SVN: r95261 - in projects/jboss-osgi/trunk: distribution/installer/src/main/resources/installer and 4 other directories.
by jboss-osgi-commits@lists.jboss.org
Author: thomas.diesler(a)jboss.com
Date: 2009-10-21 01:46:07 -0400 (Wed, 21 Oct 2009)
New Revision: 95261
Modified:
projects/jboss-osgi/trunk/distribution/installer/scripts/assembly-deploy-artifacts.xml
projects/jboss-osgi/trunk/distribution/installer/src/main/resources/installer/install-definition.xml
projects/jboss-osgi/trunk/distribution/installer/src/main/resources/runtime/conf/jboss-osgi-equinox.properties
projects/jboss-osgi/trunk/distribution/installer/src/main/resources/runtime/conf/jboss-osgi-felix.properties
projects/jboss-osgi/trunk/distribution/installer/src/main/resources/runtime/server/conf/jboss-osgi-felix-all.properties
projects/jboss-osgi/trunk/distribution/installer/src/main/resources/runtime/server/conf/jboss-osgi-felix-default.properties
projects/jboss-osgi/trunk/distribution/installer/src/main/resources/runtime/server/conf/jboss-osgi-felix-minimal.properties
projects/jboss-osgi/trunk/distribution/installer/src/main/resources/runtime/server/conf/jboss-osgi-felix-web.properties
projects/jboss-osgi/trunk/reactor/deployment/src/main/java/org/jboss/osgi/deployment/internal/DeploymentServicesActivator.java
projects/jboss-osgi/trunk/reactor/deployment/src/main/java/org/jboss/osgi/deployment/internal/SystemDeployerService.java
projects/jboss-osgi/trunk/reactor/framework/src/main/java/org/jboss/osgi/framework/service/internal/DeployerServiceImpl.java
Log:
Fix jbossmc runtime
Modified: projects/jboss-osgi/trunk/distribution/installer/scripts/assembly-deploy-artifacts.xml
===================================================================
--- projects/jboss-osgi/trunk/distribution/installer/scripts/assembly-deploy-artifacts.xml 2009-10-21 05:27:09 UTC (rev 95260)
+++ projects/jboss-osgi/trunk/distribution/installer/scripts/assembly-deploy-artifacts.xml 2009-10-21 05:46:07 UTC (rev 95261)
@@ -32,17 +32,6 @@
<unpack>false</unpack>
</dependencySet>
<dependencySet>
- <outputDirectory>lib/org.apache.felix</outputDirectory>
- <outputFileNameMapping>${artifact.artifactId}${dashClassifier?}.${artifact.extension}</outputFileNameMapping>
- <useStrictFiltering>true</useStrictFiltering>
- <includes>
- <include>org.apache.felix:org.osgi.compendium:jar</include>
- <include>org.apache.felix:org.osgi.core:jar</include>
- </includes>
- <scope>compile</scope>
- <unpack>false</unpack>
- </dependencySet>
- <dependencySet>
<outputDirectory>lib/org.osgi</outputDirectory>
<outputFileNameMapping>${artifact.artifactId}${dashClassifier?}.${artifact.extension}</outputFileNameMapping>
<useStrictFiltering>true</useStrictFiltering>
Modified: projects/jboss-osgi/trunk/distribution/installer/src/main/resources/installer/install-definition.xml
===================================================================
--- projects/jboss-osgi/trunk/distribution/installer/src/main/resources/installer/install-definition.xml 2009-10-21 05:27:09 UTC (rev 95260)
+++ projects/jboss-osgi/trunk/distribution/installer/src/main/resources/installer/install-definition.xml 2009-10-21 05:46:07 UTC (rev 95261)
@@ -254,11 +254,11 @@
<singlefile condition="isFelix" src="@{runtime.dir}/server/conf/jboss-osgi-felix-all.properties" target="$INSTALL_PATH/runtime/server/all/conf/jboss-osgi-extra.properties"
override="true" />
<fileset condition="isFelix" dir="@{deploy.artifacts.dir}/lib" targetdir="$INSTALL_PATH/runtime/lib" override="true">
- <include name="jboss-osgi-deployment.jar" />
<include name="jboss-osgi-runtime-felix.jar" />
<include name="org.apache.felix.framework.jar" />
</fileset>
- <fileset condition="isFelix" dir="@{deploy.artifacts.dir}/lib/org.apache.felix" targetdir="$INSTALL_PATH/runtime/server/minimal/deploy" override="true">
+ <fileset condition="isFelix" dir="@{deploy.artifacts.dir}/lib/org.osgi" targetdir="$INSTALL_PATH/runtime/server/minimal/deploy" override="true">
+ <include name="jboss-osgi-deployment.jar" />
<include name="org.osgi.compendium.jar" />
</fileset>
<fileset condition="isFelix" dir="@{deploy.artifacts.dir}/lib" targetdir="$INSTALL_PATH/runtime/server/all/deploy" override="true">
@@ -276,6 +276,7 @@
<include name="org.eclipse.osgi.jar" />
</fileset>
<fileset condition="isEquinox" dir="@{deploy.artifacts.dir}/lib" targetdir="$INSTALL_PATH/runtime/server/minimal/deploy" override="true">
+ <include name="jboss-osgi-deployment.jar" />
<include name="org.eclipse.osgi.services.jar" />
</fileset>
<fileset condition="isEquinox" dir="@{deploy.artifacts.dir}/lib" targetdir="$INSTALL_PATH/runtime/server/all/deploy" override="true">
@@ -398,7 +399,7 @@
<include name="org.apache.felix.configadmin.jar" />
<include name="org.apache.felix.metatype.jar" />
</fileset>
- <fileset condition="isFelix" dir="@{deploy.artifacts.dir}/lib/org.apache.felix" targetdir="${jbossInstallPath}/server/${jbossTargetServer}/deploy/osgi"
+ <fileset condition="isFelix" dir="@{deploy.artifacts.dir}/lib/org.osgi" targetdir="${jbossInstallPath}/server/${jbossTargetServer}/deploy/osgi"
override="true">
<include name="org.osgi.compendium.jar" />
</fileset>
Modified: projects/jboss-osgi/trunk/distribution/installer/src/main/resources/runtime/conf/jboss-osgi-equinox.properties
===================================================================
--- projects/jboss-osgi/trunk/distribution/installer/src/main/resources/runtime/conf/jboss-osgi-equinox.properties 2009-10-21 05:27:09 UTC (rev 95260)
+++ projects/jboss-osgi/trunk/distribution/installer/src/main/resources/runtime/conf/jboss-osgi-equinox.properties 2009-10-21 05:46:07 UTC (rev 95261)
@@ -94,4 +94,5 @@
org.jboss.osgi.spi.framework.autoStart=\
file://${osgi.home}/server/minimal/deploy/org.apache.felix.log.jar \
file://${osgi.home}/server/minimal/deploy/jboss-osgi-common.jar \
+ file://${osgi.home}/server/minimal/deploy/jboss-osgi-deployment.jar \
file://${osgi.home}/server/minimal/deploy/jboss-osgi-hotdeploy.jar
\ No newline at end of file
Modified: projects/jboss-osgi/trunk/distribution/installer/src/main/resources/runtime/conf/jboss-osgi-felix.properties
===================================================================
--- projects/jboss-osgi/trunk/distribution/installer/src/main/resources/runtime/conf/jboss-osgi-felix.properties 2009-10-21 05:27:09 UTC (rev 95260)
+++ projects/jboss-osgi/trunk/distribution/installer/src/main/resources/runtime/conf/jboss-osgi-felix.properties 2009-10-21 05:46:07 UTC (rev 95261)
@@ -22,6 +22,7 @@
org.jboss.osgi.spi.framework.autoStart=\
file://${osgi.home}/server/minimal/deploy/org.apache.felix.log.jar \
file://${osgi.home}/server/minimal/deploy/jboss-osgi-common.jar \
+ file://${osgi.home}/server/minimal/deploy/jboss-osgi-deployment.jar \
file://${osgi.home}/server/minimal/deploy/jboss-osgi-hotdeploy.jar
\ No newline at end of file
Modified: projects/jboss-osgi/trunk/distribution/installer/src/main/resources/runtime/server/conf/jboss-osgi-felix-all.properties
===================================================================
--- projects/jboss-osgi/trunk/distribution/installer/src/main/resources/runtime/server/conf/jboss-osgi-felix-all.properties 2009-10-21 05:27:09 UTC (rev 95260)
+++ projects/jboss-osgi/trunk/distribution/installer/src/main/resources/runtime/server/conf/jboss-osgi-felix-all.properties 2009-10-21 05:46:07 UTC (rev 95261)
@@ -30,6 +30,8 @@
org.apache.log4j;version=1.2, \
org.jboss.logging, \
org.jboss.net.protocol, \
+ org.jboss.osgi.deployment.common;version=1.0, \
+ org.jboss.osgi.deployment.deployer;version=1.0, \
org.jboss.osgi.spi;version=1.0, \
org.jboss.osgi.spi.capability;version=1.0, \
org.jboss.osgi.spi.framework;version=1.0, \
Modified: projects/jboss-osgi/trunk/distribution/installer/src/main/resources/runtime/server/conf/jboss-osgi-felix-default.properties
===================================================================
--- projects/jboss-osgi/trunk/distribution/installer/src/main/resources/runtime/server/conf/jboss-osgi-felix-default.properties 2009-10-21 05:27:09 UTC (rev 95260)
+++ projects/jboss-osgi/trunk/distribution/installer/src/main/resources/runtime/server/conf/jboss-osgi-felix-default.properties 2009-10-21 05:46:07 UTC (rev 95261)
@@ -24,6 +24,8 @@
org.apache.log4j;version=1.2, \
org.jboss.logging, \
org.jboss.net.protocol, \
+ org.jboss.osgi.deployment.common;version=1.0, \
+ org.jboss.osgi.deployment.deployer;version=1.0, \
org.jboss.osgi.spi;version=1.0, \
org.jboss.osgi.spi.capability;version=1.0, \
org.jboss.osgi.spi.framework;version=1.0, \
Modified: projects/jboss-osgi/trunk/distribution/installer/src/main/resources/runtime/server/conf/jboss-osgi-felix-minimal.properties
===================================================================
--- projects/jboss-osgi/trunk/distribution/installer/src/main/resources/runtime/server/conf/jboss-osgi-felix-minimal.properties 2009-10-21 05:27:09 UTC (rev 95260)
+++ projects/jboss-osgi/trunk/distribution/installer/src/main/resources/runtime/server/conf/jboss-osgi-felix-minimal.properties 2009-10-21 05:46:07 UTC (rev 95261)
@@ -10,6 +10,8 @@
org.osgi.framework.system.packages.extra=\
org.apache.log4j;version=1.2, \
org.jboss.logging, \
+ org.jboss.osgi.deployment.common;version=1.0, \
+ org.jboss.osgi.deployment.deployer;version=1.0, \
org.jboss.osgi.spi;version=1.0, \
org.jboss.osgi.spi.capability;version=1.0, \
org.jboss.osgi.spi.framework;version=1.0, \
Modified: projects/jboss-osgi/trunk/distribution/installer/src/main/resources/runtime/server/conf/jboss-osgi-felix-web.properties
===================================================================
--- projects/jboss-osgi/trunk/distribution/installer/src/main/resources/runtime/server/conf/jboss-osgi-felix-web.properties 2009-10-21 05:27:09 UTC (rev 95260)
+++ projects/jboss-osgi/trunk/distribution/installer/src/main/resources/runtime/server/conf/jboss-osgi-felix-web.properties 2009-10-21 05:46:07 UTC (rev 95261)
@@ -30,6 +30,8 @@
org.apache.log4j;version=1.2, \
org.jboss.logging, \
org.jboss.net.protocol, \
+ org.jboss.osgi.deployment.common;version=1.0, \
+ org.jboss.osgi.deployment.deployer;version=1.0, \
org.jboss.osgi.spi;version=1.0, \
org.jboss.osgi.spi.capability;version=1.0, \
org.jboss.osgi.spi.framework;version=1.0, \
Modified: projects/jboss-osgi/trunk/reactor/deployment/src/main/java/org/jboss/osgi/deployment/internal/DeploymentServicesActivator.java
===================================================================
--- projects/jboss-osgi/trunk/reactor/deployment/src/main/java/org/jboss/osgi/deployment/internal/DeploymentServicesActivator.java 2009-10-21 05:27:09 UTC (rev 95260)
+++ projects/jboss-osgi/trunk/reactor/deployment/src/main/java/org/jboss/osgi/deployment/internal/DeploymentServicesActivator.java 2009-10-21 05:46:07 UTC (rev 95261)
@@ -25,9 +25,7 @@
import java.util.Properties;
-import javax.management.JMException;
import javax.management.MBeanServer;
-import javax.management.StandardMBean;
import org.jboss.osgi.deployment.deployer.DeployerService;
import org.jboss.osgi.deployment.deployer.DeploymentRegistryService;
@@ -36,8 +34,6 @@
import org.osgi.framework.BundleContext;
import org.osgi.framework.ServiceReference;
import org.osgi.util.tracker.ServiceTracker;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
/**
* The deployers activator
@@ -47,9 +43,6 @@
*/
public class DeploymentServicesActivator implements BundleActivator
{
- // Provide logging
- private Logger log = LoggerFactory.getLogger(DeploymentServicesActivator.class);
-
public void start(BundleContext context) throws Exception
{
// Register the deployer related services
@@ -73,31 +66,10 @@
// Register the SystemDeployerService
Properties props = new Properties();
props.put("provider", "system");
- SystemDeployerService deployerService = new SystemDeployerService(context);
+ final SystemDeployerService deployerService = new SystemDeployerService(context);
context.registerService(DeployerService.class.getName(), deployerService, props);
- // Track the MBeanServer and register the DeployerService
- ServiceTracker jmxTracker = new ServiceTracker(context, MBeanServer.class.getName(), null)
- {
- @Override
- public Object addingService(ServiceReference reference)
- {
- MBeanServer mbeanServer = (MBeanServer)super.addingService(reference);
- registerDeployerServiceMBean(context, mbeanServer);
- return mbeanServer;
- }
-
- @Override
- public void removedService(ServiceReference reference, Object service)
- {
- MBeanServer mbeanServer = (MBeanServer)service;
- unregisterDeployerServiceMBean(mbeanServer);
- super.removedService(reference, service);
- }
- };
- jmxTracker.open();
-
- // Track the DeployerService and register it as an MBean
+ // Track other DeployerService implementations and register as MBean
ServiceTracker serviceTracker = new ServiceTracker(context, DeployerService.class.getName(), null)
{
@Override
@@ -108,7 +80,7 @@
if (sref != null)
{
MBeanServer mbeanServer = (MBeanServer)context.getService(sref);
- registerDeployerServiceMBean(context, mbeanServer);
+ deployerService.registerDeployerServiceMBean(context, mbeanServer);
}
return service;
}
@@ -120,48 +92,11 @@
if (sref != null)
{
MBeanServer mbeanServer = (MBeanServer)context.getService(sref);
- unregisterDeployerServiceMBean(mbeanServer);
+ deployerService.unregisterDeployerServiceMBean(mbeanServer);
}
super.removedService(reference, service);
}
};
serviceTracker.open();
}
-
- private void registerDeployerServiceMBean(BundleContext context, MBeanServer mbeanServer)
- {
- try
- {
- // Get the DeployerService with the highest ranking
- ServiceReference sref = context.getServiceReference(DeployerService.class.getName());
- if (sref == null)
- throw new IllegalStateException("Cannot obtain deployer service");
-
- // Unregister the DeployerService with a potentialy lower ranking
- if (mbeanServer.isRegistered(DeployerService.MBEAN_DEPLOYER_SERVICE))
- mbeanServer.unregisterMBean(DeployerService.MBEAN_DEPLOYER_SERVICE);
-
- // Register the DeployerService with the highest ranking
- DeployerService service = (DeployerService)context.getService(sref);
- StandardMBean mbean = new StandardMBean(service, DeployerService.class);
- mbeanServer.registerMBean(mbean, DeployerService.MBEAN_DEPLOYER_SERVICE);
- }
- catch (JMException ex)
- {
- throw new IllegalStateException("Cannot register DeployerService MBean", ex);
- }
- }
-
- private void unregisterDeployerServiceMBean(MBeanServer mbeanServer)
- {
- try
- {
- if (mbeanServer.isRegistered(DeployerService.MBEAN_DEPLOYER_SERVICE))
- mbeanServer.unregisterMBean(DeployerService.MBEAN_DEPLOYER_SERVICE);
- }
- catch (JMException ex)
- {
- log.error("Cannot unregister DeployerService MBean", ex);
- }
- }
}
\ No newline at end of file
Modified: projects/jboss-osgi/trunk/reactor/deployment/src/main/java/org/jboss/osgi/deployment/internal/SystemDeployerService.java
===================================================================
--- projects/jboss-osgi/trunk/reactor/deployment/src/main/java/org/jboss/osgi/deployment/internal/SystemDeployerService.java 2009-10-21 05:27:09 UTC (rev 95260)
+++ projects/jboss-osgi/trunk/reactor/deployment/src/main/java/org/jboss/osgi/deployment/internal/SystemDeployerService.java 2009-10-21 05:46:07 UTC (rev 95261)
@@ -30,6 +30,10 @@
import java.util.Map;
import java.util.Map.Entry;
+import javax.management.JMException;
+import javax.management.MBeanServer;
+import javax.management.StandardMBean;
+
import org.jboss.osgi.deployment.common.Deployment;
import org.jboss.osgi.deployment.deployer.DeployerService;
import org.jboss.osgi.deployment.deployer.AbstractDeployerService;
@@ -48,7 +52,7 @@
import org.slf4j.LoggerFactory;
/**
- * A {@link DeployerService} that installs/uninstalls the bundles directly on the OSGi framework without going through the MC registered deployers.
+ * A {@link DeployerService} that installs/uninstalls the bundles directly on the OSGi framework.
*
* @author thomas.diesler(a)jboss.com
* @since 27-May-2009
@@ -59,12 +63,32 @@
private Logger log = LoggerFactory.getLogger(SystemDeployerService.class);
private BundleContext context;
- private ServiceTracker registryTracker;
private ServiceTracker startLevelTracker;
public SystemDeployerService(BundleContext context)
{
this.context = context;
+
+ // Track the MBeanServer and register the DeployerService
+ ServiceTracker jmxTracker = new ServiceTracker(context, MBeanServer.class.getName(), null)
+ {
+ @Override
+ public Object addingService(ServiceReference reference)
+ {
+ MBeanServer mbeanServer = (MBeanServer)super.addingService(reference);
+ registerDeployerServiceMBean(context, mbeanServer);
+ return mbeanServer;
+ }
+
+ @Override
+ public void removedService(ServiceReference reference, Object service)
+ {
+ MBeanServer mbeanServer = (MBeanServer)service;
+ unregisterDeployerServiceMBean(mbeanServer);
+ super.removedService(reference, service);
+ }
+ };
+ jmxTracker.open();
}
public void deploy(Deployment[] depArr) throws BundleException
@@ -78,9 +102,10 @@
{
try
{
+ log.debug("Install: " + dep.getLocation());
+
String location = dep.getLocation().toExternalForm();
Bundle bundle = context.installBundle(location);
- log.info("Installed: " + bundle);
registerManagedBundle(bundle);
@@ -133,7 +158,6 @@
bundle.start();
- log.info("Started: " + bundle);
ExportedPackageHelper packageHelper = new ExportedPackageHelper(context);
packageHelper.logExportedPackages(bundle);
}
@@ -155,11 +179,12 @@
Bundle bundle = getBundle(dep);
if (bundle != null)
{
+ log.debug("Uninstall: " + bundle);
+
registry.unregisterDeployment(dep);
unregisterManagedBundle(bundle);
bundle.uninstall();
- log.info("Uninstalled: " + bundle);
}
else
{
@@ -239,12 +264,11 @@
private DeploymentRegistryService getDeploymentRegistry()
{
- if (registryTracker == null)
- {
- registryTracker = new ServiceTracker(context, DeploymentRegistryService.class.getName(), null);
- registryTracker.open();
- }
- return (DeploymentRegistryService)registryTracker.getService();
+ ServiceReference sref = context.getServiceReference(DeploymentRegistryService.class.getName());
+ if (sref == null)
+ throw new IllegalStateException("Cannot obtain DeploymentRegistryService");
+
+ return (DeploymentRegistryService)context.getService(sref);
}
private StartLevel getStartLevel()
@@ -256,4 +280,41 @@
}
return (StartLevel)startLevelTracker.getService();
}
+
+ void registerDeployerServiceMBean(BundleContext context, MBeanServer mbeanServer)
+ {
+ try
+ {
+ // Get the DeployerService with the highest ranking
+ ServiceReference sref = context.getServiceReference(DeployerService.class.getName());
+ if (sref == null)
+ throw new IllegalStateException("Cannot obtain deployer service");
+
+ // Unregister the DeployerService with a potentialy lower ranking
+ if (mbeanServer.isRegistered(DeployerService.MBEAN_DEPLOYER_SERVICE))
+ mbeanServer.unregisterMBean(DeployerService.MBEAN_DEPLOYER_SERVICE);
+
+ // Register the DeployerService with the highest ranking
+ DeployerService service = (DeployerService)context.getService(sref);
+ StandardMBean mbean = new StandardMBean(service, DeployerService.class);
+ mbeanServer.registerMBean(mbean, DeployerService.MBEAN_DEPLOYER_SERVICE);
+ }
+ catch (JMException ex)
+ {
+ throw new IllegalStateException("Cannot register DeployerService MBean", ex);
+ }
+ }
+
+ void unregisterDeployerServiceMBean(MBeanServer mbeanServer)
+ {
+ try
+ {
+ if (mbeanServer.isRegistered(DeployerService.MBEAN_DEPLOYER_SERVICE))
+ mbeanServer.unregisterMBean(DeployerService.MBEAN_DEPLOYER_SERVICE);
+ }
+ catch (JMException ex)
+ {
+ log.error("Cannot unregister DeployerService MBean", ex);
+ }
+ }
}
\ No newline at end of file
Modified: projects/jboss-osgi/trunk/reactor/framework/src/main/java/org/jboss/osgi/framework/service/internal/DeployerServiceImpl.java
===================================================================
--- projects/jboss-osgi/trunk/reactor/framework/src/main/java/org/jboss/osgi/framework/service/internal/DeployerServiceImpl.java 2009-10-21 05:27:09 UTC (rev 95260)
+++ projects/jboss-osgi/trunk/reactor/framework/src/main/java/org/jboss/osgi/framework/service/internal/DeployerServiceImpl.java 2009-10-21 05:46:07 UTC (rev 95261)
@@ -24,19 +24,19 @@
//$Id$
import java.net.URL;
+import java.util.Properties;
import org.jboss.logging.Logger;
import org.jboss.osgi.deployment.common.Deployment;
import org.jboss.osgi.deployment.deployer.DeployerService;
-import org.jboss.osgi.deployment.internal.DeploymentImpl;
+import org.jboss.osgi.deployment.deployer.DeploymentRegistryService;
+import org.jboss.osgi.deployment.internal.DeploymentRegistryServiceImpl;
+import org.jboss.osgi.deployment.internal.SystemDeployerService;
import org.jboss.osgi.framework.bundle.OSGiBundleManager;
import org.jboss.osgi.framework.plugins.DeployerServicePlugin;
import org.jboss.osgi.framework.plugins.internal.AbstractServicePluginImpl;
-import org.jboss.osgi.spi.util.BundleInfo;
-import org.osgi.framework.Bundle;
import org.osgi.framework.BundleContext;
import org.osgi.framework.BundleException;
-import org.osgi.framework.ServiceRegistration;
/**
* A plugin that manages bundle deployments.
@@ -49,7 +49,7 @@
// Provide logging
final Logger log = Logger.getLogger(DeployerServiceImpl.class);
- private ServiceRegistration registration;
+ private DeployerService delegate;
public DeployerServiceImpl(OSGiBundleManager bundleManager)
{
@@ -59,80 +59,43 @@
public void startService()
{
BundleContext context = getSystemContext();
- registration = context.registerService(DeployerService.class.getName(), this, null);
+
+ DeploymentRegistryService registry = new DeploymentRegistryServiceImpl(context);
+ context.registerService(DeploymentRegistryService.class.getName(), registry, null);
+
+ Properties props = new Properties();
+ props.put("provider", "system");
+ delegate = new SystemDeployerService(context);
+ context.registerService(DeployerService.class.getName(), this, props);
}
public void stopService()
{
- if (registration != null)
- {
- registration.unregister();
- registration = null;
- }
+ // do nothing
}
public Deployment createDeployment(URL url) throws BundleException
{
- BundleInfo info = BundleInfo.createBundleInfo(url);
- return new DeploymentImpl(info);
+ return delegate.createDeployment(url);
}
- public void deploy(URL url) throws BundleException
+ public void deploy(Deployment[] bundleDeps) throws BundleException
{
- bundleManager.install(url);
+ delegate.deploy(bundleDeps);
}
- public void undeploy(URL url) throws BundleException
+ public void deploy(URL url) throws BundleException
{
- Bundle bundle = bundleManager.getBundleByLocation(url.toExternalForm());
- if (bundle != null)
- bundle.uninstall();
+ delegate.deploy(url);
}
-
- public void deploy(Deployment[] depArr) throws BundleException
+
+ public void undeploy(Deployment[] bundleDeps) throws BundleException
{
- for (Deployment dep : depArr)
- {
- try
- {
- Bundle bundle = bundleManager.install(dep.getRoot());
- dep.addAttachment(Bundle.class, bundle);
- }
- catch (Exception ex)
- {
- log.warn("Cannot install bundle: " + dep.getLocation(), ex);
- }
- }
-
- for (Deployment dep : depArr)
- {
- try
- {
- Bundle bundle = dep.getAttachment(Bundle.class);
- if (bundle != null)
- bundle.start();
- }
- catch (Exception ex)
- {
- log.warn("Cannot start bundle: " + dep.getLocation(), ex);
- }
- }
+ delegate.undeploy(bundleDeps);
}
- public void undeploy(Deployment[] depArr) throws BundleException
+ public void undeploy(URL url) throws BundleException
{
- for (Deployment dep : depArr)
- {
- try
- {
- Bundle bundle = dep.getAttachment(Bundle.class);
- if (bundle != null)
- bundle.uninstall();
- }
- catch (Exception ex)
- {
- log.warn("Cannot uninstall bundle: " + dep.getLocation(), ex);
- }
- }
+ delegate.undeploy(url);
}
}
\ No newline at end of file
16 years, 2 months
JBoss-OSGI SVN: r95221 - in projects/jboss-osgi/projects: bundles/hotdeploy/trunk and 3 other directories.
by jboss-osgi-commits@lists.jboss.org
Author: thomas.diesler(a)jboss.com
Date: 2009-10-20 18:37:53 -0400 (Tue, 20 Oct 2009)
New Revision: 95221
Modified:
projects/jboss-osgi/projects/bundles/common/trunk/pom.xml
projects/jboss-osgi/projects/bundles/hotdeploy/trunk/pom.xml
projects/jboss-osgi/projects/bundles/microcontainer/trunk/pom.xml
projects/jboss-osgi/projects/runtime/jbossas/trunk/pom.xml
projects/jboss-osgi/projects/spi/trunk/pom.xml
Log:
Use org.osgi.core-4.2.0
Modified: projects/jboss-osgi/projects/bundles/common/trunk/pom.xml
===================================================================
--- projects/jboss-osgi/projects/bundles/common/trunk/pom.xml 2009-10-20 22:37:19 UTC (rev 95220)
+++ projects/jboss-osgi/projects/bundles/common/trunk/pom.xml 2009-10-20 22:37:53 UTC (rev 95221)
@@ -40,7 +40,7 @@
<!-- Properties -->
<properties>
<version.jboss.osgi.spi>1.0.3-SNAPSHOT</version.jboss.osgi.spi>
- <version.osgi>r4v42</version.osgi>
+ <version.osgi>4.2.0</version.osgi>
</properties>
<!-- Dependencies -->
Modified: projects/jboss-osgi/projects/bundles/hotdeploy/trunk/pom.xml
===================================================================
--- projects/jboss-osgi/projects/bundles/hotdeploy/trunk/pom.xml 2009-10-20 22:37:19 UTC (rev 95220)
+++ projects/jboss-osgi/projects/bundles/hotdeploy/trunk/pom.xml 2009-10-20 22:37:53 UTC (rev 95221)
@@ -42,7 +42,7 @@
<version.jboss.osgi.common>1.0.3-SNAPSHOT</version.jboss.osgi.common>
<version.jboss.osgi.deployment>1.0.0-SNAPSHOT</version.jboss.osgi.deployment>
<version.jboss.osgi.spi>1.0.3-SNAPSHOT</version.jboss.osgi.spi>
- <version.osgi>r4v42</version.osgi>
+ <version.osgi>4.2.0</version.osgi>
</properties>
<!-- Dependencies -->
Modified: projects/jboss-osgi/projects/bundles/microcontainer/trunk/pom.xml
===================================================================
--- projects/jboss-osgi/projects/bundles/microcontainer/trunk/pom.xml 2009-10-20 22:37:19 UTC (rev 95220)
+++ projects/jboss-osgi/projects/bundles/microcontainer/trunk/pom.xml 2009-10-20 22:37:53 UTC (rev 95221)
@@ -45,7 +45,7 @@
<version.jboss.osgi.deployment>1.0.0-SNAPSHOT</version.jboss.osgi.deployment>
<version.jboss.osgi.spi>1.0.3-SNAPSHOT</version.jboss.osgi.spi>
<version.jboss.osgi.xml.binding>2.0.1.SP1</version.jboss.osgi.xml.binding>
- <version.osgi>r4v42</version.osgi>
+ <version.osgi>4.2.0</version.osgi>
</properties>
<!-- Dependencies -->
Modified: projects/jboss-osgi/projects/runtime/jbossas/trunk/pom.xml
===================================================================
--- projects/jboss-osgi/projects/runtime/jbossas/trunk/pom.xml 2009-10-20 22:37:19 UTC (rev 95220)
+++ projects/jboss-osgi/projects/runtime/jbossas/trunk/pom.xml 2009-10-20 22:37:53 UTC (rev 95221)
@@ -31,7 +31,7 @@
<properties>
<version.jboss.osgi.microcontainer>1.0.3-SNAPSHOT</version.jboss.osgi.microcontainer>
- <version.osgi>r4v42</version.osgi>
+ <version.osgi>4.2.0</version.osgi>
</properties>
<!-- Dependencies -->
Modified: projects/jboss-osgi/projects/spi/trunk/pom.xml
===================================================================
--- projects/jboss-osgi/projects/spi/trunk/pom.xml 2009-10-20 22:37:19 UTC (rev 95220)
+++ projects/jboss-osgi/projects/spi/trunk/pom.xml 2009-10-20 22:37:53 UTC (rev 95221)
@@ -40,7 +40,7 @@
<properties>
<version.args4j>2.0.12</version.args4j>
<version.jboss.vfs>2.1.3.SP1</version.jboss.vfs>
- <version.osgi>r4v42</version.osgi>
+ <version.osgi>4.2.0</version.osgi>
</properties>
<!-- Dependencies -->
16 years, 2 months