JBoss-OSGI SVN: r97121 - in projects/jboss-osgi/trunk/distribution/installer/src/main/resources: runtime/server/conf and 1 other directory.
by jboss-osgi-commits@lists.jboss.org
Author: thomas.diesler(a)jboss.com
Date: 2009-11-28 03:00:29 -0500 (Sat, 28 Nov 2009)
New Revision: 97121
Modified:
projects/jboss-osgi/trunk/distribution/installer/src/main/resources/jbossas/jboss-beans-equinox.xml
projects/jboss-osgi/trunk/distribution/installer/src/main/resources/jbossas/jboss-beans-felix.xml
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-web.properties
Log:
Fix more runtime syspackage versions
Modified: projects/jboss-osgi/trunk/distribution/installer/src/main/resources/jbossas/jboss-beans-equinox.xml
===================================================================
--- projects/jboss-osgi/trunk/distribution/installer/src/main/resources/jbossas/jboss-beans-equinox.xml 2009-11-28 07:55:50 UTC (rev 97120)
+++ projects/jboss-osgi/trunk/distribution/installer/src/main/resources/jbossas/jboss-beans-equinox.xml 2009-11-28 08:00:29 UTC (rev 97121)
@@ -38,7 +38,23 @@
org.jboss.osgi.spi.util;version=1.0,
<!-- jboss -->
- org.jboss.logging
+ org.jboss.beans.metadata.plugins;version=2.0,
+ org.jboss.beans.metadata.plugins.builder;version=2.0,
+ org.jboss.beans.metadata.spi.builder;version=2.0,
+ org.jboss.beans.metadata.spi;version=2.0,
+ org.jboss.dependency.spi;version=2.0,
+ org.jboss.kernel.spi.dependency;version=2.0,
+ org.jboss.logging,
+ org.jboss.reflect.spi;version=2.0,
+ org.jboss.util.xml;version=2.2,
+ org.jboss.virtual;version=2.1,
+ org.jboss.virtual.plugins.registry;version=2.1,
+ org.jboss.virtual.plugins.context.jar;version=2.1,
+ org.jboss.virtual.plugins.vfs.helpers;version=2.1,
+ org.jboss.virtual.protocol;version=2.1,
+ org.jboss.xb.annotations;version=2.0,
+ org.jboss.xb.binding;version=2.0,
+ org.jboss.xb.binding.sunday.unmarshalling;version=2.0,
</value>
</entry>
<!--
Modified: projects/jboss-osgi/trunk/distribution/installer/src/main/resources/jbossas/jboss-beans-felix.xml
===================================================================
--- projects/jboss-osgi/trunk/distribution/installer/src/main/resources/jbossas/jboss-beans-felix.xml 2009-11-28 07:55:50 UTC (rev 97120)
+++ projects/jboss-osgi/trunk/distribution/installer/src/main/resources/jbossas/jboss-beans-felix.xml 2009-11-28 08:00:29 UTC (rev 97121)
@@ -55,11 +55,11 @@
org.jboss.logging,
org.jboss.reflect.spi;version=2.0,
org.jboss.util.xml;version=2.2,
- org.jboss.virtual,
- org.jboss.virtual.plugins.registry,
- org.jboss.virtual.plugins.context.jar,
- org.jboss.virtual.plugins.vfs.helpers,
- org.jboss.virtual.protocol,
+ org.jboss.virtual;version=2.1,
+ org.jboss.virtual.plugins.registry;version=2.1,
+ org.jboss.virtual.plugins.context.jar;version=2.1,
+ org.jboss.virtual.plugins.vfs.helpers;version=2.1,
+ org.jboss.virtual.protocol;version=2.1,
org.jboss.xb.annotations;version=2.0,
org.jboss.xb.binding;version=2.0,
org.jboss.xb.binding.sunday.unmarshalling;version=2.0,
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-11-28 07:55:50 UTC (rev 97120)
+++ projects/jboss-osgi/trunk/distribution/installer/src/main/resources/runtime/server/conf/jboss-osgi-felix-all.properties 2009-11-28 08:00:29 UTC (rev 97121)
@@ -30,19 +30,19 @@
# Extra System Packages
org.osgi.framework.system.packages.extra=\
- org.apache.log4j;version=1.2, \
- org.jboss.logging, \
- org.jboss.net.protocol, \
- org.jboss.osgi.deployment.deployer;version=1.0, \
- org.jboss.osgi.deployment.interceptor;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, \
- org.jboss.osgi.spi.management;version=1.0, \
- org.jboss.osgi.spi.service;version=1.0, \
- org.jboss.osgi.spi.util;version=1.0, \
- org.jboss.virtual, \
- org.jboss.virtual.plugins.registry, \
- org.jboss.virtual.plugins.context.jar, \
- org.jboss.virtual.plugins.vfs.helpers, \
- org.jboss.virtual.protocol
+ org.apache.log4j;version=1.2, \
+ org.jboss.logging, \
+ org.jboss.net.protocol, \
+ org.jboss.osgi.deployment.deployer;version=1.0, \
+ org.jboss.osgi.deployment.interceptor;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, \
+ org.jboss.osgi.spi.management;version=1.0, \
+ org.jboss.osgi.spi.service;version=1.0, \
+ org.jboss.osgi.spi.util;version=1.0, \
+ org.jboss.virtual;version=2.1, \
+ org.jboss.virtual.plugins.registry;version=2.1, \
+ org.jboss.virtual.plugins.context.jar;version=2.1, \
+ org.jboss.virtual.plugins.vfs.helpers;version=2.1, \
+ org.jboss.virtual.protocol;version=2.1
\ No newline at end of file
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-11-28 07:55:50 UTC (rev 97120)
+++ projects/jboss-osgi/trunk/distribution/installer/src/main/resources/runtime/server/conf/jboss-osgi-felix-default.properties 2009-11-28 08:00:29 UTC (rev 97121)
@@ -21,21 +21,21 @@
# Extra System Packages
org.osgi.framework.system.packages.extra=\
- org.apache.log4j;version=1.2, \
- org.jboss.logging, \
- org.jboss.net.protocol, \
- org.jboss.osgi.deployment.deployer;version=1.0, \
- org.jboss.osgi.deployment.interceptor;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, \
- org.jboss.osgi.spi.management;version=1.0, \
- org.jboss.osgi.spi.service;version=1.0, \
- org.jboss.osgi.spi.util;version=1.0, \
- org.jboss.virtual, \
- org.jboss.virtual.plugins.registry, \
- org.jboss.virtual.plugins.context.jar, \
- org.jboss.virtual.plugins.vfs.helpers, \
- org.jboss.virtual.protocol
+ org.apache.log4j;version=1.2, \
+ org.jboss.logging, \
+ org.jboss.net.protocol, \
+ org.jboss.osgi.deployment.deployer;version=1.0, \
+ org.jboss.osgi.deployment.interceptor;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, \
+ org.jboss.osgi.spi.management;version=1.0, \
+ org.jboss.osgi.spi.service;version=1.0, \
+ org.jboss.osgi.spi.util;version=1.0, \
+ org.jboss.virtual;version=2.1, \
+ org.jboss.virtual.plugins.registry;version=2.1, \
+ org.jboss.virtual.plugins.context.jar;version=2.1, \
+ org.jboss.virtual.plugins.vfs.helpers;version=2.1, \
+ org.jboss.virtual.protocol;version=2.1
\ No newline at end of file
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-11-28 07:55:50 UTC (rev 97120)
+++ projects/jboss-osgi/trunk/distribution/installer/src/main/resources/runtime/server/conf/jboss-osgi-felix-web.properties 2009-11-28 08:00:29 UTC (rev 97121)
@@ -27,19 +27,19 @@
# Extra System Packages
org.osgi.framework.system.packages.extra=\
- org.apache.log4j;version=1.2, \
- org.jboss.logging, \
- org.jboss.net.protocol, \
- org.jboss.osgi.deployment.deployer;version=1.0, \
- org.jboss.osgi.deployment.interceptor;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, \
- org.jboss.osgi.spi.management;version=1.0, \
- org.jboss.osgi.spi.service;version=1.0, \
- org.jboss.osgi.spi.util;version=1.0, \
- org.jboss.virtual, \
- org.jboss.virtual.plugins.registry, \
- org.jboss.virtual.plugins.context.jar, \
- org.jboss.virtual.plugins.vfs.helpers, \
- org.jboss.virtual.protocol
+ org.apache.log4j;version=1.2, \
+ org.jboss.logging, \
+ org.jboss.net.protocol, \
+ org.jboss.osgi.deployment.deployer;version=1.0, \
+ org.jboss.osgi.deployment.interceptor;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, \
+ org.jboss.osgi.spi.management;version=1.0, \
+ org.jboss.osgi.spi.service;version=1.0, \
+ org.jboss.osgi.spi.util;version=1.0, \
+ org.jboss.virtual;version=2.1, \
+ org.jboss.virtual.plugins.registry;version=2.1, \
+ org.jboss.virtual.plugins.context.jar;version=2.1, \
+ org.jboss.virtual.plugins.vfs.helpers;version=2.1, \
+ org.jboss.virtual.protocol;version=2.1
14 years, 6 months
JBoss-OSGI SVN: r97120 - in projects/jboss-osgi/projects/bundles/jboss-xml-binding/trunk: src/test/java/org/jboss/test/osgi/jbossxb and 5 other directories.
by jboss-osgi-commits@lists.jboss.org
Author: thomas.diesler(a)jboss.com
Date: 2009-11-28 02:55:50 -0500 (Sat, 28 Nov 2009)
New Revision: 97120
Added:
projects/jboss-osgi/projects/bundles/jboss-xml-binding/trunk/src/test/java/org/jboss/test/osgi/jbossxb/refresh/
projects/jboss-osgi/projects/bundles/jboss-xml-binding/trunk/src/test/java/org/jboss/test/osgi/jbossxb/refresh/RefreshServiceTestCase.java
projects/jboss-osgi/projects/bundles/jboss-xml-binding/trunk/src/test/java/org/jboss/test/osgi/jbossxb/simple/BasicXMLBindingTestCase.java
projects/jboss-osgi/projects/bundles/jboss-xml-binding/trunk/src/test/java/org/jboss/test/osgi/jbossxb/simple/bundle/
projects/jboss-osgi/projects/bundles/jboss-xml-binding/trunk/src/test/java/org/jboss/test/osgi/jbossxb/simple/bundle/BookingActivator.java
projects/jboss-osgi/projects/bundles/jboss-xml-binding/trunk/src/test/java/org/jboss/test/osgi/jbossxb/simple/bundle/CompanyType.java
projects/jboss-osgi/projects/bundles/jboss-xml-binding/trunk/src/test/java/org/jboss/test/osgi/jbossxb/simple/bundle/ContactType.java
projects/jboss-osgi/projects/bundles/jboss-xml-binding/trunk/src/test/java/org/jboss/test/osgi/jbossxb/simple/bundle/CourseBooking.java
projects/jboss-osgi/projects/bundles/jboss-xml-binding/trunk/src/test/java/org/jboss/test/osgi/jbossxb/simple/bundle/StudentType.java
projects/jboss-osgi/projects/bundles/jboss-xml-binding/trunk/src/test/resources/simple/simple-booking.bnd
Removed:
projects/jboss-osgi/projects/bundles/jboss-xml-binding/trunk/src/test/java/org/jboss/test/osgi/jbossxb/BasicXMLBindingTestCase.java
projects/jboss-osgi/projects/bundles/jboss-xml-binding/trunk/src/test/java/org/jboss/test/osgi/jbossxb/simple/CompanyType.java
projects/jboss-osgi/projects/bundles/jboss-xml-binding/trunk/src/test/java/org/jboss/test/osgi/jbossxb/simple/ContactType.java
projects/jboss-osgi/projects/bundles/jboss-xml-binding/trunk/src/test/java/org/jboss/test/osgi/jbossxb/simple/CourseBooking.java
projects/jboss-osgi/projects/bundles/jboss-xml-binding/trunk/src/test/java/org/jboss/test/osgi/jbossxb/simple/StudentType.java
Modified:
projects/jboss-osgi/projects/bundles/jboss-xml-binding/trunk/scripts/antrun-test-jars.xml
projects/jboss-osgi/projects/bundles/jboss-xml-binding/trunk/src/test/java/org/jboss/test/osgi/jbossxb/apitest/UnmarshallerTestCase.java
projects/jboss-osgi/projects/bundles/jboss-xml-binding/trunk/src/test/resources/simple/booking.xml
projects/jboss-osgi/projects/bundles/jboss-xml-binding/trunk/src/test/resources/simple/booking.xsd
projects/jboss-osgi/projects/bundles/jboss-xml-binding/trunk/src/test/resources/simple/simple-unmarshaller.bnd
Log:
Add refresh test case
Modified: projects/jboss-osgi/projects/bundles/jboss-xml-binding/trunk/scripts/antrun-test-jars.xml
===================================================================
--- projects/jboss-osgi/projects/bundles/jboss-xml-binding/trunk/scripts/antrun-test-jars.xml 2009-11-28 01:27:10 UTC (rev 97119)
+++ projects/jboss-osgi/projects/bundles/jboss-xml-binding/trunk/scripts/antrun-test-jars.xml 2009-11-28 07:55:50 UTC (rev 97120)
@@ -45,7 +45,8 @@
<!-- Please add alphabetically -->
- <!-- simple-unmarshaller -->
+ <!-- simple -->
+ <bnd classpath="${tests.classes.dir}" output="${tests.output.dir}/test-libs/simple-booking.jar" files="${tests.resources.dir}/simple/simple-booking.bnd" />
<bnd classpath="${tests.classes.dir}" output="${tests.output.dir}/test-libs/simple-unmarshaller.jar" files="${tests.resources.dir}/simple/simple-unmarshaller.bnd" />
<!-- Please add alphabetically -->
Deleted: projects/jboss-osgi/projects/bundles/jboss-xml-binding/trunk/src/test/java/org/jboss/test/osgi/jbossxb/BasicXMLBindingTestCase.java
===================================================================
--- projects/jboss-osgi/projects/bundles/jboss-xml-binding/trunk/src/test/java/org/jboss/test/osgi/jbossxb/BasicXMLBindingTestCase.java 2009-11-28 01:27:10 UTC (rev 97119)
+++ projects/jboss-osgi/projects/bundles/jboss-xml-binding/trunk/src/test/java/org/jboss/test/osgi/jbossxb/BasicXMLBindingTestCase.java 2009-11-28 07:55:50 UTC (rev 97120)
@@ -1,111 +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.test.osgi.jbossxb;
-
-//$Id$
-
-import static org.junit.Assert.assertNotNull;
-import static org.junit.Assume.assumeNotNull;
-
-import java.net.URL;
-
-import org.jboss.osgi.husky.BridgeFactory;
-import org.jboss.osgi.husky.HuskyCapability;
-import org.jboss.osgi.husky.RuntimeContext;
-import org.jboss.osgi.jbossxb.UnmarshallerService;
-import org.jboss.osgi.jbossxb.XMLBindingCapability;
-import org.jboss.osgi.testing.OSGiBundle;
-import org.jboss.osgi.testing.OSGiRuntime;
-import org.jboss.osgi.testing.OSGiTest;
-import org.jboss.test.osgi.jbossxb.simple.CourseBooking;
-import org.junit.After;
-import org.junit.Before;
-import org.junit.Test;
-import org.osgi.framework.Bundle;
-import org.osgi.framework.BundleContext;
-import org.osgi.framework.BundleException;
-import org.osgi.framework.ServiceReference;
-
-/**
- * Test XMLBindingService
- *
- * @author thomas.diesler(a)jboss.com
- * @since 26-Nov-2009
- */
-public class BasicXMLBindingTestCase extends OSGiTest
-{
- @RuntimeContext
- public BundleContext context;
-
- private OSGiRuntime runtime;
-
- @Before
- public void setUp() throws Exception
- {
- if (context == null)
- {
- runtime = getDefaultRuntime();
- runtime.addCapability(new HuskyCapability());
- runtime.addCapability(new XMLBindingCapability());
-
- OSGiBundle bundle = runtime.installBundle("simple-unmarshaller.jar");
- bundle.start();
- }
- }
-
- @After
- public void tearDown() throws BundleException
- {
- if (context == null)
- runtime.shutdown();
- }
-
- @Test
- public void testUnmarshaller() throws Exception
- {
- if (context == null)
- BridgeFactory.getBridge().run();
-
- assumeNotNull(context);
-
- ServiceReference sref = context.getServiceReference(UnmarshallerService.class.getName());
- assertNotNull("UnmarshallerService available", sref);
-
- UnmarshallerService unmarshaller = (UnmarshallerService)context.getService(sref);
- unmarshaller.setSchemaValidation(true);
- unmarshaller.setNamespaceAware(true);
- unmarshaller.setValidation(true);
-
- Bundle bundle = context.getBundle();
- URL xsdurl = bundle.getEntry("booking.xsd");
- assertNotNull("booking.xsd available", xsdurl);
-
- URL xmlurl = bundle.getEntry("booking.xml");
- assertNotNull("booking.xml available", xmlurl);
-
- unmarshaller.registerSchemaLocation("http://org.jboss.test.osgi.jbossxb.simple/booking.xsd", xsdurl.toExternalForm());
- unmarshaller.addClassBinding(CourseBooking.NAMESPACE_XML_SIMPLE, CourseBooking.class);
-
- CourseBooking booking = (CourseBooking)unmarshaller.unmarshal(xmlurl.toExternalForm());
- assertNotNull("booking not null", booking);
- }
-}
\ No newline at end of file
Modified: projects/jboss-osgi/projects/bundles/jboss-xml-binding/trunk/src/test/java/org/jboss/test/osgi/jbossxb/apitest/UnmarshallerTestCase.java
===================================================================
--- projects/jboss-osgi/projects/bundles/jboss-xml-binding/trunk/src/test/java/org/jboss/test/osgi/jbossxb/apitest/UnmarshallerTestCase.java 2009-11-28 01:27:10 UTC (rev 97119)
+++ projects/jboss-osgi/projects/bundles/jboss-xml-binding/trunk/src/test/java/org/jboss/test/osgi/jbossxb/apitest/UnmarshallerTestCase.java 2009-11-28 07:55:50 UTC (rev 97120)
@@ -28,7 +28,7 @@
import java.net.URL;
import org.jboss.osgi.testing.OSGiTest;
-import org.jboss.test.osgi.jbossxb.simple.CourseBooking;
+import org.jboss.test.osgi.jbossxb.simple.bundle.CourseBooking;
import org.jboss.util.xml.JBossEntityResolver;
import org.jboss.xb.binding.Unmarshaller;
import org.jboss.xb.binding.UnmarshallerFactory;
Added: projects/jboss-osgi/projects/bundles/jboss-xml-binding/trunk/src/test/java/org/jboss/test/osgi/jbossxb/refresh/RefreshServiceTestCase.java
===================================================================
--- projects/jboss-osgi/projects/bundles/jboss-xml-binding/trunk/src/test/java/org/jboss/test/osgi/jbossxb/refresh/RefreshServiceTestCase.java (rev 0)
+++ projects/jboss-osgi/projects/bundles/jboss-xml-binding/trunk/src/test/java/org/jboss/test/osgi/jbossxb/refresh/RefreshServiceTestCase.java 2009-11-28 07:55:50 UTC (rev 97120)
@@ -0,0 +1,86 @@
+/*
+ * 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.test.osgi.jbossxb.refresh;
+
+//$Id: BasicXMLBindingTestCase.java 97031 2009-11-26 14:54:08Z thomas.diesler(a)jboss.com $
+
+import static org.junit.Assert.*;
+import static org.junit.Assume.assumeNotNull;
+
+import org.jboss.osgi.husky.BridgeFactory;
+import org.jboss.osgi.husky.HuskyCapability;
+import org.jboss.osgi.husky.RuntimeContext;
+import org.jboss.osgi.jbossxb.XMLBindingCapability;
+import org.jboss.osgi.testing.OSGiBundle;
+import org.jboss.osgi.testing.OSGiPackageAdmin;
+import org.jboss.osgi.testing.OSGiRuntime;
+import org.jboss.osgi.testing.OSGiTest;
+import org.jboss.test.osgi.jbossxb.simple.bundle.BookingActivator;
+import org.junit.After;
+import org.junit.Before;
+import org.junit.Test;
+import org.osgi.framework.Bundle;
+import org.osgi.framework.BundleContext;
+import org.osgi.framework.BundleException;
+import org.osgi.framework.ServiceReference;
+import org.osgi.service.packageadmin.PackageAdmin;
+
+/**
+ * Test XMLBindingService
+ *
+ * @author thomas.diesler(a)jboss.com
+ * @since 26-Nov-2009
+ */
+public class RefreshServiceTestCase extends OSGiTest
+{
+ @Test
+ public void testUnmarshaller() throws Exception
+ {
+ OSGiRuntime runtime = getDefaultRuntime();
+ try
+ {
+ runtime.addCapability(new XMLBindingCapability());
+
+ OSGiBundle serviceBundle = runtime.getBundle("jboss-osgi-xml-binding", null);
+ serviceBundle.start();
+
+ OSGiBundle userBundle = runtime.installBundle("simple-booking.jar");
+ userBundle.start();
+ userBundle.uninstall();
+
+ serviceBundle.uninstall();
+
+ OSGiPackageAdmin packageAdmin = runtime.getPackageAdmin();
+ packageAdmin.refreshPackages(null);
+
+ serviceBundle = runtime.installBundle("bundles/jboss-osgi-xml-binding.jar");
+ serviceBundle.start();
+
+ userBundle = runtime.installBundle("simple-booking.jar");
+ userBundle.start();
+ }
+ finally
+ {
+ runtime.shutdown();
+ }
+ }
+}
\ No newline at end of file
Copied: projects/jboss-osgi/projects/bundles/jboss-xml-binding/trunk/src/test/java/org/jboss/test/osgi/jbossxb/simple/BasicXMLBindingTestCase.java (from rev 97114, projects/jboss-osgi/projects/bundles/jboss-xml-binding/trunk/src/test/java/org/jboss/test/osgi/jbossxb/BasicXMLBindingTestCase.java)
===================================================================
--- projects/jboss-osgi/projects/bundles/jboss-xml-binding/trunk/src/test/java/org/jboss/test/osgi/jbossxb/simple/BasicXMLBindingTestCase.java (rev 0)
+++ projects/jboss-osgi/projects/bundles/jboss-xml-binding/trunk/src/test/java/org/jboss/test/osgi/jbossxb/simple/BasicXMLBindingTestCase.java 2009-11-28 07:55:50 UTC (rev 97120)
@@ -0,0 +1,111 @@
+/*
+ * 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.test.osgi.jbossxb.simple;
+
+//$Id$
+
+import static org.junit.Assert.assertNotNull;
+import static org.junit.Assume.assumeNotNull;
+
+import java.net.URL;
+
+import org.jboss.osgi.husky.BridgeFactory;
+import org.jboss.osgi.husky.HuskyCapability;
+import org.jboss.osgi.husky.RuntimeContext;
+import org.jboss.osgi.jbossxb.UnmarshallerService;
+import org.jboss.osgi.jbossxb.XMLBindingCapability;
+import org.jboss.osgi.testing.OSGiBundle;
+import org.jboss.osgi.testing.OSGiRuntime;
+import org.jboss.osgi.testing.OSGiTest;
+import org.jboss.test.osgi.jbossxb.simple.bundle.CourseBooking;
+import org.junit.After;
+import org.junit.Before;
+import org.junit.Test;
+import org.osgi.framework.Bundle;
+import org.osgi.framework.BundleContext;
+import org.osgi.framework.BundleException;
+import org.osgi.framework.ServiceReference;
+
+/**
+ * Test XMLBindingService
+ *
+ * @author thomas.diesler(a)jboss.com
+ * @since 26-Nov-2009
+ */
+public class BasicXMLBindingTestCase extends OSGiTest
+{
+ @RuntimeContext
+ public BundleContext context;
+
+ private OSGiRuntime runtime;
+
+ @Before
+ public void setUp() throws Exception
+ {
+ if (context == null)
+ {
+ runtime = getDefaultRuntime();
+ runtime.addCapability(new HuskyCapability());
+ runtime.addCapability(new XMLBindingCapability());
+
+ OSGiBundle bundle = runtime.installBundle("simple-unmarshaller.jar");
+ bundle.start();
+ }
+ }
+
+ @After
+ public void tearDown() throws BundleException
+ {
+ if (context == null)
+ runtime.shutdown();
+ }
+
+ @Test
+ public void testUnmarshaller() throws Exception
+ {
+ if (context == null)
+ BridgeFactory.getBridge().run();
+
+ assumeNotNull(context);
+
+ ServiceReference sref = context.getServiceReference(UnmarshallerService.class.getName());
+ assertNotNull("UnmarshallerService available", sref);
+
+ UnmarshallerService unmarshaller = (UnmarshallerService)context.getService(sref);
+ unmarshaller.setSchemaValidation(true);
+ unmarshaller.setNamespaceAware(true);
+ unmarshaller.setValidation(true);
+
+ Bundle bundle = context.getBundle();
+ URL xsdurl = bundle.getEntry("booking.xsd");
+ assertNotNull("booking.xsd available", xsdurl);
+
+ URL xmlurl = bundle.getEntry("booking.xml");
+ assertNotNull("booking.xml available", xmlurl);
+
+ unmarshaller.registerSchemaLocation("http://org.jboss.test.osgi.jbossxb.simple/booking.xsd", xsdurl.toExternalForm());
+ unmarshaller.addClassBinding(CourseBooking.NAMESPACE_XML_SIMPLE, CourseBooking.class);
+
+ CourseBooking booking = (CourseBooking)unmarshaller.unmarshal(xmlurl.toExternalForm());
+ assertNotNull("booking not null", booking);
+ }
+}
\ No newline at end of file
Deleted: projects/jboss-osgi/projects/bundles/jboss-xml-binding/trunk/src/test/java/org/jboss/test/osgi/jbossxb/simple/CompanyType.java
===================================================================
--- projects/jboss-osgi/projects/bundles/jboss-xml-binding/trunk/src/test/java/org/jboss/test/osgi/jbossxb/simple/CompanyType.java 2009-11-28 01:27:10 UTC (rev 97119)
+++ projects/jboss-osgi/projects/bundles/jboss-xml-binding/trunk/src/test/java/org/jboss/test/osgi/jbossxb/simple/CompanyType.java 2009-11-28 07:55:50 UTC (rev 97120)
@@ -1,126 +0,0 @@
-//
-// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vJAXB 2.1.10 in JDK 6
-// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a>
-// Any modifications to this file will be lost upon recompilation of the source schema.
-// Generated on: 2009.07.21 at 10:48:55 AM CEST
-//
-
-
-package org.jboss.test.osgi.jbossxb.simple;
-
-import javax.xml.bind.annotation.XmlAccessType;
-import javax.xml.bind.annotation.XmlAccessorType;
-import javax.xml.bind.annotation.XmlAttribute;
-import javax.xml.bind.annotation.XmlElement;
-import javax.xml.bind.annotation.XmlType;
-
-
-
-/**
- * <p>Java class for companyType complex type.
- *
- * <p>The following schema fragment specifies the expected content contained within this class.
- *
- * <pre>
- * <complexType name="companyType">
- * <complexContent>
- * <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
- * <sequence>
- * <element name="address" type="{http://www.w3.org/2001/XMLSchema}anyType"/>
- * <element ref="{}contact"/>
- * </sequence>
- * <attribute name="name" type="{http://www.w3.org/2001/XMLSchema}string" />
- * </restriction>
- * </complexContent>
- * </complexType>
- * </pre>
- *
- *
- */
-(a)XmlAccessorType(XmlAccessType.FIELD)
-@XmlType(name = "companyType", propOrder = {
- "address",
- "contact"
-})
-public class CompanyType {
-
- @XmlElement(required = true)
- protected Object address;
- @XmlElement(required = true)
- protected ContactType contact;
- @XmlAttribute
- protected String name;
-
- /**
- * Gets the value of the address property.
- *
- * @return
- * possible object is
- * {@link Object }
- *
- */
- public Object getAddress() {
- return address;
- }
-
- /**
- * Sets the value of the address property.
- *
- * @param value
- * allowed object is
- * {@link Object }
- *
- */
- public void setAddress(Object value) {
- this.address = value;
- }
-
- /**
- * Gets the value of the contact property.
- *
- * @return
- * possible object is
- * {@link ContactType }
- *
- */
- public ContactType getContact() {
- return contact;
- }
-
- /**
- * Sets the value of the contact property.
- *
- * @param value
- * allowed object is
- * {@link ContactType }
- *
- */
- public void setContact(ContactType value) {
- this.contact = value;
- }
-
- /**
- * Gets the value of the name property.
- *
- * @return
- * possible object is
- * {@link String }
- *
- */
- public String getName() {
- return name;
- }
-
- /**
- * Sets the value of the name property.
- *
- * @param value
- * allowed object is
- * {@link String }
- *
- */
- public void setName(String value) {
- this.name = value;
- }
-
-}
Deleted: projects/jboss-osgi/projects/bundles/jboss-xml-binding/trunk/src/test/java/org/jboss/test/osgi/jbossxb/simple/ContactType.java
===================================================================
--- projects/jboss-osgi/projects/bundles/jboss-xml-binding/trunk/src/test/java/org/jboss/test/osgi/jbossxb/simple/ContactType.java 2009-11-28 01:27:10 UTC (rev 97119)
+++ projects/jboss-osgi/projects/bundles/jboss-xml-binding/trunk/src/test/java/org/jboss/test/osgi/jbossxb/simple/ContactType.java 2009-11-28 07:55:50 UTC (rev 97120)
@@ -1,119 +0,0 @@
-//
-// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vJAXB 2.1.10 in JDK 6
-// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a>
-// Any modifications to this file will be lost upon recompilation of the source schema.
-// Generated on: 2009.07.21 at 10:48:55 AM CEST
-//
-
-
-package org.jboss.test.osgi.jbossxb.simple;
-
-import javax.xml.bind.annotation.XmlAccessType;
-import javax.xml.bind.annotation.XmlAccessorType;
-import javax.xml.bind.annotation.XmlAttribute;
-import javax.xml.bind.annotation.XmlType;
-
-
-/**
- * <p>Java class for contactType complex type.
- *
- * <p>The following schema fragment specifies the expected content contained within this class.
- *
- * <pre>
- * <complexType name="contactType">
- * <complexContent>
- * <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
- * <attribute name="name" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
- * <attribute name="telephone" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
- * <attribute name="email" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
- * </restriction>
- * </complexContent>
- * </complexType>
- * </pre>
- *
- *
- */
-(a)XmlAccessorType(XmlAccessType.FIELD)
-@XmlType(name = "contactType", propOrder = {})
-public class ContactType {
-
- @XmlAttribute(required = true)
- protected String name;
- @XmlAttribute(required = true)
- protected String telephone;
- @XmlAttribute(required = true)
- protected String email;
-
- /**
- * Gets the value of the name property.
- *
- * @return
- * possible object is
- * {@link String }
- *
- */
- public String getName() {
- return name;
- }
-
- /**
- * Sets the value of the name property.
- *
- * @param value
- * allowed object is
- * {@link String }
- *
- */
- public void setName(String value) {
- this.name = value;
- }
-
- /**
- * Gets the value of the telephone property.
- *
- * @return
- * possible object is
- * {@link String }
- *
- */
- public String getTelephone() {
- return telephone;
- }
-
- /**
- * Sets the value of the telephone property.
- *
- * @param value
- * allowed object is
- * {@link String }
- *
- */
- public void setTelephone(String value) {
- this.telephone = value;
- }
-
- /**
- * Gets the value of the email property.
- *
- * @return
- * possible object is
- * {@link String }
- *
- */
- public String getEmail() {
- return email;
- }
-
- /**
- * Sets the value of the email property.
- *
- * @param value
- * allowed object is
- * {@link String }
- *
- */
- public void setEmail(String value) {
- this.email = value;
- }
-
-}
Deleted: projects/jboss-osgi/projects/bundles/jboss-xml-binding/trunk/src/test/java/org/jboss/test/osgi/jbossxb/simple/CourseBooking.java
===================================================================
--- projects/jboss-osgi/projects/bundles/jboss-xml-binding/trunk/src/test/java/org/jboss/test/osgi/jbossxb/simple/CourseBooking.java 2009-11-28 01:27:10 UTC (rev 97119)
+++ projects/jboss-osgi/projects/bundles/jboss-xml-binding/trunk/src/test/java/org/jboss/test/osgi/jbossxb/simple/CourseBooking.java 2009-11-28 07:55:50 UTC (rev 97120)
@@ -1,231 +0,0 @@
-//
-// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vJAXB 2.1.10 in JDK 6
-// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a>
-// Any modifications to this file will be lost upon recompilation of the source schema.
-// Generated on: 2009.07.21 at 10:48:55 AM CEST
-//
-
-package org.jboss.test.osgi.jbossxb.simple;
-
-import java.math.BigDecimal;
-import java.util.ArrayList;
-import java.util.List;
-
-import javax.xml.bind.annotation.XmlAccessType;
-import javax.xml.bind.annotation.XmlAccessorType;
-import javax.xml.bind.annotation.XmlAttribute;
-import javax.xml.bind.annotation.XmlElement;
-import javax.xml.bind.annotation.XmlNsForm;
-import javax.xml.bind.annotation.XmlSchemaType;
-import javax.xml.bind.annotation.XmlType;
-import javax.xml.datatype.XMLGregorianCalendar;
-
-import org.jboss.xb.annotations.JBossXmlSchema;
-
-/**
- * <p>Java class for courseBooking complex type.
- *
- * <p>The following schema fragment specifies the expected content contained within this class.
- *
- * <pre>
- * <complexType name="courseBooking">
- * <complexContent>
- * <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
- * <sequence>
- * <element ref="{}company"/>
- * <element ref="{}student" maxOccurs="unbounded"/>
- * </sequence>
- * <attribute name="courseReference" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
- * <attribute name="courseDate" use="required" type="{http://www.w3.org/2001/XMLSchema}date" />
- * <attribute name="invoiceReference" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
- * <attribute name="totalPrice" use="required" type="{http://www.w3.org/2001/XMLSchema}decimal" />
- * </restriction>
- * </complexContent>
- * </complexType>
- * </pre>
- *
- *
- */
-@JBossXmlSchema(namespace = CourseBooking.NAMESPACE_XML_SIMPLE, elementFormDefault = XmlNsForm.QUALIFIED)
-(a)XmlAccessorType(XmlAccessType.FIELD)
-@XmlType(name = "courseBooking", propOrder = { "company", "student" })
-public class CourseBooking
-{
- public static final String NAMESPACE_XML_SIMPLE = "http://org.jboss.test.osgi.jbossxb.simple";
-
- @XmlElement(required = true)
- protected CompanyType company;
- @XmlElement(required = true)
- protected List<StudentType> student;
- @XmlAttribute(required = true)
- protected String courseReference;
- @XmlAttribute(required = true)
- @XmlSchemaType(name = "date")
- protected XMLGregorianCalendar courseDate;
- @XmlAttribute(required = true)
- protected String invoiceReference;
- @XmlAttribute(required = true)
- protected BigDecimal totalPrice;
-
- /**
- * Gets the value of the company property.
- *
- * @return
- * possible object is
- * {@link CompanyType }
- *
- */
- public CompanyType getCompany()
- {
- return company;
- }
-
- /**
- * Sets the value of the company property.
- *
- * @param value
- * allowed object is
- * {@link CompanyType }
- *
- */
- public void setCompany(CompanyType value)
- {
- this.company = value;
- }
-
- /**
- * Gets the value of the student property.
- *
- * <p>
- * This accessor method returns a reference to the live list,
- * not a snapshot. Therefore any modification you make to the
- * returned list will be present inside the JAXB object.
- * This is why there is not a <CODE>set</CODE> method for the student property.
- *
- * <p>
- * For example, to add a new item, do as follows:
- * <pre>
- * getStudent().add(newItem);
- * </pre>
- *
- *
- * <p>
- * Objects of the following type(s) are allowed in the list
- * {@link StudentType }
- *
- *
- */
- public List<StudentType> getStudent()
- {
- if (student == null)
- {
- student = new ArrayList<StudentType>();
- }
- return this.student;
- }
-
- /**
- * Gets the value of the courseReference property.
- *
- * @return
- * possible object is
- * {@link String }
- *
- */
- public String getCourseReference()
- {
- return courseReference;
- }
-
- /**
- * Sets the value of the courseReference property.
- *
- * @param value
- * allowed object is
- * {@link String }
- *
- */
- public void setCourseReference(String value)
- {
- this.courseReference = value;
- }
-
- /**
- * Gets the value of the courseDate property.
- *
- * @return
- * possible object is
- * {@link XMLGregorianCalendar }
- *
- */
- public XMLGregorianCalendar getCourseDate()
- {
- return courseDate;
- }
-
- /**
- * Sets the value of the courseDate property.
- *
- * @param value
- * allowed object is
- * {@link XMLGregorianCalendar }
- *
- */
- public void setCourseDate(XMLGregorianCalendar value)
- {
- this.courseDate = value;
- }
-
- /**
- * Gets the value of the invoiceReference property.
- *
- * @return
- * possible object is
- * {@link String }
- *
- */
- public String getInvoiceReference()
- {
- return invoiceReference;
- }
-
- /**
- * Sets the value of the invoiceReference property.
- *
- * @param value
- * allowed object is
- * {@link String }
- *
- */
- public void setInvoiceReference(String value)
- {
- this.invoiceReference = value;
- }
-
- /**
- * Gets the value of the totalPrice property.
- *
- * @return
- * possible object is
- * {@link BigDecimal }
- *
- */
- public BigDecimal getTotalPrice()
- {
- return totalPrice;
- }
-
- /**
- * Sets the value of the totalPrice property.
- *
- * @param value
- * allowed object is
- * {@link BigDecimal }
- *
- */
- public void setTotalPrice(BigDecimal value)
- {
- this.totalPrice = value;
- }
-
-}
Deleted: projects/jboss-osgi/projects/bundles/jboss-xml-binding/trunk/src/test/java/org/jboss/test/osgi/jbossxb/simple/StudentType.java
===================================================================
--- projects/jboss-osgi/projects/bundles/jboss-xml-binding/trunk/src/test/java/org/jboss/test/osgi/jbossxb/simple/StudentType.java 2009-11-28 01:27:10 UTC (rev 97119)
+++ projects/jboss-osgi/projects/bundles/jboss-xml-binding/trunk/src/test/java/org/jboss/test/osgi/jbossxb/simple/StudentType.java 2009-11-28 07:55:50 UTC (rev 97120)
@@ -1,92 +0,0 @@
-//
-// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vJAXB 2.1.10 in JDK 6
-// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a>
-// Any modifications to this file will be lost upon recompilation of the source schema.
-// Generated on: 2009.07.21 at 10:48:55 AM CEST
-//
-
-
-package org.jboss.test.osgi.jbossxb.simple;
-
-import javax.xml.bind.annotation.XmlAccessType;
-import javax.xml.bind.annotation.XmlAccessorType;
-import javax.xml.bind.annotation.XmlAttribute;
-import javax.xml.bind.annotation.XmlType;
-
-
-/**
- * <p>Java class for studentType complex type.
- *
- * <p>The following schema fragment specifies the expected content contained within this class.
- *
- * <pre>
- * <complexType name="studentType">
- * <complexContent>
- * <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
- * <attribute name="firstName" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
- * <attribute name="surname" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
- * </restriction>
- * </complexContent>
- * </complexType>
- * </pre>
- *
- *
- */
-(a)XmlAccessorType(XmlAccessType.FIELD)
-@XmlType(name = "studentType", propOrder = {})
-public class StudentType {
-
- @XmlAttribute(required = true)
- protected String firstName;
- @XmlAttribute(required = true)
- protected String surname;
-
- /**
- * Gets the value of the firstName property.
- *
- * @return
- * possible object is
- * {@link String }
- *
- */
- public String getFirstName() {
- return firstName;
- }
-
- /**
- * Sets the value of the firstName property.
- *
- * @param value
- * allowed object is
- * {@link String }
- *
- */
- public void setFirstName(String value) {
- this.firstName = value;
- }
-
- /**
- * Gets the value of the surname property.
- *
- * @return
- * possible object is
- * {@link String }
- *
- */
- public String getSurname() {
- return surname;
- }
-
- /**
- * Sets the value of the surname property.
- *
- * @param value
- * allowed object is
- * {@link String }
- *
- */
- public void setSurname(String value) {
- this.surname = value;
- }
-
-}
Added: projects/jboss-osgi/projects/bundles/jboss-xml-binding/trunk/src/test/java/org/jboss/test/osgi/jbossxb/simple/bundle/BookingActivator.java
===================================================================
--- projects/jboss-osgi/projects/bundles/jboss-xml-binding/trunk/src/test/java/org/jboss/test/osgi/jbossxb/simple/bundle/BookingActivator.java (rev 0)
+++ projects/jboss-osgi/projects/bundles/jboss-xml-binding/trunk/src/test/java/org/jboss/test/osgi/jbossxb/simple/bundle/BookingActivator.java 2009-11-28 07:55:50 UTC (rev 97120)
@@ -0,0 +1,63 @@
+/*
+ * 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.test.osgi.jbossxb.simple.bundle;
+
+//$Id: BasicXMLBindingTestCase.java 97031 2009-11-26 14:54:08Z thomas.diesler(a)jboss.com $
+
+import java.net.URL;
+
+import org.jboss.osgi.jbossxb.UnmarshallerService;
+import org.osgi.framework.Bundle;
+import org.osgi.framework.BundleActivator;
+import org.osgi.framework.BundleContext;
+import org.osgi.framework.ServiceReference;
+
+/**
+ * A bundle activator that uses the unmarshaller service
+ *
+ * @author thomas.diesler(a)jboss.com
+ * @since 26-Nov-2009
+ */
+public class BookingActivator implements BundleActivator
+{
+ public void start(BundleContext context) throws Exception
+ {
+ ServiceReference sref = context.getServiceReference(UnmarshallerService.class.getName());
+ UnmarshallerService unmarshaller = (UnmarshallerService)context.getService(sref);
+ unmarshaller.setSchemaValidation(true);
+ unmarshaller.setNamespaceAware(true);
+ unmarshaller.setValidation(true);
+
+ Bundle bundle = context.getBundle();
+ URL xsdurl = bundle.getEntry("booking.xsd");
+ URL xmlurl = bundle.getEntry("booking.xml");
+
+ unmarshaller.registerSchemaLocation("http://org.jboss.test.osgi.jbossxb.simple/booking.xsd", xsdurl.toExternalForm());
+ unmarshaller.addClassBinding(CourseBooking.NAMESPACE_XML_SIMPLE, CourseBooking.class);
+
+ unmarshaller.unmarshal(xmlurl.toExternalForm());
+ }
+
+ public void stop(BundleContext context) throws Exception
+ {
+ }
+}
\ No newline at end of file
Copied: projects/jboss-osgi/projects/bundles/jboss-xml-binding/trunk/src/test/java/org/jboss/test/osgi/jbossxb/simple/bundle/CompanyType.java (from rev 97114, projects/jboss-osgi/projects/bundles/jboss-xml-binding/trunk/src/test/java/org/jboss/test/osgi/jbossxb/simple/CompanyType.java)
===================================================================
--- projects/jboss-osgi/projects/bundles/jboss-xml-binding/trunk/src/test/java/org/jboss/test/osgi/jbossxb/simple/bundle/CompanyType.java (rev 0)
+++ projects/jboss-osgi/projects/bundles/jboss-xml-binding/trunk/src/test/java/org/jboss/test/osgi/jbossxb/simple/bundle/CompanyType.java 2009-11-28 07:55:50 UTC (rev 97120)
@@ -0,0 +1,126 @@
+//
+// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vJAXB 2.1.10 in JDK 6
+// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a>
+// Any modifications to this file will be lost upon recompilation of the source schema.
+// Generated on: 2009.07.21 at 10:48:55 AM CEST
+//
+
+
+package org.jboss.test.osgi.jbossxb.simple.bundle;
+
+import javax.xml.bind.annotation.XmlAccessType;
+import javax.xml.bind.annotation.XmlAccessorType;
+import javax.xml.bind.annotation.XmlAttribute;
+import javax.xml.bind.annotation.XmlElement;
+import javax.xml.bind.annotation.XmlType;
+
+
+
+/**
+ * <p>Java class for companyType complex type.
+ *
+ * <p>The following schema fragment specifies the expected content contained within this class.
+ *
+ * <pre>
+ * <complexType name="companyType">
+ * <complexContent>
+ * <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ * <sequence>
+ * <element name="address" type="{http://www.w3.org/2001/XMLSchema}anyType"/>
+ * <element ref="{}contact"/>
+ * </sequence>
+ * <attribute name="name" type="{http://www.w3.org/2001/XMLSchema}string" />
+ * </restriction>
+ * </complexContent>
+ * </complexType>
+ * </pre>
+ *
+ *
+ */
+(a)XmlAccessorType(XmlAccessType.FIELD)
+@XmlType(name = "companyType", propOrder = {
+ "address",
+ "contact"
+})
+public class CompanyType {
+
+ @XmlElement(required = true)
+ protected Object address;
+ @XmlElement(required = true)
+ protected ContactType contact;
+ @XmlAttribute
+ protected String name;
+
+ /**
+ * Gets the value of the address property.
+ *
+ * @return
+ * possible object is
+ * {@link Object }
+ *
+ */
+ public Object getAddress() {
+ return address;
+ }
+
+ /**
+ * Sets the value of the address property.
+ *
+ * @param value
+ * allowed object is
+ * {@link Object }
+ *
+ */
+ public void setAddress(Object value) {
+ this.address = value;
+ }
+
+ /**
+ * Gets the value of the contact property.
+ *
+ * @return
+ * possible object is
+ * {@link ContactType }
+ *
+ */
+ public ContactType getContact() {
+ return contact;
+ }
+
+ /**
+ * Sets the value of the contact property.
+ *
+ * @param value
+ * allowed object is
+ * {@link ContactType }
+ *
+ */
+ public void setContact(ContactType value) {
+ this.contact = value;
+ }
+
+ /**
+ * Gets the value of the name property.
+ *
+ * @return
+ * possible object is
+ * {@link String }
+ *
+ */
+ public String getName() {
+ return name;
+ }
+
+ /**
+ * Sets the value of the name property.
+ *
+ * @param value
+ * allowed object is
+ * {@link String }
+ *
+ */
+ public void setName(String value) {
+ this.name = value;
+ }
+
+}
Copied: projects/jboss-osgi/projects/bundles/jboss-xml-binding/trunk/src/test/java/org/jboss/test/osgi/jbossxb/simple/bundle/ContactType.java (from rev 97114, projects/jboss-osgi/projects/bundles/jboss-xml-binding/trunk/src/test/java/org/jboss/test/osgi/jbossxb/simple/ContactType.java)
===================================================================
--- projects/jboss-osgi/projects/bundles/jboss-xml-binding/trunk/src/test/java/org/jboss/test/osgi/jbossxb/simple/bundle/ContactType.java (rev 0)
+++ projects/jboss-osgi/projects/bundles/jboss-xml-binding/trunk/src/test/java/org/jboss/test/osgi/jbossxb/simple/bundle/ContactType.java 2009-11-28 07:55:50 UTC (rev 97120)
@@ -0,0 +1,119 @@
+//
+// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vJAXB 2.1.10 in JDK 6
+// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a>
+// Any modifications to this file will be lost upon recompilation of the source schema.
+// Generated on: 2009.07.21 at 10:48:55 AM CEST
+//
+
+
+package org.jboss.test.osgi.jbossxb.simple.bundle;
+
+import javax.xml.bind.annotation.XmlAccessType;
+import javax.xml.bind.annotation.XmlAccessorType;
+import javax.xml.bind.annotation.XmlAttribute;
+import javax.xml.bind.annotation.XmlType;
+
+
+/**
+ * <p>Java class for contactType complex type.
+ *
+ * <p>The following schema fragment specifies the expected content contained within this class.
+ *
+ * <pre>
+ * <complexType name="contactType">
+ * <complexContent>
+ * <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ * <attribute name="name" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
+ * <attribute name="telephone" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
+ * <attribute name="email" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
+ * </restriction>
+ * </complexContent>
+ * </complexType>
+ * </pre>
+ *
+ *
+ */
+(a)XmlAccessorType(XmlAccessType.FIELD)
+@XmlType(name = "contactType", propOrder = {})
+public class ContactType {
+
+ @XmlAttribute(required = true)
+ protected String name;
+ @XmlAttribute(required = true)
+ protected String telephone;
+ @XmlAttribute(required = true)
+ protected String email;
+
+ /**
+ * Gets the value of the name property.
+ *
+ * @return
+ * possible object is
+ * {@link String }
+ *
+ */
+ public String getName() {
+ return name;
+ }
+
+ /**
+ * Sets the value of the name property.
+ *
+ * @param value
+ * allowed object is
+ * {@link String }
+ *
+ */
+ public void setName(String value) {
+ this.name = value;
+ }
+
+ /**
+ * Gets the value of the telephone property.
+ *
+ * @return
+ * possible object is
+ * {@link String }
+ *
+ */
+ public String getTelephone() {
+ return telephone;
+ }
+
+ /**
+ * Sets the value of the telephone property.
+ *
+ * @param value
+ * allowed object is
+ * {@link String }
+ *
+ */
+ public void setTelephone(String value) {
+ this.telephone = value;
+ }
+
+ /**
+ * Gets the value of the email property.
+ *
+ * @return
+ * possible object is
+ * {@link String }
+ *
+ */
+ public String getEmail() {
+ return email;
+ }
+
+ /**
+ * Sets the value of the email property.
+ *
+ * @param value
+ * allowed object is
+ * {@link String }
+ *
+ */
+ public void setEmail(String value) {
+ this.email = value;
+ }
+
+}
Copied: projects/jboss-osgi/projects/bundles/jboss-xml-binding/trunk/src/test/java/org/jboss/test/osgi/jbossxb/simple/bundle/CourseBooking.java (from rev 97114, projects/jboss-osgi/projects/bundles/jboss-xml-binding/trunk/src/test/java/org/jboss/test/osgi/jbossxb/simple/CourseBooking.java)
===================================================================
--- projects/jboss-osgi/projects/bundles/jboss-xml-binding/trunk/src/test/java/org/jboss/test/osgi/jbossxb/simple/bundle/CourseBooking.java (rev 0)
+++ projects/jboss-osgi/projects/bundles/jboss-xml-binding/trunk/src/test/java/org/jboss/test/osgi/jbossxb/simple/bundle/CourseBooking.java 2009-11-28 07:55:50 UTC (rev 97120)
@@ -0,0 +1,233 @@
+//
+// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vJAXB 2.1.10 in JDK 6
+// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a>
+// Any modifications to this file will be lost upon recompilation of the source schema.
+// Generated on: 2009.07.21 at 10:48:55 AM CEST
+//
+
+package org.jboss.test.osgi.jbossxb.simple.bundle;
+
+import java.math.BigDecimal;
+import java.util.ArrayList;
+import java.util.List;
+
+import javax.xml.bind.annotation.XmlAccessType;
+import javax.xml.bind.annotation.XmlAccessorType;
+import javax.xml.bind.annotation.XmlAttribute;
+import javax.xml.bind.annotation.XmlElement;
+import javax.xml.bind.annotation.XmlNsForm;
+import javax.xml.bind.annotation.XmlRootElement;
+import javax.xml.bind.annotation.XmlSchemaType;
+import javax.xml.bind.annotation.XmlType;
+import javax.xml.datatype.XMLGregorianCalendar;
+
+import org.jboss.xb.annotations.JBossXmlSchema;
+
+/**
+ * <p>Java class for courseBooking complex type.
+ *
+ * <p>The following schema fragment specifies the expected content contained within this class.
+ *
+ * <pre>
+ * <complexType name="courseBooking">
+ * <complexContent>
+ * <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ * <sequence>
+ * <element ref="{}company"/>
+ * <element ref="{}student" maxOccurs="unbounded"/>
+ * </sequence>
+ * <attribute name="courseReference" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
+ * <attribute name="courseDate" use="required" type="{http://www.w3.org/2001/XMLSchema}date" />
+ * <attribute name="invoiceReference" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
+ * <attribute name="totalPrice" use="required" type="{http://www.w3.org/2001/XMLSchema}decimal" />
+ * </restriction>
+ * </complexContent>
+ * </complexType>
+ * </pre>
+ *
+ *
+ */
+@JBossXmlSchema(namespace = CourseBooking.NAMESPACE_XML_SIMPLE, elementFormDefault = XmlNsForm.QUALIFIED)
+@XmlRootElement(name = "booking")
+(a)XmlAccessorType(XmlAccessType.FIELD)
+@XmlType(name = "courseBooking", propOrder = { "company", "student" })
+public class CourseBooking
+{
+ public static final String NAMESPACE_XML_SIMPLE = "http://org.jboss.test.osgi.jbossxb.simple";
+
+ @XmlElement(required = true)
+ protected CompanyType company;
+ @XmlElement(required = true)
+ protected List<StudentType> student;
+ @XmlAttribute(required = true)
+ protected String courseReference;
+ @XmlAttribute(required = true)
+ @XmlSchemaType(name = "date")
+ protected XMLGregorianCalendar courseDate;
+ @XmlAttribute(required = true)
+ protected String invoiceReference;
+ @XmlAttribute(required = true)
+ protected BigDecimal totalPrice;
+
+ /**
+ * Gets the value of the company property.
+ *
+ * @return
+ * possible object is
+ * {@link CompanyType }
+ *
+ */
+ public CompanyType getCompany()
+ {
+ return company;
+ }
+
+ /**
+ * Sets the value of the company property.
+ *
+ * @param value
+ * allowed object is
+ * {@link CompanyType }
+ *
+ */
+ public void setCompany(CompanyType value)
+ {
+ this.company = value;
+ }
+
+ /**
+ * Gets the value of the student property.
+ *
+ * <p>
+ * This accessor method returns a reference to the live list,
+ * not a snapshot. Therefore any modification you make to the
+ * returned list will be present inside the JAXB object.
+ * This is why there is not a <CODE>set</CODE> method for the student property.
+ *
+ * <p>
+ * For example, to add a new item, do as follows:
+ * <pre>
+ * getStudent().add(newItem);
+ * </pre>
+ *
+ *
+ * <p>
+ * Objects of the following type(s) are allowed in the list
+ * {@link StudentType }
+ *
+ *
+ */
+ public List<StudentType> getStudent()
+ {
+ if (student == null)
+ {
+ student = new ArrayList<StudentType>();
+ }
+ return this.student;
+ }
+
+ /**
+ * Gets the value of the courseReference property.
+ *
+ * @return
+ * possible object is
+ * {@link String }
+ *
+ */
+ public String getCourseReference()
+ {
+ return courseReference;
+ }
+
+ /**
+ * Sets the value of the courseReference property.
+ *
+ * @param value
+ * allowed object is
+ * {@link String }
+ *
+ */
+ public void setCourseReference(String value)
+ {
+ this.courseReference = value;
+ }
+
+ /**
+ * Gets the value of the courseDate property.
+ *
+ * @return
+ * possible object is
+ * {@link XMLGregorianCalendar }
+ *
+ */
+ public XMLGregorianCalendar getCourseDate()
+ {
+ return courseDate;
+ }
+
+ /**
+ * Sets the value of the courseDate property.
+ *
+ * @param value
+ * allowed object is
+ * {@link XMLGregorianCalendar }
+ *
+ */
+ public void setCourseDate(XMLGregorianCalendar value)
+ {
+ this.courseDate = value;
+ }
+
+ /**
+ * Gets the value of the invoiceReference property.
+ *
+ * @return
+ * possible object is
+ * {@link String }
+ *
+ */
+ public String getInvoiceReference()
+ {
+ return invoiceReference;
+ }
+
+ /**
+ * Sets the value of the invoiceReference property.
+ *
+ * @param value
+ * allowed object is
+ * {@link String }
+ *
+ */
+ public void setInvoiceReference(String value)
+ {
+ this.invoiceReference = value;
+ }
+
+ /**
+ * Gets the value of the totalPrice property.
+ *
+ * @return
+ * possible object is
+ * {@link BigDecimal }
+ *
+ */
+ public BigDecimal getTotalPrice()
+ {
+ return totalPrice;
+ }
+
+ /**
+ * Sets the value of the totalPrice property.
+ *
+ * @param value
+ * allowed object is
+ * {@link BigDecimal }
+ *
+ */
+ public void setTotalPrice(BigDecimal value)
+ {
+ this.totalPrice = value;
+ }
+
+}
Copied: projects/jboss-osgi/projects/bundles/jboss-xml-binding/trunk/src/test/java/org/jboss/test/osgi/jbossxb/simple/bundle/StudentType.java (from rev 97114, projects/jboss-osgi/projects/bundles/jboss-xml-binding/trunk/src/test/java/org/jboss/test/osgi/jbossxb/simple/StudentType.java)
===================================================================
--- projects/jboss-osgi/projects/bundles/jboss-xml-binding/trunk/src/test/java/org/jboss/test/osgi/jbossxb/simple/bundle/StudentType.java (rev 0)
+++ projects/jboss-osgi/projects/bundles/jboss-xml-binding/trunk/src/test/java/org/jboss/test/osgi/jbossxb/simple/bundle/StudentType.java 2009-11-28 07:55:50 UTC (rev 97120)
@@ -0,0 +1,92 @@
+//
+// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vJAXB 2.1.10 in JDK 6
+// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a>
+// Any modifications to this file will be lost upon recompilation of the source schema.
+// Generated on: 2009.07.21 at 10:48:55 AM CEST
+//
+
+
+package org.jboss.test.osgi.jbossxb.simple.bundle;
+
+import javax.xml.bind.annotation.XmlAccessType;
+import javax.xml.bind.annotation.XmlAccessorType;
+import javax.xml.bind.annotation.XmlAttribute;
+import javax.xml.bind.annotation.XmlType;
+
+
+/**
+ * <p>Java class for studentType complex type.
+ *
+ * <p>The following schema fragment specifies the expected content contained within this class.
+ *
+ * <pre>
+ * <complexType name="studentType">
+ * <complexContent>
+ * <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ * <attribute name="firstName" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
+ * <attribute name="surname" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
+ * </restriction>
+ * </complexContent>
+ * </complexType>
+ * </pre>
+ *
+ *
+ */
+(a)XmlAccessorType(XmlAccessType.FIELD)
+@XmlType(name = "studentType", propOrder = {})
+public class StudentType {
+
+ @XmlAttribute(required = true)
+ protected String firstName;
+ @XmlAttribute(required = true)
+ protected String surname;
+
+ /**
+ * Gets the value of the firstName property.
+ *
+ * @return
+ * possible object is
+ * {@link String }
+ *
+ */
+ public String getFirstName() {
+ return firstName;
+ }
+
+ /**
+ * Sets the value of the firstName property.
+ *
+ * @param value
+ * allowed object is
+ * {@link String }
+ *
+ */
+ public void setFirstName(String value) {
+ this.firstName = value;
+ }
+
+ /**
+ * Gets the value of the surname property.
+ *
+ * @return
+ * possible object is
+ * {@link String }
+ *
+ */
+ public String getSurname() {
+ return surname;
+ }
+
+ /**
+ * Sets the value of the surname property.
+ *
+ * @param value
+ * allowed object is
+ * {@link String }
+ *
+ */
+ public void setSurname(String value) {
+ this.surname = value;
+ }
+
+}
Modified: projects/jboss-osgi/projects/bundles/jboss-xml-binding/trunk/src/test/resources/simple/booking.xml
===================================================================
--- projects/jboss-osgi/projects/bundles/jboss-xml-binding/trunk/src/test/resources/simple/booking.xml 2009-11-28 01:27:10 UTC (rev 97119)
+++ projects/jboss-osgi/projects/bundles/jboss-xml-binding/trunk/src/test/resources/simple/booking.xml 2009-11-28 07:55:50 UTC (rev 97120)
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
-<course-booking xmlns="http://org.jboss.test.osgi.jbossxb.simple" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+<booking xmlns="http://org.jboss.test.osgi.jbossxb.simple" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://org.jboss.test.osgi.jbossxb.simple http://org.jboss.test.osgi.jbossxb.simple/booking.xsd"
courseReference="Course100" courseDate="2009-11-26" invoiceReference="Ref100" totalPrice="100">
<company name="ACME Consulting">
@@ -8,4 +8,4 @@
</company>
<student firstName="Jane" surname="Dow" />
<student firstName="John" surname="Doe" />
-</course-booking>
+</booking>
Modified: projects/jboss-osgi/projects/bundles/jboss-xml-binding/trunk/src/test/resources/simple/booking.xsd
===================================================================
--- projects/jboss-osgi/projects/bundles/jboss-xml-binding/trunk/src/test/resources/simple/booking.xsd 2009-11-28 01:27:10 UTC (rev 97119)
+++ projects/jboss-osgi/projects/bundles/jboss-xml-binding/trunk/src/test/resources/simple/booking.xsd 2009-11-28 07:55:50 UTC (rev 97120)
@@ -13,7 +13,7 @@
elementFormDefault="qualified" attributeFormDefault="unqualified"
version="1.0.0">
- <xsd:element name="course-booking" type="courseBooking" />
+ <xsd:element name="booking" type="courseBooking" />
<xsd:complexType name="courseBooking">
<xsd:sequence>
<xsd:element ref="company" />
Added: projects/jboss-osgi/projects/bundles/jboss-xml-binding/trunk/src/test/resources/simple/simple-booking.bnd
===================================================================
--- projects/jboss-osgi/projects/bundles/jboss-xml-binding/trunk/src/test/resources/simple/simple-booking.bnd (rev 0)
+++ projects/jboss-osgi/projects/bundles/jboss-xml-binding/trunk/src/test/resources/simple/simple-booking.bnd 2009-11-28 07:55:50 UTC (rev 97120)
@@ -0,0 +1,16 @@
+# bnd build -classpath target/test-classes -output target/test-libs/simple-booking.jar src/test/resources/simple/simple-booking.bnd
+
+Bundle-SymbolicName: simple-booking
+Bundle-Activator: org.jboss.test.osgi.jbossxb.simple.bundle.BookingActivator
+Private-Package: org.jboss.test.osgi.jbossxb.simple.bundle
+
+Import-Package: \
+ javax.xml.bind.annotation, \
+ javax.xml.datatype, \
+ org.jboss.osgi.jbossxb, \
+ org.jboss.osgi.spi.capability, \
+ org.jboss.xb.annotations, \
+ org.osgi.framework
+
+Include-Resource: booking.xml, booking.xsd
+
Modified: projects/jboss-osgi/projects/bundles/jboss-xml-binding/trunk/src/test/resources/simple/simple-unmarshaller.bnd
===================================================================
--- projects/jboss-osgi/projects/bundles/jboss-xml-binding/trunk/src/test/resources/simple/simple-unmarshaller.bnd 2009-11-28 01:27:10 UTC (rev 97119)
+++ projects/jboss-osgi/projects/bundles/jboss-xml-binding/trunk/src/test/resources/simple/simple-unmarshaller.bnd 2009-11-28 07:55:50 UTC (rev 97120)
@@ -1,8 +1,8 @@
# bnd build -classpath target/test-classes -output target/test-libs/simple-unmarshaller.jar src/test/resources/simple/simple-unmarshaller.bnd
Bundle-SymbolicName: simple-unmarshaller
-Export-Package: org.jboss.test.osgi.jbossxb
-Private-Package: org.jboss.test.osgi.jbossxb.simple
+Export-Package: org.jboss.test.osgi.jbossxb.simple
+Private-Package: org.jboss.test.osgi.jbossxb.simple.bundle
Import-Package: \
javax.xml.bind.annotation, \
@@ -18,4 +18,4 @@
Include-Resource: booking.xml, booking.xsd
# Tell Husky that there are test cases in this package
-Test-Package: org.jboss.test.osgi.jbossxb
+Test-Package: org.jboss.test.osgi.jbossxb.simple
14 years, 6 months
JBoss-OSGI SVN: r97115 - in projects/jboss-osgi: projects/bundles/jboss-xml-binding/trunk/src/main/java/org/jboss/osgi/jbossxb and 5 other directories.
by jboss-osgi-commits@lists.jboss.org
Author: thomas.diesler(a)jboss.com
Date: 2009-11-27 12:48:55 -0500 (Fri, 27 Nov 2009)
New Revision: 97115
Modified:
projects/jboss-osgi/projects/bundles/jboss-xml-binding/trunk/pom.xml
projects/jboss-osgi/projects/bundles/jboss-xml-binding/trunk/src/main/java/org/jboss/osgi/jbossxb/UnmarshallerService.java
projects/jboss-osgi/projects/bundles/jboss-xml-binding/trunk/src/main/java/org/jboss/osgi/jbossxb/internal/UnmarshallerServiceImpl.java
projects/jboss-osgi/projects/bundles/microcontainer/trunk/pom.xml
projects/jboss-osgi/projects/bundles/microcontainer/trunk/src/main/java/org/jboss/osgi/microcontainer/internal/EmbeddedBeanDeployer.java
projects/jboss-osgi/trunk/distribution/installer/src/main/resources/installer/install-definition.xml
projects/jboss-osgi/trunk/distribution/pom.xml
Log:
Fix runtime for MC framework
Modified: projects/jboss-osgi/projects/bundles/jboss-xml-binding/trunk/pom.xml
===================================================================
--- projects/jboss-osgi/projects/bundles/jboss-xml-binding/trunk/pom.xml 2009-11-27 16:53:45 UTC (rev 97114)
+++ projects/jboss-osgi/projects/bundles/jboss-xml-binding/trunk/pom.xml 2009-11-27 17:48:55 UTC (rev 97115)
@@ -186,8 +186,9 @@
</Embed-Dependency>
<_exportcontents>
org.jboss.xb.annotations;version=${version.jboss.xb},
+ org.jboss.xb.binding.resolver;version=${version.jboss.xb},
org.jboss.xb.binding.sunday.unmarshalling;version=${version.jboss.xb},
- org.jboss.xb.binding;version=${version.jboss.xb},
+ org.jboss.xb.util;version=${version.jboss.xb},
</_exportcontents>
</instructions>
</configuration>
Modified: projects/jboss-osgi/projects/bundles/jboss-xml-binding/trunk/src/main/java/org/jboss/osgi/jbossxb/UnmarshallerService.java
===================================================================
--- projects/jboss-osgi/projects/bundles/jboss-xml-binding/trunk/src/main/java/org/jboss/osgi/jbossxb/UnmarshallerService.java 2009-11-27 16:53:45 UTC (rev 97114)
+++ projects/jboss-osgi/projects/bundles/jboss-xml-binding/trunk/src/main/java/org/jboss/osgi/jbossxb/UnmarshallerService.java 2009-11-27 17:48:55 UTC (rev 97115)
@@ -38,7 +38,7 @@
*/
public interface UnmarshallerService
{
- void setFeature(String featureName, Boolean flag);
+ void setFeature(String featureName, boolean flag);
void setValidation(boolean validation);
Modified: projects/jboss-osgi/projects/bundles/jboss-xml-binding/trunk/src/main/java/org/jboss/osgi/jbossxb/internal/UnmarshallerServiceImpl.java
===================================================================
--- projects/jboss-osgi/projects/bundles/jboss-xml-binding/trunk/src/main/java/org/jboss/osgi/jbossxb/internal/UnmarshallerServiceImpl.java 2009-11-27 16:53:45 UTC (rev 97114)
+++ projects/jboss-osgi/projects/bundles/jboss-xml-binding/trunk/src/main/java/org/jboss/osgi/jbossxb/internal/UnmarshallerServiceImpl.java 2009-11-27 17:48:55 UTC (rev 97115)
@@ -66,7 +66,7 @@
log.debug("UnmarshallerService using: " + bundleLoader);
}
- public void setFeature(String featureName, Boolean flag)
+ public void setFeature(String featureName, boolean flag)
{
factory.setFeature(featureName, flag);
}
Modified: projects/jboss-osgi/projects/bundles/microcontainer/trunk/pom.xml
===================================================================
--- projects/jboss-osgi/projects/bundles/microcontainer/trunk/pom.xml 2009-11-27 16:53:45 UTC (rev 97114)
+++ projects/jboss-osgi/projects/bundles/microcontainer/trunk/pom.xml 2009-11-27 17:48:55 UTC (rev 97115)
@@ -40,7 +40,7 @@
<!-- Properties -->
<properties>
<version.jboss.osgi.runtime.felix>2.0.2-SNAPSHOT</version.jboss.osgi.runtime.felix>
- <version.jboss.deployers>2.0.5.SP1</version.jboss.deployers>
+ <version.jboss.deployers>2.0.9.GA</version.jboss.deployers>
<version.jboss.microcontainer>2.0.9.GA</version.jboss.microcontainer>
<version.jboss.osgi.common>1.0.4-SNAPSHOT</version.jboss.osgi.common>
<version.jboss.osgi.common.core>2.2.13.GA</version.jboss.osgi.common.core>
Modified: projects/jboss-osgi/projects/bundles/microcontainer/trunk/src/main/java/org/jboss/osgi/microcontainer/internal/EmbeddedBeanDeployer.java
===================================================================
--- projects/jboss-osgi/projects/bundles/microcontainer/trunk/src/main/java/org/jboss/osgi/microcontainer/internal/EmbeddedBeanDeployer.java 2009-11-27 16:53:45 UTC (rev 97114)
+++ projects/jboss-osgi/projects/bundles/microcontainer/trunk/src/main/java/org/jboss/osgi/microcontainer/internal/EmbeddedBeanDeployer.java 2009-11-27 17:48:55 UTC (rev 97115)
@@ -24,15 +24,16 @@
// $Id$
import org.jboss.deployers.vfs.deployer.kernel.BeanDeployer;
-import org.jboss.deployers.vfs.spi.deployer.JBossXBDeployerHelper;
import org.jboss.kernel.spi.deployment.KernelDeployment;
import org.jboss.osgi.jbossxb.UnmarshallerService;
import org.jboss.osgi.spi.NotImplementedException;
import org.jboss.virtual.VirtualFile;
import org.jboss.xb.binding.ObjectModelFactory;
import org.jboss.xb.binding.sunday.unmarshalling.DefaultSchemaResolver;
+import org.jboss.xb.util.JBossXBHelper;
import org.osgi.framework.BundleContext;
import org.osgi.framework.ServiceReference;
+import org.xml.sax.InputSource;
/**
* A {@link BeanDeployer} that that delegates to the {@link UnmarshallerService}.
@@ -70,12 +71,12 @@
}
@Override
- protected JBossXBDeployerHelper<KernelDeployment> getHelper()
+ protected JBossXBHelper<KernelDeployment> getHelper()
{
return new EmbeddedDeployerHelper<KernelDeployment>(getOutput());
}
- class EmbeddedDeployerHelper<T> extends JBossXBDeployerHelper<T>
+ class EmbeddedDeployerHelper<T> extends JBossXBHelper<T>
{
protected EmbeddedDeployerHelper(Class<T> output)
{
@@ -83,35 +84,34 @@
}
@Override
- public void setFeature(String featureName, Boolean flag) throws Exception
+ public void setFeature(String featureName, boolean flag) throws Exception
{
UnmarshallerService unmarshaller = getUnmarshallerService(systemContext);
unmarshaller.setFeature(featureName, flag);
}
-
+
@Override
@SuppressWarnings("unchecked")
- public T parse(VirtualFile file) throws Exception
+ public T parse(InputSource source) throws Exception
{
UnmarshallerService unmarshaller = getUnmarshallerService(systemContext);
- return (T)unmarshaller.unmarshal(file.openStream());
+ return (T)unmarshaller.unmarshal(source);
}
- // Below are the methods that are not (yet) implemented
@Override
- public <U> U parse(Class<U> expectedType, VirtualFile file, U root, ObjectModelFactory omf) throws Exception
+ public <U> U parse(Class<U> expectedType, InputSource source, U root, ObjectModelFactory omf) throws Exception
{
throw new NotImplementedException();
}
@Override
- public <U> U parse(Class<U> expectedType, VirtualFile file) throws Exception
+ public <U> U parse(Class<U> expectedType, InputSource source) throws Exception
{
throw new NotImplementedException();
}
@Override
- public T parse(VirtualFile file, T root, ObjectModelFactory omf) throws Exception
+ public T parse(InputSource source, T root, ObjectModelFactory omf) throws Exception
{
throw new NotImplementedException();
}
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-11-27 16:53:45 UTC (rev 97114)
+++ projects/jboss-osgi/trunk/distribution/installer/src/main/resources/installer/install-definition.xml 2009-11-27 17:48:55 UTC (rev 97115)
@@ -147,6 +147,7 @@
<include name="jboss-osgi-jndi-sources.jar" />
<include name="jboss-osgi-jta-sources.jar" />
<include name="jboss-osgi-microcontainer-sources.jar" />
+ <include name="jboss-osgi-reflect-sources.jar" />
<include name="jboss-osgi-runtime-equinox-sources.jar" />
<include name="jboss-osgi-runtime-felix-sources.jar" />
<include name="jboss-osgi-runtime-jbossas-sources.jar" />
@@ -239,6 +240,7 @@
<include name="jboss-osgi-husky.jar" />
<include name="jboss-osgi-jaxb.jar" />
<include name="jboss-osgi-jta.jar" />
+ <include name="jboss-osgi-reflect.jar" />
<include name="jboss-osgi-xml-binding.jar" />
</fileset>
@@ -382,6 +384,7 @@
<include name="jboss-osgi-jmx.jar" />
<include name="jboss-osgi-jndi.jar" />
<include name="jboss-osgi-webconsole.jar" />
+ <include name="jboss-osgi-reflect.jar" />
<include name="jboss-osgi-xml-binding.jar" />
<include name="pax-web-jetty-bundle.jar" />
<include name="org.apache.felix.log.jar" />
Modified: projects/jboss-osgi/trunk/distribution/pom.xml
===================================================================
--- projects/jboss-osgi/trunk/distribution/pom.xml 2009-11-27 16:53:45 UTC (rev 97114)
+++ projects/jboss-osgi/trunk/distribution/pom.xml 2009-11-27 17:48:55 UTC (rev 97115)
@@ -251,6 +251,17 @@
</dependency>
<dependency>
<groupId>org.jboss.osgi.bundles</groupId>
+ <artifactId>jboss-osgi-reflect</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.jboss.osgi.bundles</groupId>
+ <artifactId>jboss-osgi-reflect</artifactId>
+ <version>${version.jboss.osgi.reflect}</version>
+ <classifier>sources</classifier>
+ </dependency>
+ <!-- jboss-osgi-reflect: no javadoc -->
+ <dependency>
+ <groupId>org.jboss.osgi.bundles</groupId>
<artifactId>jboss-osgi-webapp</artifactId>
<version>${version.jboss.osgi.webapp}</version>
<classifier>sources</classifier>
14 years, 6 months
JBoss-OSGI SVN: r97112 - in projects/jboss-osgi/trunk/reactor/framework: src/etc/osgitck and 2 other directories.
by jboss-osgi-commits@lists.jboss.org
Author: alesj
Date: 2009-11-27 10:38:13 -0500 (Fri, 27 Nov 2009)
New Revision: 97112
Added:
projects/jboss-osgi/trunk/reactor/framework/src/main/java/org/jboss/osgi/framework/bundle/ControllerContextHandle.java
projects/jboss-osgi/trunk/reactor/framework/src/main/java/org/jboss/osgi/framework/bundle/GenericServiceReferenceWrapper.java
projects/jboss-osgi/trunk/reactor/framework/src/main/java/org/jboss/osgi/framework/bundle/OSGiServiceState.java
Removed:
projects/jboss-osgi/trunk/reactor/framework/src/main/java/org/jboss/osgi/framework/bundle/OSGiServiceState.java
Modified:
projects/jboss-osgi/trunk/reactor/framework/pom.xml
projects/jboss-osgi/trunk/reactor/framework/src/etc/osgitck/jboss-osgi-bootstrap.xml
projects/jboss-osgi/trunk/reactor/framework/src/main/java/org/jboss/osgi/framework/bundle/AbstractBundleState.java
projects/jboss-osgi/trunk/reactor/framework/src/main/java/org/jboss/osgi/framework/bundle/ContextRegistryAction.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/bundle/OSGiBundleState.java
projects/jboss-osgi/trunk/reactor/framework/src/main/java/org/jboss/osgi/framework/bundle/OSGiServiceAction.java
projects/jboss-osgi/trunk/reactor/framework/src/main/java/org/jboss/osgi/framework/bundle/OSGiServiceReferenceWrapper.java
projects/jboss-osgi/trunk/reactor/framework/src/test/resources/bootstrap/jboss-osgi-bootstrap.xml
Log:
[JBOSGI-141]; abstract osgi service usage to plain MC core.
Modified: projects/jboss-osgi/trunk/reactor/framework/pom.xml
===================================================================
--- projects/jboss-osgi/trunk/reactor/framework/pom.xml 2009-11-27 15:12:58 UTC (rev 97111)
+++ projects/jboss-osgi/trunk/reactor/framework/pom.xml 2009-11-27 15:38:13 UTC (rev 97112)
@@ -42,7 +42,7 @@
<version.drools>5.0.1</version.drools>
<version.jboss.aop>2.1.0.CR3</version.jboss.aop>
<version.jboss.classloading>2.0.8.GA</version.jboss.classloading>
- <version.jboss.deployers>2.0.9.GA</version.jboss.deployers>
+ <version.jboss.deployers>2.2.0-SNAPSHOT</version.jboss.deployers>
<version.jboss.kernel>2.2.0-SNAPSHOT</version.jboss.kernel>
<version.jboss.osgi.apache.xerces>2.9.1.SP2</version.jboss.osgi.apache.xerces>
<version.jboss.osgi.common>1.0.3</version.jboss.osgi.common>
Modified: projects/jboss-osgi/trunk/reactor/framework/src/etc/osgitck/jboss-osgi-bootstrap.xml
===================================================================
--- projects/jboss-osgi/trunk/reactor/framework/src/etc/osgitck/jboss-osgi-bootstrap.xml 2009-11-27 15:12:58 UTC (rev 97111)
+++ projects/jboss-osgi/trunk/reactor/framework/src/etc/osgitck/jboss-osgi-bootstrap.xml 2009-11-27 15:38:13 UTC (rev 97112)
@@ -12,6 +12,7 @@
<constructor>
<parameter><inject bean="jboss.kernel:service=Kernel" /></parameter>
<parameter><inject bean="MainDeployer" /></parameter>
+ <parameter><inject bean="DeploymentRegistry" /></parameter>
</constructor>
<property name="properties">
<map keyClass="java.lang.String" valueClass="java.lang.String">
@@ -95,6 +96,9 @@
<property name="deployers"><inject bean="Deployers" /></property>
</bean>
+ <!-- The deployment registry -->
+ <bean name="DeploymentRegistry" class="org.jboss.deployers.structure.spi.helpers.AbstractDeploymentRegistry"/>
+
<!-- The holder for deployers that determine structure -->
<bean name="StructuralDeployers" class="org.jboss.deployers.vfs.plugins.structure.VFSStructuralDeployersImpl">
<property name="structureBuilder">
Modified: projects/jboss-osgi/trunk/reactor/framework/src/main/java/org/jboss/osgi/framework/bundle/AbstractBundleState.java
===================================================================
--- projects/jboss-osgi/trunk/reactor/framework/src/main/java/org/jboss/osgi/framework/bundle/AbstractBundleState.java 2009-11-27 15:12:58 UTC (rev 97111)
+++ projects/jboss-osgi/trunk/reactor/framework/src/main/java/org/jboss/osgi/framework/bundle/AbstractBundleState.java 2009-11-27 15:38:13 UTC (rev 97112)
@@ -35,6 +35,8 @@
import java.util.concurrent.atomic.AtomicInteger;
import org.jboss.dependency.plugins.tracker.AbstractContextTracker;
+import org.jboss.dependency.spi.ControllerContext;
+import org.jboss.dependency.spi.tracker.ContextTracking;
import org.jboss.osgi.framework.metadata.OSGiMetaData;
import org.jboss.osgi.framework.plugins.BundleStoragePlugin;
import org.jboss.osgi.framework.plugins.FrameworkEventsPlugin;
@@ -299,36 +301,37 @@
/**
* Add a registered service
*
- * @param serviceState the service
+ * @param context the context
*/
- void addRegisteredService(OSGiServiceState serviceState)
+ void addRegisteredService(org.jboss.dependency.spi.ControllerContext context)
{
- addUsedBy(serviceState, this);
+ addUsedBy(context, this);
}
/**
* Remove a registered service
*
- * @param serviceState the service
+ * @param context the context
*/
- void removeRegisteredService(OSGiServiceState serviceState)
+ void removeRegisteredService(OSGiServiceState context)
{
- removeUsedBy(serviceState, this);
+ removeUsedBy(context, this);
}
public ServiceReference[] getRegisteredServices()
{
checkInstalled();
- Set<OSGiServiceState> contexts = getUsedContexts(OSGiServiceState.class);
+ Set<org.jboss.dependency.spi.ControllerContext> contexts = getUsedContexts(null);
if (contexts.isEmpty())
return null;
Set<ServiceReference> result = new HashSet<ServiceReference>();
- for (OSGiServiceState service : contexts)
+ for (org.jboss.dependency.spi.ControllerContext context : contexts)
{
- if (service.hasPermission())
- result.add(service.getReferenceInternal());
+ ServiceReference ref = getBundleManager().getServiceReferenceForContext(context);
+ if (ref != null)
+ result.add(ref);
}
if (result.isEmpty())
return null;
@@ -336,51 +339,49 @@
}
/**
- * True if the use count of a service for this bundle is grater that 0.
+ * Increment the use count of a context for this bundle
*
- * @param serviceState the service
- * @return true if counter is bigger than zero, false otherwise
+ * @param context the context
*/
- boolean isServiceInUse(OSGiServiceState serviceState)
+ void addContextInUse(ControllerContext context)
{
- return isContextInUse(serviceState);
+ if (context instanceof ContextTracking)
+ {
+ ContextTracking ct = (ContextTracking)context;
+ ct.getTarget(this);
+ }
}
/**
- * Increment the use count of a service for this bundle
+ * Decrement the use count of a context for this bundle
*
- * @param serviceState the service
- */
- void addServiceInUse(OSGiServiceState serviceState)
- {
- serviceState.getTarget(this);
- }
-
- /**
- * Decrement the use count of a service for this bundle
- *
- * @param serviceState the service
+ * @param context the context
* @return true when the service is still in use by the bundle
*/
- boolean removeServiceInUse(OSGiServiceState serviceState)
+ boolean removeContextInUse(ControllerContext context)
{
- serviceState.ungetTarget(this);
- return isContextInUse(serviceState);
+ if (context instanceof ContextTracking)
+ {
+ ContextTracking ct = (ContextTracking)context;
+ ct.ungetTarget(this);
+ }
+ return isContextInUse(context);
}
public ServiceReference[] getServicesInUse()
{
- Set<OSGiServiceState> contexts = getUsedContexts(OSGiServiceState.class);
+ Set<org.jboss.dependency.spi.ControllerContext> contexts = getUsedContexts(null);
if (contexts == null || contexts.isEmpty())
return null;
List<ServiceReference> references = new ArrayList<ServiceReference>();
- for (OSGiServiceState service : contexts)
+ for (org.jboss.dependency.spi.ControllerContext context : contexts)
{
- if (getUsedByCount(service, this) > 0)
+ if (getUsedByCount(context, this) > 0)
{
- if (service.hasPermission())
- references.add(service.getReferenceInternal());
+ ServiceReference ref = getBundleManager().getServiceReferenceForContext(context);
+ if (ref != null)
+ references.add(ref);
}
}
@@ -407,7 +408,7 @@
Object getService(OSGiServiceState serviceState)
{
- return getBundleManager().getService(this, serviceState);
+ return getBundleManager().getService(this, serviceState);
}
public ServiceReference getServiceReference(String clazz)
@@ -457,18 +458,19 @@
throw new IllegalArgumentException("Null reference");
// Check if the service is still in use by this bundle
- OSGiServiceState serviceState = ((OSGiServiceReferenceWrapper)reference).getServiceState();
- if (isServiceInUse(serviceState) == false)
+ ControllerContextHandle handle = (ControllerContextHandle)reference;
+ ControllerContext context = handle.getContext();
+ if (isContextInUse(context) == false)
return false;
checkValidBundleContext();
- return getBundleManager().ungetService(this, reference);
+ return getBundleManager().ungetContext(this, context);
}
- boolean ungetService(OSGiServiceState state)
+ boolean ungetContex(ControllerContext state)
{
- return getBundleManager().ungetService(this, state);
+ return getBundleManager().ungetContext(this, state);
}
public void addBundleListener(BundleListener listener)
Modified: projects/jboss-osgi/trunk/reactor/framework/src/main/java/org/jboss/osgi/framework/bundle/ContextRegistryAction.java
===================================================================
--- projects/jboss-osgi/trunk/reactor/framework/src/main/java/org/jboss/osgi/framework/bundle/ContextRegistryAction.java 2009-11-27 15:12:58 UTC (rev 97111)
+++ projects/jboss-osgi/trunk/reactor/framework/src/main/java/org/jboss/osgi/framework/bundle/ContextRegistryAction.java 2009-11-27 15:38:13 UTC (rev 97112)
@@ -22,7 +22,6 @@
package org.jboss.osgi.framework.bundle;
import org.jboss.dependency.spi.Controller;
-import org.jboss.dependency.spi.ControllerContext;
import org.jboss.dependency.spi.tracker.ContextRegistry;
/**
@@ -38,7 +37,7 @@
* @param context the context
* @return context registry or null if cannot be applied
*/
- protected ContextRegistry getContextRegistry(ControllerContext context)
+ protected ContextRegistry getContextRegistry(org.jboss.dependency.spi.ControllerContext context)
{
Controller controller = context.getController();
return (controller instanceof ContextRegistry) ? ContextRegistry.class.cast(controller) : null;
Copied: projects/jboss-osgi/trunk/reactor/framework/src/main/java/org/jboss/osgi/framework/bundle/ControllerContextHandle.java (from rev 96803, projects/jboss-osgi/trunk/reactor/framework/src/main/java/org/jboss/osgi/framework/bundle/OSGiServiceReferenceWrapper.java)
===================================================================
--- projects/jboss-osgi/trunk/reactor/framework/src/main/java/org/jboss/osgi/framework/bundle/ControllerContextHandle.java (rev 0)
+++ projects/jboss-osgi/trunk/reactor/framework/src/main/java/org/jboss/osgi/framework/bundle/ControllerContextHandle.java 2009-11-27 15:38:13 UTC (rev 97112)
@@ -0,0 +1,40 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2009, Red Hat Middleware LLC, and individual contributors
+* as indicated by the @author tags. See the copyright.txt file 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.framework.bundle;
+
+import org.jboss.dependency.spi.ControllerContext;
+import org.osgi.framework.ServiceReference;
+
+/**
+ * ControllerContext handle.
+ *
+ * @author <a href="ales.justin(a)jboss.org">Ales Justin</a>
+ */
+abstract class ControllerContextHandle implements ServiceReference
+{
+ /**
+ * Get a hold of underlying controller context.
+ *
+ * @return the controller context
+ */
+ abstract ControllerContext getContext();
+}
\ No newline at end of file
Copied: projects/jboss-osgi/trunk/reactor/framework/src/main/java/org/jboss/osgi/framework/bundle/GenericServiceReferenceWrapper.java (from rev 96803, projects/jboss-osgi/trunk/reactor/framework/src/main/java/org/jboss/osgi/framework/bundle/OSGiServiceReferenceWrapper.java)
===================================================================
--- projects/jboss-osgi/trunk/reactor/framework/src/main/java/org/jboss/osgi/framework/bundle/GenericServiceReferenceWrapper.java (rev 0)
+++ projects/jboss-osgi/trunk/reactor/framework/src/main/java/org/jboss/osgi/framework/bundle/GenericServiceReferenceWrapper.java 2009-11-27 15:38:13 UTC (rev 97112)
@@ -0,0 +1,126 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2009, Red Hat Middleware LLC, and individual contributors
+* as indicated by the @author tags. See the copyright.txt file 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.framework.bundle;
+
+import java.util.HashSet;
+import java.util.Set;
+
+import org.jboss.dependency.spi.ControllerContext;
+import org.jboss.dependency.spi.tracker.ContextTracker;
+import org.jboss.dependency.spi.tracker.ContextTracking;
+import org.osgi.framework.Bundle;
+
+/**
+ * GenericServiceReferenceWrapper.
+ *
+ * @author <a href="ales.justin(a)jboss.org">Ales Justin</a>
+ */
+class GenericServiceReferenceWrapper extends ControllerContextHandle
+{
+ private ControllerContext context;
+ private AbstractBundleState bundleState;
+
+ public GenericServiceReferenceWrapper(ControllerContext context, AbstractBundleState bundleState)
+ {
+ if (context == null)
+ throw new IllegalArgumentException("Null context");
+ if (bundleState == null)
+ throw new IllegalArgumentException("Null bundle state");
+
+ this.context = context;
+ this.bundleState = bundleState;
+ }
+
+ ControllerContext getContext()
+ {
+ return context;
+ }
+
+ public Object getProperty(String s)
+ {
+ return null; // TODO
+ }
+
+ public String[] getPropertyKeys()
+ {
+ return null; // TODO
+ }
+
+ public Bundle getBundle()
+ {
+ return bundleState.getBundleInternal();
+ }
+
+ public Bundle[] getUsingBundles()
+ {
+ if (context instanceof ContextTracking)
+ {
+ ContextTracking tracking = (ContextTracking)context;
+ ContextTracker ct = tracking.getContextTracker();
+ if (ct == null)
+ return null;
+
+ Set<Object> users = ct.getUsers(context);
+ Set<Bundle> bundles = new HashSet<Bundle>();
+ for (Object user : users)
+ {
+ if (ct.getUsedByCount(context, user) > 0)
+ {
+ OSGiBundleManager manager = bundleState.getBundleManager();
+ AbstractBundleState abs = manager.getBundleForUser(user);
+ bundles.add(abs.getBundleInternal());
+ }
+ }
+ return bundles.toArray(new Bundle[bundles.size()]);
+ }
+ return null;
+ }
+
+ public boolean isAssignableTo(Bundle bundle, String s)
+ {
+ return false; // TODO
+ }
+
+ public int compareTo(Object o)
+ {
+ return 0; // TODO
+ }
+
+ public int hashCode()
+ {
+ return context.hashCode();
+ }
+
+ public boolean equals(Object obj)
+ {
+ if (obj instanceof GenericServiceReferenceWrapper == false)
+ return false;
+
+ GenericServiceReferenceWrapper other = (GenericServiceReferenceWrapper)obj;
+ return context == other.context;
+ }
+
+ public String toString()
+ {
+ return context.toString();
+ }
+}
\ No newline at end of file
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-11-27 15:12:58 UTC (rev 97111)
+++ projects/jboss-osgi/trunk/reactor/framework/src/main/java/org/jboss/osgi/framework/bundle/OSGiBundleManager.java 2009-11-27 15:38:13 UTC (rev 97112)
@@ -52,11 +52,13 @@
import org.jboss.dependency.spi.Controller;
import org.jboss.dependency.spi.ControllerContext;
import org.jboss.dependency.spi.ControllerState;
+import org.jboss.dependency.spi.tracker.ContextTracker;
import org.jboss.deployers.client.spi.DeployerClient;
import org.jboss.deployers.spi.DeploymentException;
import org.jboss.deployers.spi.attachments.MutableAttachments;
import org.jboss.deployers.spi.deployer.DeploymentStage;
import org.jboss.deployers.spi.deployer.DeploymentStages;
+import org.jboss.deployers.structure.spi.DeploymentRegistry;
import org.jboss.deployers.structure.spi.DeploymentUnit;
import org.jboss.deployers.structure.spi.main.MainDeployerStructure;
import org.jboss.deployers.vfs.spi.client.VFSDeployment;
@@ -64,6 +66,11 @@
import org.jboss.kernel.Kernel;
import org.jboss.kernel.spi.dependency.KernelController;
import org.jboss.logging.Logger;
+import org.jboss.metadata.plugins.loader.memory.MemoryMetaDataLoader;
+import org.jboss.metadata.spi.loader.MutableMetaDataLoader;
+import org.jboss.metadata.spi.repository.MutableMetaDataRepository;
+import org.jboss.metadata.spi.retrieval.MetaDataRetrieval;
+import org.jboss.metadata.spi.scope.ScopeKey;
import org.jboss.osgi.deployment.deployer.Deployment;
import org.jboss.osgi.framework.metadata.OSGiMetaData;
import org.jboss.osgi.framework.metadata.PackageAttribute;
@@ -142,6 +149,9 @@
/** The deployment structure */
private MainDeployerStructure deployerStructure;
+ /** The deployment registry */
+ private DeploymentRegistry registry;
+
/** The executor */
private Executor executor;
@@ -175,11 +185,12 @@
*
* @param kernel the kernel
* @param deployerClient the deployer client
+ * @param registry the deployment registry
* @throws IllegalArgumentException for a null parameter
*/
- public OSGiBundleManager(Kernel kernel, DeployerClient deployerClient)
+ public OSGiBundleManager(Kernel kernel, DeployerClient deployerClient, DeploymentRegistry registry)
{
- this(kernel, deployerClient, null);
+ this(kernel, deployerClient, registry, null);
}
/**
@@ -187,10 +198,11 @@
*
* @param kernel the kernel
* @param deployerClient the deployer client
+ * @param registry the deployment registry
* @param executor the executor
* @throws IllegalArgumentException for a null parameter
*/
- public OSGiBundleManager(Kernel kernel, DeployerClient deployerClient, Executor executor)
+ public OSGiBundleManager(Kernel kernel, DeployerClient deployerClient, DeploymentRegistry registry, Executor executor)
{
if (kernel == null)
throw new IllegalArgumentException("Null kernel");
@@ -198,10 +210,13 @@
throw new IllegalArgumentException("Null deployerClient");
if (deployerClient instanceof MainDeployerStructure == false)
throw new IllegalArgumentException("Deployer client does not implement " + MainDeployerStructure.class.getName());
+ if (registry == null)
+ throw new IllegalArgumentException("Null deployment registry");
this.kernel = kernel;
this.deployerClient = deployerClient;
this.deployerStructure = (MainDeployerStructure)deployerClient;
+ this.registry = registry;
// TODO thread factory
if (executor == null)
@@ -220,11 +235,107 @@
OSGiMetaData systemMetaData = new AbstractOSGiMetaData(manifest);
systemBundle = new OSGiSystemState(systemMetaData);
addBundle(systemBundle);
+
+ applySystemContextTracker(true);
}
+ public void stop()
+ {
+ applySystemContextTracker(false);
+ }
+
/**
+ * Add system bundle as default context tracker.
+ *
+ * @param register do we register or unregister
+ */
+ protected void applySystemContextTracker(boolean register)
+ {
+ MutableMetaDataRepository repository = kernel.getMetaDataRepository().getMetaDataRepository();
+ MetaDataRetrieval retrieval = repository.getMetaDataRetrieval(ScopeKey.DEFAULT_SCOPE);
+ if (register && retrieval == null)
+ {
+ retrieval = new MemoryMetaDataLoader(ScopeKey.DEFAULT_SCOPE);
+ repository.addMetaDataRetrieval(retrieval);
+ }
+ if (retrieval != null && retrieval instanceof MutableMetaDataLoader)
+ {
+ MutableMetaDataLoader mmdl = (MutableMetaDataLoader)retrieval;
+ if (register)
+ {
+ mmdl.addMetaData(systemBundle, ContextTracker.class);
+ }
+ else
+ {
+ mmdl.removeMetaData(ContextTracker.class);
+ if (mmdl.isEmpty())
+ repository.removeMetaDataRetrieval(mmdl.getScope());
+ }
+ }
+ }
+
+ /**
+ * Get bundle for user tracker.
+ *
+ * @param user the user tracker object
+ * @return bundle state
+ */
+ AbstractBundleState getBundleForUser(Object user)
+ {
+ if (user instanceof AbstractBundleState)
+ return (AbstractBundleState)user;
+ else if (user instanceof org.jboss.dependency.spi.ControllerContext)
+ return getBundleForContext((org.jboss.dependency.spi.ControllerContext)user);
+ else
+ throw new IllegalArgumentException("Unknown tracker type: " + user);
+ }
+
+ /**
+ * Get bundle for context.
+ *
+ * @param context the context
+ * @return bundle state
+ */
+ AbstractBundleState getBundleForContext(ControllerContext context)
+ {
+ if (context instanceof OSGiServiceState)
+ {
+ OSGiServiceState service = (OSGiServiceState)context;
+ return service.getBundleState();
+ }
+
+ DeploymentUnit unit = registry.getDeployment(context);
+ if (unit != null)
+ {
+ OSGiBundleState bundleState = unit.getAttachment(OSGiBundleState.class);
+ if (bundleState != null)
+ return bundleState;
+ }
+
+ return systemBundle;
+ }
+
+ /**
+ * Get service reference for context.
+ *
+ * @param context the context
+ * @return service reference
+ */
+ ServiceReference getServiceReferenceForContext(ControllerContext context)
+ {
+ if (context instanceof OSGiServiceState)
+ {
+ OSGiServiceState service = (OSGiServiceState)context;
+ return service.hasPermission() ? service.getReferenceInternal() : null;
+ }
+
+ AbstractBundleState bundleState = getBundleForContext(context);
+ return new GenericServiceReferenceWrapper(context, bundleState);
+ }
+
+ /**
* Get the kernel
- *
+ *
* @return the kernel
*/
public Kernel getKernel()
@@ -234,7 +345,7 @@
/**
* Get the deployerClient.
- *
+ *
* @return the deployerClient.
*/
public DeployerClient getDeployerClient()
@@ -244,7 +355,7 @@
/**
* Set the framework properties
- *
+ *
* @param properties the properties
*/
public void setProperties(Map<String, Object> properties)
@@ -268,7 +379,7 @@
/**
* Get a property
- *
+ *
* @param key the property key
* @return the property
* @throws SecurityException if the caller doesn't have the relevant property permission
@@ -967,7 +1078,7 @@
return true;
DeploymentUnit unit = bundleState.getDeploymentUnit();
- ControllerContext context = unit.getAttachment(ControllerContext.class);
+ org.jboss.dependency.spi.ControllerContext context = unit.getAttachment(org.jboss.dependency.spi.ControllerContext.class);
ControllerState requiredState = context.getRequiredState();
DeploymentStage requiredStage = unit.getRequiredStage();
@@ -1053,7 +1164,7 @@
*/
Collection<OSGiServiceState> getServices(AbstractBundleState bundle, String clazz, Filter filter, boolean checkAssignable)
{
- Set<ControllerContext> contexts;
+ Set<org.jboss.dependency.spi.ControllerContext> contexts;
KernelController controller = kernel.getController();
// Don't check assignabilty for the system bundle
@@ -1084,8 +1195,9 @@
// review: optimise this, e.g. index by class
// Use a sorted set to order services according to spec
Set<OSGiServiceState> result = new TreeSet<OSGiServiceState>(ServiceComparator.INSTANCE);
- for (ControllerContext context : contexts)
+ for (org.jboss.dependency.spi.ControllerContext context : contexts)
{
+ // TODO - fix filtering
if (context instanceof OSGiServiceState)
{
OSGiServiceState service = OSGiServiceState.class.cast(context);
@@ -1260,9 +1372,19 @@
*/
Object getService(AbstractBundleState bundleState, ServiceReference reference)
{
- OSGiServiceReferenceWrapper serviceReference = (OSGiServiceReferenceWrapper)reference;
- OSGiServiceState serviceState = serviceReference.getServiceState();
- return getService(bundleState, serviceState);
+ if (reference instanceof OSGiServiceReferenceWrapper)
+ {
+ OSGiServiceReferenceWrapper serviceReference = (OSGiServiceReferenceWrapper)reference;
+ OSGiServiceState serviceState = serviceReference.getServiceState();
+ return getService(bundleState, serviceState);
+ }
+ else
+ {
+ ControllerContextHandle handle = (ControllerContextHandle)reference;
+ ControllerContext context = handle.getContext();
+ Object target = context.getTarget();
+ return getResult(bundleState, context, target);
+ }
}
/**
@@ -1275,8 +1397,21 @@
Object getService(AbstractBundleState bundleState, OSGiServiceState serviceState)
{
Object result = serviceState.getService(bundleState);
+ return getResult(bundleState, serviceState, result);
+ }
+
+ /**
+ * Get result.
+ *
+ * @param bundleState the bundle state
+ * @param context the context
+ * @param result the result
+ * @return result
+ */
+ private Object getResult(AbstractBundleState bundleState, ControllerContext context, Object result)
+ {
if (result != null)
- bundleState.addServiceInUse(serviceState);
+ bundleState.addContextInUse(context);
return result;
}
@@ -1291,21 +1426,22 @@
{
if (reference == null)
throw new IllegalArgumentException("Null reference");
- OSGiServiceReferenceWrapper serviceReference = (OSGiServiceReferenceWrapper)reference;
- OSGiServiceState serviceState = serviceReference.getServiceState();
- return ungetService(bundleState, serviceState);
+
+ ControllerContextHandle serviceReference = (ControllerContextHandle)reference;
+ ControllerContext context = serviceReference.getContext();
+ return ungetContext(bundleState, context);
}
/**
- * Unget a service
+ * Unget a context
*
* @param bundleState the bundle state
- * @param service the service
- * @return true when the service is still in use by the bundle
+ * @param context the context
+ * @return true when the context is still in use by the bundle
*/
- boolean ungetService(AbstractBundleState bundleState, OSGiServiceState service)
+ boolean ungetContext(AbstractBundleState bundleState, org.jboss.dependency.spi.ControllerContext context)
{
- return bundleState.removeServiceInUse(service);
+ return bundleState.removeContextInUse(context);
}
/**
Modified: projects/jboss-osgi/trunk/reactor/framework/src/main/java/org/jboss/osgi/framework/bundle/OSGiBundleState.java
===================================================================
--- projects/jboss-osgi/trunk/reactor/framework/src/main/java/org/jboss/osgi/framework/bundle/OSGiBundleState.java 2009-11-27 15:12:58 UTC (rev 97111)
+++ projects/jboss-osgi/trunk/reactor/framework/src/main/java/org/jboss/osgi/framework/bundle/OSGiBundleState.java 2009-11-27 15:38:13 UTC (rev 97112)
@@ -343,6 +343,7 @@
}
}
+ // TODO - I guess we need to unget them all, but only OSGi will have a real "unget" notion
for (OSGiServiceState service : getUsedContexts(OSGiServiceState.class))
{
int count = getUsedByCount(service, this);
Modified: projects/jboss-osgi/trunk/reactor/framework/src/main/java/org/jboss/osgi/framework/bundle/OSGiServiceAction.java
===================================================================
--- projects/jboss-osgi/trunk/reactor/framework/src/main/java/org/jboss/osgi/framework/bundle/OSGiServiceAction.java 2009-11-27 15:12:58 UTC (rev 97111)
+++ projects/jboss-osgi/trunk/reactor/framework/src/main/java/org/jboss/osgi/framework/bundle/OSGiServiceAction.java 2009-11-27 15:38:13 UTC (rev 97112)
@@ -22,7 +22,6 @@
package org.jboss.osgi.framework.bundle;
import org.jboss.dependency.plugins.action.SimpleControllerContextAction;
-import org.jboss.dependency.spi.ControllerContext;
import org.jboss.logging.Logger;
/**
@@ -34,12 +33,12 @@
{
protected Logger log = Logger.getLogger(getClass());
- protected OSGiServiceState contextCast(ControllerContext context)
+ protected OSGiServiceState contextCast(org.jboss.dependency.spi.ControllerContext context)
{
return OSGiServiceState.class.cast(context);
}
- protected boolean validateContext(ControllerContext context)
+ protected boolean validateContext(org.jboss.dependency.spi.ControllerContext context)
{
return (context instanceof OSGiServiceState);
}
Modified: projects/jboss-osgi/trunk/reactor/framework/src/main/java/org/jboss/osgi/framework/bundle/OSGiServiceReferenceWrapper.java
===================================================================
--- projects/jboss-osgi/trunk/reactor/framework/src/main/java/org/jboss/osgi/framework/bundle/OSGiServiceReferenceWrapper.java 2009-11-27 15:12:58 UTC (rev 97111)
+++ projects/jboss-osgi/trunk/reactor/framework/src/main/java/org/jboss/osgi/framework/bundle/OSGiServiceReferenceWrapper.java 2009-11-27 15:38:13 UTC (rev 97112)
@@ -21,16 +21,17 @@
*/
package org.jboss.osgi.framework.bundle;
+import org.jboss.dependency.spi.ControllerContext;
import org.osgi.framework.Bundle;
-import org.osgi.framework.ServiceReference;
/**
* OSGiServiceReferenceWrapper.
*
* @author <a href="adrian(a)jboss.com">Adrian Brock</a>
+ * @author <a href="ales.justin(a)jboss.org">Ales Justin</a>
* @version $Revision: 1.1 $
*/
-public class OSGiServiceReferenceWrapper implements ServiceReference
+public class OSGiServiceReferenceWrapper extends ControllerContextHandle
{
/** The service state */
private OSGiServiceState serviceState;
@@ -48,6 +49,11 @@
this.serviceState = serviceState;
}
+ ControllerContext getContext()
+ {
+ return getServiceState();
+ }
+
public Bundle getBundle()
{
return serviceState.getBundle();
Deleted: projects/jboss-osgi/trunk/reactor/framework/src/main/java/org/jboss/osgi/framework/bundle/OSGiServiceState.java
===================================================================
--- projects/jboss-osgi/trunk/reactor/framework/src/main/java/org/jboss/osgi/framework/bundle/OSGiServiceState.java 2009-11-27 15:12:58 UTC (rev 97111)
+++ projects/jboss-osgi/trunk/reactor/framework/src/main/java/org/jboss/osgi/framework/bundle/OSGiServiceState.java 2009-11-27 15:38:13 UTC (rev 97112)
@@ -1,833 +0,0 @@
-/*
-* JBoss, Home of Professional Open Source
-* Copyright 2009, Red Hat Middleware LLC, and individual contributors
-* as indicated by the @author tags. See the copyright.txt file 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.framework.bundle;
-
-import java.security.AccessControlContext;
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.Collection;
-import java.util.Dictionary;
-import java.util.Enumeration;
-import java.util.List;
-import java.util.Map;
-import java.util.Set;
-import java.util.concurrent.ConcurrentHashMap;
-import java.util.concurrent.atomic.AtomicLong;
-
-import org.jboss.beans.info.spi.BeanInfo;
-import org.jboss.dependency.plugins.AbstractControllerContext;
-import org.jboss.dependency.spi.ScopeInfo;
-import org.jboss.dependency.spi.dispatch.InvokeDispatchContext;
-import org.jboss.dependency.spi.tracker.ContextTracker;
-import org.jboss.deployers.structure.spi.DeploymentUnit;
-import org.jboss.kernel.Kernel;
-import org.jboss.kernel.spi.config.KernelConfigurator;
-import org.jboss.metadata.spi.scope.CommonLevels;
-import org.jboss.metadata.spi.scope.Scope;
-import org.jboss.metadata.spi.scope.ScopeKey;
-import org.jboss.osgi.framework.plugins.FrameworkEventsPlugin;
-import org.jboss.osgi.framework.util.CaseInsensitiveDictionary;
-import org.jboss.osgi.spi.util.BundleClassLoader;
-import org.jboss.util.id.GUID;
-import org.osgi.framework.Bundle;
-import org.osgi.framework.BundleException;
-import org.osgi.framework.Constants;
-import org.osgi.framework.FrameworkEvent;
-import org.osgi.framework.ServiceEvent;
-import org.osgi.framework.ServiceFactory;
-import org.osgi.framework.ServicePermission;
-import org.osgi.framework.ServiceReference;
-import org.osgi.framework.ServiceRegistration;
-
-/**
- * OSGiServiceState.
- *
- * @author <a href="adrian(a)jboss.com">Adrian Brock</a>
- * @author <a href="ales.justin(a)jboss.org">Ales Justin</a>
- * @version $Revision: 1.1 $
- */
-public class OSGiServiceState extends AbstractControllerContext implements ServiceReference, ServiceRegistration, InvokeDispatchContext
-{
- /** The get classloader permission */
- private static final RuntimePermission GET_CLASSLOADER_PERMISSION = new RuntimePermission("getClassLoader");
-
- /** Used to generate a unique id */
- private static final AtomicLong serviceIDGenerator = new AtomicLong();
-
- /** The bundle that registered the service */
- private AbstractBundleState bundleState;
-
- /** The service reference */
- private OSGiServiceReferenceWrapper serviceReference;
-
- /** The service registration */
- private OSGiServiceRegistrationWrapper serviceRegistration;
-
- /** The service id */
- private long serviceId = serviceIDGenerator.incrementAndGet();
-
- /** The service interfaces */
- private String[] clazzes;
-
- /** The service or service factory */
- private Object serviceOrFactory;
-
- /** The service factory provided service cache */
- private Map<AbstractBundleState, Object> serviceCache;
-
- /** The properties */
- private CaseInsensitiveDictionary properties;
-
- /** The bean info */
- private BeanInfo beanInfo;
-
- /**
- * Create a new OSGiServiceState.
- *
- * @param bundleState the bundle state
- * @param clazzes the interfaces
- * @param service the services
- * @param properties the properties
- * @throws IllegalArgumentException for a null parameter
- */
- @SuppressWarnings("unchecked")
- public OSGiServiceState(AbstractBundleState bundleState, String[] clazzes, Object service, Dictionary properties)
- {
- // name is random / unique, we use aliases
- super(GUID.asString(), OSGiControllerContextActions.ACTIONS, null, service);
-
- if (bundleState == null)
- throw new IllegalArgumentException("Null bundle state");
- if (clazzes == null || clazzes.length == 0)
- throw new IllegalArgumentException("Null or empty clazzes");
-
- for (String clazz : clazzes)
- {
- if (clazz == null)
- throw new IllegalArgumentException("Null class in: " + Arrays.toString(clazzes));
- }
- if (service == null)
- throw new IllegalArgumentException("Null service");
-
- this.bundleState = bundleState;
- this.clazzes = clazzes;
- this.serviceOrFactory = service;
-
- if (service instanceof ServiceFactory == false)
- checkObjClass(service);
-
- if (properties != null)
- this.properties = new CaseInsensitiveDictionary(properties);
-
- serviceRegistration = new OSGiServiceRegistrationWrapper(this);
-
- initOSGiScopeInfo();
- }
-
- /**
- * Get the serviceId.
- *
- * @return the serviceId.
- */
- public long getServiceId()
- {
- return serviceId;
- }
-
- /**
- * Get the service ranking.
- *
- * @return the service rankin.
- */
- public int getServiceRanking()
- {
- Object ranking = getProperty(Constants.SERVICE_RANKING);
- if (ranking != null && ranking instanceof Integer)
- return (Integer)ranking;
- return 0;
- }
-
- /**
- * Get the classes.
- *
- * @return the classes.
- */
- public String[] getClasses()
- {
- return clazzes;
- }
-
- @Override
- protected void initScopeInfo()
- {
- // nothing
- }
-
- protected void initOSGiScopeInfo()
- {
- String className = null;
- Class<?> clazz = null;
-
- Object target = serviceOrFactory;
- if (target != null && target instanceof ServiceFactory == false)
- clazz = target.getClass();
- else if (clazzes.length == 1)
- className = clazzes[0];
-
- ScopeInfo info = OSGiScopeInfo.createScopeInfo(getName(), className, clazz, this);
- setScopeInfo(info);
-
- ScopeKey scope;
- ScopeKey mutableScope;
- if (bundleState instanceof OSGiBundleState)
- {
- OSGiBundleState obs = (OSGiBundleState)bundleState;
- DeploymentUnit unit = obs.getDeploymentUnit();
- scope = unit.getScope();
- mutableScope = unit.getMutableScope();
- }
- else
- {
- // TODO - what to do for system bundle?
- scope = new ScopeKey(CommonLevels.SERVER, "JBoss");
- mutableScope = null;
- }
- mergeScopes(info.getScope(), scope);
- mergeScopes(info.getMutableScope(), mutableScope);
- }
-
- /**
- * Merge scope keys.
- *
- * @param contextKey the context key
- * @param unitKey the unit key
- */
- protected static void mergeScopes(ScopeKey contextKey, ScopeKey unitKey)
- {
- if (contextKey == null)
- return;
- if (unitKey == null)
- return;
-
- Collection<Scope> unitScopes = unitKey.getScopes();
- if (unitScopes == null || unitScopes.isEmpty())
- return;
-
- for (Scope scope : unitScopes)
- contextKey.addScope(scope);
- }
-
- @Override
- public Object getTarget()
- {
- // get service directly
- return getService(bundleState);
- }
-
- public Object invoke(String name, Object[] parameters, String[] signature) throws Throwable
- {
- return getBeanInfo().invoke(getTarget(), name, signature, parameters);
- }
-
- public ClassLoader getClassLoader() throws Throwable
- {
- SecurityManager sm = System.getSecurityManager();
- if (sm != null)
- sm.checkPermission(GET_CLASSLOADER_PERMISSION);
-
- return BundleClassLoader.createClassLoader(getBundle());
- }
-
- public Object get(String name) throws Throwable
- {
- return getBeanInfo().getProperty(getTarget(), name);
- }
-
- public void set(String name, Object value) throws Throwable
- {
- getBeanInfo().setProperty(getTarget(), name, value);
- }
-
- /**
- * Get bean info.
- *
- * @return the bean info
- */
- protected BeanInfo getBeanInfo()
- {
- if (isUnregistered())
- return null;
-
- if (beanInfo == null)
- {
- try
- {
- Kernel kernel = bundleState.getBundleManager().getKernel();
- KernelConfigurator configurator = kernel.getConfigurator();
- Object service = getTarget(); // should not be null, we're not unregistered
- beanInfo = configurator.getBeanInfo(service.getClass());
- }
- catch (Throwable t)
- {
- throw new RuntimeException(t);
- }
- }
- return beanInfo;
- }
-
- /**
- * Get the service.
- *
- * @param bundleState the bundle that requested the service
- * @return the service.
- */
- Object getService(AbstractBundleState bundleState)
- {
- // [TODO] fix race condition with unregistration
- if (isUnregistered())
- return null;
-
- checkPermission("get", false);
-
- Object service = serviceOrFactory;
- if (serviceOrFactory instanceof ServiceFactory)
- {
- if (serviceCache == null)
- serviceCache = new ConcurrentHashMap<AbstractBundleState, Object>();
-
- service = serviceCache.get(bundleState);
- if (service == null)
- {
- ServiceFactory serviceFactory = (ServiceFactory)serviceOrFactory;
- try
- {
- service = checkObjClass(serviceFactory.getService(bundleState.getBundle(), getRegistration()));
- serviceCache.put(bundleState, service);
- }
- catch (Throwable t)
- {
- log.error("Error from getService for " + this, t);
- FrameworkEventsPlugin plugin = bundleState.getBundleManager().getPlugin(FrameworkEventsPlugin.class);
- plugin.fireFrameworkEvent(bundleState, FrameworkEvent.ERROR, new BundleException("Error using service factory:" + serviceFactory, t));
- return null;
- }
- }
- }
- return service;
- }
-
- /**
- * Get the service registration
- *
- * @return the service registration
- */
- public ServiceRegistration getRegistration()
- {
- return serviceRegistration;
- }
-
- public ServiceReference getReference()
- {
- checkUnregistered();
- return getReferenceInternal();
- }
-
- public ServiceReference getReferenceInternal()
- {
- if (serviceReference == null)
- serviceReference = new OSGiServiceReferenceWrapper(this);
- return serviceReference;
- }
-
- public Bundle getBundle()
- {
- if (isUnregistered())
- return null;
- return bundleState.getBundleInternal();
- }
-
- /**
- * Get the bundleState.
- *
- * @return the bundleState.
- */
- public AbstractBundleState getBundleState()
- {
- return bundleState;
- }
-
- public Object getProperty(String key)
- {
- if (key == null)
- return null;
- if (Constants.SERVICE_ID.equalsIgnoreCase(key))
- return getServiceId();
- if (Constants.OBJECTCLASS.equalsIgnoreCase(key))
- return getClasses();
- if (properties == null)
- return null;
- return properties.get(key);
- }
-
- public String[] getPropertyKeys()
- {
- ArrayList<String> result = new ArrayList<String>();
- if (properties != null)
- {
- Enumeration<String> keys = properties.keys();
- while (keys.hasMoreElements())
- result.add(keys.nextElement());
- }
- result.add(Constants.SERVICE_ID);
- result.add(Constants.OBJECTCLASS);
- return result.toArray(new String[result.size()]);
- }
-
- @SuppressWarnings("unchecked")
- public void setProperties(Dictionary properties)
- {
- checkUnregistered();
-
- if (properties == null)
- this.properties = null;
- else
- this.properties = new CaseInsensitiveDictionary(properties);
-
- FrameworkEventsPlugin plugin = bundleState.getBundleManager().getPlugin(FrameworkEventsPlugin.class);
- plugin.fireServiceEvent(bundleState, ServiceEvent.MODIFIED, this);
- }
-
- public Bundle[] getUsingBundles()
- {
- ContextTracker ct = getContextTracker();
- if (ct == null)
- return null;
-
- Set<Object> users = ct.getUsers(this);
- List<Bundle> bundles = new ArrayList<Bundle>();
- for (Object user : users)
- {
- if (user instanceof AbstractBundleState && ct.getUsedByCount(this, user) > 0)
- {
- AbstractBundleState abs = (AbstractBundleState)user;
- bundles.add(abs.getBundleInternal());
- }
- }
- return bundles.toArray(new Bundle[bundles.size()]);
- }
-
- public boolean isAssignableTo(Bundle bundle, String className)
- {
- if (bundle == null)
- throw new IllegalArgumentException("Null bundle");
- if (className == null)
- throw new IllegalArgumentException("Null class name");
-
- if (bundle instanceof OSGiBundleWrapper == false)
- throw new IllegalArgumentException("Unknown bundle: " + bundle);
-
- OSGiBundleWrapper wrapper = (OSGiBundleWrapper)bundle;
- AbstractBundleState bundleState = wrapper.getBundleState();
- return isAssignableTo(bundleState, className);
- }
-
- /**
- * Check the isAssignableTo
- *
- * @param other the bundle state
- * @param className the class name
- * @return true when assignable
- */
- boolean isAssignableTo(AbstractBundleState other, String className)
- {
- if (className == null)
- throw new IllegalArgumentException("Null class name");
-
- if (other == bundleState)
- return true;
-
- if (isUnregistered())
- return false;
-
- Class<?> source = (Class<?>)bundleState.getSource(className);
- if (source == null)
- throw new IllegalStateException("Cannot load '" + className + "' from: " + bundleState);
-
- Class<?> otherSource = (Class<?>)other.getSource(className);
- if (otherSource == null)
- {
- log.debug("Cannot load '" + className + "' from: " + other);
- return false;
- }
-
- boolean equals = source.equals(otherSource);
- if (equals == false)
- {
- ClassLoader otherLoader = otherSource.getClassLoader();
- ClassLoader sourceLoader = source.getClassLoader();
- StringBuffer buffer = new StringBuffer("Cannot assign '" + className + "' comming from different exporters");
- buffer.append("\n service: ").append(sourceLoader);
- buffer.append("\n request: ").append(otherLoader);
- log.warn(buffer.toString());
- }
- return equals;
- }
-
- /**
- * Check the isAssignable
- *
- * @param bundle the bundle state
- * @return true when assignable
- */
- boolean isAssignable(AbstractBundleState bundle)
- {
- if (bundle == bundleState)
- return true;
-
- if (isUnregistered())
- return false;
-
- for (String clazz : getClasses())
- {
- if (isAssignableTo(bundle, clazz) == false)
- return false;
- }
- return true;
- }
-
- /**
- * Match the class
- *
- * @param className the class name
- * @return true when the class name matches
- */
- boolean matchClass(String className)
- {
- if (clazzes == null || clazzes.length == 0)
- return false;
-
- for (String clazz : clazzes)
- {
- if (className.equals(clazz))
- return true;
- }
- return false;
- }
-
- public void unregister()
- {
- checkUnregistered();
-
- try
- {
- bundleState.unregisterService(this);
- }
- finally
- {
- synchronized (this)
- {
- serviceRegistration = null;
- }
- }
- }
-
- public int compareTo(Object reference)
- {
- if (reference == null)
- throw new IllegalArgumentException("Null reference");
-
- OSGiServiceState other;
- if (reference instanceof OSGiServiceState)
- other = (OSGiServiceState)reference;
- else if (reference instanceof OSGiServiceReferenceWrapper)
- other = ((OSGiServiceReferenceWrapper)reference).getServiceState();
- else
- throw new IllegalArgumentException(reference + " is not a service reference");
-
- long thisServiceId = this.getServiceId();
- long otherServiceId = other.getServiceId();
- if (thisServiceId == otherServiceId)
- return 0;
-
- int thisRanking = this.getServiceRanking();
- int otherRanking = other.getServiceRanking();
- int ranking = thisRanking - otherRanking;
- if (ranking != 0)
- return ranking;
-
- if (thisServiceId > otherServiceId)
- return -1;
- else
- return +1;
- }
-
- @Override
- public boolean equals(Object obj)
- {
- if (obj == null)
- return false;
-
- OSGiServiceState other;
- if (obj instanceof OSGiServiceState)
- other = (OSGiServiceState)obj;
- else if (obj instanceof OSGiServiceReferenceWrapper)
- other = ((OSGiServiceReferenceWrapper)obj).getServiceState();
- else
- return false;
- return this == other;
- }
-
- @Override
- public int hashCode()
- {
- return toString().hashCode();
- }
-
- @Override
- public String toString()
- {
- StringBuilder builder = new StringBuilder();
- builder.append("Service{");
- builder.append("id=").append(getServiceId());
- builder.append(" classes=").append(Arrays.asList(getClasses()));
- builder.append("}");
- return builder.toString();
- }
-
- public String toLongString()
- {
- StringBuilder builder = new StringBuilder();
- builder.append("Service{");
- builder.append("id=").append(getServiceId());
- builder.append(" bundle=").append(getBundleState().getCanonicalName());
- builder.append(" classes=").append(Arrays.asList(getClasses()));
- builder.append(serviceOrFactory instanceof ServiceFactory ? " factory=" : " service=").append(serviceOrFactory);
- if (properties != null)
- builder.append(" properties=").append(properties);
- builder.append("}");
- return builder.toString();
- }
-
- /**
- * Register the service
- */
- void internalRegister()
- {
- checkPermission("register", true);
- getBundleState().addRegisteredService(this);
- }
-
- /**
- * Unregister the service
- */
- void internalUnregister()
- {
- ContextTracker ct = getContextTracker();
- if (ct != null) // nobody used us?
- {
- Set<Object> users = ct.getUsers(this);
- if (users.isEmpty() == false)
- {
- for (Object user : users)
- {
- if (user instanceof AbstractBundleState)
- {
- AbstractBundleState using = (AbstractBundleState)user;
- if (using.ungetService(this) == false)
- {
- if (serviceOrFactory instanceof ServiceFactory)
- {
- ServiceFactory serviceFactory = (ServiceFactory)serviceOrFactory;
- try
- {
- Object service = serviceCache.remove(using);
- serviceFactory.ungetService(using.getBundle(), getRegistration(), service);
- }
- catch (Throwable t)
- {
- log.warn("Error from ungetService for " + this, t);
- FrameworkEventsPlugin plugin = bundleState.getBundleManager().getPlugin(FrameworkEventsPlugin.class);
- plugin.fireFrameworkEvent(bundleState, FrameworkEvent.WARNING, new BundleException("Error using service factory:" + serviceFactory, t));
- }
- }
- }
- }
- }
- }
- }
-
- getBundleState().removeRegisteredService(this);
- serviceOrFactory = null;
- }
-
- /**
- * Check an object matches the specified classes
- *
- * @param object the object
- * @return the object if all is ok
- */
- private Object checkObjClass(Object object)
- {
- if (object == null)
- throw new IllegalArgumentException("Null object");
-
- for (String className : getClasses())
- {
- try
- {
- Class<?> clazz = getBundleState().loadClass(className);
- // [TODO] show classloader information all interfaces for debugging purposes
- if (clazz.isInstance(object) == false)
- throw new IllegalArgumentException(object.getClass().getName() + " does not implement " + className);
- }
- catch (ClassNotFoundException e)
- {
- throw new IllegalArgumentException(object.getClass().getName() + " cannot load class: " + className, e);
- }
- }
- return object;
- }
-
- /**
- * Check whether the caller has permission
- *
- * @param action the action to check
- * @param all whether all permissions are required
- */
- void checkPermission(String action, boolean all)
- {
- SecurityManager sm = System.getSecurityManager();
- if (sm == null)
- return;
-
- String[] clazzes = getClasses();
- SecurityException se = null;
- for (String clazz : clazzes)
- {
- try
- {
- ServicePermission permission = new ServicePermission(clazz, action);
- sm.checkPermission(permission);
- if (all == false)
- return;
- }
- catch (SecurityException e)
- {
- if (all)
- throw e;
- se = e;
- }
- }
- if (se != null)
- throw se;
- }
-
- /**
- * Check whether the caller has permission
- *
- * @param accessControlContext access control context
- * @param action the action to check
- * @param all whether all permissions are required
- */
- void checkPermission(AccessControlContext accessControlContext, String action, boolean all)
- {
- if (System.getSecurityManager() == null)
- return;
-
- String[] clazzes = getClasses();
- SecurityException se = null;
- for (String clazz : clazzes)
- {
- try
- {
- ServicePermission permission = new ServicePermission(clazz, action);
- accessControlContext.checkPermission(permission);
- if (all == false)
- return;
- }
- catch (SecurityException e)
- {
- if (all)
- throw e;
- se = e;
- }
- }
- if (se != null)
- throw se;
- }
-
- /**
- * Check whether the caller has permission to this object
- *
- * @return true when the caller has permission
- */
- boolean hasPermission()
- {
- try
- {
- checkPermission("get", false);
- return true;
- }
- catch (SecurityException ignored)
- {
- }
- return false;
- }
-
- /**
- * Check whether the caller has permission to this object
- *
- * @param accessControlContext access control context
- * @return true when the caller has permission
- */
- public boolean hasPermission(AccessControlContext accessControlContext)
- {
- try
- {
- checkPermission(accessControlContext, "get", false);
- return true;
- }
- catch (SecurityException ignored)
- {
- }
- return false;
- }
-
- /**
- * Check if the service is unregistered
- *
- * @throws IllegalStateException if unregistered
- */
- private void checkUnregistered()
- {
- if (isUnregistered())
- throw new IllegalStateException("Service is unregistered: " + this);
- }
-
- /**
- * @return true when the service is unregistered
- */
- synchronized boolean isUnregistered()
- {
- return serviceRegistration == null;
- }
-}
Added: projects/jboss-osgi/trunk/reactor/framework/src/main/java/org/jboss/osgi/framework/bundle/OSGiServiceState.java
===================================================================
--- projects/jboss-osgi/trunk/reactor/framework/src/main/java/org/jboss/osgi/framework/bundle/OSGiServiceState.java (rev 0)
+++ projects/jboss-osgi/trunk/reactor/framework/src/main/java/org/jboss/osgi/framework/bundle/OSGiServiceState.java 2009-11-27 15:38:13 UTC (rev 97112)
@@ -0,0 +1,838 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2009, Red Hat Middleware LLC, and individual contributors
+* as indicated by the @author tags. See the copyright.txt file 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.framework.bundle;
+
+import java.security.AccessControlContext;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.Collection;
+import java.util.Dictionary;
+import java.util.Enumeration;
+import java.util.HashSet;
+import java.util.Map;
+import java.util.Set;
+import java.util.concurrent.ConcurrentHashMap;
+import java.util.concurrent.atomic.AtomicLong;
+
+import org.jboss.beans.info.spi.BeanInfo;
+import org.jboss.dependency.plugins.AbstractControllerContext;
+import org.jboss.dependency.spi.ScopeInfo;
+import org.jboss.dependency.spi.dispatch.InvokeDispatchContext;
+import org.jboss.dependency.spi.tracker.ContextTracker;
+import org.jboss.deployers.structure.spi.DeploymentUnit;
+import org.jboss.kernel.Kernel;
+import org.jboss.kernel.spi.config.KernelConfigurator;
+import org.jboss.metadata.spi.scope.CommonLevels;
+import org.jboss.metadata.spi.scope.Scope;
+import org.jboss.metadata.spi.scope.ScopeKey;
+import org.jboss.osgi.framework.plugins.FrameworkEventsPlugin;
+import org.jboss.osgi.framework.util.CaseInsensitiveDictionary;
+import org.jboss.osgi.spi.util.BundleClassLoader;
+import org.jboss.util.id.GUID;
+import org.osgi.framework.Bundle;
+import org.osgi.framework.BundleException;
+import org.osgi.framework.Constants;
+import org.osgi.framework.FrameworkEvent;
+import org.osgi.framework.ServiceEvent;
+import org.osgi.framework.ServiceFactory;
+import org.osgi.framework.ServicePermission;
+import org.osgi.framework.ServiceReference;
+import org.osgi.framework.ServiceRegistration;
+
+/**
+ * OSGiServiceState.
+ *
+ * @author <a href="adrian(a)jboss.com">Adrian Brock</a>
+ * @author <a href="ales.justin(a)jboss.org">Ales Justin</a>
+ * @version $Revision: 1.1 $
+ */
+public class OSGiServiceState extends AbstractControllerContext implements ServiceReference, ServiceRegistration, InvokeDispatchContext
+{
+ /** The get classloader permission */
+ private static final RuntimePermission GET_CLASSLOADER_PERMISSION = new RuntimePermission("getClassLoader");
+
+ /** Used to generate a unique id */
+ private static final AtomicLong serviceIDGenerator = new AtomicLong();
+
+ /** The bundle that registered the service */
+ private AbstractBundleState bundleState;
+
+ /** The service reference */
+ private OSGiServiceReferenceWrapper serviceReference;
+
+ /** The service registration */
+ private OSGiServiceRegistrationWrapper serviceRegistration;
+
+ /** The service id */
+ private long serviceId = serviceIDGenerator.incrementAndGet();
+
+ /** The service interfaces */
+ private String[] clazzes;
+
+ /** The service or service factory */
+ private Object serviceOrFactory;
+
+ /** The service factory provided service cache */
+ private Map<AbstractBundleState, Object> serviceCache;
+
+ /** The properties */
+ private CaseInsensitiveDictionary properties;
+
+ /** The bean info */
+ private BeanInfo beanInfo;
+
+ /**
+ * Create a new OSGiServiceState.
+ *
+ * @param bundleState the bundle state
+ * @param clazzes the interfaces
+ * @param service the services
+ * @param properties the properties
+ * @throws IllegalArgumentException for a null parameter
+ */
+ @SuppressWarnings("unchecked")
+ public OSGiServiceState(AbstractBundleState bundleState, String[] clazzes, Object service, Dictionary properties)
+ {
+ // name is random / unique, we use aliases
+ super(GUID.asString(), OSGiControllerContextActions.ACTIONS, null, service);
+
+ if (bundleState == null)
+ throw new IllegalArgumentException("Null bundle state");
+ if (clazzes == null || clazzes.length == 0)
+ throw new IllegalArgumentException("Null or empty clazzes");
+
+ for (String clazz : clazzes)
+ {
+ if (clazz == null)
+ throw new IllegalArgumentException("Null class in: " + Arrays.toString(clazzes));
+ }
+ if (service == null)
+ throw new IllegalArgumentException("Null service");
+
+ this.bundleState = bundleState;
+ this.clazzes = clazzes;
+ this.serviceOrFactory = service;
+
+ if (service instanceof ServiceFactory == false)
+ checkObjClass(service);
+
+ if (properties != null)
+ this.properties = new CaseInsensitiveDictionary(properties);
+
+ serviceRegistration = new OSGiServiceRegistrationWrapper(this);
+
+ initOSGiScopeInfo();
+ }
+
+ /**
+ * Get the serviceId.
+ *
+ * @return the serviceId.
+ */
+ public long getServiceId()
+ {
+ return serviceId;
+ }
+
+ /**
+ * Get the service ranking.
+ *
+ * @return the service rankin.
+ */
+ public int getServiceRanking()
+ {
+ Object ranking = getProperty(Constants.SERVICE_RANKING);
+ if (ranking != null && ranking instanceof Integer)
+ return (Integer)ranking;
+ return 0;
+ }
+
+ /**
+ * Get the classes.
+ *
+ * @return the classes.
+ */
+ public String[] getClasses()
+ {
+ return clazzes;
+ }
+
+ @Override
+ protected void initScopeInfo()
+ {
+ // nothing
+ }
+
+ protected void initOSGiScopeInfo()
+ {
+ String className = null;
+ Class<?> clazz = null;
+
+ Object target = serviceOrFactory;
+ if (target != null && target instanceof ServiceFactory == false)
+ clazz = target.getClass();
+ else if (clazzes.length == 1)
+ className = clazzes[0];
+
+ ScopeInfo info = OSGiScopeInfo.createScopeInfo(getName(), className, clazz, this);
+ setScopeInfo(info);
+
+ ScopeKey scope;
+ ScopeKey mutableScope;
+ if (bundleState instanceof OSGiBundleState)
+ {
+ OSGiBundleState obs = (OSGiBundleState)bundleState;
+ DeploymentUnit unit = obs.getDeploymentUnit();
+ scope = unit.getScope();
+ mutableScope = unit.getMutableScope();
+ }
+ else
+ {
+ // TODO - what to do for system bundle?
+ scope = new ScopeKey(CommonLevels.SERVER, "JBoss");
+ mutableScope = null;
+ }
+ mergeScopes(info.getScope(), scope);
+ mergeScopes(info.getMutableScope(), mutableScope);
+ }
+
+ /**
+ * Merge scope keys.
+ *
+ * @param contextKey the context key
+ * @param unitKey the unit key
+ */
+ protected static void mergeScopes(ScopeKey contextKey, ScopeKey unitKey)
+ {
+ if (contextKey == null)
+ return;
+ if (unitKey == null)
+ return;
+
+ Collection<Scope> unitScopes = unitKey.getScopes();
+ if (unitScopes == null || unitScopes.isEmpty())
+ return;
+
+ for (Scope scope : unitScopes)
+ contextKey.addScope(scope);
+ }
+
+ @Override
+ public Object getTarget()
+ {
+ // get service directly
+ return getService(bundleState);
+ }
+
+ public Object invoke(String name, Object[] parameters, String[] signature) throws Throwable
+ {
+ return getBeanInfo().invoke(getTarget(), name, signature, parameters);
+ }
+
+ public ClassLoader getClassLoader() throws Throwable
+ {
+ SecurityManager sm = System.getSecurityManager();
+ if (sm != null)
+ sm.checkPermission(GET_CLASSLOADER_PERMISSION);
+
+ return BundleClassLoader.createClassLoader(getBundle());
+ }
+
+ public Object get(String name) throws Throwable
+ {
+ return getBeanInfo().getProperty(getTarget(), name);
+ }
+
+ public void set(String name, Object value) throws Throwable
+ {
+ getBeanInfo().setProperty(getTarget(), name, value);
+ }
+
+ /**
+ * Get bean info.
+ *
+ * @return the bean info
+ */
+ protected BeanInfo getBeanInfo()
+ {
+ if (isUnregistered())
+ return null;
+
+ if (beanInfo == null)
+ {
+ try
+ {
+ Kernel kernel = bundleState.getBundleManager().getKernel();
+ KernelConfigurator configurator = kernel.getConfigurator();
+ Object service = getTarget(); // should not be null, we're not unregistered
+ beanInfo = configurator.getBeanInfo(service.getClass());
+ }
+ catch (Throwable t)
+ {
+ throw new RuntimeException(t);
+ }
+ }
+ return beanInfo;
+ }
+
+ /**
+ * Get the service.
+ *
+ * @param bundleState the bundle that requested the service
+ * @return the service.
+ */
+ Object getService(AbstractBundleState bundleState)
+ {
+ // [TODO] fix race condition with unregistration
+ if (isUnregistered())
+ return null;
+
+ checkPermission("get", false);
+
+ Object service = serviceOrFactory;
+ if (serviceOrFactory instanceof ServiceFactory)
+ {
+ if (serviceCache == null)
+ serviceCache = new ConcurrentHashMap<AbstractBundleState, Object>();
+
+ service = serviceCache.get(bundleState);
+ if (service == null)
+ {
+ ServiceFactory serviceFactory = (ServiceFactory)serviceOrFactory;
+ try
+ {
+ service = checkObjClass(serviceFactory.getService(bundleState.getBundle(), getRegistration()));
+ serviceCache.put(bundleState, service);
+ }
+ catch (Throwable t)
+ {
+ log.error("Error from getService for " + this, t);
+ FrameworkEventsPlugin plugin = bundleState.getBundleManager().getPlugin(FrameworkEventsPlugin.class);
+ plugin.fireFrameworkEvent(bundleState, FrameworkEvent.ERROR, new BundleException("Error using service factory:" + serviceFactory, t));
+ return null;
+ }
+ }
+ }
+ return service;
+ }
+
+ /**
+ * Get the service registration
+ *
+ * @return the service registration
+ */
+ public ServiceRegistration getRegistration()
+ {
+ return serviceRegistration;
+ }
+
+ public ServiceReference getReference()
+ {
+ checkUnregistered();
+ return getReferenceInternal();
+ }
+
+ public ServiceReference getReferenceInternal()
+ {
+ if (serviceReference == null)
+ serviceReference = new OSGiServiceReferenceWrapper(this);
+ return serviceReference;
+ }
+
+ public Bundle getBundle()
+ {
+ if (isUnregistered())
+ return null;
+ return bundleState.getBundleInternal();
+ }
+
+ /**
+ * Get the bundleState.
+ *
+ * @return the bundleState.
+ */
+ public AbstractBundleState getBundleState()
+ {
+ return bundleState;
+ }
+
+ public Object getProperty(String key)
+ {
+ if (key == null)
+ return null;
+ if (Constants.SERVICE_ID.equalsIgnoreCase(key))
+ return getServiceId();
+ if (Constants.OBJECTCLASS.equalsIgnoreCase(key))
+ return getClasses();
+ if (properties == null)
+ return null;
+ return properties.get(key);
+ }
+
+ public String[] getPropertyKeys()
+ {
+ ArrayList<String> result = new ArrayList<String>();
+ if (properties != null)
+ {
+ Enumeration<String> keys = properties.keys();
+ while (keys.hasMoreElements())
+ result.add(keys.nextElement());
+ }
+ result.add(Constants.SERVICE_ID);
+ result.add(Constants.OBJECTCLASS);
+ return result.toArray(new String[result.size()]);
+ }
+
+ @SuppressWarnings("unchecked")
+ public void setProperties(Dictionary properties)
+ {
+ checkUnregistered();
+
+ if (properties == null)
+ this.properties = null;
+ else
+ this.properties = new CaseInsensitiveDictionary(properties);
+
+ FrameworkEventsPlugin plugin = bundleState.getBundleManager().getPlugin(FrameworkEventsPlugin.class);
+ plugin.fireServiceEvent(bundleState, ServiceEvent.MODIFIED, this);
+ }
+
+ public Bundle[] getUsingBundles()
+ {
+ ContextTracker ct = getContextTracker();
+ if (ct == null)
+ return null;
+
+ Set<Object> users = ct.getUsers(this);
+ Set<Bundle> bundles = new HashSet<Bundle>();
+ for (Object user : users)
+ {
+ if (ct.getUsedByCount(this, user) > 0)
+ {
+ OSGiBundleManager manager = bundleState.getBundleManager();
+ AbstractBundleState abs = manager.getBundleForUser(user);
+ bundles.add(abs.getBundleInternal());
+ }
+ }
+ return bundles.toArray(new Bundle[bundles.size()]);
+ }
+
+ public boolean isAssignableTo(Bundle bundle, String className)
+ {
+ if (bundle == null)
+ throw new IllegalArgumentException("Null bundle");
+ if (className == null)
+ throw new IllegalArgumentException("Null class name");
+
+ if (bundle instanceof OSGiBundleWrapper == false)
+ throw new IllegalArgumentException("Unknown bundle: " + bundle);
+
+ OSGiBundleWrapper wrapper = (OSGiBundleWrapper)bundle;
+ AbstractBundleState bundleState = wrapper.getBundleState();
+ return isAssignableTo(bundleState, className);
+ }
+
+ /**
+ * Check the isAssignableTo
+ *
+ * @param other the bundle state
+ * @param className the class name
+ * @return true when assignable
+ */
+ boolean isAssignableTo(AbstractBundleState other, String className)
+ {
+ if (className == null)
+ throw new IllegalArgumentException("Null class name");
+
+ if (other == bundleState)
+ return true;
+
+ if (isUnregistered())
+ return false;
+
+ Class<?> source = (Class<?>)bundleState.getSource(className);
+ if (source == null)
+ throw new IllegalStateException("Cannot load '" + className + "' from: " + bundleState);
+
+ Class<?> otherSource = (Class<?>)other.getSource(className);
+ if (otherSource == null)
+ {
+ log.debug("Cannot load '" + className + "' from: " + other);
+ return false;
+ }
+
+ boolean equals = source.equals(otherSource);
+ if (equals == false)
+ {
+ ClassLoader otherLoader = otherSource.getClassLoader();
+ ClassLoader sourceLoader = source.getClassLoader();
+ StringBuffer buffer = new StringBuffer("Cannot assign '" + className + "' comming from different exporters");
+ buffer.append("\n service: ").append(sourceLoader);
+ buffer.append("\n request: ").append(otherLoader);
+ log.warn(buffer.toString());
+ }
+ return equals;
+ }
+
+ /**
+ * Check the isAssignable
+ *
+ * @param bundle the bundle state
+ * @return true when assignable
+ */
+ boolean isAssignable(AbstractBundleState bundle)
+ {
+ if (bundle == bundleState)
+ return true;
+
+ if (isUnregistered())
+ return false;
+
+ for (String clazz : getClasses())
+ {
+ if (isAssignableTo(bundle, clazz) == false)
+ return false;
+ }
+ return true;
+ }
+
+ /**
+ * Match the class
+ *
+ * @param className the class name
+ * @return true when the class name matches
+ */
+ boolean matchClass(String className)
+ {
+ if (clazzes == null || clazzes.length == 0)
+ return false;
+
+ for (String clazz : clazzes)
+ {
+ if (className.equals(clazz))
+ return true;
+ }
+ return false;
+ }
+
+ public void unregister()
+ {
+ checkUnregistered();
+
+ try
+ {
+ bundleState.unregisterService(this);
+ }
+ finally
+ {
+ synchronized (this)
+ {
+ serviceRegistration = null;
+ }
+ }
+ }
+
+ public int compareTo(Object reference)
+ {
+ if (reference == null)
+ throw new IllegalArgumentException("Null reference");
+
+ OSGiServiceState other;
+ if (reference instanceof OSGiServiceState)
+ other = (OSGiServiceState)reference;
+ else if (reference instanceof OSGiServiceReferenceWrapper)
+ other = ((OSGiServiceReferenceWrapper)reference).getServiceState();
+ else
+ throw new IllegalArgumentException(reference + " is not a service reference");
+
+ long thisServiceId = this.getServiceId();
+ long otherServiceId = other.getServiceId();
+ if (thisServiceId == otherServiceId)
+ return 0;
+
+ int thisRanking = this.getServiceRanking();
+ int otherRanking = other.getServiceRanking();
+ int ranking = thisRanking - otherRanking;
+ if (ranking != 0)
+ return ranking;
+
+ if (thisServiceId > otherServiceId)
+ return -1;
+ else
+ return +1;
+ }
+
+ @Override
+ public boolean equals(Object obj)
+ {
+ if (obj == null)
+ return false;
+
+ OSGiServiceState other;
+ if (obj instanceof OSGiServiceState)
+ other = (OSGiServiceState)obj;
+ else if (obj instanceof OSGiServiceReferenceWrapper)
+ other = ((OSGiServiceReferenceWrapper)obj).getServiceState();
+ else
+ return false;
+ return this == other;
+ }
+
+ @Override
+ public int hashCode()
+ {
+ return toString().hashCode();
+ }
+
+ @Override
+ public String toString()
+ {
+ StringBuilder builder = new StringBuilder();
+ builder.append("Service{");
+ builder.append("id=").append(getServiceId());
+ builder.append(" classes=").append(Arrays.asList(getClasses()));
+ builder.append("}");
+ return builder.toString();
+ }
+
+ public String toLongString()
+ {
+ StringBuilder builder = new StringBuilder();
+ builder.append("Service{");
+ builder.append("id=").append(getServiceId());
+ builder.append(" bundle=").append(getBundleState().getCanonicalName());
+ builder.append(" classes=").append(Arrays.asList(getClasses()));
+ builder.append(serviceOrFactory instanceof ServiceFactory ? " factory=" : " service=").append(serviceOrFactory);
+ if (properties != null)
+ builder.append(" properties=").append(properties);
+ builder.append("}");
+ return builder.toString();
+ }
+
+ /**
+ * Register the service
+ */
+ void internalRegister()
+ {
+ checkPermission("register", true);
+ getBundleState().addRegisteredService(this);
+ }
+
+ /**
+ * Unregister the service
+ */
+ void internalUnregister()
+ {
+ ContextTracker ct = getContextTracker();
+ if (ct != null) // nobody used us?
+ {
+ Set<Object> users = ct.getUsers(this);
+ if (users.isEmpty() == false)
+ {
+ OSGiBundleManager manager = bundleState.getBundleManager();
+ Set<AbstractBundleState> used = new HashSet<AbstractBundleState>();
+ for (Object user : users)
+ {
+ AbstractBundleState using = manager.getBundleForUser(user);
+ if (used.contains(using) == false)
+ {
+ used.add(using); // add so we don't remove duplicates
+
+ if (using.ungetContex(this) == false)
+ {
+ if (serviceOrFactory instanceof ServiceFactory)
+ {
+ ServiceFactory serviceFactory = (ServiceFactory)serviceOrFactory;
+ try
+ {
+ Object service = serviceCache.remove(using);
+ serviceFactory.ungetService(using.getBundle(), getRegistration(), service);
+ }
+ catch (Throwable t)
+ {
+ log.warn("Error from ungetService for " + this, t);
+ FrameworkEventsPlugin plugin = bundleState.getBundleManager().getPlugin(FrameworkEventsPlugin.class);
+ plugin.fireFrameworkEvent(bundleState, FrameworkEvent.WARNING, new BundleException("Error using service factory:" + serviceFactory, t));
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+
+ getBundleState().removeRegisteredService(this);
+ serviceOrFactory = null;
+ }
+
+ /**
+ * Check an object matches the specified classes
+ *
+ * @param object the object
+ * @return the object if all is ok
+ */
+ private Object checkObjClass(Object object)
+ {
+ if (object == null)
+ throw new IllegalArgumentException("Null object");
+
+ for (String className : getClasses())
+ {
+ try
+ {
+ Class<?> clazz = getBundleState().loadClass(className);
+ // [TODO] show classloader information all interfaces for debugging purposes
+ if (clazz.isInstance(object) == false)
+ throw new IllegalArgumentException(object.getClass().getName() + " does not implement " + className);
+ }
+ catch (ClassNotFoundException e)
+ {
+ throw new IllegalArgumentException(object.getClass().getName() + " cannot load class: " + className, e);
+ }
+ }
+ return object;
+ }
+
+ /**
+ * Check whether the caller has permission
+ *
+ * @param action the action to check
+ * @param all whether all permissions are required
+ */
+ void checkPermission(String action, boolean all)
+ {
+ SecurityManager sm = System.getSecurityManager();
+ if (sm == null)
+ return;
+
+ String[] clazzes = getClasses();
+ SecurityException se = null;
+ for (String clazz : clazzes)
+ {
+ try
+ {
+ ServicePermission permission = new ServicePermission(clazz, action);
+ sm.checkPermission(permission);
+ if (all == false)
+ return;
+ }
+ catch (SecurityException e)
+ {
+ if (all)
+ throw e;
+ se = e;
+ }
+ }
+ if (se != null)
+ throw se;
+ }
+
+ /**
+ * Check whether the caller has permission
+ *
+ * @param accessControlContext access control context
+ * @param action the action to check
+ * @param all whether all permissions are required
+ */
+ void checkPermission(AccessControlContext accessControlContext, String action, boolean all)
+ {
+ if (System.getSecurityManager() == null)
+ return;
+
+ String[] clazzes = getClasses();
+ SecurityException se = null;
+ for (String clazz : clazzes)
+ {
+ try
+ {
+ ServicePermission permission = new ServicePermission(clazz, action);
+ accessControlContext.checkPermission(permission);
+ if (all == false)
+ return;
+ }
+ catch (SecurityException e)
+ {
+ if (all)
+ throw e;
+ se = e;
+ }
+ }
+ if (se != null)
+ throw se;
+ }
+
+ /**
+ * Check whether the caller has permission to this object
+ *
+ * @return true when the caller has permission
+ */
+ boolean hasPermission()
+ {
+ try
+ {
+ checkPermission("get", false);
+ return true;
+ }
+ catch (SecurityException ignored)
+ {
+ }
+ return false;
+ }
+
+ /**
+ * Check whether the caller has permission to this object
+ *
+ * @param accessControlContext access control context
+ * @return true when the caller has permission
+ */
+ public boolean hasPermission(AccessControlContext accessControlContext)
+ {
+ try
+ {
+ checkPermission(accessControlContext, "get", false);
+ return true;
+ }
+ catch (SecurityException ignored)
+ {
+ }
+ return false;
+ }
+
+ /**
+ * Check if the service is unregistered
+ *
+ * @throws IllegalStateException if unregistered
+ */
+ private void checkUnregistered()
+ {
+ if (isUnregistered())
+ throw new IllegalStateException("Service is unregistered: " + this);
+ }
+
+ /**
+ * @return true when the service is unregistered
+ */
+ synchronized boolean isUnregistered()
+ {
+ return serviceRegistration == null;
+ }
+}
Modified: projects/jboss-osgi/trunk/reactor/framework/src/test/resources/bootstrap/jboss-osgi-bootstrap.xml
===================================================================
--- projects/jboss-osgi/trunk/reactor/framework/src/test/resources/bootstrap/jboss-osgi-bootstrap.xml 2009-11-27 15:12:58 UTC (rev 97111)
+++ projects/jboss-osgi/trunk/reactor/framework/src/test/resources/bootstrap/jboss-osgi-bootstrap.xml 2009-11-27 15:38:13 UTC (rev 97112)
@@ -12,6 +12,7 @@
<constructor>
<parameter><inject bean="jboss.kernel:service=Kernel" /></parameter>
<parameter><inject bean="MainDeployer" /></parameter>
+ <parameter><inject bean="DeploymentRegistry" /></parameter>
</constructor>
<property name="properties">
<map keyClass="java.lang.String" valueClass="java.lang.String">
@@ -94,6 +95,9 @@
<property name="deployers"><inject bean="Deployers" /></property>
</bean>
+ <!-- The deployment registry -->
+ <bean name="DeploymentRegistry" class="org.jboss.deployers.structure.spi.helpers.AbstractDeploymentRegistry"/>
+
<!-- The holder for deployers that determine structure -->
<bean name="StructuralDeployers" class="org.jboss.deployers.vfs.plugins.structure.VFSStructuralDeployersImpl">
<property name="structureBuilder">
@@ -127,6 +131,7 @@
<constructor>
<parameter class="org.jboss.dependency.spi.Controller"><inject bean="jboss.kernel:service=KernelController" /></parameter>
</constructor>
+ <property name="deploymentRegistry"><inject bean="DeploymentRegistry"/></property>
</bean>
<!-- OSGI Deployment -->
14 years, 6 months
JBoss-OSGI SVN: r97111 - in projects/jboss-osgi: projects/bundles/jboss-reflect/trunk/src/main/java/org/jboss/osgi and 11 other directories.
by jboss-osgi-commits@lists.jboss.org
Author: thomas.diesler(a)jboss.com
Date: 2009-11-27 10:12:58 -0500 (Fri, 27 Nov 2009)
New Revision: 97111
Removed:
projects/jboss-osgi/projects/bundles/jboss-reflect/trunk/src/main/java/org/jboss/osgi/jbossxb/
Modified:
projects/jboss-osgi/projects/bundles/jboss-reflect/trunk/pom.xml
projects/jboss-osgi/projects/bundles/jboss-xml-binding/trunk/pom.xml
projects/jboss-osgi/projects/bundles/jboss-xml-binding/trunk/scripts/assembly-bundles.xml
projects/jboss-osgi/projects/bundles/jboss-xml-binding/trunk/src/main/java/org/jboss/osgi/jbossxb/XMLBindingCapability.java
projects/jboss-osgi/projects/bundles/microcontainer/trunk/pom.xml
projects/jboss-osgi/projects/bundles/microcontainer/trunk/scripts/assembly-bundles.xml
projects/jboss-osgi/trunk/pom.xml
projects/jboss-osgi/trunk/reactor/blueprint/pom.xml
projects/jboss-osgi/trunk/reactor/blueprint/scripts/assembly-bundles.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:
Use jboss-osgi-reflect
Modified: projects/jboss-osgi/projects/bundles/jboss-reflect/trunk/pom.xml
===================================================================
--- projects/jboss-osgi/projects/bundles/jboss-reflect/trunk/pom.xml 2009-11-27 14:45:30 UTC (rev 97110)
+++ projects/jboss-osgi/projects/bundles/jboss-reflect/trunk/pom.xml 2009-11-27 15:12:58 UTC (rev 97111)
@@ -39,6 +39,7 @@
<!-- Properties -->
<properties>
+ <version.javassist>3.9.0.GA</version.javassist>
<version.jboss.reflect>2.0.2.GA</version.jboss.reflect>
</properties>
@@ -49,6 +50,11 @@
<artifactId>bnd</artifactId>
</dependency>
<dependency>
+ <groupId>javassist</groupId>
+ <artifactId>javassist</artifactId>
+ <version>${version.javassist}</version>
+ </dependency>
+ <dependency>
<groupId>org.jboss</groupId>
<artifactId>jboss-reflect</artifactId>
<version>${version.jboss.reflect}</version>
@@ -65,8 +71,20 @@
<Bundle-SymbolicName>${artifactId}</Bundle-SymbolicName>
<Bundle-ActivationPolicy>lazy</Bundle-ActivationPolicy>
<Embed-Transitive>true</Embed-Transitive>
+ <Import-Package>
+
+ <!-- import -->
+ org.jboss.logging,
+ org.jboss.util,
+ org.jboss.util.collection,
+ org.jboss.util.propertyeditor,
+
+ <!-- ignore -->
+ !com.sun.jdi*
+ </Import-Package>
<Embed-Dependency>
jboss-reflect;inline=false,
+ javassist;inline=false,
</Embed-Dependency>
<_exportcontents>
org.jboss.beans.info*;version=${version.jboss.reflect},
Modified: projects/jboss-osgi/projects/bundles/jboss-xml-binding/trunk/pom.xml
===================================================================
--- projects/jboss-osgi/projects/bundles/jboss-xml-binding/trunk/pom.xml 2009-11-27 14:45:30 UTC (rev 97110)
+++ projects/jboss-osgi/projects/bundles/jboss-xml-binding/trunk/pom.xml 2009-11-27 15:12:58 UTC (rev 97111)
@@ -41,13 +41,12 @@
<properties>
<version.jboss.osgi.runtime.felix>2.0.2-SNAPSHOT</version.jboss.osgi.runtime.felix>
<version.jboss.xb>2.0.2.Beta3</version.jboss.xb>
- <version.javassist>3.9.0.GA</version.javassist>
<version.jboss.osgi.common>1.0.4-SNAPSHOT</version.jboss.osgi.common>
<version.jboss.osgi.common.core>2.2.13.GA</version.jboss.osgi.common.core>
<version.jboss.osgi.husky>1.0.2-SNAPSHOT</version.jboss.osgi.husky>
<version.jboss.osgi.jaxb>2.1.10-SNAPSHOT</version.jboss.osgi.jaxb>
+ <version.jboss.osgi.reflect>2.0.2-SNAPSHOT</version.jboss.osgi.reflect>
<version.jboss.osgi.spi>1.0.3-SNAPSHOT</version.jboss.osgi.spi>
- <version.jboss.reflect>2.0.2.GA</version.jboss.reflect>
<version.osgi>4.2.0</version.osgi>
</properties>
@@ -58,11 +57,6 @@
<artifactId>bnd</artifactId>
</dependency>
<dependency>
- <groupId>javassist</groupId>
- <artifactId>javassist</artifactId>
- <version>${version.javassist}</version>
- </dependency>
- <dependency>
<groupId>org.jboss.osgi</groupId>
<artifactId>jboss-osgi-spi</artifactId>
<version>${version.jboss.osgi.spi}</version>
@@ -108,6 +102,12 @@
<version>${version.jboss.osgi.jaxb}</version>
<scope>provided</scope>
</dependency>
+ <dependency>
+ <groupId>org.jboss.osgi.bundles</groupId>
+ <artifactId>jboss-osgi-reflect</artifactId>
+ <version>${version.jboss.osgi.reflect}</version>
+ <scope>provided</scope>
+ </dependency>
<!-- OSGi Dependencies -->
<dependency>
@@ -173,21 +173,18 @@
org.osgi.service.log,
org.osgi.util.tracker,
- <!-- ignore -->
- !com.sun.jdi*
+ <!-- jboss-osgi-reflect -->
+ org.jboss.beans.info.spi;version="[2.0,2.1)",
+ org.jboss.config.plugins.property;version="[2.0,2.1)",
+ org.jboss.config.spi;version="[2.0,2.1)",
+ org.jboss.joinpoint.plugins;version="[2.0,2.1)",
+ org.jboss.reflect.plugins.introspection;version="[2.0,2.1)",
+ org.jboss.reflect.spi;version="[2.0,2.1)",
</Import-Package>
<Embed-Dependency>
- javassist;inline=false,
jbossxb;inline=false,
- jboss-reflect;inline=false,
</Embed-Dependency>
<_exportcontents>
- org.jboss.beans.info*;version=${version.jboss.reflect},
- org.jboss.classadapter.spi*;version=${version.jboss.reflect},
- org.jboss.config*;version=${version.jboss.reflect},
- org.jboss.joinpoint*;version=${version.jboss.reflect},
- org.jboss.reflect.plugins.introspection;version=${version.jboss.reflect},
- org.jboss.reflect.spi*;version=${version.jboss.reflect},
org.jboss.xb.annotations;version=${version.jboss.xb},
org.jboss.xb.binding.sunday.unmarshalling;version=${version.jboss.xb},
org.jboss.xb.binding;version=${version.jboss.xb},
Modified: projects/jboss-osgi/projects/bundles/jboss-xml-binding/trunk/scripts/assembly-bundles.xml
===================================================================
--- projects/jboss-osgi/projects/bundles/jboss-xml-binding/trunk/scripts/assembly-bundles.xml 2009-11-27 14:45:30 UTC (rev 97110)
+++ projects/jboss-osgi/projects/bundles/jboss-xml-binding/trunk/scripts/assembly-bundles.xml 2009-11-27 15:12:58 UTC (rev 97111)
@@ -20,6 +20,7 @@
<include>*:jboss-osgi-common-core:jar</include>
<include>*:jboss-osgi-husky:jar</include>
<include>*:jboss-osgi-jaxb:jar</include>
+ <include>*:jboss-osgi-reflect:jar</include>
<include>*:org.osgi.compendium:jar</include>
</includes>
<useStrictFiltering>true</useStrictFiltering>
Modified: projects/jboss-osgi/projects/bundles/jboss-xml-binding/trunk/src/main/java/org/jboss/osgi/jbossxb/XMLBindingCapability.java
===================================================================
--- projects/jboss-osgi/projects/bundles/jboss-xml-binding/trunk/src/main/java/org/jboss/osgi/jbossxb/XMLBindingCapability.java 2009-11-27 14:45:30 UTC (rev 97110)
+++ projects/jboss-osgi/projects/bundles/jboss-xml-binding/trunk/src/main/java/org/jboss/osgi/jbossxb/XMLBindingCapability.java 2009-11-27 15:12:58 UTC (rev 97111)
@@ -47,6 +47,7 @@
addDependency(new JAXBCapability());
addBundle("bundles/jboss-osgi-common-core.jar");
+ addBundle("bundles/jboss-osgi-reflect.jar");
addBundle("bundles/jboss-osgi-xml-binding.jar");
}
}
\ No newline at end of file
Modified: projects/jboss-osgi/projects/bundles/microcontainer/trunk/pom.xml
===================================================================
--- projects/jboss-osgi/projects/bundles/microcontainer/trunk/pom.xml 2009-11-27 14:45:30 UTC (rev 97110)
+++ projects/jboss-osgi/projects/bundles/microcontainer/trunk/pom.xml 2009-11-27 15:12:58 UTC (rev 97111)
@@ -48,6 +48,7 @@
<version.jboss.osgi.husky>1.0.2-SNAPSHOT</version.jboss.osgi.husky>
<version.jboss.osgi.jaxb>2.1.10-SNAPSHOT</version.jboss.osgi.jaxb>
<version.jboss.osgi.jmx>1.0.2-SNAPSHOT</version.jboss.osgi.jmx>
+ <version.jboss.osgi.reflect>2.0.2-SNAPSHOT</version.jboss.osgi.reflect>
<version.jboss.osgi.runtime.deployers>1.0.3</version.jboss.osgi.runtime.deployers>
<version.jboss.osgi.spi>1.0.3-SNAPSHOT</version.jboss.osgi.spi>
<version.jboss.osgi.xml.binding>2.0.2-SNAPSHOT</version.jboss.osgi.xml.binding>
@@ -131,6 +132,12 @@
</dependency>
<dependency>
<groupId>org.jboss.osgi.bundles</groupId>
+ <artifactId>jboss-osgi-reflect</artifactId>
+ <version>${version.jboss.osgi.reflect}</version>
+ <scope>provided</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.jboss.osgi.bundles</groupId>
<artifactId>jboss-osgi-xml-binding</artifactId>
<version>${version.jboss.osgi.xml.binding}</version>
<scope>provided</scope>
Modified: projects/jboss-osgi/projects/bundles/microcontainer/trunk/scripts/assembly-bundles.xml
===================================================================
--- projects/jboss-osgi/projects/bundles/microcontainer/trunk/scripts/assembly-bundles.xml 2009-11-27 14:45:30 UTC (rev 97110)
+++ projects/jboss-osgi/projects/bundles/microcontainer/trunk/scripts/assembly-bundles.xml 2009-11-27 15:12:58 UTC (rev 97111)
@@ -22,6 +22,7 @@
<include>*:jboss-osgi-jaxb:jar</include>
<include>*:jboss-osgi-jndi:jar</include>
<include>*:jboss-osgi-jmx:jar</include>
+ <include>*:jboss-osgi-reflect:jar</include>
<include>*:jboss-osgi-xml-binding:jar</include>
<include>*:org.osgi.compendium:jar</include>
</includes>
Modified: projects/jboss-osgi/trunk/pom.xml
===================================================================
--- projects/jboss-osgi/trunk/pom.xml 2009-11-27 14:45:30 UTC (rev 97110)
+++ projects/jboss-osgi/trunk/pom.xml 2009-11-27 15:12:58 UTC (rev 97111)
@@ -62,6 +62,7 @@
<version.jboss.osgi.jndi>1.0.2-SNAPSHOT</version.jboss.osgi.jndi>
<version.jboss.osgi.jta>1.0.0</version.jboss.osgi.jta>
<version.jboss.osgi.microcontainer>2.0.9-SNAPSHOT</version.jboss.osgi.microcontainer>
+ <version.jboss.osgi.reflect>2.0.2-SNAPSHOT</version.jboss.osgi.reflect>
<version.jboss.osgi.runtime.deployers>1.0.3</version.jboss.osgi.runtime.deployers>
<version.jboss.osgi.runtime.equinox>3.5.1-SNAPSHOT</version.jboss.osgi.runtime.equinox>
<version.jboss.osgi.runtime.felix>2.0.2-SNAPSHOT</version.jboss.osgi.runtime.felix>
@@ -147,6 +148,11 @@
</dependency>
<dependency>
<groupId>org.jboss.osgi.bundles</groupId>
+ <artifactId>jboss-osgi-reflect</artifactId>
+ <version>${version.jboss.osgi.reflect}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.jboss.osgi.bundles</groupId>
<artifactId>jboss-osgi-webapp</artifactId>
<version>${version.jboss.osgi.webapp}</version>
</dependency>
Modified: projects/jboss-osgi/trunk/reactor/blueprint/pom.xml
===================================================================
--- projects/jboss-osgi/trunk/reactor/blueprint/pom.xml 2009-11-27 14:45:30 UTC (rev 97110)
+++ projects/jboss-osgi/trunk/reactor/blueprint/pom.xml 2009-11-27 15:12:58 UTC (rev 97111)
@@ -94,6 +94,11 @@
</dependency>
<dependency>
<groupId>org.jboss.osgi.bundles</groupId>
+ <artifactId>jboss-osgi-reflect</artifactId>
+ <scope>provided</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.jboss.osgi.bundles</groupId>
<artifactId>jboss-osgi-xml-binding</artifactId>
<scope>provided</scope>
</dependency>
Modified: projects/jboss-osgi/trunk/reactor/blueprint/scripts/assembly-bundles.xml
===================================================================
--- projects/jboss-osgi/trunk/reactor/blueprint/scripts/assembly-bundles.xml 2009-11-27 14:45:30 UTC (rev 97110)
+++ projects/jboss-osgi/trunk/reactor/blueprint/scripts/assembly-bundles.xml 2009-11-27 15:12:58 UTC (rev 97111)
@@ -23,6 +23,7 @@
<include>*:jboss-osgi-jmx:jar</include>
<include>*:jboss-osgi-jndi:jar</include>
<include>*:jboss-osgi-microcontainer:jar</include>
+ <include>*:jboss-osgi-reflect:jar</include>
<include>*:jboss-osgi-xml-binding:jar</include>
</includes>
<useStrictFiltering>true</useStrictFiltering>
Modified: projects/jboss-osgi/trunk/testsuite/example/scripts/assembly-bundles.xml
===================================================================
--- projects/jboss-osgi/trunk/testsuite/example/scripts/assembly-bundles.xml 2009-11-27 14:45:30 UTC (rev 97110)
+++ projects/jboss-osgi/trunk/testsuite/example/scripts/assembly-bundles.xml 2009-11-27 15:12:58 UTC (rev 97111)
@@ -25,8 +25,9 @@
<include>*:jboss-osgi-jndi:jar</include>
<include>*:jboss-osgi-jta:jar</include>
<include>*:jboss-osgi-microcontainer:jar</include>
+ <include>*:jboss-osgi-reflect:jar</include>
+ <include>*:jboss-osgi-webapp: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-11-27 14:45:30 UTC (rev 97110)
+++ projects/jboss-osgi/trunk/testsuite/functional/scripts/assembly-bundles.xml 2009-11-27 15:12:58 UTC (rev 97111)
@@ -24,8 +24,9 @@
<include>*:jboss-osgi-jmx:jar</include>
<include>*:jboss-osgi-jndi:jar</include>
<include>*:jboss-osgi-microcontainer:jar</include>
+ <include>*:jboss-osgi-reflect:jar</include>
+ <include>*:jboss-osgi-webapp: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-11-27 14:45:30 UTC (rev 97110)
+++ projects/jboss-osgi/trunk/testsuite/pom.xml 2009-11-27 15:12:58 UTC (rev 97111)
@@ -140,6 +140,11 @@
</dependency>
<dependency>
<groupId>org.jboss.osgi.bundles</groupId>
+ <artifactId>jboss-osgi-reflect</artifactId>
+ <scope>provided</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.jboss.osgi.bundles</groupId>
<artifactId>jboss-osgi-xml-binding</artifactId>
<scope>provided</scope>
</dependency>
14 years, 6 months
JBoss-OSGI SVN: r97110 - in projects/jboss-osgi/projects/bundles: jboss-reflect and 5 other directories.
by jboss-osgi-commits@lists.jboss.org
Author: thomas.diesler(a)jboss.com
Date: 2009-11-27 09:45:30 -0500 (Fri, 27 Nov 2009)
New Revision: 97110
Added:
projects/jboss-osgi/projects/bundles/jboss-reflect/
projects/jboss-osgi/projects/bundles/jboss-reflect/trunk/
projects/jboss-osgi/projects/bundles/jboss-reflect/trunk/src/main/java/org/jboss/osgi/reflect/
Removed:
projects/jboss-osgi/projects/bundles/jboss-reflect/trunk/scripts/
projects/jboss-osgi/projects/bundles/jboss-reflect/trunk/src/main/java/org/jboss/osgi/jbossxb/UnmarshallerService.java
projects/jboss-osgi/projects/bundles/jboss-reflect/trunk/src/main/java/org/jboss/osgi/jbossxb/XMLBindingCapability.java
projects/jboss-osgi/projects/bundles/jboss-reflect/trunk/src/main/java/org/jboss/osgi/jbossxb/internal/
projects/jboss-osgi/projects/bundles/jboss-reflect/trunk/src/main/resources/
projects/jboss-osgi/projects/bundles/jboss-reflect/trunk/src/test/java/
projects/jboss-osgi/projects/bundles/jboss-reflect/trunk/src/test/resources/
Modified:
projects/jboss-osgi/projects/bundles/jboss-reflect/trunk/.classpath
projects/jboss-osgi/projects/bundles/jboss-reflect/trunk/pom.xml
Log:
Add jboss-osgi-reflect
Copied: projects/jboss-osgi/projects/bundles/jboss-reflect/trunk (from rev 97108, projects/jboss-osgi/projects/bundles/jboss-xml-binding/trunk)
Modified: projects/jboss-osgi/projects/bundles/jboss-reflect/trunk/.classpath
===================================================================
--- projects/jboss-osgi/projects/bundles/jboss-xml-binding/trunk/.classpath 2009-11-27 14:07:53 UTC (rev 97108)
+++ projects/jboss-osgi/projects/bundles/jboss-reflect/trunk/.classpath 2009-11-27 14:45:30 UTC (rev 97110)
@@ -1,9 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
- <classpathentry kind="src" path="src/main/java"/>
- <classpathentry kind="src" output="target/test-classes" path="src/test/resources"/>
- <classpathentry kind="src" output="target/test-classes" path="src/test/java"/>
- <classpathentry excluding="**" kind="src" path="src/main/resources"/>
+ <classpathentry kind="src" output="target/classes" path="src/main/java"/>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/J2SE-1.5"/>
<classpathentry kind="con" path="org.maven.ide.eclipse.MAVEN2_CLASSPATH_CONTAINER"/>
<classpathentry kind="output" path="target/classes"/>
Modified: projects/jboss-osgi/projects/bundles/jboss-reflect/trunk/pom.xml
===================================================================
--- projects/jboss-osgi/projects/bundles/jboss-xml-binding/trunk/pom.xml 2009-11-27 14:07:53 UTC (rev 97108)
+++ projects/jboss-osgi/projects/bundles/jboss-reflect/trunk/pom.xml 2009-11-27 14:45:30 UTC (rev 97110)
@@ -14,11 +14,11 @@
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
- <name>JBossOSGi Bundles - JBossXB</name>
- <description>A JBossOSGi provided JBossXB bundle</description>
+ <name>JBossOSGi Bundles - JBoss Reflect</name>
+ <description>A JBossOSGi provided JBoss Reflect bundle</description>
<groupId>org.jboss.osgi.bundles</groupId>
- <artifactId>jboss-osgi-xml-binding</artifactId>
+ <artifactId>jboss-osgi-reflect</artifactId>
<packaging>bundle</packaging>
<version>2.0.2-SNAPSHOT</version>
@@ -32,23 +32,14 @@
<!-- Subversion -->
<scm>
- <connection>scm:svn:http://anonsvn.jboss.org/repos/jbossas/projects/jboss-osgi/projec...</connection>
- <developerConnection>scm:svn:https://svn.jboss.org/repos/jbossas/projects/jboss-osgi/projects/...</developerConnection>
+ <connection>scm:svn:http://anonsvn.jboss.org/repos/jbossas/projects/jboss-osgi/projec...</connection>
+ <developerConnection>scm:svn:https://svn.jboss.org/repos/jbossas/projects/jboss-osgi/projects/...</developerConnection>
<url>http://fisheye.jboss.com/qsearch/JBossOSGi</url>
</scm>
<!-- Properties -->
<properties>
- <version.jboss.osgi.runtime.felix>2.0.2-SNAPSHOT</version.jboss.osgi.runtime.felix>
- <version.jboss.xb>2.0.2.Beta3</version.jboss.xb>
- <version.javassist>3.9.0.GA</version.javassist>
- <version.jboss.osgi.common>1.0.4-SNAPSHOT</version.jboss.osgi.common>
- <version.jboss.osgi.common.core>2.2.13.GA</version.jboss.osgi.common.core>
- <version.jboss.osgi.husky>1.0.2-SNAPSHOT</version.jboss.osgi.husky>
- <version.jboss.osgi.jaxb>2.1.10-SNAPSHOT</version.jboss.osgi.jaxb>
- <version.jboss.osgi.spi>1.0.3-SNAPSHOT</version.jboss.osgi.spi>
<version.jboss.reflect>2.0.2.GA</version.jboss.reflect>
- <version.osgi>4.2.0</version.osgi>
</properties>
<!-- Dependencies -->
@@ -58,83 +49,10 @@
<artifactId>bnd</artifactId>
</dependency>
<dependency>
- <groupId>javassist</groupId>
- <artifactId>javassist</artifactId>
- <version>${version.javassist}</version>
- </dependency>
- <dependency>
- <groupId>org.jboss.osgi</groupId>
- <artifactId>jboss-osgi-spi</artifactId>
- <version>${version.jboss.osgi.spi}</version>
- </dependency>
- <dependency>
<groupId>org.jboss</groupId>
- <artifactId>jbossxb</artifactId>
- <version>${version.jboss.xb}</version>
- <exclusions>
- <exclusion>
- <groupId>org.jboss</groupId>
- <artifactId>jboss-common-core</artifactId>
- </exclusion>
- </exclusions>
+ <artifactId>jboss-reflect</artifactId>
+ <version>${version.jboss.reflect}</version>
</dependency>
- <dependency>
- <groupId>org.slf4j</groupId>
- <artifactId>slf4j-api</artifactId>
- </dependency>
-
- <!-- Provided Dependencies -->
- <dependency>
- <groupId>org.jboss.osgi.bundles</groupId>
- <artifactId>jboss-osgi-common</artifactId>
- <version>${version.jboss.osgi.common}</version>
- <scope>provided</scope>
- </dependency>
- <dependency>
- <groupId>org.jboss.osgi.bundles</groupId>
- <artifactId>jboss-osgi-common-core</artifactId>
- <version>${version.jboss.osgi.common.core}</version>
- <scope>provided</scope>
- </dependency>
- <dependency>
- <groupId>org.jboss.osgi.bundles</groupId>
- <artifactId>jboss-osgi-husky</artifactId>
- <version>${version.jboss.osgi.husky}</version>
- <scope>provided</scope>
- </dependency>
- <dependency>
- <groupId>org.jboss.osgi.bundles</groupId>
- <artifactId>jboss-osgi-jaxb</artifactId>
- <version>${version.jboss.osgi.jaxb}</version>
- <scope>provided</scope>
- </dependency>
-
- <!-- OSGi Dependencies -->
- <dependency>
- <groupId>org.osgi</groupId>
- <artifactId>org.osgi.core</artifactId>
- <version>${version.osgi}</version>
- <scope>provided</scope>
- </dependency>
- <dependency>
- <groupId>org.osgi</groupId>
- <artifactId>org.osgi.compendium</artifactId>
- <version>${version.osgi}</version>
- <scope>provided</scope>
- </dependency>
-
- <!-- Test Dependencies -->
- <dependency>
- <groupId>org.jboss.osgi.runtime</groupId>
- <artifactId>jboss-osgi-runtime-felix</artifactId>
- <version>${version.jboss.osgi.runtime.felix}</version>
- <scope>test</scope>
- </dependency>
- <dependency>
- <groupId>org.slf4j</groupId>
- <artifactId>slf4j-log4j12</artifactId>
- <scope>test</scope>
- </dependency>
</dependencies>
<build>
@@ -145,40 +63,9 @@
<configuration>
<instructions>
<Bundle-SymbolicName>${artifactId}</Bundle-SymbolicName>
- <Bundle-Activator>org.jboss.osgi.jbossxb.internal.XMLBindingActivator</Bundle-Activator>
<Bundle-ActivationPolicy>lazy</Bundle-ActivationPolicy>
<Embed-Transitive>true</Embed-Transitive>
- <Export-Package>
- org.jboss.osgi.jbossxb;version=${version}
- </Export-Package>
- <Import-Package>
- <!-- system -->
- javax.activation,
- javax.xml.bind.*,
- javax.xml.namespace,
- javax.xml.parsers,
- org.slf4j,
- org.w3c.dom*,
- org.xml.sax*,
-
- <!-- import -->
- com.wutka.dtd,
- org.apache.xerces.*,
- org.jboss.logging,
- org.jboss.osgi.jaxb;version="[2.1,2.2)",
- org.jboss.osgi.spi.capability;version="[1.0,1.1)",
- org.jboss.osgi.spi.util;version="[1.0,1.1)",
- org.jboss.util*,
- org.osgi.framework,
- org.osgi.service.log,
- org.osgi.util.tracker,
-
- <!-- ignore -->
- !com.sun.jdi*
- </Import-Package>
<Embed-Dependency>
- javassist;inline=false,
- jbossxb;inline=false,
jboss-reflect;inline=false,
</Embed-Dependency>
<_exportcontents>
@@ -188,113 +75,11 @@
org.jboss.joinpoint*;version=${version.jboss.reflect},
org.jboss.reflect.plugins.introspection;version=${version.jboss.reflect},
org.jboss.reflect.spi*;version=${version.jboss.reflect},
- org.jboss.xb.annotations;version=${version.jboss.xb},
- org.jboss.xb.binding.sunday.unmarshalling;version=${version.jboss.xb},
- org.jboss.xb.binding;version=${version.jboss.xb},
</_exportcontents>
</instructions>
</configuration>
</plugin>
- <plugin>
- <artifactId>maven-assembly-plugin</artifactId>
- <executions>
- <execution>
- <id>bundles</id>
- <phase>test-compile</phase>
- <goals>
- <goal>directory-single</goal>
- </goals>
- <configuration>
- <finalName>test-libs</finalName>
- <ignoreDirFormatExtensions>true</ignoreDirFormatExtensions>
- <appendAssemblyId>false</appendAssemblyId>
- <descriptors>
- <descriptor>scripts/assembly-bundles.xml</descriptor>
- </descriptors>
- </configuration>
- </execution>
- </executions>
- </plugin>
- <plugin>
- <artifactId>maven-antrun-plugin</artifactId>
- <executions>
- <execution>
- <id>build-test-jars</id>
- <phase>integration-test</phase>
- <goals>
- <goal>run</goal>
- </goals>
- <configuration>
- <tasks>
- <property name="maven.runtime.classpath" refid="maven.runtime.classpath" />
- <property name="artifactId" value="${artifactId}" />
- <property name="tests.output.dir" value="${project.build.directory}" />
- <property name="build.artifact" value="${project.build.finalName}" />
- <ant antfile="scripts/antrun-test-jars.xml" />
- </tasks>
- </configuration>
- </execution>
- </executions>
- </plugin>
- <plugin>
- <artifactId>maven-surefire-plugin</artifactId>
- <configuration>
- <skip>true</skip>
- </configuration>
- <executions>
- <execution>
- <id>surefire-integration-tests</id>
- <phase>integration-test</phase>
- <goals>
- <goal>test</goal>
- </goals>
- <configuration>
- <skip>false</skip>
- <argLine>${surefire.jpda.args}</argLine>
- <systemProperties>
- <property>
- <name>java.protocol.handler.pkgs</name>
- <value>org.jboss.net.protocol|org.jboss.virtual.protocol</value>
- </property>
- <property>
- <name>log4j.output.dir</name>
- <value>${project.build.directory}</value>
- </property>
- <property>
- <name>org.jboss.osgi.husky.Invoker</name>
- <value>org.jboss.osgi.husky.internal.OSGiInvoker</value>
- </property>
- <property>
- <name>test.archive.directory</name>
- <value>${project.build.directory}/test-libs</value>
- </property>
- </systemProperties>
- </configuration>
- </execution>
- </executions>
- </plugin>
</plugins>
</build>
- <!-- Profiles -->
- <profiles>
-
- <!--
- Name: jpda
- Descr: Enable JPDA remote debuging
- -->
- <profile>
- <id>jpda</id>
- <activation>
- <property>
- <name>jpda</name>
- </property>
- </activation>
- <properties>
- <surefire.jpda.args>-Xrunjdwp:transport=dt_socket,address=8787,server=y,suspend=y</surefire.jpda.args>
- </properties>
- </profile>
-
- </profiles>
-
</project>
Deleted: projects/jboss-osgi/projects/bundles/jboss-reflect/trunk/src/main/java/org/jboss/osgi/jbossxb/UnmarshallerService.java
===================================================================
--- projects/jboss-osgi/projects/bundles/jboss-xml-binding/trunk/src/main/java/org/jboss/osgi/jbossxb/UnmarshallerService.java 2009-11-27 14:07:53 UTC (rev 97108)
+++ projects/jboss-osgi/projects/bundles/jboss-reflect/trunk/src/main/java/org/jboss/osgi/jbossxb/UnmarshallerService.java 2009-11-27 14:45:30 UTC (rev 97110)
@@ -1,64 +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.jbossxb;
-
-//$Id$
-
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.Reader;
-
-import org.xml.sax.ErrorHandler;
-import org.xml.sax.InputSource;
-
-/**
- * An unmarshaller service
- *
- * @author thomas.diesler(a)jboss.com
- * @since 26-Nov-2009
- */
-public interface UnmarshallerService
-{
- void setFeature(String featureName, Boolean flag);
-
- void setValidation(boolean validation);
-
- void setNamespaceAware(boolean namespaces);
-
- void setSchemaValidation(boolean validation);
-
- void setErrorHandler(ErrorHandler errorHandler);
-
- void registerSchemaLocation(String id, String dtdOrSchema);
-
- void addClassBinding(String nsUri, String className);
-
- void addClassBinding(String nsUri, Class<?> clazz);
-
- Object unmarshal(Reader xmlReader) throws IOException;
-
- Object unmarshal(InputStream xmlStream) throws IOException;
-
- Object unmarshal(InputSource source) throws IOException;
-
- Object unmarshal(String xml) throws IOException;
-}
\ No newline at end of file
Deleted: projects/jboss-osgi/projects/bundles/jboss-reflect/trunk/src/main/java/org/jboss/osgi/jbossxb/XMLBindingCapability.java
===================================================================
--- projects/jboss-osgi/projects/bundles/jboss-xml-binding/trunk/src/main/java/org/jboss/osgi/jbossxb/XMLBindingCapability.java 2009-11-27 14:07:53 UTC (rev 97108)
+++ projects/jboss-osgi/projects/bundles/jboss-reflect/trunk/src/main/java/org/jboss/osgi/jbossxb/XMLBindingCapability.java 2009-11-27 14:45:30 UTC (rev 97110)
@@ -1,52 +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.jbossxb;
-
-//$Id$
-
-import org.jboss.osgi.jaxb.JAXBCapability;
-import org.jboss.osgi.spi.capability.Capability;
-
-/**
- * Adds the JBossXB capability.
- *
- * It is ignored if the {@link UnmarshallerService} is already registered.
- *
- * Dependent capabilities: {@link JAXBCapability}.
- *
- * Installed bundles: jboss-osgi-common-core.jar, jboss-osgi-xml-binding.jar
- *
- * @author thomas.diesler(a)jboss.com
- * @since 05-May-2009
- */
-public class XMLBindingCapability extends Capability
-{
- public XMLBindingCapability()
- {
- super (UnmarshallerService.class.getName());
-
- addDependency(new JAXBCapability());
-
- addBundle("bundles/jboss-osgi-common-core.jar");
- addBundle("bundles/jboss-osgi-xml-binding.jar");
- }
-}
\ No newline at end of file
14 years, 6 months
JBoss-OSGI SVN: r97108 - in projects/jboss-osgi/projects: bundles/jboss-xml-binding/trunk/src/main/java/org/jboss/osgi/jbossxb and 13 other directories.
by jboss-osgi-commits@lists.jboss.org
Author: thomas.diesler(a)jboss.com
Date: 2009-11-27 09:07:53 -0500 (Fri, 27 Nov 2009)
New Revision: 97108
Added:
projects/jboss-osgi/projects/bundles/jboss-xml-binding/trunk/src/test/resources/META-INF/
projects/jboss-osgi/projects/bundles/jboss-xml-binding/trunk/src/test/resources/META-INF/services/
projects/jboss-osgi/projects/bundles/jboss-xml-binding/trunk/src/test/resources/META-INF/services/org.jboss.osgi.spi.framework.OSGiBootstrapProvider
projects/jboss-osgi/projects/bundles/microcontainer/trunk/src/main/java/org/jboss/osgi/microcontainer/internal/EmbeddedBeanDeployer.java
projects/jboss-osgi/projects/bundles/microcontainer/trunk/src/test/resources/META-INF/
projects/jboss-osgi/projects/bundles/microcontainer/trunk/src/test/resources/META-INF/services/
projects/jboss-osgi/projects/bundles/microcontainer/trunk/src/test/resources/META-INF/services/org.jboss.osgi.spi.framework.OSGiBootstrapProvider
Modified:
projects/jboss-osgi/projects/bundles/jboss-xml-binding/trunk/pom.xml
projects/jboss-osgi/projects/bundles/jboss-xml-binding/trunk/src/main/java/org/jboss/osgi/jbossxb/UnmarshallerService.java
projects/jboss-osgi/projects/bundles/jboss-xml-binding/trunk/src/main/java/org/jboss/osgi/jbossxb/internal/UnmarshallerServiceImpl.java
projects/jboss-osgi/projects/bundles/microcontainer/trunk/pom.xml
projects/jboss-osgi/projects/bundles/microcontainer/trunk/src/main/java/org/jboss/osgi/microcontainer/internal/EmbeddedXMLDeployer.java
projects/jboss-osgi/projects/bundles/microcontainer/trunk/src/main/java/org/jboss/osgi/microcontainer/internal/MicrocontainerServiceImpl.java
projects/jboss-osgi/projects/bundles/microcontainer/trunk/src/main/resources/META-INF/base-deployers-beans.xml
projects/jboss-osgi/projects/bundles/microcontainer/trunk/src/test/resources/jboss-osgi-framework.properties
projects/jboss-osgi/projects/runtime/equinox/trunk/pom.xml
projects/jboss-osgi/projects/runtime/felix/trunk/pom.xml
projects/jboss-osgi/projects/spi/trunk/src/main/java/org/jboss/osgi/spi/util/BundleClassLoader.java
Log:
MC bundle delegates to UnmarshallerService
Modified: projects/jboss-osgi/projects/bundles/jboss-xml-binding/trunk/pom.xml
===================================================================
--- projects/jboss-osgi/projects/bundles/jboss-xml-binding/trunk/pom.xml 2009-11-27 13:47:59 UTC (rev 97107)
+++ projects/jboss-osgi/projects/bundles/jboss-xml-binding/trunk/pom.xml 2009-11-27 14:07:53 UTC (rev 97108)
@@ -39,7 +39,7 @@
<!-- Properties -->
<properties>
- <version.jboss.osgi.runtime.felix>2.0.0</version.jboss.osgi.runtime.felix>
+ <version.jboss.osgi.runtime.felix>2.0.2-SNAPSHOT</version.jboss.osgi.runtime.felix>
<version.jboss.xb>2.0.2.Beta3</version.jboss.xb>
<version.javassist>3.9.0.GA</version.javassist>
<version.jboss.osgi.common>1.0.4-SNAPSHOT</version.jboss.osgi.common>
@@ -149,7 +149,7 @@
<Bundle-ActivationPolicy>lazy</Bundle-ActivationPolicy>
<Embed-Transitive>true</Embed-Transitive>
<Export-Package>
- org.jboss.osgi.jbossxb;version=2.0.2
+ org.jboss.osgi.jbossxb;version=${version}
</Export-Package>
<Import-Package>
<!-- system -->
@@ -165,9 +165,9 @@
com.wutka.dtd,
org.apache.xerces.*,
org.jboss.logging,
- org.jboss.osgi.jaxb;version=2.0,
- org.jboss.osgi.spi.capability;version=1.0,
- org.jboss.osgi.spi.util;version=1.0,
+ org.jboss.osgi.jaxb;version="[2.1,2.2)",
+ org.jboss.osgi.spi.capability;version="[1.0,1.1)",
+ org.jboss.osgi.spi.util;version="[1.0,1.1)",
org.jboss.util*,
org.osgi.framework,
org.osgi.service.log,
@@ -182,7 +182,15 @@
jboss-reflect;inline=false,
</Embed-Dependency>
<_exportcontents>
- org.jboss.xb.annotations;version=2.0.2,
+ org.jboss.beans.info*;version=${version.jboss.reflect},
+ org.jboss.classadapter.spi*;version=${version.jboss.reflect},
+ org.jboss.config*;version=${version.jboss.reflect},
+ org.jboss.joinpoint*;version=${version.jboss.reflect},
+ org.jboss.reflect.plugins.introspection;version=${version.jboss.reflect},
+ org.jboss.reflect.spi*;version=${version.jboss.reflect},
+ org.jboss.xb.annotations;version=${version.jboss.xb},
+ org.jboss.xb.binding.sunday.unmarshalling;version=${version.jboss.xb},
+ org.jboss.xb.binding;version=${version.jboss.xb},
</_exportcontents>
</instructions>
</configuration>
@@ -268,7 +276,6 @@
</plugins>
</build>
-
<!-- Profiles -->
<profiles>
Modified: projects/jboss-osgi/projects/bundles/jboss-xml-binding/trunk/src/main/java/org/jboss/osgi/jbossxb/UnmarshallerService.java
===================================================================
--- projects/jboss-osgi/projects/bundles/jboss-xml-binding/trunk/src/main/java/org/jboss/osgi/jbossxb/UnmarshallerService.java 2009-11-27 13:47:59 UTC (rev 97107)
+++ projects/jboss-osgi/projects/bundles/jboss-xml-binding/trunk/src/main/java/org/jboss/osgi/jbossxb/UnmarshallerService.java 2009-11-27 14:07:53 UTC (rev 97108)
@@ -38,6 +38,8 @@
*/
public interface UnmarshallerService
{
+ void setFeature(String featureName, Boolean flag);
+
void setValidation(boolean validation);
void setNamespaceAware(boolean namespaces);
Modified: projects/jboss-osgi/projects/bundles/jboss-xml-binding/trunk/src/main/java/org/jboss/osgi/jbossxb/internal/UnmarshallerServiceImpl.java
===================================================================
--- projects/jboss-osgi/projects/bundles/jboss-xml-binding/trunk/src/main/java/org/jboss/osgi/jbossxb/internal/UnmarshallerServiceImpl.java 2009-11-27 13:47:59 UTC (rev 97107)
+++ projects/jboss-osgi/projects/bundles/jboss-xml-binding/trunk/src/main/java/org/jboss/osgi/jbossxb/internal/UnmarshallerServiceImpl.java 2009-11-27 14:07:53 UTC (rev 97108)
@@ -52,6 +52,7 @@
// Provide logging
private static Logger log = LoggerFactory.getLogger(UnmarshallerServiceImpl.class);
+ private UnmarshallerFactory factory;
private Unmarshaller unmarshaller;
private JBossEntityResolver entityResolver;
private DefaultSchemaResolver schemaBindingResolver;
@@ -59,16 +60,22 @@
public UnmarshallerServiceImpl(BundleContext context)
{
- unmarshaller = UnmarshallerFactory.newInstance().newUnmarshaller();
+ factory = UnmarshallerFactory.newInstance();
schemaBindingResolver = new DefaultSchemaResolver();
bundleLoader = BundleClassLoader.createClassLoader(context.getBundle());
+ log.debug("UnmarshallerService using: " + bundleLoader);
}
+ public void setFeature(String featureName, Boolean flag)
+ {
+ factory.setFeature(featureName, flag);
+ }
+
public void setNamespaceAware(boolean namespaces)
{
try
{
- unmarshaller.setNamespaceAware(namespaces);
+ getUnmarshaller().setNamespaceAware(namespaces);
}
catch (JBossXBException ex)
{
@@ -80,7 +87,7 @@
{
try
{
- unmarshaller.setSchemaValidation(validation);
+ getUnmarshaller().setSchemaValidation(validation);
}
catch (JBossXBException ex)
{
@@ -92,7 +99,7 @@
{
try
{
- unmarshaller.setValidation(validation);
+ getUnmarshaller().setValidation(validation);
}
catch (JBossXBException ex)
{
@@ -102,7 +109,7 @@
public void setErrorHandler(ErrorHandler errorHandler)
{
- unmarshaller.setErrorHandler(errorHandler);
+ getUnmarshaller().setErrorHandler(errorHandler);
}
public void registerSchemaLocation(String id, String dtdOrSchema)
@@ -112,7 +119,7 @@
try
{
entityResolver = new JBossEntityResolver();
- unmarshaller.setEntityResolver(entityResolver);
+ getUnmarshaller().setEntityResolver(entityResolver);
}
catch (JBossXBException ex)
{
@@ -153,7 +160,7 @@
try
{
Thread.currentThread().setContextClassLoader(bundleLoader);
- return unmarshaller.unmarshal(xmlReader, schemaBindingResolver);
+ return getUnmarshaller().unmarshal(xmlReader, schemaBindingResolver);
}
catch (JBossXBException ex)
{
@@ -173,7 +180,7 @@
try
{
Thread.currentThread().setContextClassLoader(bundleLoader);
- return unmarshaller.unmarshal(xmlStream, schemaBindingResolver);
+ return getUnmarshaller().unmarshal(xmlStream, schemaBindingResolver);
}
catch (JBossXBException ex)
{
@@ -193,7 +200,7 @@
try
{
Thread.currentThread().setContextClassLoader(bundleLoader);
- return unmarshaller.unmarshal(source, schemaBindingResolver);
+ return getUnmarshaller().unmarshal(source, schemaBindingResolver);
}
catch (JBossXBException ex)
{
@@ -213,7 +220,7 @@
try
{
Thread.currentThread().setContextClassLoader(bundleLoader);
- return unmarshaller.unmarshal(xml, schemaBindingResolver);
+ return getUnmarshaller().unmarshal(xml, schemaBindingResolver);
}
catch (JBossXBException ex)
{
@@ -226,4 +233,11 @@
Thread.currentThread().setContextClassLoader(ctxLoader);
}
}
+
+ private Unmarshaller getUnmarshaller()
+ {
+ if (unmarshaller == null)
+ unmarshaller = factory.newUnmarshaller();
+ return unmarshaller;
+ }
}
\ No newline at end of file
Added: projects/jboss-osgi/projects/bundles/jboss-xml-binding/trunk/src/test/resources/META-INF/services/org.jboss.osgi.spi.framework.OSGiBootstrapProvider
===================================================================
--- projects/jboss-osgi/projects/bundles/jboss-xml-binding/trunk/src/test/resources/META-INF/services/org.jboss.osgi.spi.framework.OSGiBootstrapProvider (rev 0)
+++ projects/jboss-osgi/projects/bundles/jboss-xml-binding/trunk/src/test/resources/META-INF/services/org.jboss.osgi.spi.framework.OSGiBootstrapProvider 2009-11-27 14:07:53 UTC (rev 97108)
@@ -0,0 +1 @@
+org.jboss.osgi.felix.FelixBootstrapProvider # The Felix bootstrap provider
\ No newline at end of file
Modified: projects/jboss-osgi/projects/bundles/microcontainer/trunk/pom.xml
===================================================================
--- projects/jboss-osgi/projects/bundles/microcontainer/trunk/pom.xml 2009-11-27 13:47:59 UTC (rev 97107)
+++ projects/jboss-osgi/projects/bundles/microcontainer/trunk/pom.xml 2009-11-27 14:07:53 UTC (rev 97108)
@@ -39,7 +39,7 @@
<!-- Properties -->
<properties>
- <version.jboss.osgi.runtime.felix>2.0.0</version.jboss.osgi.runtime.felix>
+ <version.jboss.osgi.runtime.felix>2.0.2-SNAPSHOT</version.jboss.osgi.runtime.felix>
<version.jboss.deployers>2.0.5.SP1</version.jboss.deployers>
<version.jboss.microcontainer>2.0.9.GA</version.jboss.microcontainer>
<version.jboss.osgi.common>1.0.4-SNAPSHOT</version.jboss.osgi.common>
@@ -51,7 +51,6 @@
<version.jboss.osgi.runtime.deployers>1.0.3</version.jboss.osgi.runtime.deployers>
<version.jboss.osgi.spi>1.0.3-SNAPSHOT</version.jboss.osgi.spi>
<version.jboss.osgi.xml.binding>2.0.2-SNAPSHOT</version.jboss.osgi.xml.binding>
- <version.jboss.reflect>2.0.2.GA</version.jboss.reflect>
<version.osgi>4.2.0</version.osgi>
</properties>
@@ -77,6 +76,10 @@
<groupId>org.jboss</groupId>
<artifactId>jboss-common-core</artifactId>
</exclusion>
+ <exclusion>
+ <groupId>org.jboss</groupId>
+ <artifactId>jbossxb</artifactId>
+ </exclusion>
</exclusions>
</dependency>
<dependency>
@@ -226,14 +229,12 @@
jboss-metatype;inline=false,
jboss-mdr;inline=false,
jboss-osgi-deployers;inline=false,
- jboss-reflect;inline=false,
jboss-kernel;inline=false,
</Embed-Dependency>
<_exportcontents>
org.jboss.beans.metadata*;version=2.0.9,
org.jboss.dependency.spi*;version=2.0.9,
org.jboss.kernel.spi*;version=2.0.9,
- org.jboss.reflect.spi;version=2.0.2,
</_exportcontents>
</instructions>
</configuration>
@@ -270,9 +271,9 @@
<configuration>
<tasks>
<property name="maven.runtime.classpath" refid="maven.runtime.classpath" />
- <property name="artifactId" value="${artifactId}" />
<property name="tests.output.dir" value="${project.build.directory}" />
<property name="build.artifact" value="${project.build.finalName}" />
+ <property name="artifactId" value="${artifactId}" />
<ant antfile="scripts/antrun-test-jars.xml" />
</tasks>
</configuration>
@@ -319,4 +320,25 @@
</plugins>
</build>
+ <!-- Profiles -->
+ <profiles>
+
+ <!--
+ Name: jpda
+ Descr: Enable JPDA remote debuging
+ -->
+ <profile>
+ <id>jpda</id>
+ <activation>
+ <property>
+ <name>jpda</name>
+ </property>
+ </activation>
+ <properties>
+ <surefire.jpda.args>-Xrunjdwp:transport=dt_socket,address=8787,server=y,suspend=y</surefire.jpda.args>
+ </properties>
+ </profile>
+
+ </profiles>
+
</project>
Added: projects/jboss-osgi/projects/bundles/microcontainer/trunk/src/main/java/org/jboss/osgi/microcontainer/internal/EmbeddedBeanDeployer.java
===================================================================
--- projects/jboss-osgi/projects/bundles/microcontainer/trunk/src/main/java/org/jboss/osgi/microcontainer/internal/EmbeddedBeanDeployer.java (rev 0)
+++ projects/jboss-osgi/projects/bundles/microcontainer/trunk/src/main/java/org/jboss/osgi/microcontainer/internal/EmbeddedBeanDeployer.java 2009-11-27 14:07:53 UTC (rev 97108)
@@ -0,0 +1,161 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2006, 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.microcontainer.internal;
+
+// $Id$
+
+import org.jboss.deployers.vfs.deployer.kernel.BeanDeployer;
+import org.jboss.deployers.vfs.spi.deployer.JBossXBDeployerHelper;
+import org.jboss.kernel.spi.deployment.KernelDeployment;
+import org.jboss.osgi.jbossxb.UnmarshallerService;
+import org.jboss.osgi.spi.NotImplementedException;
+import org.jboss.virtual.VirtualFile;
+import org.jboss.xb.binding.ObjectModelFactory;
+import org.jboss.xb.binding.sunday.unmarshalling.DefaultSchemaResolver;
+import org.osgi.framework.BundleContext;
+import org.osgi.framework.ServiceReference;
+
+/**
+ * A {@link BeanDeployer} that that delegates to the {@link UnmarshallerService}.
+ *
+ * @author thomas.diesler(a)jboss.com
+ * @since 30-Jun-2009
+ */
+public class EmbeddedBeanDeployer extends BeanDeployer
+{
+ private BundleContext systemContext;
+
+ public void setSystemContext(BundleContext systemContext)
+ {
+ this.systemContext = systemContext;
+ }
+
+ static UnmarshallerService getUnmarshallerService(BundleContext context)
+ {
+ ServiceReference sref = context.getServiceReference(UnmarshallerService.class.getName());
+ if (sref == null)
+ throw new IllegalStateException("Cannot obtain: " + UnmarshallerService.class.getName());
+
+ UnmarshallerService unmarshaller = (UnmarshallerService)context.getService(sref);
+ unmarshaller.addClassBinding("urn:jboss:aop-beans:1.0", "org.jboss.aop.microcontainer.beans.metadata.AOPDeployment");
+ unmarshaller.addClassBinding("urn:jboss:bean-deployer", "org.jboss.kernel.plugins.deployment.AbstractKernelDeployment10");
+ unmarshaller.addClassBinding("urn:jboss:bean-deployer:2.0", "org.jboss.kernel.plugins.deployment.AbstractKernelDeployment");
+ unmarshaller.addClassBinding("urn:jboss:javabean:1.0", "org.jboss.javabean.plugins.jaxb.JavaBean10");
+ unmarshaller.addClassBinding("urn:jboss:javabean:2.0", "org.jboss.javabean.plugins.jaxb.JavaBean20");
+ unmarshaller.addClassBinding("urn:jboss:policy:1.0", "org.jboss.beans.metadata.plugins.policy.AbstractPolicyMetaData");
+ unmarshaller.addClassBinding("urn:jboss:classloading:1.0", "org.jboss.classloading.spi.metadata.ClassLoadingMetaData10");
+ unmarshaller.addClassBinding("urn:jboss:classloader:1.0", "org.jboss.classloading.spi.vfs.metadata.VFSClassLoaderFactory10");
+ unmarshaller.addClassBinding("urn:jboss:deployers:2.0", "org.jboss.deployers.vfs.plugins.xb.SchemaResolverDeployerMetaData");
+
+ return unmarshaller;
+ }
+
+ @Override
+ protected JBossXBDeployerHelper<KernelDeployment> getHelper()
+ {
+ return new EmbeddedDeployerHelper<KernelDeployment>(getOutput());
+ }
+
+ class EmbeddedDeployerHelper<T> extends JBossXBDeployerHelper<T>
+ {
+ protected EmbeddedDeployerHelper(Class<T> output)
+ {
+ super(output);
+ }
+
+ @Override
+ public void setFeature(String featureName, Boolean flag) throws Exception
+ {
+ UnmarshallerService unmarshaller = getUnmarshallerService(systemContext);
+ unmarshaller.setFeature(featureName, flag);
+ }
+
+ @Override
+ @SuppressWarnings("unchecked")
+ public T parse(VirtualFile file) throws Exception
+ {
+ UnmarshallerService unmarshaller = getUnmarshallerService(systemContext);
+ return (T)unmarshaller.unmarshal(file.openStream());
+ }
+
+ // Below are the methods that are not (yet) implemented
+ @Override
+ public <U> U parse(Class<U> expectedType, VirtualFile file, U root, ObjectModelFactory omf) throws Exception
+ {
+ throw new NotImplementedException();
+ }
+
+ @Override
+ public <U> U parse(Class<U> expectedType, VirtualFile file) throws Exception
+ {
+ throw new NotImplementedException();
+ }
+
+ @Override
+ public T parse(VirtualFile file, T root, ObjectModelFactory omf) throws Exception
+ {
+ throw new NotImplementedException();
+ }
+
+ @Override
+ public void addTypeBinding(String namespace, Class<?> metadata)
+ {
+ throw new NotImplementedException();
+ }
+
+ @Override
+ public DefaultSchemaResolver getResolver()
+ {
+ throw new NotImplementedException();
+ }
+
+ @Override
+ public boolean isUseSchemaValidation()
+ {
+ throw new NotImplementedException();
+ }
+
+ @Override
+ public boolean isUseValidation()
+ {
+ throw new NotImplementedException();
+ }
+
+ @Override
+ public void removeTypeBinding(String namespace)
+ {
+ throw new NotImplementedException();
+ }
+
+ @Override
+ public void setUseSchemaValidation(boolean useSchemaValidation)
+ {
+ throw new NotImplementedException();
+ }
+
+ @Override
+ public void setUseValidation(boolean useValidation)
+ {
+ throw new NotImplementedException();
+ }
+ }
+}
Property changes on: projects/jboss-osgi/projects/bundles/microcontainer/trunk/src/main/java/org/jboss/osgi/microcontainer/internal/EmbeddedBeanDeployer.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Modified: projects/jboss-osgi/projects/bundles/microcontainer/trunk/src/main/java/org/jboss/osgi/microcontainer/internal/EmbeddedXMLDeployer.java
===================================================================
--- projects/jboss-osgi/projects/bundles/microcontainer/trunk/src/main/java/org/jboss/osgi/microcontainer/internal/EmbeddedXMLDeployer.java 2009-11-27 13:47:59 UTC (rev 97107)
+++ projects/jboss-osgi/projects/bundles/microcontainer/trunk/src/main/java/org/jboss/osgi/microcontainer/internal/EmbeddedXMLDeployer.java 2009-11-27 14:07:53 UTC (rev 97108)
@@ -35,7 +35,6 @@
import org.jboss.logging.Logger;
import org.jboss.osgi.jbossxb.UnmarshallerService;
import org.osgi.framework.BundleContext;
-import org.osgi.framework.ServiceReference;
/**
* An XML deployer that unlike the {@link BasicXMLDeployer} does not cache
@@ -134,21 +133,7 @@
long start = System.currentTimeMillis();
- ServiceReference sref = context.getServiceReference(UnmarshallerService.class.getName());
- if (sref == null)
- throw new IllegalStateException("Cannot obtain: " + UnmarshallerService.class.getName());
-
- UnmarshallerService unmarshaller = (UnmarshallerService)context.getService(sref);
- unmarshaller.addClassBinding("urn:jboss:aop-beans:1.0", "org.jboss.aop.microcontainer.beans.metadata.AOPDeployment");
- unmarshaller.addClassBinding("urn:jboss:bean-deployer", "org.jboss.kernel.plugins.deployment.AbstractKernelDeployment10");
- unmarshaller.addClassBinding("urn:jboss:bean-deployer:2.0", "org.jboss.kernel.plugins.deployment.AbstractKernelDeployment");
- unmarshaller.addClassBinding("urn:jboss:javabean:1.0", "org.jboss.javabean.plugins.jaxb.JavaBean10");
- unmarshaller.addClassBinding("urn:jboss:javabean:2.0", "org.jboss.javabean.plugins.jaxb.JavaBean20");
- unmarshaller.addClassBinding("urn:jboss:policy:1.0", "org.jboss.beans.metadata.plugins.policy.AbstractPolicyMetaData");
- unmarshaller.addClassBinding("urn:jboss:classloading:1.0", "org.jboss.classloading.spi.metadata.ClassLoadingMetaData10");
- unmarshaller.addClassBinding("urn:jboss:classloader:1.0", "org.jboss.classloading.spi.vfs.metadata.VFSClassLoaderFactory10");
- unmarshaller.addClassBinding("urn:jboss:deployers:2.0", "org.jboss.deployers.vfs.plugins.xb.SchemaResolverDeployerMetaData");
-
+ UnmarshallerService unmarshaller = EmbeddedBeanDeployer.getUnmarshallerService(context);
KernelDeployment deployment = (KernelDeployment)unmarshaller.unmarshal(url.toString());
if (deployment == null)
throw new RuntimeException("The xml " + url + " is not well formed!");
Modified: projects/jboss-osgi/projects/bundles/microcontainer/trunk/src/main/java/org/jboss/osgi/microcontainer/internal/MicrocontainerServiceImpl.java
===================================================================
--- projects/jboss-osgi/projects/bundles/microcontainer/trunk/src/main/java/org/jboss/osgi/microcontainer/internal/MicrocontainerServiceImpl.java 2009-11-27 13:47:59 UTC (rev 97107)
+++ projects/jboss-osgi/projects/bundles/microcontainer/trunk/src/main/java/org/jboss/osgi/microcontainer/internal/MicrocontainerServiceImpl.java 2009-11-27 14:07:53 UTC (rev 97108)
@@ -23,17 +23,24 @@
//$Id$
+import static org.osgi.framework.Constants.OBJECTCLASS;
+
import java.net.URL;
+import java.util.Arrays;
+import java.util.List;
import javax.management.MBeanServer;
import org.jboss.kernel.Kernel;
import org.jboss.kernel.spi.dependency.KernelController;
+import org.jboss.osgi.jbossxb.UnmarshallerService;
import org.jboss.osgi.microcontainer.AbstractMicrocontainerService;
import org.jboss.osgi.spi.management.MicrocontainerServiceMBean;
import org.jboss.osgi.spi.service.MicrocontainerService;
import org.jboss.virtual.VFS;
import org.osgi.framework.BundleContext;
+import org.osgi.framework.Filter;
+import org.osgi.framework.InvalidSyntaxException;
import org.osgi.framework.ServiceReference;
import org.osgi.util.tracker.ServiceTracker;
@@ -75,28 +82,54 @@
installBean(controller, BEAN_KERNEL, kernel);
installBean(controller, BEAN_KERNEL_CONTROLLER, controller);
+ // Setup a filter to track both services
+ Filter filter;
+ try
+ {
+ String jmxService = "(" + OBJECTCLASS + "=" + MBeanServer.class.getName() + ")";
+ String xmlService = "(" + OBJECTCLASS + "=" + UnmarshallerService.class.getName() + ")";
+ filter = context.createFilter("(|" + jmxService + xmlService + ")");
+ }
+ catch (InvalidSyntaxException ex)
+ {
+ throw new IllegalArgumentException("Invalid filter syntax");
+ }
+
// Register the MicrocontainerServiceMBean
- ServiceTracker tracker = new ServiceTracker(context, MBeanServer.class.getName(), null)
+ ServiceTracker tracker = new ServiceTracker(context, filter, null)
{
+ UnmarshallerService xmlService;
+ MBeanServer mbeanServer;
+
@Override
public Object addingService(ServiceReference sref)
{
- MBeanServer mbeanServer = (MBeanServer)super.addingService(sref);
+ Object service = super.addingService(sref);
+
+ List<String> classList = Arrays.asList((String[])sref.getProperty(OBJECTCLASS));
+ if (classList.contains(MBeanServer.class.getName()))
+ mbeanServer = (MBeanServer)service;
- // Install the MBeanServer
- installBean(controller, BEAN_MBEAN_SERVER, mbeanServer);
+ if (classList.contains(UnmarshallerService.class.getName()))
+ xmlService = (UnmarshallerService)service;
- // Deploy the deployer beans
- URL deployersURL = context.getBundle().getResource("META-INF/base-deployers-beans.xml");
- deployer.deploy(deployersURL);
+ if (mbeanServer != null && xmlService != null)
+ {
+ // Install the MBeanServer
+ installBean(controller, BEAN_MBEAN_SERVER, mbeanServer);
- // Register the MicrocontainerService
- context.registerService(MicrocontainerService.class.getName(), mcServiceImpl, null);
+ // Deploy the deployer beans
+ URL deployersURL = context.getBundle().getResource("META-INF/base-deployers-beans.xml");
+ deployer.deploy(deployersURL);
- // Register the MicrocontainerServiceMBean
- registerMicrocontainerServiceMBean(mbeanServer);
+ // Register the MicrocontainerService
+ context.registerService(MicrocontainerService.class.getName(), mcServiceImpl, null);
- return mbeanServer;
+ // Register the MicrocontainerServiceMBean
+ registerMicrocontainerServiceMBean(mbeanServer);
+ }
+
+ return service;
}
};
tracker.open();
Modified: projects/jboss-osgi/projects/bundles/microcontainer/trunk/src/main/resources/META-INF/base-deployers-beans.xml
===================================================================
--- projects/jboss-osgi/projects/bundles/microcontainer/trunk/src/main/resources/META-INF/base-deployers-beans.xml 2009-11-27 13:47:59 UTC (rev 97107)
+++ projects/jboss-osgi/projects/bundles/microcontainer/trunk/src/main/resources/META-INF/base-deployers-beans.xml 2009-11-27 14:07:53 UTC (rev 97108)
@@ -52,6 +52,7 @@
<!-- POJO Deployment -->
<bean name="BeanDeployer" class="org.jboss.osgi.microcontainer.internal.EmbeddedBeanDeployer">
+ <property name="systemContext"><inject bean="jboss.osgi:service=BundleContext" /></property>
<property name="suffix">jboss-beans.xml</property>
</bean>
<bean name="KernelDeploymentDeployer" class="org.jboss.osgi.deployer.BundleContainedBeansDeployer">
Added: projects/jboss-osgi/projects/bundles/microcontainer/trunk/src/test/resources/META-INF/services/org.jboss.osgi.spi.framework.OSGiBootstrapProvider
===================================================================
--- projects/jboss-osgi/projects/bundles/microcontainer/trunk/src/test/resources/META-INF/services/org.jboss.osgi.spi.framework.OSGiBootstrapProvider (rev 0)
+++ projects/jboss-osgi/projects/bundles/microcontainer/trunk/src/test/resources/META-INF/services/org.jboss.osgi.spi.framework.OSGiBootstrapProvider 2009-11-27 14:07:53 UTC (rev 97108)
@@ -0,0 +1 @@
+org.jboss.osgi.felix.FelixBootstrapProvider # The Felix bootstrap provider
\ No newline at end of file
Modified: projects/jboss-osgi/projects/bundles/microcontainer/trunk/src/test/resources/jboss-osgi-framework.properties
===================================================================
--- projects/jboss-osgi/projects/bundles/microcontainer/trunk/src/test/resources/jboss-osgi-framework.properties 2009-11-27 13:47:59 UTC (rev 97107)
+++ projects/jboss-osgi/projects/bundles/microcontainer/trunk/src/test/resources/jboss-osgi-framework.properties 2009-11-27 14:07:53 UTC (rev 97108)
@@ -4,12 +4,15 @@
# $Id: jboss-osgi-framework.properties 97021 2009-11-26 12:40:11Z thomas.diesler(a)jboss.com $
#
+# Felix config properties
+felix.bootdelegation.implicit=false
+
# Properties to configure the Framework
org.osgi.framework.storage=${test.archive.directory}/../osgi-store
org.osgi.framework.storage.clean=onFirstInit
# Framework bootdelegation
-# org.osgi.framework.bootdelegation=
+org.osgi.framework.bootdelegation=sun.reflect
# Extra System Packages
org.osgi.framework.system.packages.extra=\
@@ -36,5 +39,5 @@
file://${test.archive.directory}/bundles/org.osgi.compendium.jar
# Bundles that need to be started automatically
-#org.jboss.osgi.spi.framework.autoStart=\
-# file://${test.archive.directory}/bundles/jboss-osgi-common.jar
+org.jboss.osgi.spi.framework.autoStart=\
+ file://${test.archive.directory}/bundles/jboss-osgi-common.jar
Modified: projects/jboss-osgi/projects/runtime/equinox/trunk/pom.xml
===================================================================
--- projects/jboss-osgi/projects/runtime/equinox/trunk/pom.xml 2009-11-27 13:47:59 UTC (rev 97107)
+++ projects/jboss-osgi/projects/runtime/equinox/trunk/pom.xml 2009-11-27 14:07:53 UTC (rev 97108)
@@ -40,8 +40,8 @@
<properties>
<version.eclipse.equinox>3.5.1</version.eclipse.equinox>
<version.jboss.osgi.deployment>1.0.0</version.jboss.osgi.deployment>
- <version.jboss.osgi.husky>1.0.2</version.jboss.osgi.husky>
- <version.jboss.osgi.spi>1.0.3</version.jboss.osgi.spi>
+ <version.jboss.osgi.husky>1.0.2-SNAPSHOT</version.jboss.osgi.husky>
+ <version.jboss.osgi.spi>1.0.3-SNAPSHOT</version.jboss.osgi.spi>
</properties>
<!-- Dependencies -->
Modified: projects/jboss-osgi/projects/runtime/felix/trunk/pom.xml
===================================================================
--- projects/jboss-osgi/projects/runtime/felix/trunk/pom.xml 2009-11-27 13:47:59 UTC (rev 97107)
+++ projects/jboss-osgi/projects/runtime/felix/trunk/pom.xml 2009-11-27 14:07:53 UTC (rev 97108)
@@ -39,8 +39,8 @@
<properties>
<version.felix.framework>2.0.2</version.felix.framework>
<version.jboss.osgi.deployment>1.0.0</version.jboss.osgi.deployment>
- <version.jboss.osgi.husky>1.0.2</version.jboss.osgi.husky>
- <version.jboss.osgi.spi>1.0.3</version.jboss.osgi.spi>
+ <version.jboss.osgi.husky>1.0.2-SNAPSHOT</version.jboss.osgi.husky>
+ <version.jboss.osgi.spi>1.0.3-SNAPSHOT</version.jboss.osgi.spi>
<version.osgi>4.2.0</version.osgi>
</properties>
Modified: projects/jboss-osgi/projects/spi/trunk/src/main/java/org/jboss/osgi/spi/util/BundleClassLoader.java
===================================================================
--- projects/jboss-osgi/projects/spi/trunk/src/main/java/org/jboss/osgi/spi/util/BundleClassLoader.java 2009-11-27 13:47:59 UTC (rev 97107)
+++ projects/jboss-osgi/projects/spi/trunk/src/main/java/org/jboss/osgi/spi/util/BundleClassLoader.java 2009-11-27 14:07:53 UTC (rev 97108)
@@ -27,11 +27,9 @@
import java.net.URL;
import java.security.AccessController;
import java.security.PrivilegedAction;
-import java.util.Dictionary;
import java.util.Enumeration;
import org.osgi.framework.Bundle;
-import org.osgi.framework.Constants;
/**
* A BundleClassLoader delegates all classloading concerns to the underlying Bundle.
@@ -108,8 +106,7 @@
public String toString()
{
- Dictionary<?, ?> headers = bundle.getHeaders();
- String bundleId = bundle.getSymbolicName() + ":" + headers.get(Constants.BUNDLE_VERSION);
- return "BundleClassLoader for [" + bundleId + "]";
+ String shortName = bundle.getSymbolicName() + "-" + bundle.getVersion();
+ return "BundleClassLoader[id=" + bundle.getBundleId() + "," + shortName + "]";
}
}
14 years, 6 months
JBoss-OSGI SVN: r97055 - in projects/jboss-osgi/projects/bundles: jboss-xml-binding/trunk/src/main/java/org/jboss/osgi/jbossxb and 3 other directories.
by jboss-osgi-commits@lists.jboss.org
Author: thomas.diesler(a)jboss.com
Date: 2009-11-26 19:15:10 -0500 (Thu, 26 Nov 2009)
New Revision: 97055
Removed:
projects/jboss-osgi/projects/bundles/microcontainer/trunk/src/main/java/org/jboss/osgi/microcontainer/internal/EmbeddedBeanDeployer.java
projects/jboss-osgi/projects/bundles/microcontainer/trunk/src/main/java/org/jboss/osgi/microcontainer/internal/EmbeddedSchemaResolverFactory.java
Modified:
projects/jboss-osgi/projects/bundles/jboss-xml-binding/trunk/scripts/assembly-bundles.xml
projects/jboss-osgi/projects/bundles/jboss-xml-binding/trunk/src/main/java/org/jboss/osgi/jbossxb/UnmarshallerService.java
projects/jboss-osgi/projects/bundles/jboss-xml-binding/trunk/src/main/java/org/jboss/osgi/jbossxb/internal/UnmarshallerServiceImpl.java
projects/jboss-osgi/projects/bundles/microcontainer/trunk/pom.xml
projects/jboss-osgi/projects/bundles/microcontainer/trunk/src/main/java/org/jboss/osgi/microcontainer/internal/EmbeddedKernelBootstrap.java
projects/jboss-osgi/projects/bundles/microcontainer/trunk/src/main/java/org/jboss/osgi/microcontainer/internal/EmbeddedXMLDeployer.java
Log:
WIP
Modified: projects/jboss-osgi/projects/bundles/jboss-xml-binding/trunk/scripts/assembly-bundles.xml
===================================================================
--- projects/jboss-osgi/projects/bundles/jboss-xml-binding/trunk/scripts/assembly-bundles.xml 2009-11-27 00:13:39 UTC (rev 97054)
+++ projects/jboss-osgi/projects/bundles/jboss-xml-binding/trunk/scripts/assembly-bundles.xml 2009-11-27 00:15:10 UTC (rev 97055)
@@ -16,6 +16,7 @@
<outputFileNameMapping>${artifact.artifactId}${dashClassifier?}.${artifact.extension}</outputFileNameMapping>
<includes>
<include>*:jboss-osgi-apache-xerces:jar</include>
+ <include>*:jboss-osgi-common:jar</include>
<include>*:jboss-osgi-common-core:jar</include>
<include>*:jboss-osgi-husky:jar</include>
<include>*:jboss-osgi-jaxb:jar</include>
Modified: projects/jboss-osgi/projects/bundles/jboss-xml-binding/trunk/src/main/java/org/jboss/osgi/jbossxb/UnmarshallerService.java
===================================================================
--- projects/jboss-osgi/projects/bundles/jboss-xml-binding/trunk/src/main/java/org/jboss/osgi/jbossxb/UnmarshallerService.java 2009-11-27 00:13:39 UTC (rev 97054)
+++ projects/jboss-osgi/projects/bundles/jboss-xml-binding/trunk/src/main/java/org/jboss/osgi/jbossxb/UnmarshallerService.java 2009-11-27 00:15:10 UTC (rev 97055)
@@ -46,15 +46,10 @@
void setErrorHandler(ErrorHandler errorHandler);
- /**
- * Register the mapping from the public id/system id to the dtd/xsd file
- * name. This overwrites any existing mapping.
- *
- * @param id the DOCTYPE public id or system id such as "-//Sun Microsystems, Inc.//DTD Enterprise JavaBeans 1.1//EN"
- * @param dtdOrSchema the simple dtd/xsd file name, "ejb-jar.dtd"
- */
void registerSchemaLocation(String id, String dtdOrSchema);
+ void addClassBinding(String nsUri, String className);
+
void addClassBinding(String nsUri, Class<?> clazz);
Object unmarshal(Reader xmlReader) throws IOException;
Modified: projects/jboss-osgi/projects/bundles/jboss-xml-binding/trunk/src/main/java/org/jboss/osgi/jbossxb/internal/UnmarshallerServiceImpl.java
===================================================================
--- projects/jboss-osgi/projects/bundles/jboss-xml-binding/trunk/src/main/java/org/jboss/osgi/jbossxb/internal/UnmarshallerServiceImpl.java 2009-11-27 00:13:39 UTC (rev 97054)
+++ projects/jboss-osgi/projects/bundles/jboss-xml-binding/trunk/src/main/java/org/jboss/osgi/jbossxb/internal/UnmarshallerServiceImpl.java 2009-11-27 00:15:10 UTC (rev 97055)
@@ -52,16 +52,16 @@
// Provide logging
private static Logger log = LoggerFactory.getLogger(UnmarshallerServiceImpl.class);
- private BundleContext context;
private Unmarshaller unmarshaller;
private JBossEntityResolver entityResolver;
private DefaultSchemaResolver schemaBindingResolver;
+ private BundleClassLoader bundleLoader;
public UnmarshallerServiceImpl(BundleContext context)
{
- this.context = context;
unmarshaller = UnmarshallerFactory.newInstance().newUnmarshaller();
schemaBindingResolver = new DefaultSchemaResolver();
+ bundleLoader = BundleClassLoader.createClassLoader(context.getBundle());
}
public void setNamespaceAware(boolean namespaces)
@@ -99,7 +99,7 @@
throw new IllegalStateException(ex);
}
}
-
+
public void setErrorHandler(ErrorHandler errorHandler)
{
unmarshaller.setErrorHandler(errorHandler);
@@ -120,8 +120,28 @@
}
}
entityResolver.registerLocalEntity(id, dtdOrSchema);
+ log.debug("Register [" + id + "=" + dtdOrSchema + "]");
}
+ public void addClassBinding(String nsUri, String className)
+ {
+ ClassLoader ctxLoader = Thread.currentThread().getContextClassLoader();
+ try
+ {
+ Thread.currentThread().setContextClassLoader(bundleLoader);
+ schemaBindingResolver.addClassBinding(nsUri, className);
+ log.debug("Add mapping of '" + nsUri + "' to " + className);
+ }
+ catch (ClassNotFoundException ex)
+ {
+ log.debug("Ignore mapping of '" + nsUri + "' to " + className);
+ }
+ finally
+ {
+ Thread.currentThread().setContextClassLoader(ctxLoader);
+ }
+ }
+
public void addClassBinding(String nsUri, Class<?> clazz)
{
schemaBindingResolver.addClassBinding(nsUri, clazz);
@@ -129,8 +149,10 @@
public Object unmarshal(Reader xmlReader) throws IOException
{
+ ClassLoader ctxLoader = Thread.currentThread().getContextClassLoader();
try
{
+ Thread.currentThread().setContextClassLoader(bundleLoader);
return unmarshaller.unmarshal(xmlReader, schemaBindingResolver);
}
catch (JBossXBException ex)
@@ -139,12 +161,18 @@
ioex.initCause(ex);
throw ioex;
}
+ finally
+ {
+ Thread.currentThread().setContextClassLoader(ctxLoader);
+ }
}
public Object unmarshal(InputStream xmlStream) throws IOException
{
+ ClassLoader ctxLoader = Thread.currentThread().getContextClassLoader();
try
{
+ Thread.currentThread().setContextClassLoader(bundleLoader);
return unmarshaller.unmarshal(xmlStream, schemaBindingResolver);
}
catch (JBossXBException ex)
@@ -153,12 +181,18 @@
ioex.initCause(ex);
throw ioex;
}
+ finally
+ {
+ Thread.currentThread().setContextClassLoader(ctxLoader);
+ }
}
public Object unmarshal(InputSource source) throws IOException
{
+ ClassLoader ctxLoader = Thread.currentThread().getContextClassLoader();
try
{
+ Thread.currentThread().setContextClassLoader(bundleLoader);
return unmarshaller.unmarshal(source, schemaBindingResolver);
}
catch (JBossXBException ex)
@@ -167,6 +201,10 @@
ioex.initCause(ex);
throw ioex;
}
+ finally
+ {
+ Thread.currentThread().setContextClassLoader(ctxLoader);
+ }
}
public Object unmarshal(String xml) throws IOException
@@ -174,7 +212,6 @@
ClassLoader ctxLoader = Thread.currentThread().getContextClassLoader();
try
{
- BundleClassLoader bundleLoader = BundleClassLoader.createClassLoader(context.getBundle());
Thread.currentThread().setContextClassLoader(bundleLoader);
return unmarshaller.unmarshal(xml, schemaBindingResolver);
}
Modified: projects/jboss-osgi/projects/bundles/microcontainer/trunk/pom.xml
===================================================================
--- projects/jboss-osgi/projects/bundles/microcontainer/trunk/pom.xml 2009-11-27 00:13:39 UTC (rev 97054)
+++ projects/jboss-osgi/projects/bundles/microcontainer/trunk/pom.xml 2009-11-27 00:15:10 UTC (rev 97055)
@@ -40,7 +40,6 @@
<!-- Properties -->
<properties>
<version.jboss.osgi.runtime.felix>2.0.0</version.jboss.osgi.runtime.felix>
- <version.javassist>3.9.0.GA</version.javassist>
<version.jboss.deployers>2.0.5.SP1</version.jboss.deployers>
<version.jboss.microcontainer>2.0.9.GA</version.jboss.microcontainer>
<version.jboss.osgi.common>1.0.4-SNAPSHOT</version.jboss.osgi.common>
@@ -53,18 +52,12 @@
<version.jboss.osgi.spi>1.0.3-SNAPSHOT</version.jboss.osgi.spi>
<version.jboss.osgi.xml.binding>2.0.2-SNAPSHOT</version.jboss.osgi.xml.binding>
<version.jboss.reflect>2.0.2.GA</version.jboss.reflect>
- <version.jboss.xb>2.0.2.Beta3</version.jboss.xb>
<version.osgi>4.2.0</version.osgi>
</properties>
<!-- Dependencies -->
<dependencies>
<dependency>
- <groupId>javassist</groupId>
- <artifactId>javassist</artifactId>
- <version>${version.javassist}</version>
- </dependency>
- <dependency>
<groupId>org.jboss.deployers</groupId>
<artifactId>jboss-deployers-vfs</artifactId>
<version>${version.jboss.deployers}</version>
@@ -87,17 +80,6 @@
</exclusions>
</dependency>
<dependency>
- <groupId>org.jboss</groupId>
- <artifactId>jbossxb</artifactId>
- <version>${version.jboss.xb}</version>
- <exclusions>
- <exclusion>
- <groupId>org.jboss</groupId>
- <artifactId>jboss-common-core</artifactId>
- </exclusion>
- </exclusions>
- </dependency>
- <dependency>
<groupId>org.jboss.osgi</groupId>
<artifactId>jboss-osgi-spi</artifactId>
<version>${version.jboss.osgi.spi}</version>
@@ -226,7 +208,6 @@
<DynamicImport-Package>*</DynamicImport-Package>
<Embed-Transitive>true</Embed-Transitive>
<Embed-Dependency>
- javassist;inline=false,
jboss-classloader;inline=false,
jboss-classloading;inline=false,
jboss-classloading-spi;inline=false,
@@ -247,7 +228,6 @@
jboss-osgi-deployers;inline=false,
jboss-reflect;inline=false,
jboss-kernel;inline=false,
- jbossxb;inline=false,
</Embed-Dependency>
<_exportcontents>
org.jboss.beans.metadata*;version=2.0.9,
Deleted: projects/jboss-osgi/projects/bundles/microcontainer/trunk/src/main/java/org/jboss/osgi/microcontainer/internal/EmbeddedBeanDeployer.java
===================================================================
--- projects/jboss-osgi/projects/bundles/microcontainer/trunk/src/main/java/org/jboss/osgi/microcontainer/internal/EmbeddedBeanDeployer.java 2009-11-27 00:13:39 UTC (rev 97054)
+++ projects/jboss-osgi/projects/bundles/microcontainer/trunk/src/main/java/org/jboss/osgi/microcontainer/internal/EmbeddedBeanDeployer.java 2009-11-27 00:15:10 UTC (rev 97055)
@@ -1,72 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2006, 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.microcontainer.internal;
-
-// $Id: $
-
-import org.jboss.deployers.vfs.deployer.kernel.BeanDeployer;
-import org.jboss.deployers.vfs.spi.deployer.JBossXBDeployerHelper;
-import org.jboss.kernel.spi.deployment.KernelDeployment;
-import org.jboss.xb.binding.sunday.unmarshalling.DefaultSchemaResolver;
-import org.jboss.xb.binding.sunday.unmarshalling.SchemaBindingResolver;
-import org.jboss.xb.binding.sunday.unmarshalling.SchemaResolverFactory;
-
-/**
- * A {@link BeanDeployer} that provides a non-static {@link SchemaBindingResolver}.
- *
- * @author thomas.diesler(a)jboss.com
- * @since 30-Jun-2009
- */
-public class EmbeddedBeanDeployer extends BeanDeployer
-{
- private JBossXBDeployerHelper<KernelDeployment> helper;
-
- @Override
- protected JBossXBDeployerHelper<KernelDeployment> getHelper()
- {
- if (helper == null)
- helper = new EmbeddedDeployerHelper<KernelDeployment>(getOutput());
-
- return helper;
- }
-
- class EmbeddedDeployerHelper<T> extends JBossXBDeployerHelper<T>
- {
- private DefaultSchemaResolver resolver;
-
- protected EmbeddedDeployerHelper(Class<T> output)
- {
- super(output);
- }
-
- @Override
- public DefaultSchemaResolver getResolver()
- {
- if (resolver == null)
- {
- SchemaResolverFactory factory = EmbeddedSchemaResolverFactory.getInstance();
- resolver = (DefaultSchemaResolver)factory.getSchemaBindingResolver();
- }
- return resolver;
- }
- }
-}
Modified: projects/jboss-osgi/projects/bundles/microcontainer/trunk/src/main/java/org/jboss/osgi/microcontainer/internal/EmbeddedKernelBootstrap.java
===================================================================
--- projects/jboss-osgi/projects/bundles/microcontainer/trunk/src/main/java/org/jboss/osgi/microcontainer/internal/EmbeddedKernelBootstrap.java 2009-11-27 00:13:39 UTC (rev 97054)
+++ projects/jboss-osgi/projects/bundles/microcontainer/trunk/src/main/java/org/jboss/osgi/microcontainer/internal/EmbeddedKernelBootstrap.java 2009-11-27 00:15:10 UTC (rev 97055)
@@ -45,7 +45,6 @@
public EmbeddedKernelBootstrap(BundleContext context)
{
-
// Get or bootstrap the kernel
if (kernel == null)
{
@@ -59,7 +58,7 @@
throw new IllegalStateException("Cannot bootstrap kernel", e);
}
}
- deployer = new EmbeddedXMLDeployer(kernel);
+ deployer = new EmbeddedXMLDeployer(context, kernel);
}
/**
Deleted: projects/jboss-osgi/projects/bundles/microcontainer/trunk/src/main/java/org/jboss/osgi/microcontainer/internal/EmbeddedSchemaResolverFactory.java
===================================================================
--- projects/jboss-osgi/projects/bundles/microcontainer/trunk/src/main/java/org/jboss/osgi/microcontainer/internal/EmbeddedSchemaResolverFactory.java 2009-11-27 00:13:39 UTC (rev 97054)
+++ projects/jboss-osgi/projects/bundles/microcontainer/trunk/src/main/java/org/jboss/osgi/microcontainer/internal/EmbeddedSchemaResolverFactory.java 2009-11-27 00:15:10 UTC (rev 97055)
@@ -1,111 +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.microcontainer.internal;
-
-// $Id$
-
-import org.jboss.logging.Logger;
-import org.jboss.xb.binding.sunday.unmarshalling.DefaultSchemaResolver;
-import org.jboss.xb.binding.sunday.unmarshalling.SchemaBindingResolver;
-import org.jboss.xb.binding.sunday.unmarshalling.SchemaResolverFactory;
-import org.jboss.xb.binding.sunday.unmarshalling.SingletonSchemaResolverFactory;
-
-/**
- * A {@link SchemaResolverFactory} that unlike the {@link SingletonSchemaResolverFactory}
- * does not cache classes in static singletons.
- *
- * @author thomas.diesler(a)jboss.com
- * @since 27-Jun-2008
- */
-public class EmbeddedSchemaResolverFactory implements SchemaResolverFactory
-{
- /** The log */
- private static final Logger log = Logger.getLogger(EmbeddedSchemaResolverFactory.class);
-
- /** The resolver */
- private final DefaultSchemaResolver resolver = new DefaultSchemaResolver();
-
- /**
- * Create a new SingletonSchemaResolverFactory.
- */
- private EmbeddedSchemaResolverFactory()
- {
- addJaxbSchema("urn:jboss:aop-beans:1.0", "org.jboss.aop.microcontainer.beans.metadata.AOPDeployment");
- addJaxbSchema("urn:jboss:bean-deployer", "org.jboss.kernel.plugins.deployment.AbstractKernelDeployment10");
- addJaxbSchema("urn:jboss:bean-deployer:2.0", "org.jboss.kernel.plugins.deployment.AbstractKernelDeployment");
- addJaxbSchema("urn:jboss:javabean:1.0", "org.jboss.javabean.plugins.jaxb.JavaBean10");
- addJaxbSchema("urn:jboss:javabean:2.0", "org.jboss.javabean.plugins.jaxb.JavaBean20");
- addJaxbSchema("urn:jboss:policy:1.0", "org.jboss.beans.metadata.plugins.policy.AbstractPolicyMetaData");
- addJaxbSchema("urn:jboss:classloading:1.0", "org.jboss.classloading.spi.metadata.ClassLoadingMetaData10");
- addJaxbSchema("urn:jboss:classloader:1.0", "org.jboss.classloading.spi.vfs.metadata.VFSClassLoaderFactory10");
- addJaxbSchema("urn:jboss:deployers:2.0", "org.jboss.deployers.vfs.plugins.xb.SchemaResolverDeployerMetaData");
- }
-
- public static SchemaResolverFactory getInstance()
- {
- return new EmbeddedSchemaResolverFactory();
- }
-
- public SchemaBindingResolver getSchemaBindingResolver()
- {
- return resolver;
- }
-
- /**
- * Set the parse annotations for a schema
- *
- * @param namespace the namespace
- * @param parseAnnotations whether to parse annotations
- */
- protected void setParseAnnotations(String namespace, Boolean parseAnnotations)
- {
- resolver.addSchemaParseAnnotations(namespace, parseAnnotations);
- if (log.isTraceEnabled())
- log.trace("Parse annotations '" + namespace + "' set to '" + parseAnnotations + "'");
- }
-
- /**
- * Add a schema.
- *
- * @param namespace the namespace
- * @param reference the schema reference class
- * @return true when added
- */
- public boolean addJaxbSchema(String namespace, String reference)
- {
- try
- {
- resolver.addClassBinding(namespace, reference);
- if (log.isTraceEnabled())
- log.trace("Mapped '" + namespace + "' to '" + reference + "'");
-
- return true;
- }
- catch (Exception ignored)
- {
- if (log.isTraceEnabled())
- log.trace("Ignored: ", ignored);
-
- return false;
- }
- }
-}
Modified: projects/jboss-osgi/projects/bundles/microcontainer/trunk/src/main/java/org/jboss/osgi/microcontainer/internal/EmbeddedXMLDeployer.java
===================================================================
--- projects/jboss-osgi/projects/bundles/microcontainer/trunk/src/main/java/org/jboss/osgi/microcontainer/internal/EmbeddedXMLDeployer.java 2009-11-27 00:13:39 UTC (rev 97054)
+++ projects/jboss-osgi/projects/bundles/microcontainer/trunk/src/main/java/org/jboss/osgi/microcontainer/internal/EmbeddedXMLDeployer.java 2009-11-27 00:15:10 UTC (rev 97055)
@@ -33,9 +33,9 @@
import org.jboss.kernel.plugins.deployment.xml.BasicXMLDeployer;
import org.jboss.kernel.spi.deployment.KernelDeployment;
import org.jboss.logging.Logger;
-import org.jboss.xb.binding.Unmarshaller;
-import org.jboss.xb.binding.UnmarshallerFactory;
-import org.jboss.xb.binding.sunday.unmarshalling.SchemaBindingResolver;
+import org.jboss.osgi.jbossxb.UnmarshallerService;
+import org.osgi.framework.BundleContext;
+import org.osgi.framework.ServiceReference;
/**
* An XML deployer that unlike the {@link BasicXMLDeployer} does not cache
@@ -46,26 +46,24 @@
*/
public class EmbeddedXMLDeployer extends BasicKernelDeployer
{
- /** The log */
+ // Provide Logging
private static final Logger log = Logger.getLogger(EmbeddedXMLDeployer.class);
- /** Unmarshaller factory */
- private UnmarshallerFactory factory = UnmarshallerFactory.newInstance();
-
- /** The resolver */
- private SchemaBindingResolver resolver = EmbeddedSchemaResolverFactory.getInstance().getSchemaBindingResolver();
-
+ private BundleContext context;
+
/** The deployments by url or name */
private Map<String, KernelDeployment> deploymentsByName = new ConcurrentHashMap<String, KernelDeployment>();
/**
* Create a new XML deployer
*
+ * @param context the bundle context
* @param kernel the kernel
*/
- public EmbeddedXMLDeployer(Kernel kernel)
+ public EmbeddedXMLDeployer(BundleContext context, Kernel kernel)
{
super(kernel, null);
+ this.context = context;
}
public Collection<String> getDeploymentNames()
@@ -136,8 +134,22 @@
long start = System.currentTimeMillis();
- Unmarshaller unmarshaller = factory.newUnmarshaller();
- KernelDeployment deployment = (KernelDeployment)unmarshaller.unmarshal(url.toString(), resolver);
+ ServiceReference sref = context.getServiceReference(UnmarshallerService.class.getName());
+ if (sref == null)
+ throw new IllegalStateException("Cannot obtain: " + UnmarshallerService.class.getName());
+
+ UnmarshallerService unmarshaller = (UnmarshallerService)context.getService(sref);
+ unmarshaller.addClassBinding("urn:jboss:aop-beans:1.0", "org.jboss.aop.microcontainer.beans.metadata.AOPDeployment");
+ unmarshaller.addClassBinding("urn:jboss:bean-deployer", "org.jboss.kernel.plugins.deployment.AbstractKernelDeployment10");
+ unmarshaller.addClassBinding("urn:jboss:bean-deployer:2.0", "org.jboss.kernel.plugins.deployment.AbstractKernelDeployment");
+ unmarshaller.addClassBinding("urn:jboss:javabean:1.0", "org.jboss.javabean.plugins.jaxb.JavaBean10");
+ unmarshaller.addClassBinding("urn:jboss:javabean:2.0", "org.jboss.javabean.plugins.jaxb.JavaBean20");
+ unmarshaller.addClassBinding("urn:jboss:policy:1.0", "org.jboss.beans.metadata.plugins.policy.AbstractPolicyMetaData");
+ unmarshaller.addClassBinding("urn:jboss:classloading:1.0", "org.jboss.classloading.spi.metadata.ClassLoadingMetaData10");
+ unmarshaller.addClassBinding("urn:jboss:classloader:1.0", "org.jboss.classloading.spi.vfs.metadata.VFSClassLoaderFactory10");
+ unmarshaller.addClassBinding("urn:jboss:deployers:2.0", "org.jboss.deployers.vfs.plugins.xb.SchemaResolverDeployerMetaData");
+
+ KernelDeployment deployment = (KernelDeployment)unmarshaller.unmarshal(url.toString());
if (deployment == null)
throw new RuntimeException("The xml " + url + " is not well formed!");
14 years, 6 months
JBoss-OSGI SVN: r97050 - in projects/jboss-osgi: projects/bundles/apache-xerces/trunk/src/main/java/org/jboss/osgi/xml and 28 other directories.
by jboss-osgi-commits@lists.jboss.org
Author: thomas.diesler(a)jboss.com
Date: 2009-11-26 17:32:23 -0500 (Thu, 26 Nov 2009)
New Revision: 97050
Added:
projects/jboss-osgi/projects/bundles/common/trunk/src/main/java/org/jboss/osgi/common/log/LoggingCapability.java
projects/jboss-osgi/projects/bundles/common/trunk/src/main/java/org/jboss/osgi/common/log/LoggingService.java
projects/jboss-osgi/projects/bundles/microcontainer/trunk/scripts/
projects/jboss-osgi/projects/bundles/microcontainer/trunk/src/test/
projects/jboss-osgi/projects/bundles/microcontainer/trunk/src/test/java/
projects/jboss-osgi/projects/bundles/microcontainer/trunk/src/test/java/org/
projects/jboss-osgi/projects/bundles/microcontainer/trunk/src/test/java/org/jboss/
projects/jboss-osgi/projects/bundles/microcontainer/trunk/src/test/java/org/jboss/test/
projects/jboss-osgi/projects/bundles/microcontainer/trunk/src/test/java/org/jboss/test/osgi/
projects/jboss-osgi/projects/bundles/microcontainer/trunk/src/test/java/org/jboss/test/osgi/microcontainer/
projects/jboss-osgi/projects/bundles/microcontainer/trunk/src/test/java/org/jboss/test/osgi/microcontainer/BasicMicrocontainerTestCase.java
projects/jboss-osgi/projects/bundles/microcontainer/trunk/src/test/java/org/jboss/test/osgi/microcontainer/simple/
projects/jboss-osgi/projects/bundles/microcontainer/trunk/src/test/java/org/jboss/test/osgi/microcontainer/simple/SimpleActivator.java
projects/jboss-osgi/projects/bundles/microcontainer/trunk/src/test/java/org/jboss/test/osgi/microcontainer/simple/SomeBean.java
projects/jboss-osgi/projects/bundles/microcontainer/trunk/src/test/java/org/jboss/test/osgi/microcontainer/simple/SomeService.java
projects/jboss-osgi/projects/bundles/microcontainer/trunk/src/test/resources/
projects/jboss-osgi/projects/bundles/microcontainer/trunk/src/test/resources/jboss-osgi-framework.properties
projects/jboss-osgi/projects/bundles/microcontainer/trunk/src/test/resources/log4j.xml
Modified:
projects/jboss-osgi/projects/bundles/apache-xerces/trunk/pom.xml
projects/jboss-osgi/projects/bundles/apache-xerces/trunk/src/main/java/org/jboss/osgi/xml/XMLParserCapability.java
projects/jboss-osgi/projects/bundles/common/trunk/pom.xml
projects/jboss-osgi/projects/bundles/common/trunk/src/main/java/org/jboss/osgi/common/internal/CommonServicesActivator.java
projects/jboss-osgi/projects/bundles/jaxb/trunk/src/main/java/org/jboss/osgi/jaxb/JAXBCapability.java
projects/jboss-osgi/projects/bundles/jboss-xml-binding/trunk/pom.xml
projects/jboss-osgi/projects/bundles/jmx/trunk/pom.xml
projects/jboss-osgi/projects/bundles/jndi/trunk/pom.xml
projects/jboss-osgi/projects/bundles/jndi/trunk/src/main/java/org/jboss/osgi/jndi/JNDICapability.java
projects/jboss-osgi/projects/bundles/jndi/trunk/src/main/java/org/jboss/osgi/jndi/internal/JNPServer.java
projects/jboss-osgi/projects/bundles/microcontainer/trunk/.classpath
projects/jboss-osgi/projects/bundles/microcontainer/trunk/pom.xml
projects/jboss-osgi/projects/bundles/microcontainer/trunk/scripts/assembly-bundles.xml
projects/jboss-osgi/projects/bundles/microcontainer/trunk/src/main/java/org/jboss/osgi/microcontainer/MicrocontainerCapability.java
projects/jboss-osgi/projects/runtime/framework/branches/1.0.0.Alpha2/src/main/java/org/jboss/osgi/framework/plugins/internal/AutoInstallPluginImpl.java
projects/jboss-osgi/trunk/pom.xml
projects/jboss-osgi/trunk/reactor/blueprint/pom.xml
projects/jboss-osgi/trunk/reactor/blueprint/scripts/assembly-bundles.xml
projects/jboss-osgi/trunk/reactor/blueprint/src/test/resources/META-INF/jboss-osgi-bootstrap.xml
projects/jboss-osgi/trunk/reactor/blueprint/src/test/resources/jboss-osgi-framework.properties
Log:
Add integration tests to microcontainer bundle
Modified: projects/jboss-osgi/projects/bundles/apache-xerces/trunk/pom.xml
===================================================================
--- projects/jboss-osgi/projects/bundles/apache-xerces/trunk/pom.xml 2009-11-26 21:48:31 UTC (rev 97049)
+++ projects/jboss-osgi/projects/bundles/apache-xerces/trunk/pom.xml 2009-11-26 22:32:23 UTC (rev 97050)
@@ -32,6 +32,7 @@
<properties>
<version.apache.xerces>2.9.1</version.apache.xerces>
+ <version.jboss.osgi.common>1.0.4-SNAPSHOT</version.jboss.osgi.common>
<version.jboss.osgi.spi>1.0.3-SNAPSHOT</version.jboss.osgi.spi>
<version.wutka.dtdparser>1.2.1</version.wutka.dtdparser>
<version.xml.resolver>1.2</version.xml.resolver>
@@ -65,6 +66,14 @@
<version>${version.xml.resolver}</version>
</dependency>
+ <!-- Provided Capability -->
+ <dependency>
+ <groupId>org.jboss.osgi.bundles</groupId>
+ <artifactId>jboss-osgi-common</artifactId>
+ <version>${version.jboss.osgi.common}</version>
+ <scope>provided</scope>
+ </dependency>
+
<!-- OSGi Dependencies -->
<dependency>
<groupId>org.osgi</groupId>
@@ -107,6 +116,7 @@
org.xml.sax*,
<!-- import -->
+ org.jboss.osgi.common.log;version=1.0,
org.jboss.osgi.spi.capability;version=1.0,
org.osgi.framework,
org.osgi.service.log,
Modified: projects/jboss-osgi/projects/bundles/apache-xerces/trunk/src/main/java/org/jboss/osgi/xml/XMLParserCapability.java
===================================================================
--- projects/jboss-osgi/projects/bundles/apache-xerces/trunk/src/main/java/org/jboss/osgi/xml/XMLParserCapability.java 2009-11-26 21:48:31 UTC (rev 97049)
+++ projects/jboss-osgi/projects/bundles/apache-xerces/trunk/src/main/java/org/jboss/osgi/xml/XMLParserCapability.java 2009-11-26 22:32:23 UTC (rev 97050)
@@ -25,6 +25,7 @@
import javax.xml.parsers.SAXParserFactory;
+import org.jboss.osgi.common.log.LoggingCapability;
import org.jboss.osgi.spi.capability.Capability;
/**
@@ -58,6 +59,8 @@
{
super(SAXParserFactory.class.getName());
setFilter("(" + PARSER_PROVIDER + "=" + PROVIDER_JBOSS_OSGI + ")");
+
+ addDependency(new LoggingCapability());
addBundle("bundles/jboss-osgi-apache-xerces.jar");
}
Modified: projects/jboss-osgi/projects/bundles/common/trunk/pom.xml
===================================================================
--- projects/jboss-osgi/projects/bundles/common/trunk/pom.xml 2009-11-26 21:48:31 UTC (rev 97049)
+++ projects/jboss-osgi/projects/bundles/common/trunk/pom.xml 2009-11-26 22:32:23 UTC (rev 97050)
@@ -95,6 +95,7 @@
<Import-Package>
javax.management,
org.apache.log4j;version=1.2;resolution:=optional,
+ org.jboss.osgi.spi.capability;version=1.0,
org.jboss.osgi.spi.util;version=1.0,
org.osgi.framework;version=1.4,
org.osgi.service.log;version=1.3,
Modified: projects/jboss-osgi/projects/bundles/common/trunk/src/main/java/org/jboss/osgi/common/internal/CommonServicesActivator.java
===================================================================
--- projects/jboss-osgi/projects/bundles/common/trunk/src/main/java/org/jboss/osgi/common/internal/CommonServicesActivator.java 2009-11-26 21:48:31 UTC (rev 97049)
+++ projects/jboss-osgi/projects/bundles/common/trunk/src/main/java/org/jboss/osgi/common/internal/CommonServicesActivator.java 2009-11-26 22:32:23 UTC (rev 97050)
@@ -25,6 +25,7 @@
import org.jboss.osgi.common.log.LogServiceTracker;
+import org.jboss.osgi.common.log.LoggingService;
import org.osgi.framework.BundleActivator;
import org.osgi.framework.BundleContext;
import org.osgi.framework.ServiceReference;
@@ -49,6 +50,9 @@
// Track LogReaderService and add/remove LogListener
logReaderTracker = trackLogReaderService(context);
logReaderTracker.open();
+
+ // Register the logging marker service
+ context.registerService(LoggingService.class.getName(), new LoggingService(){}, null);
}
public void stop(BundleContext context)
Added: projects/jboss-osgi/projects/bundles/common/trunk/src/main/java/org/jboss/osgi/common/log/LoggingCapability.java
===================================================================
--- projects/jboss-osgi/projects/bundles/common/trunk/src/main/java/org/jboss/osgi/common/log/LoggingCapability.java (rev 0)
+++ projects/jboss-osgi/projects/bundles/common/trunk/src/main/java/org/jboss/osgi/common/log/LoggingCapability.java 2009-11-26 22:32:23 UTC (rev 97050)
@@ -0,0 +1,47 @@
+/*
+ * 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.common.log;
+
+import org.jboss.osgi.spi.capability.Capability;
+import org.jboss.osgi.spi.capability.CompendiumCapability;
+
+/**
+ * Adds the logging capability.
+ *
+ * It is ignored if the {@link LoggingService} is already registered.
+ *
+ * Installed bundles: jboss-osgi-common.jar
+ *
+ * @author thomas.diesler(a)jboss.com
+ * @since 14-Sep-2009
+ */
+public class LoggingCapability extends Capability
+{
+ public LoggingCapability()
+ {
+ super(LoggingService.class.getName());
+
+ addDependency(new CompendiumCapability());
+
+ addBundle("bundles/jboss-osgi-common.jar");
+ }
+}
\ No newline at end of file
Added: projects/jboss-osgi/projects/bundles/common/trunk/src/main/java/org/jboss/osgi/common/log/LoggingService.java
===================================================================
--- projects/jboss-osgi/projects/bundles/common/trunk/src/main/java/org/jboss/osgi/common/log/LoggingService.java (rev 0)
+++ projects/jboss-osgi/projects/bundles/common/trunk/src/main/java/org/jboss/osgi/common/log/LoggingService.java 2009-11-26 22:32:23 UTC (rev 97050)
@@ -0,0 +1,34 @@
+/*
+ * 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.common.log;
+
+//$Id: $
+
+/**
+ * A marker service that is registered by jboss-osgi-common
+ *
+ * @author thomas.diesler(a)jboss.com
+ * @since 29-May-2009
+ */
+public interface LoggingService
+{
+}
\ No newline at end of file
Modified: projects/jboss-osgi/projects/bundles/jaxb/trunk/src/main/java/org/jboss/osgi/jaxb/JAXBCapability.java
===================================================================
--- projects/jboss-osgi/projects/bundles/jaxb/trunk/src/main/java/org/jboss/osgi/jaxb/JAXBCapability.java 2009-11-26 21:48:31 UTC (rev 97049)
+++ projects/jboss-osgi/projects/bundles/jaxb/trunk/src/main/java/org/jboss/osgi/jaxb/JAXBCapability.java 2009-11-26 22:32:23 UTC (rev 97050)
@@ -45,6 +45,7 @@
super(JAXBService.class.getName());
addDependency(new XMLParserCapability());
+
addBundle("bundles/jboss-osgi-jaxb.jar");
}
}
\ No newline at end of file
Modified: projects/jboss-osgi/projects/bundles/jboss-xml-binding/trunk/pom.xml
===================================================================
--- projects/jboss-osgi/projects/bundles/jboss-xml-binding/trunk/pom.xml 2009-11-26 21:48:31 UTC (rev 97049)
+++ projects/jboss-osgi/projects/bundles/jboss-xml-binding/trunk/pom.xml 2009-11-26 22:32:23 UTC (rev 97050)
@@ -42,6 +42,7 @@
<version.jboss.osgi.runtime.felix>2.0.0</version.jboss.osgi.runtime.felix>
<version.jboss.xb>2.0.2.Beta3</version.jboss.xb>
<version.javassist>3.9.0.GA</version.javassist>
+ <version.jboss.osgi.common>1.0.4-SNAPSHOT</version.jboss.osgi.common>
<version.jboss.osgi.common.core>2.2.13.GA</version.jboss.osgi.common.core>
<version.jboss.osgi.husky>1.0.2-SNAPSHOT</version.jboss.osgi.husky>
<version.jboss.osgi.jaxb>2.1.10-SNAPSHOT</version.jboss.osgi.jaxb>
@@ -85,6 +86,12 @@
<!-- Provided Dependencies -->
<dependency>
<groupId>org.jboss.osgi.bundles</groupId>
+ <artifactId>jboss-osgi-common</artifactId>
+ <version>${version.jboss.osgi.common}</version>
+ <scope>provided</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.jboss.osgi.bundles</groupId>
<artifactId>jboss-osgi-common-core</artifactId>
<version>${version.jboss.osgi.common.core}</version>
<scope>provided</scope>
Modified: projects/jboss-osgi/projects/bundles/jmx/trunk/pom.xml
===================================================================
--- projects/jboss-osgi/projects/bundles/jmx/trunk/pom.xml 2009-11-26 21:48:31 UTC (rev 97049)
+++ projects/jboss-osgi/projects/bundles/jmx/trunk/pom.xml 2009-11-26 22:32:23 UTC (rev 97050)
@@ -21,7 +21,7 @@
<artifactId>jboss-osgi-jmx</artifactId>
<packaging>bundle</packaging>
- <version>1.0.3-SNAPSHOT</version>
+ <version>1.0.2-SNAPSHOT</version>
<!-- Parent -->
<parent>
@@ -40,8 +40,8 @@
<!-- Properties -->
<properties>
<version.jboss.osgi.common.core>2.2.13.GA</version.jboss.osgi.common.core>
- <version.jboss.osgi.jndi>1.0.1</version.jboss.osgi.jndi>
- <version.jboss.osgi.spi>1.0.3</version.jboss.osgi.spi>
+ <version.jboss.osgi.jndi>1.0.2-SNAPSHOT</version.jboss.osgi.jndi>
+ <version.jboss.osgi.spi>1.0.3-SNAPSHOT</version.jboss.osgi.spi>
<version.osgi>4.2.0</version.osgi>
</properties>
@@ -99,7 +99,6 @@
javax.naming.spi,
<!-- jboss-osgi -->
- org.jboss.osgi.common.log;version=1.0,
org.jboss.osgi.spi.capability;version=1.0,
org.jboss.osgi.spi.management;version=1.0,
Modified: projects/jboss-osgi/projects/bundles/jndi/trunk/pom.xml
===================================================================
--- projects/jboss-osgi/projects/bundles/jndi/trunk/pom.xml 2009-11-26 21:48:31 UTC (rev 97049)
+++ projects/jboss-osgi/projects/bundles/jndi/trunk/pom.xml 2009-11-26 22:32:23 UTC (rev 97050)
@@ -27,25 +27,26 @@
<parent>
<groupId>org.jboss.osgi</groupId>
<artifactId>jboss-osgi-parent</artifactId>
- <version>1.0.2</version>
+ <version>1.0.4</version>
</parent>
<!-- Properties -->
<properties>
<version.jboss.naming>5.0.1.GA</version.jboss.naming>
- <version.jboss.osgi.common>1.0.1</version.jboss.osgi.common>
- <version.osgi>r4v42</version.osgi>
+ <version.jboss.osgi.common>1.0.4-SNAPSHOT</version.jboss.osgi.common>
+ <version.osgi>4.2.0</version.osgi>
</properties>
<!-- Dependencies -->
<dependencies>
+
+ <!-- Provided Dependencies -->
<dependency>
<groupId>org.jboss.osgi.bundles</groupId>
<artifactId>jboss-osgi-common</artifactId>
<version>${version.jboss.osgi.common}</version>
+ <scope>provided</scope>
</dependency>
-
- <!-- Provided Dependencies -->
<dependency>
<groupId>org.jboss.naming</groupId>
<artifactId>jnpserver</artifactId>
@@ -84,9 +85,10 @@
<Import-Package>
javax.naming*,
javax.net,
+ org.slf4j,
org.jboss.logging,
org.jboss.net.sockets,
- org.jboss.osgi.common.log;version="1.0",
+ org.jboss.osgi.common.log;version=1.0,
org.jboss.osgi.spi.capability;version="1.0",
org.jboss.osgi.spi.util;version="1.0",
org.jboss.util.naming,
@@ -99,7 +101,7 @@
jnpserver;inline=false,
</Embed-Dependency>
<_exportcontents>
- org.jnp.interfaces;version=${version.jboss.naming},
+ org.jnp.interfaces;version=5.0.1,
</_exportcontents>
</instructions>
</configuration>
Modified: projects/jboss-osgi/projects/bundles/jndi/trunk/src/main/java/org/jboss/osgi/jndi/JNDICapability.java
===================================================================
--- projects/jboss-osgi/projects/bundles/jndi/trunk/src/main/java/org/jboss/osgi/jndi/JNDICapability.java 2009-11-26 21:48:31 UTC (rev 97049)
+++ projects/jboss-osgi/projects/bundles/jndi/trunk/src/main/java/org/jboss/osgi/jndi/JNDICapability.java 2009-11-26 22:32:23 UTC (rev 97050)
@@ -25,9 +25,8 @@
import javax.naming.InitialContext;
+import org.jboss.osgi.common.log.LoggingCapability;
import org.jboss.osgi.spi.capability.Capability;
-import org.jboss.osgi.spi.capability.LogServiceCapability;
-import org.jboss.osgi.spi.testing.OSGiRuntime;
/**
* Adds the JNDI capability to the {@link OSGiRuntime}
@@ -59,7 +58,7 @@
addSystemProperty("org.jboss.osgi.jndi.rmi.port", "1198");
addSystemProperty("org.jboss.osgi.jndi.port", "1199");
- addDependency(new LogServiceCapability());
+ addDependency(new LoggingCapability());
addBundle("bundles/jboss-osgi-common-core.jar");
addBundle("bundles/jboss-osgi-jndi.jar");
Modified: projects/jboss-osgi/projects/bundles/jndi/trunk/src/main/java/org/jboss/osgi/jndi/internal/JNPServer.java
===================================================================
--- projects/jboss-osgi/projects/bundles/jndi/trunk/src/main/java/org/jboss/osgi/jndi/internal/JNPServer.java 2009-11-26 21:48:31 UTC (rev 97049)
+++ projects/jboss-osgi/projects/bundles/jndi/trunk/src/main/java/org/jboss/osgi/jndi/internal/JNPServer.java 2009-11-26 22:32:23 UTC (rev 97050)
@@ -33,13 +33,13 @@
import javax.naming.NamingException;
import org.jboss.net.sockets.DefaultSocketFactory;
-import org.jboss.osgi.common.log.LogServiceTracker;
import org.jnp.interfaces.Naming;
import org.jnp.server.Main;
import org.jnp.server.NamingBean;
import org.jnp.server.NamingServer;
import org.osgi.framework.BundleContext;
-import org.osgi.service.log.LogService;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
/**
* Start/Stop the {@link NamingServer}
@@ -49,7 +49,9 @@
*/
public class JNPServer
{
- private LogService log;
+ // Provide logging
+ final Logger log = LoggerFactory.getLogger(JNPServer.class);
+
private String host;
private int jndiPort;
private int rmiPort;
@@ -62,7 +64,6 @@
public JNPServer(BundleContext context, String host, int jndiPort, int rmiPort)
{
- this.log = new LogServiceTracker(context);
this.host = host;
this.jndiPort = jndiPort;
this.rmiPort = rmiPort;
@@ -77,11 +78,11 @@
try
{
rmiRegistry.list();
- log.log(LogService.LOG_DEBUG, "RMI registry running at host=" + host + ",port=" + rmiPort);
+ log.debug("RMI registry running at host=" + host + ",port=" + rmiPort);
}
catch (RemoteException e)
{
- log.log(LogService.LOG_DEBUG, "No RMI registry running at host=" + host + ",port=" + rmiPort + ". Will create one.");
+ log.debug("No RMI registry running at host=" + host + ",port=" + rmiPort + ". Will create one.");
rmiRegistry = LocateRegistry.createRegistry(rmiPort, null, new DefaultSocketFactory(InetAddress.getByName(host)));
shutdownRegistry = true;
}
@@ -96,11 +97,11 @@
namingMain.setRmiPort(rmiPort);
namingMain.start();
- log.log(LogService.LOG_INFO, "JNDI started: JNP=" + host + ":" + jndiPort + ", RMI=" + host + ":" + rmiPort);
+ log.info("JNDI started: JNP=" + host + ":" + jndiPort + ", RMI=" + host + ":" + rmiPort);
}
catch (Exception ex)
{
- log.log(LogService.LOG_ERROR, "Cannot start Naming server", ex);
+ log.error("Cannot start Naming server", ex);
}
}
@@ -111,7 +112,7 @@
namingMain.stop();
namingMain = null;
namingServer = null;
- log.log(LogService.LOG_DEBUG, "Naming server stopped");
+ log.debug("Naming server stopped");
}
// Shutdown the registry if this service created it
@@ -119,12 +120,12 @@
{
try
{
- log.log(LogService.LOG_DEBUG, "Shutdown RMI registry");
+ log.debug("Shutdown RMI registry");
UnicastRemoteObject.unexportObject(rmiRegistry, true);
}
catch (NoSuchObjectException ex)
{
- log.log(LogService.LOG_WARNING, "Cannot shutdown RMI registry", ex);
+ log.warn("Cannot shutdown RMI registry", ex);
}
}
}
Modified: projects/jboss-osgi/projects/bundles/microcontainer/trunk/.classpath
===================================================================
--- projects/jboss-osgi/projects/bundles/microcontainer/trunk/.classpath 2009-11-26 21:48:31 UTC (rev 97049)
+++ projects/jboss-osgi/projects/bundles/microcontainer/trunk/.classpath 2009-11-26 22:32:23 UTC (rev 97050)
@@ -1,6 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry kind="src" output="target/classes" path="src/main/java"/>
+ <classpathentry kind="src" output="target/test-classes" path="src/test/java"/>
+ <classpathentry kind="src" output="target/test-classes" path="src/test/resources"/>
<classpathentry excluding="**" kind="src" output="target/classes" path="src/main/resources"/>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/J2SE-1.5"/>
<classpathentry kind="con" path="org.maven.ide.eclipse.MAVEN2_CLASSPATH_CONTAINER"/>
Modified: projects/jboss-osgi/projects/bundles/microcontainer/trunk/pom.xml
===================================================================
--- projects/jboss-osgi/projects/bundles/microcontainer/trunk/pom.xml 2009-11-26 21:48:31 UTC (rev 97049)
+++ projects/jboss-osgi/projects/bundles/microcontainer/trunk/pom.xml 2009-11-26 22:32:23 UTC (rev 97050)
@@ -39,13 +39,19 @@
<!-- Properties -->
<properties>
+ <version.jboss.osgi.runtime.felix>2.0.0</version.jboss.osgi.runtime.felix>
<version.javassist>3.9.0.GA</version.javassist>
<version.jboss.deployers>2.0.5.SP1</version.jboss.deployers>
<version.jboss.microcontainer>2.0.9.GA</version.jboss.microcontainer>
+ <version.jboss.osgi.common>1.0.4-SNAPSHOT</version.jboss.osgi.common>
+ <version.jboss.osgi.common.core>2.2.13.GA</version.jboss.osgi.common.core>
+ <version.jboss.osgi.deployment>1.0.0</version.jboss.osgi.deployment>
+ <version.jboss.osgi.husky>1.0.2-SNAPSHOT</version.jboss.osgi.husky>
+ <version.jboss.osgi.jaxb>2.1.10-SNAPSHOT</version.jboss.osgi.jaxb>
+ <version.jboss.osgi.jmx>1.0.2-SNAPSHOT</version.jboss.osgi.jmx>
<version.jboss.osgi.runtime.deployers>1.0.3</version.jboss.osgi.runtime.deployers>
- <version.jboss.osgi.deployment>1.0.0</version.jboss.osgi.deployment>
- <version.jboss.osgi.jmx>1.0.2</version.jboss.osgi.jmx>
- <version.jboss.osgi.spi>1.0.3</version.jboss.osgi.spi>
+ <version.jboss.osgi.spi>1.0.3-SNAPSHOT</version.jboss.osgi.spi>
+ <version.jboss.osgi.xml.binding>2.0.2-SNAPSHOT</version.jboss.osgi.xml.binding>
<version.jboss.reflect>2.0.2.GA</version.jboss.reflect>
<version.jboss.xb>2.0.2.Beta3</version.jboss.xb>
<version.osgi>4.2.0</version.osgi>
@@ -62,11 +68,23 @@
<groupId>org.jboss.deployers</groupId>
<artifactId>jboss-deployers-vfs</artifactId>
<version>${version.jboss.deployers}</version>
+ <exclusions>
+ <exclusion>
+ <groupId>org.jboss</groupId>
+ <artifactId>jboss-common-core</artifactId>
+ </exclusion>
+ </exclusions>
</dependency>
<dependency>
<groupId>org.jboss.microcontainer</groupId>
<artifactId>jboss-kernel</artifactId>
<version>${version.jboss.microcontainer}</version>
+ <exclusions>
+ <exclusion>
+ <groupId>org.jboss</groupId>
+ <artifactId>jboss-common-core</artifactId>
+ </exclusion>
+ </exclusions>
</dependency>
<dependency>
<groupId>org.jboss</groupId>
@@ -85,11 +103,6 @@
<version>${version.jboss.osgi.spi}</version>
</dependency>
<dependency>
- <groupId>org.jboss.osgi.bundles</groupId>
- <artifactId>jboss-osgi-jmx</artifactId>
- <version>${version.jboss.osgi.jmx}</version>
- </dependency>
- <dependency>
<groupId>org.jboss.osgi.runtime</groupId>
<artifactId>jboss-osgi-deployers</artifactId>
<version>${version.jboss.osgi.runtime.deployers}</version>
@@ -102,6 +115,44 @@
<!-- Provided Dependencies -->
<dependency>
+ <groupId>org.jboss.osgi.bundles</groupId>
+ <artifactId>jboss-osgi-common</artifactId>
+ <version>${version.jboss.osgi.common}</version>
+ <scope>provided</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.jboss.osgi.bundles</groupId>
+ <artifactId>jboss-osgi-common-core</artifactId>
+ <version>${version.jboss.osgi.common.core}</version>
+ <scope>provided</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.jboss.osgi.bundles</groupId>
+ <artifactId>jboss-osgi-husky</artifactId>
+ <version>${version.jboss.osgi.husky}</version>
+ <scope>provided</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.jboss.osgi.bundles</groupId>
+ <artifactId>jboss-osgi-jaxb</artifactId>
+ <version>${version.jboss.osgi.jaxb}</version>
+ <scope>provided</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.jboss.osgi.bundles</groupId>
+ <artifactId>jboss-osgi-jmx</artifactId>
+ <version>${version.jboss.osgi.jmx}</version>
+ <scope>provided</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.jboss.osgi.bundles</groupId>
+ <artifactId>jboss-osgi-xml-binding</artifactId>
+ <version>${version.jboss.osgi.xml.binding}</version>
+ <scope>provided</scope>
+ </dependency>
+
+ <!-- OSGi Dependencies -->
+ <dependency>
<groupId>org.osgi</groupId>
<artifactId>org.osgi.core</artifactId>
<version>${version.osgi}</version>
@@ -113,6 +164,19 @@
<version>${version.osgi}</version>
<scope>provided</scope>
</dependency>
+
+ <!-- Test Dependencies -->
+ <dependency>
+ <groupId>org.jboss.osgi.runtime</groupId>
+ <artifactId>jboss-osgi-runtime-felix</artifactId>
+ <version>${version.jboss.osgi.runtime.felix}</version>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.slf4j</groupId>
+ <artifactId>slf4j-log4j12</artifactId>
+ <scope>test</scope>
+ </dependency>
</dependencies>
<build>
@@ -136,7 +200,7 @@
<!-- system -->
javax.management,
javax.naming*,
- javax.xml.*,
+ javax.xml.bind;version=2.1,
org.w3c.dom,
org.xml.sax,
@@ -194,6 +258,84 @@
</instructions>
</configuration>
</plugin>
+ <plugin>
+ <artifactId>maven-assembly-plugin</artifactId>
+ <executions>
+ <execution>
+ <id>bundles</id>
+ <phase>test-compile</phase>
+ <goals>
+ <goal>directory-single</goal>
+ </goals>
+ <configuration>
+ <finalName>test-libs</finalName>
+ <ignoreDirFormatExtensions>true</ignoreDirFormatExtensions>
+ <appendAssemblyId>false</appendAssemblyId>
+ <descriptors>
+ <descriptor>scripts/assembly-bundles.xml</descriptor>
+ </descriptors>
+ </configuration>
+ </execution>
+ </executions>
+ </plugin>
+ <plugin>
+ <artifactId>maven-antrun-plugin</artifactId>
+ <executions>
+ <execution>
+ <id>build-test-jars</id>
+ <phase>integration-test</phase>
+ <goals>
+ <goal>run</goal>
+ </goals>
+ <configuration>
+ <tasks>
+ <property name="maven.runtime.classpath" refid="maven.runtime.classpath" />
+ <property name="artifactId" value="${artifactId}" />
+ <property name="tests.output.dir" value="${project.build.directory}" />
+ <property name="build.artifact" value="${project.build.finalName}" />
+ <ant antfile="scripts/antrun-test-jars.xml" />
+ </tasks>
+ </configuration>
+ </execution>
+ </executions>
+ </plugin>
+ <plugin>
+ <artifactId>maven-surefire-plugin</artifactId>
+ <configuration>
+ <skip>true</skip>
+ </configuration>
+ <executions>
+ <execution>
+ <id>surefire-integration-tests</id>
+ <phase>integration-test</phase>
+ <goals>
+ <goal>test</goal>
+ </goals>
+ <configuration>
+ <skip>false</skip>
+ <argLine>${surefire.jpda.args}</argLine>
+ <systemProperties>
+ <property>
+ <name>java.protocol.handler.pkgs</name>
+ <value>org.jboss.net.protocol|org.jboss.virtual.protocol</value>
+ </property>
+ <property>
+ <name>log4j.output.dir</name>
+ <value>${project.build.directory}</value>
+ </property>
+ <property>
+ <name>org.jboss.osgi.husky.Invoker</name>
+ <value>org.jboss.osgi.husky.internal.OSGiInvoker</value>
+ </property>
+ <property>
+ <name>test.archive.directory</name>
+ <value>${project.build.directory}/test-libs</value>
+ </property>
+ </systemProperties>
+ </configuration>
+ </execution>
+ </executions>
+ </plugin>
</plugins>
</build>
Copied: projects/jboss-osgi/projects/bundles/microcontainer/trunk/scripts (from rev 97041, projects/jboss-osgi/projects/bundles/jboss-xml-binding/trunk/scripts)
Modified: projects/jboss-osgi/projects/bundles/microcontainer/trunk/scripts/assembly-bundles.xml
===================================================================
--- projects/jboss-osgi/projects/bundles/jboss-xml-binding/trunk/scripts/assembly-bundles.xml 2009-11-26 16:47:57 UTC (rev 97041)
+++ projects/jboss-osgi/projects/bundles/microcontainer/trunk/scripts/assembly-bundles.xml 2009-11-26 22:32:23 UTC (rev 97050)
@@ -16,9 +16,13 @@
<outputFileNameMapping>${artifact.artifactId}${dashClassifier?}.${artifact.extension}</outputFileNameMapping>
<includes>
<include>*:jboss-osgi-apache-xerces:jar</include>
+ <include>*:jboss-osgi-common:jar</include>
<include>*:jboss-osgi-common-core:jar</include>
<include>*:jboss-osgi-husky:jar</include>
<include>*:jboss-osgi-jaxb:jar</include>
+ <include>*:jboss-osgi-jndi:jar</include>
+ <include>*:jboss-osgi-jmx:jar</include>
+ <include>*:jboss-osgi-xml-binding:jar</include>
<include>*:org.osgi.compendium:jar</include>
</includes>
<useStrictFiltering>true</useStrictFiltering>
Modified: projects/jboss-osgi/projects/bundles/microcontainer/trunk/src/main/java/org/jboss/osgi/microcontainer/MicrocontainerCapability.java
===================================================================
--- projects/jboss-osgi/projects/bundles/microcontainer/trunk/src/main/java/org/jboss/osgi/microcontainer/MicrocontainerCapability.java 2009-11-26 21:48:31 UTC (rev 97049)
+++ projects/jboss-osgi/projects/bundles/microcontainer/trunk/src/main/java/org/jboss/osgi/microcontainer/MicrocontainerCapability.java 2009-11-26 22:32:23 UTC (rev 97050)
@@ -23,6 +23,7 @@
//$Id$
+import org.jboss.osgi.jbossxb.XMLBindingCapability;
import org.jboss.osgi.jmx.JMXCapability;
import org.jboss.osgi.spi.capability.Capability;
import org.jboss.osgi.spi.service.MicrocontainerService;
@@ -45,6 +46,7 @@
super(MicrocontainerService.class.getName());
addDependency(new JMXCapability());
+ addDependency(new XMLBindingCapability());
addBundle("bundles/jboss-osgi-microcontainer.jar");
}
Added: projects/jboss-osgi/projects/bundles/microcontainer/trunk/src/test/java/org/jboss/test/osgi/microcontainer/BasicMicrocontainerTestCase.java
===================================================================
--- projects/jboss-osgi/projects/bundles/microcontainer/trunk/src/test/java/org/jboss/test/osgi/microcontainer/BasicMicrocontainerTestCase.java (rev 0)
+++ projects/jboss-osgi/projects/bundles/microcontainer/trunk/src/test/java/org/jboss/test/osgi/microcontainer/BasicMicrocontainerTestCase.java 2009-11-26 22:32:23 UTC (rev 97050)
@@ -0,0 +1,72 @@
+/*
+ * 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.test.osgi.microcontainer;
+
+//$Id: BasicXMLBindingTestCase.java 97031 2009-11-26 14:54:08Z thomas.diesler(a)jboss.com $
+
+import static org.junit.Assert.assertNotNull;
+
+import org.jboss.osgi.husky.HuskyCapability;
+import org.jboss.osgi.microcontainer.MicrocontainerCapability;
+import org.jboss.osgi.spi.service.MicrocontainerService;
+import org.jboss.osgi.testing.OSGiRuntime;
+import org.jboss.osgi.testing.OSGiServiceReference;
+import org.jboss.osgi.testing.OSGiTest;
+import org.junit.After;
+import org.junit.Before;
+import org.junit.Test;
+import org.osgi.framework.BundleException;
+
+/**
+ * Test MicrocontainerService
+ *
+ * @author thomas.diesler(a)jboss.com
+ * @since 26-Nov-2009
+ */
+public class BasicMicrocontainerTestCase extends OSGiTest
+{
+ private OSGiRuntime runtime;
+
+ @Before
+ public void setUp() throws Exception
+ {
+ runtime = getDefaultRuntime();
+ runtime.addCapability(new HuskyCapability());
+ runtime.addCapability(new MicrocontainerCapability());
+
+ //OSGiBundle bundle = runtime.installBundle("simple-unmarshaller.jar");
+ //bundle.start();
+ }
+
+ @After
+ public void tearDown() throws BundleException
+ {
+ runtime.shutdown();
+ }
+
+ @Test
+ public void testMicrocontainerService() throws Exception
+ {
+ OSGiServiceReference sref = runtime.getServiceReference(MicrocontainerService.class.getName());
+ assertNotNull("MicrocontainerService available", sref);
+ }
+}
\ No newline at end of file
Added: projects/jboss-osgi/projects/bundles/microcontainer/trunk/src/test/java/org/jboss/test/osgi/microcontainer/simple/SimpleActivator.java
===================================================================
--- projects/jboss-osgi/projects/bundles/microcontainer/trunk/src/test/java/org/jboss/test/osgi/microcontainer/simple/SimpleActivator.java (rev 0)
+++ projects/jboss-osgi/projects/bundles/microcontainer/trunk/src/test/java/org/jboss/test/osgi/microcontainer/simple/SimpleActivator.java 2009-11-26 22:32:23 UTC (rev 97050)
@@ -0,0 +1,45 @@
+/*
+ * 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.test.osgi.microcontainer.simple;
+
+//$Id: SomeServiceActivator.java 89664 2009-06-02 12:55:10Z thomas.diesler(a)jboss.com $
+
+import org.osgi.framework.BundleActivator;
+import org.osgi.framework.BundleContext;
+
+/**
+ * A Service Activator
+ *
+ * @author thomas.diesler(a)jboss.com
+ * @since 24-Apr-2009
+ */
+public class SimpleActivator implements BundleActivator
+{
+ public void start(BundleContext context)
+ {
+ context.registerService(SomeService.class.getName(), new SomeService(context), null);
+ }
+
+ public void stop(BundleContext context)
+ {
+ }
+}
\ No newline at end of file
Added: projects/jboss-osgi/projects/bundles/microcontainer/trunk/src/test/java/org/jboss/test/osgi/microcontainer/simple/SomeBean.java
===================================================================
--- projects/jboss-osgi/projects/bundles/microcontainer/trunk/src/test/java/org/jboss/test/osgi/microcontainer/simple/SomeBean.java (rev 0)
+++ projects/jboss-osgi/projects/bundles/microcontainer/trunk/src/test/java/org/jboss/test/osgi/microcontainer/simple/SomeBean.java 2009-11-26 22:32:23 UTC (rev 97050)
@@ -0,0 +1,28 @@
+/*
+ * 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.test.osgi.microcontainer.simple;
+
+//$Id: SomeBean.java 93025 2009-08-31 13:10:16Z thomas.diesler(a)jboss.com $
+
+public class SomeBean
+{
+}
Added: projects/jboss-osgi/projects/bundles/microcontainer/trunk/src/test/java/org/jboss/test/osgi/microcontainer/simple/SomeService.java
===================================================================
--- projects/jboss-osgi/projects/bundles/microcontainer/trunk/src/test/java/org/jboss/test/osgi/microcontainer/simple/SomeService.java (rev 0)
+++ projects/jboss-osgi/projects/bundles/microcontainer/trunk/src/test/java/org/jboss/test/osgi/microcontainer/simple/SomeService.java 2009-11-26 22:32:23 UTC (rev 97050)
@@ -0,0 +1,54 @@
+/*
+ * 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.test.osgi.microcontainer.simple;
+
+//$Id: SomeService.java 93025 2009-08-31 13:10:16Z thomas.diesler(a)jboss.com $
+
+import org.jboss.osgi.spi.service.MicrocontainerService;
+import org.osgi.framework.BundleContext;
+import org.osgi.framework.ServiceReference;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+/**
+ * A service that accesses the MicrocontainerService
+ *
+ * @author thomas.diesler(a)jboss.com
+ * @since 24-Apr-2009
+ */
+public class SomeService
+{
+ // Provide logging
+ private static Logger log = LoggerFactory.getLogger(SomeService.class);
+
+ public SomeService(BundleContext context)
+ {
+ ServiceReference sref = context.getServiceReference(MicrocontainerService.class.getName());
+ MicrocontainerService service = (MicrocontainerService)context.getService(sref);
+
+ SomeBean bean = (SomeBean)service.getRegisteredBean("SomeBean");
+ if (bean == null)
+ throw new IllegalStateException("No MC bean");
+
+ log.info("MC bean available");
+ }
+}
Added: projects/jboss-osgi/projects/bundles/microcontainer/trunk/src/test/resources/jboss-osgi-framework.properties
===================================================================
--- projects/jboss-osgi/projects/bundles/microcontainer/trunk/src/test/resources/jboss-osgi-framework.properties (rev 0)
+++ projects/jboss-osgi/projects/bundles/microcontainer/trunk/src/test/resources/jboss-osgi-framework.properties 2009-11-26 22:32:23 UTC (rev 97050)
@@ -0,0 +1,40 @@
+#
+# Properties read by the org.jboss.osgi.spi.framework.PropertiesBootstrapProvider
+#
+# $Id: jboss-osgi-framework.properties 97021 2009-11-26 12:40:11Z thomas.diesler(a)jboss.com $
+#
+
+# Properties to configure the Framework
+org.osgi.framework.storage=${test.archive.directory}/../osgi-store
+org.osgi.framework.storage.clean=onFirstInit
+
+# Framework bootdelegation
+# org.osgi.framework.bootdelegation=
+
+# Extra System Packages
+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.deployment.interceptor;version=1.0, \
+ org.jboss.osgi.spi;version=1.0, \
+ org.jboss.osgi.spi.capability;version=1.0, \
+ org.jboss.osgi.spi.management;version=1.0, \
+ org.jboss.osgi.spi.service;version=1.0, \
+ org.jboss.osgi.spi.util;version=1.0, \
+ org.jboss.virtual;version=2.1, \
+ org.jboss.virtual.plugins.registry;version=2.1, \
+ org.jboss.virtual.plugins.context.jar;version=2.1, \
+ org.jboss.virtual.plugins.vfs.helpers;version=2.1, \
+ org.jboss.virtual.protocol;version=2.1, \
+ org.osgi.framework;version=1.5, \
+ org.slf4j;version=1.5
+
+# Bundles that need to be installed with the Framework automatically
+org.jboss.osgi.spi.framework.autoInstall=\
+ file://${test.archive.directory}/bundles/org.osgi.compendium.jar
+
+# Bundles that need to be started automatically
+#org.jboss.osgi.spi.framework.autoStart=\
+# file://${test.archive.directory}/bundles/jboss-osgi-common.jar
Added: projects/jboss-osgi/projects/bundles/microcontainer/trunk/src/test/resources/log4j.xml
===================================================================
--- projects/jboss-osgi/projects/bundles/microcontainer/trunk/src/test/resources/log4j.xml (rev 0)
+++ projects/jboss-osgi/projects/bundles/microcontainer/trunk/src/test/resources/log4j.xml 2009-11-26 22:32:23 UTC (rev 97050)
@@ -0,0 +1,55 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE log4j:configuration SYSTEM "log4j.dtd">
+
+<log4j:configuration xmlns:log4j="http://jakarta.apache.org/log4j/" debug="false">
+
+ <!-- ================================= -->
+ <!-- Preserve messages in a local file -->
+ <!-- ================================= -->
+
+ <appender name="FILE" class="org.apache.log4j.FileAppender">
+ <param name="File" value="${log4j.output.dir}/test.log"/>
+ <param name="Append" value="false"/>
+ <layout class="org.apache.log4j.PatternLayout">
+ <!-- The default pattern: Date Priority [Category] Message\n -->
+ <param name="ConversionPattern" value="%d %-5p [%c] %m%n"/>
+ </layout>
+ </appender>
+
+ <!-- ============================== -->
+ <!-- Append messages to the console -->
+ <!-- ============================== -->
+
+ <appender name="CONSOLE" class="org.apache.log4j.ConsoleAppender">
+ <param name="Target" value="System.out" />
+ <param name="Threshold" value="INFO" />
+ <layout class="org.apache.log4j.PatternLayout">
+ <param name="ConversionPattern" value="%d{HH:mm:ss,SSS} %-5p [%c{1}] %m%n" />
+ </layout>
+ </appender>
+
+ <!-- ================ -->
+ <!-- Limit categories -->
+ <!-- ================ -->
+
+ <!-- Show jboss deployer traces
+ <category name="org.jboss.deployers">
+ <priority value="TRACE" />
+ </category>
+ -->
+
+ <!-- Show jboss deployer traces -->
+ <category name="org.jboss.xb">
+ <priority value="TRACE" />
+ </category>
+
+ <!-- ======================= -->
+ <!-- Setup the Root category -->
+ <!-- ======================= -->
+
+ <root>
+ <!--appender-ref ref="CONSOLE"/-->
+ <appender-ref ref="FILE"/>
+ </root>
+
+</log4j:configuration>
Modified: projects/jboss-osgi/projects/runtime/framework/branches/1.0.0.Alpha2/src/main/java/org/jboss/osgi/framework/plugins/internal/AutoInstallPluginImpl.java
===================================================================
--- projects/jboss-osgi/projects/runtime/framework/branches/1.0.0.Alpha2/src/main/java/org/jboss/osgi/framework/plugins/internal/AutoInstallPluginImpl.java 2009-11-26 21:48:31 UTC (rev 97049)
+++ projects/jboss-osgi/projects/runtime/framework/branches/1.0.0.Alpha2/src/main/java/org/jboss/osgi/framework/plugins/internal/AutoInstallPluginImpl.java 2009-11-26 22:32:23 UTC (rev 97050)
@@ -24,6 +24,7 @@
//$Id$
import java.net.URL;
+import java.util.Collections;
import java.util.List;
import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;
@@ -45,8 +46,8 @@
// Provide logging
final Logger log = Logger.getLogger(AutoInstallPluginImpl.class);
- private List<URL> autoInstall;
- private List<URL> autoStart;
+ private List<URL> autoInstall = Collections.emptyList();
+ private List<URL> autoStart = Collections.emptyList();
private Map<URL, Bundle> autoBundles = new ConcurrentHashMap<URL, Bundle>();
@@ -55,7 +56,6 @@
super(bundleManager);
}
-
public void setAutoInstall(List<URL> autoInstall)
{
this.autoInstall = autoInstall;
Modified: projects/jboss-osgi/trunk/pom.xml
===================================================================
--- projects/jboss-osgi/trunk/pom.xml 2009-11-26 21:48:31 UTC (rev 97049)
+++ projects/jboss-osgi/trunk/pom.xml 2009-11-26 22:32:23 UTC (rev 97050)
@@ -51,15 +51,15 @@
<version.izpack>4.3.1</version.izpack>
<version.jboss.osgi.apache.xerces>2.9.1-SNAPSHOT</version.jboss.osgi.apache.xerces>
<version.jboss.osgi.blueprint>1.0.0.Alpha3</version.jboss.osgi.blueprint>
- <version.jboss.osgi.common>1.0.3</version.jboss.osgi.common>
+ <version.jboss.osgi.common>1.0.4-SNAPSHOT</version.jboss.osgi.common>
<version.jboss.osgi.common.core>2.2.13.GA</version.jboss.osgi.common.core>
<version.jboss.osgi.deployment>1.0.0</version.jboss.osgi.deployment>
<version.jboss.osgi.framework>1.0.0.Alpha2-SNAPSHOT</version.jboss.osgi.framework>
<version.jboss.osgi.hotdeploy>1.0.3</version.jboss.osgi.hotdeploy>
<version.jboss.osgi.husky>1.0.2-SNAPSHOT</version.jboss.osgi.husky>
<version.jboss.osgi.jaxb>2.1.10-SNAPSHOT</version.jboss.osgi.jaxb>
- <version.jboss.osgi.jmx>1.0.2</version.jboss.osgi.jmx>
- <version.jboss.osgi.jndi>1.0.1</version.jboss.osgi.jndi>
+ <version.jboss.osgi.jmx>1.0.2-SNAPSHOT</version.jboss.osgi.jmx>
+ <version.jboss.osgi.jndi>1.0.2-SNAPSHOT</version.jboss.osgi.jndi>
<version.jboss.osgi.jta>1.0.0</version.jboss.osgi.jta>
<version.jboss.osgi.microcontainer>2.0.9-SNAPSHOT</version.jboss.osgi.microcontainer>
<version.jboss.osgi.runtime.deployers>1.0.3</version.jboss.osgi.runtime.deployers>
Modified: projects/jboss-osgi/trunk/reactor/blueprint/pom.xml
===================================================================
--- projects/jboss-osgi/trunk/reactor/blueprint/pom.xml 2009-11-26 21:48:31 UTC (rev 97049)
+++ projects/jboss-osgi/trunk/reactor/blueprint/pom.xml 2009-11-26 22:32:23 UTC (rev 97050)
@@ -64,6 +64,11 @@
</dependency>
<dependency>
<groupId>org.jboss.osgi.bundles</groupId>
+ <artifactId>jboss-osgi-common</artifactId>
+ <scope>provided</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.jboss.osgi.bundles</groupId>
<artifactId>jboss-osgi-common-core</artifactId>
<scope>provided</scope>
</dependency>
Modified: projects/jboss-osgi/trunk/reactor/blueprint/scripts/assembly-bundles.xml
===================================================================
--- projects/jboss-osgi/trunk/reactor/blueprint/scripts/assembly-bundles.xml 2009-11-26 21:48:31 UTC (rev 97049)
+++ projects/jboss-osgi/trunk/reactor/blueprint/scripts/assembly-bundles.xml 2009-11-26 22:32:23 UTC (rev 97050)
@@ -24,7 +24,6 @@
<include>*:jboss-osgi-jndi:jar</include>
<include>*:jboss-osgi-microcontainer:jar</include>
<include>*:jboss-osgi-xml-binding:jar</include>
- <include>*:org.apache.felix.log:jar</include>
</includes>
<useStrictFiltering>true</useStrictFiltering>
<scope>provided</scope>
Modified: projects/jboss-osgi/trunk/reactor/blueprint/src/test/resources/META-INF/jboss-osgi-bootstrap.xml
===================================================================
--- projects/jboss-osgi/trunk/reactor/blueprint/src/test/resources/META-INF/jboss-osgi-bootstrap.xml 2009-11-26 21:48:31 UTC (rev 97049)
+++ projects/jboss-osgi/trunk/reactor/blueprint/src/test/resources/META-INF/jboss-osgi-bootstrap.xml 2009-11-26 22:32:23 UTC (rev 97050)
@@ -68,7 +68,6 @@
</property>
<property name="autoStart">
<list elementClass="java.net.URL">
- <value>${test.archive.directory}/bundles/org.apache.felix.log.jar</value>
<value>${test.archive.directory}/bundles/jboss-osgi-common.jar</value>
</list>
</property>
Modified: projects/jboss-osgi/trunk/reactor/blueprint/src/test/resources/jboss-osgi-framework.properties
===================================================================
--- projects/jboss-osgi/trunk/reactor/blueprint/src/test/resources/jboss-osgi-framework.properties 2009-11-26 21:48:31 UTC (rev 97049)
+++ projects/jboss-osgi/trunk/reactor/blueprint/src/test/resources/jboss-osgi-framework.properties 2009-11-26 22:32:23 UTC (rev 97050)
@@ -38,6 +38,5 @@
# Bundles that need to be started automatically
org.jboss.osgi.spi.framework.autoStart=\
- file://${test.archive.directory}/bundles/org.apache.felix.log.jar \
file://${test.archive.directory}/bundles/jboss-osgi-common.jar
\ No newline at end of file
14 years, 6 months
JBoss-OSGI SVN: r97046 - in projects/jboss-osgi/trunk/reactor/blueprint: src/test/resources/META-INF and 1 other directory.
by jboss-osgi-commits@lists.jboss.org
Author: thomas.diesler(a)jboss.com
Date: 2009-11-26 14:19:40 -0500 (Thu, 26 Nov 2009)
New Revision: 97046
Modified:
projects/jboss-osgi/trunk/reactor/blueprint/pom.xml
projects/jboss-osgi/trunk/reactor/blueprint/src/test/resources/META-INF/jboss-osgi-bootstrap.xml
Log:
Use MC for BP default framework
Modified: projects/jboss-osgi/trunk/reactor/blueprint/pom.xml
===================================================================
--- projects/jboss-osgi/trunk/reactor/blueprint/pom.xml 2009-11-26 18:24:59 UTC (rev 97045)
+++ projects/jboss-osgi/trunk/reactor/blueprint/pom.xml 2009-11-26 19:19:40 UTC (rev 97046)
@@ -331,32 +331,36 @@
</dependency>
</dependencies>
</profile>
+
+ <!--
+ Name: framework-jbossmc
+ Descr: Setup for JBossMC framework integration testing
+ -->
<profile>
- <id>framework-felix-default</id>
+ <id>framework-jbossmc</id>
<activation>
<property>
- <name>!framework</name>
+ <name>framework</name>
+ <value>jbossmc</value>
</property>
</activation>
<dependencies>
<dependency>
<groupId>org.jboss.osgi.runtime</groupId>
- <artifactId>jboss-osgi-runtime-felix</artifactId>
+ <artifactId>jboss-osgi-framework</artifactId>
<scope>provided</scope>
</dependency>
</dependencies>
+ <build>
+ <plugins>
+ </plugins>
+ </build>
</profile>
-
- <!--
- Name: framework-jbossmc
- Descr: Setup for JBossMC framework integration testing
- -->
<profile>
- <id>framework-jbossmc</id>
+ <id>framework-jbossmc-default</id>
<activation>
<property>
- <name>framework</name>
- <value>jbossmc</value>
+ <name>!framework</name>
</property>
</activation>
<dependencies>
Modified: projects/jboss-osgi/trunk/reactor/blueprint/src/test/resources/META-INF/jboss-osgi-bootstrap.xml
===================================================================
--- projects/jboss-osgi/trunk/reactor/blueprint/src/test/resources/META-INF/jboss-osgi-bootstrap.xml 2009-11-26 18:24:59 UTC (rev 97045)
+++ projects/jboss-osgi/trunk/reactor/blueprint/src/test/resources/META-INF/jboss-osgi-bootstrap.xml 2009-11-26 19:19:40 UTC (rev 97046)
@@ -33,6 +33,8 @@
org.jboss.dependency.spi;version=2.0,
org.jboss.kernel.spi.dependency;version=2.0,
org.jboss.logging;version=2.0,
+ org.jboss.reflect.spi;version=2.0,
+ org.jboss.util;version=2.2,
<!-- jboss-osgi -->
org.jboss.osgi.spi;version=1.0,
14 years, 6 months