JBoss-OSGI SVN: r91495 - in projects/jboss-osgi/projects: bundles/apache-xerces/trunk/src/main/java/org/jboss/osgi/apache/xerces and 11 other directories.
by jboss-osgi-commits@lists.jboss.org
Author: thomas.diesler(a)jboss.com
Date: 2009-07-21 09:54:45 -0400 (Tue, 21 Jul 2009)
New Revision: 91495
Added:
projects/jboss-osgi/projects/bundles/apache-xerces/trunk/src/main/java/org/jboss/osgi/xml/DocumentBuilderFactoryImpl.java
projects/jboss-osgi/projects/bundles/apache-xerces/trunk/src/main/java/org/jboss/osgi/xml/SAXParserFactoryImpl.java
projects/jboss-osgi/projects/bundles/apache-xerces/trunk/src/main/java/org/jboss/osgi/xml/XMLParserActivatorExt.java
projects/jboss-osgi/projects/runtime/jbossas/trunk/src/main/java/
projects/jboss-osgi/projects/runtime/jbossas/trunk/src/main/java/org/
projects/jboss-osgi/projects/runtime/jbossas/trunk/src/main/java/org/jboss/
projects/jboss-osgi/projects/runtime/jbossas/trunk/src/main/java/org/jboss/osgi/
projects/jboss-osgi/projects/runtime/jbossas/trunk/src/main/java/org/jboss/osgi/microcontainer/
projects/jboss-osgi/projects/runtime/jbossas/trunk/src/main/java/org/jboss/osgi/microcontainer/integration/
projects/jboss-osgi/projects/runtime/jbossas/trunk/src/main/java/org/jboss/osgi/microcontainer/integration/MicrocontainerServiceBean.java
Removed:
projects/jboss-osgi/projects/bundles/apache-xerces/trunk/src/main/java/org/jboss/osgi/apache/xerces/internal/
projects/jboss-osgi/projects/bundles/microcontainer/trunk/src/main/java/org/jboss/osgi/microcontainer/integration/MicrocontainerServiceBean.java
Modified:
projects/jboss-osgi/projects/bundles/apache-xerces/trunk/pom.xml
projects/jboss-osgi/projects/bundles/apache-xerces/trunk/src/main/resources/META-INF/services/javax.xml.parsers.DocumentBuilderFactory
projects/jboss-osgi/projects/bundles/apache-xerces/trunk/src/main/resources/META-INF/services/javax.xml.parsers.SAXParserFactory
projects/jboss-osgi/projects/runtime/jbossas/trunk/.classpath
projects/jboss-osgi/projects/runtime/jbossas/trunk/pom.xml
Log:
[JBOSGI-92] XMLParserActivator in compendium cannot load SAXParserFactory - WIP
Modified: projects/jboss-osgi/projects/bundles/apache-xerces/trunk/pom.xml
===================================================================
--- projects/jboss-osgi/projects/bundles/apache-xerces/trunk/pom.xml 2009-07-21 10:05:53 UTC (rev 91494)
+++ projects/jboss-osgi/projects/bundles/apache-xerces/trunk/pom.xml 2009-07-21 13:54:45 UTC (rev 91495)
@@ -89,7 +89,7 @@
<configuration>
<instructions>
<Bundle-SymbolicName>${artifactId}</Bundle-SymbolicName>
- <Bundle-Activator>org.jboss.osgi.apache.xerces.internal.XercesParserActivator</Bundle-Activator>
+ <Bundle-Activator>org.jboss.osgi.xml.XMLParserActivatorExt</Bundle-Activator>
<Bundle-ActivationPolicy>lazy</Bundle-ActivationPolicy>
<Private-Package>
org.jboss.osgi.apache.xerces.internal
@@ -108,7 +108,7 @@
<!-- import -->
org.jboss.osgi.common.log;version=1.0,
- org.jboss.osgi.spi.capability;version=1.0,
+ org.jboss.osgi.spi.capability;version=1.0,
org.osgi.framework,
org.osgi.service.log,
org.osgi.util.xml,
Added: projects/jboss-osgi/projects/bundles/apache-xerces/trunk/src/main/java/org/jboss/osgi/xml/DocumentBuilderFactoryImpl.java
===================================================================
--- projects/jboss-osgi/projects/bundles/apache-xerces/trunk/src/main/java/org/jboss/osgi/xml/DocumentBuilderFactoryImpl.java (rev 0)
+++ projects/jboss-osgi/projects/bundles/apache-xerces/trunk/src/main/java/org/jboss/osgi/xml/DocumentBuilderFactoryImpl.java 2009-07-21 13:54:45 UTC (rev 91495)
@@ -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.xml;
+
+//$Id: XercesParserActivator.java 91417 2009-07-20 09:25:44Z thomas.diesler(a)jboss.com $
+
+/**
+ * A DocumentBuilderFactory that gets loaded from this bundle.
+ *
+ * @author thomas.diesler(a)jboss.com
+ * @since 21-Jul-2009
+ */
+public class DocumentBuilderFactoryImpl extends org.apache.xerces.jaxp.DocumentBuilderFactoryImpl
+{
+}
\ No newline at end of file
Added: projects/jboss-osgi/projects/bundles/apache-xerces/trunk/src/main/java/org/jboss/osgi/xml/SAXParserFactoryImpl.java
===================================================================
--- projects/jboss-osgi/projects/bundles/apache-xerces/trunk/src/main/java/org/jboss/osgi/xml/SAXParserFactoryImpl.java (rev 0)
+++ projects/jboss-osgi/projects/bundles/apache-xerces/trunk/src/main/java/org/jboss/osgi/xml/SAXParserFactoryImpl.java 2009-07-21 13:54:45 UTC (rev 91495)
@@ -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.xml;
+
+//$Id: XercesParserActivator.java 91417 2009-07-20 09:25:44Z thomas.diesler(a)jboss.com $
+
+/**
+ * A SAXParserFactory that gets loaded from this bundle.
+ *
+ * @author thomas.diesler(a)jboss.com
+ * @since 21-Jul-2009
+ */
+public class SAXParserFactoryImpl extends org.apache.xerces.jaxp.SAXParserFactoryImpl
+{
+}
\ No newline at end of file
Copied: projects/jboss-osgi/projects/bundles/apache-xerces/trunk/src/main/java/org/jboss/osgi/xml/XMLParserActivatorExt.java (from rev 91485, projects/jboss-osgi/projects/bundles/apache-xerces/trunk/src/main/java/org/jboss/osgi/apache/xerces/internal/XercesParserActivator.java)
===================================================================
--- projects/jboss-osgi/projects/bundles/apache-xerces/trunk/src/main/java/org/jboss/osgi/xml/XMLParserActivatorExt.java (rev 0)
+++ projects/jboss-osgi/projects/bundles/apache-xerces/trunk/src/main/java/org/jboss/osgi/xml/XMLParserActivatorExt.java 2009-07-21 13:54:45 UTC (rev 91495)
@@ -0,0 +1,213 @@
+/*
+ * 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.xml;
+
+//$Id$
+
+import java.util.Hashtable;
+
+import javax.xml.parsers.DocumentBuilderFactory;
+import javax.xml.parsers.SAXParserFactory;
+
+import org.jboss.osgi.common.log.LogServiceTracker;
+import org.osgi.framework.BundleContext;
+import org.osgi.framework.ServiceReference;
+import org.osgi.service.log.LogService;
+import org.osgi.util.xml.XMLParserActivator;
+
+/**
+ * Activate the XML parser using {@link XMLParserActivatorExt}
+ *
+ * @author thomas.diesler(a)jboss.com
+ * @since 29-Apr-2009
+ */
+public class XMLParserActivatorExt extends XMLParserActivator
+{
+ private LogService log;
+
+ /*
+ * Service property specifying if factory is configured to support XInclude aware parsers.
+ * The value is of type <code>Boolean</code>.
+ */
+ public static final String PARSER_XINCLUDEAWARE = "parser.xincludeAware";
+
+ public void start(BundleContext context) throws Exception
+ {
+ log = new LogServiceTracker(context);
+ super.start(context);
+ logSAXParserFactory(context);
+ logDOMParserFactory(context);
+ }
+
+
+ @Override
+ @SuppressWarnings("unchecked")
+ public void setDOMProperties(DocumentBuilderFactory factory, Hashtable props)
+ {
+ // check if this parser can be configured to validate
+ boolean validating = true;
+ factory.setValidating(true);
+ factory.setNamespaceAware(false);
+ try
+ {
+ factory.newDocumentBuilder();
+ }
+ catch (Exception pce_val)
+ {
+ validating = false;
+ }
+
+ // check if this parser can be configured to be namespaceaware
+ boolean namespaceaware = true;
+ factory.setValidating(false);
+ factory.setNamespaceAware(true);
+ try
+ {
+ factory.newDocumentBuilder();
+ }
+ catch (Exception pce_nsa)
+ {
+ namespaceaware = false;
+ }
+
+ // check if this parser can be configured to be xinclude aware
+ boolean xinclude = true;
+ factory.setValidating(validating);
+ factory.setNamespaceAware(namespaceaware);
+ factory.setXIncludeAware(true);
+ try
+ {
+ factory.newDocumentBuilder();
+ }
+ catch (Exception pce_inc)
+ {
+ xinclude = false;
+ }
+
+ // set the factory values
+ factory.setValidating(validating);
+ factory.setNamespaceAware(namespaceaware);
+ factory.setXIncludeAware(xinclude);
+
+ // set the OSGi service properties
+ props.put(PARSER_VALIDATING, new Boolean(validating));
+ props.put(PARSER_NAMESPACEAWARE, new Boolean(namespaceaware));
+ props.put(PARSER_XINCLUDEAWARE, new Boolean(xinclude));
+ }
+
+
+ @Override
+ @SuppressWarnings("unchecked")
+ public void setSAXProperties(SAXParserFactory factory, Hashtable props)
+ {
+ // check if this parser can be configured to validate
+ boolean validating = true;
+ factory.setValidating(true);
+ factory.setNamespaceAware(false);
+ try
+ {
+ factory.newSAXParser();
+ }
+ catch (Exception pce_val)
+ {
+ validating = false;
+ }
+
+ // check if this parser can be configured to be namespaceaware
+ boolean namespaceaware = true;
+ factory.setValidating(false);
+ factory.setNamespaceAware(true);
+ try
+ {
+ factory.newSAXParser();
+ }
+ catch (Exception pce_nsa)
+ {
+ namespaceaware = false;
+ }
+
+ // check if this parser can be configured to be xinclude aware
+ boolean xinclude = true;
+ factory.setValidating(validating);
+ factory.setNamespaceAware(namespaceaware);
+ factory.setXIncludeAware(true);
+ try
+ {
+ factory.newSAXParser();
+ }
+ catch (Exception pce_inc)
+ {
+ xinclude = false;
+ }
+
+ // set the factory values
+ factory.setValidating(validating);
+ factory.setNamespaceAware(namespaceaware);
+ factory.setXIncludeAware(xinclude);
+
+ // set the OSGi service properties
+ props.put(PARSER_NAMESPACEAWARE, new Boolean(namespaceaware));
+ props.put(PARSER_VALIDATING, new Boolean(validating));
+ props.put(PARSER_XINCLUDEAWARE, new Boolean(xinclude));
+ }
+
+
+ private void logSAXParserFactory(BundleContext context)
+ {
+ ServiceReference saxRef = context.getServiceReference(SAXParserFactory.class.getName());
+ if (saxRef != null)
+ {
+ Object factory = context.getService(saxRef);
+ log.log(LogService.LOG_DEBUG, "SAXParserFactory: " + factory.getClass().getName());
+
+ for (String key : saxRef.getPropertyKeys())
+ {
+ Object value = saxRef.getProperty(key);
+ log.log(LogService.LOG_DEBUG, " " + key + "=" + value);
+ }
+ }
+ else
+ {
+ log.log(LogService.LOG_WARNING, "No SAXParserFactory registered");
+ }
+ }
+
+ private void logDOMParserFactory(BundleContext context)
+ {
+ ServiceReference domRef = context.getServiceReference(DocumentBuilderFactory.class.getName());
+ if (domRef != null)
+ {
+ Object factory = context.getService(domRef);
+ log.log(LogService.LOG_DEBUG, "DocumentBuilderFactory: " + factory.getClass().getName());
+
+ for (String key : domRef.getPropertyKeys())
+ {
+ Object value = domRef.getProperty(key);
+ log.log(LogService.LOG_DEBUG, " " + key + "=" + value);
+ }
+ }
+ else
+ {
+ log.log(LogService.LOG_WARNING, "No DocumentBuilderFactory registered");
+ }
+ }
+}
\ No newline at end of file
Modified: projects/jboss-osgi/projects/bundles/apache-xerces/trunk/src/main/resources/META-INF/services/javax.xml.parsers.DocumentBuilderFactory
===================================================================
--- projects/jboss-osgi/projects/bundles/apache-xerces/trunk/src/main/resources/META-INF/services/javax.xml.parsers.DocumentBuilderFactory 2009-07-21 10:05:53 UTC (rev 91494)
+++ projects/jboss-osgi/projects/bundles/apache-xerces/trunk/src/main/resources/META-INF/services/javax.xml.parsers.DocumentBuilderFactory 2009-07-21 13:54:45 UTC (rev 91495)
@@ -1 +1 @@
-org.apache.xerces.jaxp.DocumentBuilderFactoryImpl
\ No newline at end of file
+org.jboss.osgi.xml.DocumentBuilderFactoryImpl
\ No newline at end of file
Modified: projects/jboss-osgi/projects/bundles/apache-xerces/trunk/src/main/resources/META-INF/services/javax.xml.parsers.SAXParserFactory
===================================================================
--- projects/jboss-osgi/projects/bundles/apache-xerces/trunk/src/main/resources/META-INF/services/javax.xml.parsers.SAXParserFactory 2009-07-21 10:05:53 UTC (rev 91494)
+++ projects/jboss-osgi/projects/bundles/apache-xerces/trunk/src/main/resources/META-INF/services/javax.xml.parsers.SAXParserFactory 2009-07-21 13:54:45 UTC (rev 91495)
@@ -1 +1 @@
-org.apache.xerces.jaxp.SAXParserFactoryImpl
\ No newline at end of file
+org.jboss.osgi.xml.SAXParserFactoryImpl
\ No newline at end of file
Deleted: projects/jboss-osgi/projects/bundles/microcontainer/trunk/src/main/java/org/jboss/osgi/microcontainer/integration/MicrocontainerServiceBean.java
===================================================================
--- projects/jboss-osgi/projects/bundles/microcontainer/trunk/src/main/java/org/jboss/osgi/microcontainer/integration/MicrocontainerServiceBean.java 2009-07-21 10:05:53 UTC (rev 91494)
+++ projects/jboss-osgi/projects/bundles/microcontainer/trunk/src/main/java/org/jboss/osgi/microcontainer/integration/MicrocontainerServiceBean.java 2009-07-21 13:54:45 UTC (rev 91495)
@@ -1,139 +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.integration;
-
-//$Id$
-
-import java.util.Properties;
-
-import javax.management.MBeanServer;
-import javax.naming.InitialContext;
-import javax.naming.NamingException;
-
-import org.jboss.kernel.Kernel;
-import org.jboss.kernel.spi.dependency.KernelController;
-import org.jboss.logging.Logger;
-import org.jboss.osgi.microcontainer.MicrocontainerService;
-import org.jboss.osgi.spi.management.MicrocontainerServiceMBean;
-import org.jboss.osgi.spi.service.DeployerService;
-import org.osgi.framework.BundleContext;
-
-/**
- * An implementation of the {@link DeployerService} and {@link MicrocontainerService}
- * which is installed as MC bean in jbossas.
- *
- * @author thomas.diesler(a)jboss.com
- * @since 05-May-2009
- */
-public class MicrocontainerServiceBean extends AbstractMicrocontainerService implements MicrocontainerServiceMBean
-{
- private static Logger log = Logger.getLogger(MicrocontainerServiceBean.class);
-
- private BundleContext context;
- private MBeanServer mbeanServer;
- private Kernel kernel;
-
- public void setSystemContext(BundleContext context)
- {
- this.context = context;
- }
-
- public void setMbeanServer(MBeanServer mbeanServer)
- {
- this.mbeanServer = mbeanServer;
- }
-
- public void setKernel(Kernel kernel)
- {
- this.kernel = kernel;
- }
-
- public Kernel getKernel()
- {
- return kernel;
- }
-
- @Override
- public void logDebug(String message)
- {
- log.debug(message);
- }
-
- @Override
- public void logWarning(String message, Exception ex)
- {
- log.warn(message, ex);
- }
-
- public void start()
- {
- Kernel kernel = getKernel();
- KernelController controller = kernel.getController();
-
- // Register the MBeanServer
- context.registerService(MBeanServer.class.getName(), mbeanServer, null);
- log.debug("MBeanServer registered");
-
- // Register the InitialContext service
- registerInitialContext();
- log.debug("InitialContext registered");
-
- // Preregister some beans
- installBean(controller, BEAN_SYSTEM_BUNDLE_CONTEXT, context);
- installBean(controller, BEAN_KERNEL, kernel);
- installBean(controller, BEAN_KERNEL_CONTROLLER, controller);
- installBean(controller, BEAN_MBEAN_SERVER, mbeanServer);
-
- // Register the MicrocontainerService
- log.debug("Register MicrocontainerService");
- context.registerService(MicrocontainerService.class.getName(), this, null);
- log.debug("MicrocontainerService registered");
-
- // Register the DeployerService
- Properties props = new Properties();
- props.setProperty("provider", "microcontainer");
- context.registerService(DeployerService.class.getName(), this, props);
- log.debug("DeployerService registered");
-
- // Register the MicrocontainerServiceMBean
- registerMicrocontainerServiceMBean(mbeanServer);
- log.debug("MicrocontainerServiceMBean registered");
- }
-
- void stop()
- {
- unregisterMicrocontainerServiceMBean(mbeanServer);
- }
-
- public void registerInitialContext()
- {
- try
- {
- InitialContext initialContext = new InitialContext();
- context.registerService(InitialContext.class.getName(), initialContext, null);
- }
- catch (NamingException ex)
- {
- throw new IllegalStateException("Cannot register InitialContext", ex);
- }
- }
-}
\ No newline at end of file
Modified: projects/jboss-osgi/projects/runtime/jbossas/trunk/.classpath
===================================================================
--- projects/jboss-osgi/projects/runtime/jbossas/trunk/.classpath 2009-07-21 10:05:53 UTC (rev 91494)
+++ projects/jboss-osgi/projects/runtime/jbossas/trunk/.classpath 2009-07-21 13:54:45 UTC (rev 91495)
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
- <classpathentry kind="src" output="target/classes" path="src/main/java"/>
<classpathentry excluding="**" kind="src" output="target/classes" path="src/main/resources"/>
+ <classpathentry kind="src" 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/runtime/jbossas/trunk/pom.xml
===================================================================
--- projects/jboss-osgi/projects/runtime/jbossas/trunk/pom.xml 2009-07-21 10:05:53 UTC (rev 91494)
+++ projects/jboss-osgi/projects/runtime/jbossas/trunk/pom.xml 2009-07-21 13:54:45 UTC (rev 91495)
@@ -31,6 +31,7 @@
<properties>
<version.jboss.osgi.microcontainer>1.0.0-SNAPSHOT</version.jboss.osgi.microcontainer>
+ <version.osgi>r4v41</version.osgi>
</properties>
<!-- Dependencies -->
@@ -40,6 +41,18 @@
<artifactId>jboss-osgi-microcontainer</artifactId>
<version>${version.jboss.osgi.microcontainer}</version>
</dependency>
+ <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>
</dependencies>
<!-- Build -->
Copied: projects/jboss-osgi/projects/runtime/jbossas/trunk/src/main/java/org/jboss/osgi/microcontainer/integration/MicrocontainerServiceBean.java (from rev 91485, projects/jboss-osgi/projects/bundles/microcontainer/trunk/src/main/java/org/jboss/osgi/microcontainer/integration/MicrocontainerServiceBean.java)
===================================================================
--- projects/jboss-osgi/projects/runtime/jbossas/trunk/src/main/java/org/jboss/osgi/microcontainer/integration/MicrocontainerServiceBean.java (rev 0)
+++ projects/jboss-osgi/projects/runtime/jbossas/trunk/src/main/java/org/jboss/osgi/microcontainer/integration/MicrocontainerServiceBean.java 2009-07-21 13:54:45 UTC (rev 91495)
@@ -0,0 +1,146 @@
+/*
+ * 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.integration;
+
+
+//$Id$
+
+import java.util.Properties;
+
+import javax.management.MBeanServer;
+import javax.naming.InitialContext;
+import javax.naming.NamingException;
+
+import org.jboss.kernel.Kernel;
+import org.jboss.kernel.spi.dependency.KernelController;
+import org.jboss.logging.Logger;
+import org.jboss.osgi.microcontainer.MicrocontainerService;
+import org.jboss.osgi.microcontainer.integration.AbstractMicrocontainerService;
+import org.jboss.osgi.spi.management.MicrocontainerServiceMBean;
+import org.jboss.osgi.spi.service.DeployerService;
+import org.jboss.osgi.xml.XMLParserActivatorExt;
+import org.osgi.framework.BundleContext;
+
+/**
+ * An implementation of the {@link DeployerService} and {@link MicrocontainerService}
+ * which is installed as MC bean in jbossas.
+ *
+ * @author thomas.diesler(a)jboss.com
+ * @since 05-May-2009
+ */
+public class MicrocontainerServiceBean extends AbstractMicrocontainerService implements MicrocontainerServiceMBean
+{
+ private static Logger log = Logger.getLogger(MicrocontainerServiceBean.class);
+
+ private BundleContext context;
+ private MBeanServer mbeanServer;
+ private Kernel kernel;
+
+ public void setSystemContext(BundleContext context)
+ {
+ this.context = context;
+ }
+
+ public void setMbeanServer(MBeanServer mbeanServer)
+ {
+ this.mbeanServer = mbeanServer;
+ }
+
+ public void setKernel(Kernel kernel)
+ {
+ this.kernel = kernel;
+ }
+
+ public Kernel getKernel()
+ {
+ return kernel;
+ }
+
+ @Override
+ public void logDebug(String message)
+ {
+ log.debug(message);
+ }
+
+ @Override
+ public void logWarning(String message, Exception ex)
+ {
+ log.warn(message, ex);
+ }
+
+ public void start() throws Exception
+ {
+ Kernel kernel = getKernel();
+ KernelController controller = kernel.getController();
+
+ // Register the MBeanServer
+ context.registerService(MBeanServer.class.getName(), mbeanServer, null);
+ log.debug("MBeanServer registered");
+
+ // Register the InitialContext service
+ registerInitialContext();
+ log.debug("InitialContext registered");
+
+ // Preregister some beans
+ installBean(controller, BEAN_SYSTEM_BUNDLE_CONTEXT, context);
+ installBean(controller, BEAN_KERNEL, kernel);
+ installBean(controller, BEAN_KERNEL_CONTROLLER, controller);
+ installBean(controller, BEAN_MBEAN_SERVER, mbeanServer);
+
+ // Register the MicrocontainerService
+ log.debug("Register MicrocontainerService");
+ context.registerService(MicrocontainerService.class.getName(), this, null);
+ log.debug("MicrocontainerService registered");
+
+ // Register the DeployerService
+ Properties props = new Properties();
+ props.setProperty("provider", "microcontainer");
+ context.registerService(DeployerService.class.getName(), this, props);
+ log.debug("DeployerService registered");
+
+ // Register the MicrocontainerServiceMBean
+ registerMicrocontainerServiceMBean(mbeanServer);
+ log.debug("MicrocontainerServiceMBean registered");
+
+ // Register the DOM/SAX factories
+ XMLParserActivatorExt parserActivator = new XMLParserActivatorExt();
+ parserActivator.start(context);
+ }
+
+ void stop()
+ {
+ unregisterMicrocontainerServiceMBean(mbeanServer);
+ }
+
+ public void registerInitialContext()
+ {
+ try
+ {
+ InitialContext initialContext = new InitialContext();
+ context.registerService(InitialContext.class.getName(), initialContext, null);
+ }
+ catch (NamingException ex)
+ {
+ throw new IllegalStateException("Cannot register InitialContext", ex);
+ }
+ }
+}
\ No newline at end of file
16 years, 5 months
JBoss-OSGI SVN: r91494 - in projects/jboss-osgi: projects/bundles/jaxb/trunk/src/main/java/org/jboss/osgi/jaxb/internal and 6 other directories.
by jboss-osgi-commits@lists.jboss.org
Author: thomas.diesler(a)jboss.com
Date: 2009-07-21 06:05:53 -0400 (Tue, 21 Jul 2009)
New Revision: 91494
Added:
projects/jboss-osgi/trunk/testsuite/example/src/test/java/org/jboss/test/osgi/example/xml/jaxb/
projects/jboss-osgi/trunk/testsuite/example/src/test/java/org/jboss/test/osgi/example/xml/jaxb/CompanyType.java
projects/jboss-osgi/trunk/testsuite/example/src/test/java/org/jboss/test/osgi/example/xml/jaxb/ContactType.java
projects/jboss-osgi/trunk/testsuite/example/src/test/java/org/jboss/test/osgi/example/xml/jaxb/CourseBooking.java
projects/jboss-osgi/trunk/testsuite/example/src/test/java/org/jboss/test/osgi/example/xml/jaxb/JAXBTestCase.java
projects/jboss-osgi/trunk/testsuite/example/src/test/java/org/jboss/test/osgi/example/xml/jaxb/ObjectFactory.java
projects/jboss-osgi/trunk/testsuite/example/src/test/java/org/jboss/test/osgi/example/xml/jaxb/StudentType.java
projects/jboss-osgi/trunk/testsuite/example/src/test/resources/xml/jaxb/
projects/jboss-osgi/trunk/testsuite/example/src/test/resources/xml/jaxb/booking.xml
projects/jboss-osgi/trunk/testsuite/example/src/test/resources/xml/jaxb/booking.xsd
projects/jboss-osgi/trunk/testsuite/example/src/test/resources/xml/jaxb/example-xml-jaxb.bnd
Modified:
projects/jboss-osgi/projects/bundles/jaxb/trunk/src/main/java/org/jboss/osgi/jaxb/JAXBService.java
projects/jboss-osgi/projects/bundles/jaxb/trunk/src/main/java/org/jboss/osgi/jaxb/internal/JAXBServiceImpl.java
projects/jboss-osgi/trunk/testsuite/example/scripts/antrun-test-jars.xml
projects/jboss-osgi/trunk/testsuite/example/src/test/java/org/jboss/test/osgi/example/xml/parser/DOMParserTestCase.java
projects/jboss-osgi/trunk/testsuite/example/src/test/java/org/jboss/test/osgi/example/xml/parser/SAXParserTestCase.java
Log:
[JBOSGI-95] Provide JAXB example
Modified: projects/jboss-osgi/projects/bundles/jaxb/trunk/src/main/java/org/jboss/osgi/jaxb/JAXBService.java
===================================================================
--- projects/jboss-osgi/projects/bundles/jaxb/trunk/src/main/java/org/jboss/osgi/jaxb/JAXBService.java 2009-07-21 09:58:10 UTC (rev 91493)
+++ projects/jboss-osgi/projects/bundles/jaxb/trunk/src/main/java/org/jboss/osgi/jaxb/JAXBService.java 2009-07-21 10:05:53 UTC (rev 91494)
@@ -41,26 +41,26 @@
*
* @see {@link JAXBContext#newInstance(String)}
*/
- JAXBContext newInstance(String contextPath) throws JAXBException;
+ JAXBContext newJAXBContext(String contextPath) throws JAXBException;
/**
* Obtain a new instance of a JAXBContext class.
*
* @see {@link JAXBContext#newInstance(String,ClassLoader,Map)}
*/
- JAXBContext newInstance(String contextPath, Map<String,?> props) throws JAXBException;
+ JAXBContext newJAXBContext(String contextPath, Map<String,?> props) throws JAXBException;
/**
* Obtain a new instance of a JAXBContext class.
*
* @see {@link JAXBContext#newInstance(Class...)}
*/
- JAXBContext newInstance(Class<?> ... classesToBeBound) throws JAXBException;
+ JAXBContext newJAXBContext(Class<?> ... classesToBeBound) throws JAXBException;
/**
* Obtain a new instance of a JAXBContext class.
*
* @see {@link JAXBContext#newInstance(Class[], Map)}
*/
- JAXBContext newInstance(Class<?>[] classesToBeBound, Map<String,?> props) throws JAXBException;
+ JAXBContext newJAXBContext(Class<?>[] classesToBeBound, Map<String,?> props) throws JAXBException;
}
\ No newline at end of file
Modified: projects/jboss-osgi/projects/bundles/jaxb/trunk/src/main/java/org/jboss/osgi/jaxb/internal/JAXBServiceImpl.java
===================================================================
--- projects/jboss-osgi/projects/bundles/jaxb/trunk/src/main/java/org/jboss/osgi/jaxb/internal/JAXBServiceImpl.java 2009-07-21 09:58:10 UTC (rev 91493)
+++ projects/jboss-osgi/projects/bundles/jaxb/trunk/src/main/java/org/jboss/osgi/jaxb/internal/JAXBServiceImpl.java 2009-07-21 10:05:53 UTC (rev 91494)
@@ -47,23 +47,23 @@
this.bundle = bundle;
}
- public JAXBContext newInstance(String contextPath) throws JAXBException
+ public JAXBContext newJAXBContext(String contextPath) throws JAXBException
{
- return newInstance(contextPath, null);
+ return newJAXBContext(contextPath, null);
}
- public JAXBContext newInstance(String contextPath, Map<String, ?> props) throws JAXBException
+ public JAXBContext newJAXBContext(String contextPath, Map<String, ?> props) throws JAXBException
{
ClassLoader classLoader = BundleClassLoader.createClassLoader(bundle);
return JAXBContext.newInstance(contextPath, classLoader, props);
}
- public JAXBContext newInstance(Class<?>... classesToBeBound) throws JAXBException
+ public JAXBContext newJAXBContext(Class<?>... classesToBeBound) throws JAXBException
{
return JAXBContext.newInstance(classesToBeBound);
}
- public JAXBContext newInstance(Class<?>[] classesToBeBound, Map<String, ?> props) throws JAXBException
+ public JAXBContext newJAXBContext(Class<?>[] classesToBeBound, Map<String, ?> props) throws JAXBException
{
return JAXBContext.newInstance(classesToBeBound, props);
}
Modified: projects/jboss-osgi/trunk/testsuite/example/scripts/antrun-test-jars.xml
===================================================================
--- projects/jboss-osgi/trunk/testsuite/example/scripts/antrun-test-jars.xml 2009-07-21 09:58:10 UTC (rev 91493)
+++ projects/jboss-osgi/trunk/testsuite/example/scripts/antrun-test-jars.xml 2009-07-21 10:05:53 UTC (rev 91494)
@@ -62,6 +62,9 @@
<bnd classpath="${tests.classes.dir}" output="${tests.output.dir}/test-libs/example-simple.jar" files="${tests.resources.dir}/simple/example-simple.bnd" />
<bnd classpath="${tests.classes.dir}" output="${tests.output.dir}/test-libs/example-simple-husky.jar" files="${tests.resources.dir}/simple/example-simple-husky.bnd" />
+ <!-- xml/jaxb -->
+ <bnd classpath="${tests.classes.dir}" output="${tests.output.dir}/test-libs/example-xml-jaxb.jar" files="${tests.resources.dir}/xml/jaxb/example-xml-jaxb.bnd" />
+
<!-- xml/parser -->
<bnd classpath="${tests.classes.dir}" output="${tests.output.dir}/test-libs/example-xml-parser.jar" files="${tests.resources.dir}/xml/parser/example-xml-parser.bnd" />
Added: projects/jboss-osgi/trunk/testsuite/example/src/test/java/org/jboss/test/osgi/example/xml/jaxb/CompanyType.java
===================================================================
--- projects/jboss-osgi/trunk/testsuite/example/src/test/java/org/jboss/test/osgi/example/xml/jaxb/CompanyType.java (rev 0)
+++ projects/jboss-osgi/trunk/testsuite/example/src/test/java/org/jboss/test/osgi/example/xml/jaxb/CompanyType.java 2009-07-21 10:05:53 UTC (rev 91494)
@@ -0,0 +1,125 @@
+//
+// 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.example.xml.jaxb;
+
+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;
+ }
+
+}
Added: projects/jboss-osgi/trunk/testsuite/example/src/test/java/org/jboss/test/osgi/example/xml/jaxb/ContactType.java
===================================================================
--- projects/jboss-osgi/trunk/testsuite/example/src/test/java/org/jboss/test/osgi/example/xml/jaxb/ContactType.java (rev 0)
+++ projects/jboss-osgi/trunk/testsuite/example/src/test/java/org/jboss/test/osgi/example/xml/jaxb/ContactType.java 2009-07-21 10:05:53 UTC (rev 91494)
@@ -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.example.xml.jaxb;
+
+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")
+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;
+ }
+
+}
Added: projects/jboss-osgi/trunk/testsuite/example/src/test/java/org/jboss/test/osgi/example/xml/jaxb/CourseBooking.java
===================================================================
--- projects/jboss-osgi/trunk/testsuite/example/src/test/java/org/jboss/test/osgi/example/xml/jaxb/CourseBooking.java (rev 0)
+++ projects/jboss-osgi/trunk/testsuite/example/src/test/java/org/jboss/test/osgi/example/xml/jaxb/CourseBooking.java 2009-07-21 10:05:53 UTC (rev 91494)
@@ -0,0 +1,217 @@
+//
+// 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.example.xml.jaxb;
+
+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.XmlSchemaType;
+import javax.xml.bind.annotation.XmlType;
+import javax.xml.datatype.XMLGregorianCalendar;
+
+
+/**
+ * <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>
+ *
+ *
+ */
+(a)XmlAccessorType(XmlAccessType.FIELD)
+@XmlType(name = "courseBooking", propOrder = {
+ "company",
+ "student"
+})
+public class CourseBooking {
+
+ @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;
+ }
+
+}
Added: projects/jboss-osgi/trunk/testsuite/example/src/test/java/org/jboss/test/osgi/example/xml/jaxb/JAXBTestCase.java
===================================================================
--- projects/jboss-osgi/trunk/testsuite/example/src/test/java/org/jboss/test/osgi/example/xml/jaxb/JAXBTestCase.java (rev 0)
+++ projects/jboss-osgi/trunk/testsuite/example/src/test/java/org/jboss/test/osgi/example/xml/jaxb/JAXBTestCase.java 2009-07-21 10:05:53 UTC (rev 91494)
@@ -0,0 +1,122 @@
+/*
+ * 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.example.xml.jaxb;
+
+//$Id: DOMParserTestCase.java 91490 2009-07-21 08:39:45Z thomas.diesler(a)jboss.com $
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertNotNull;
+import static org.junit.Assume.assumeNotNull;
+
+import java.net.URL;
+
+import javax.xml.bind.JAXBContext;
+import javax.xml.bind.JAXBElement;
+import javax.xml.bind.JAXBException;
+import javax.xml.bind.Unmarshaller;
+
+import org.jboss.osgi.husky.BridgeFactory;
+import org.jboss.osgi.husky.HuskyCapability;
+import org.jboss.osgi.husky.annotation.ProvideContext;
+import org.jboss.osgi.jaxb.JAXBCapability;
+import org.jboss.osgi.jaxb.JAXBService;
+import org.jboss.osgi.spi.testing.OSGiBundle;
+import org.jboss.osgi.spi.testing.OSGiRuntime;
+import org.jboss.osgi.spi.testing.OSGiTestHelper;
+import org.junit.After;
+import org.junit.Before;
+import org.junit.Test;
+import org.osgi.framework.BundleContext;
+import org.osgi.framework.ServiceReference;
+
+/**
+ * A test that uses JAXB to read an XML document.
+ *
+ * @author thomas.diesler(a)jboss.com
+ * @since 21-Jul-2009
+ */
+public class JAXBTestCase
+{
+ @ProvideContext
+ public static BundleContext context;
+ private static OSGiRuntime runtime;
+
+ @Before
+ public void beforeClass() throws Exception
+ {
+ // Only do this if we are not within the OSGi Runtime
+ if (context == null)
+ {
+ runtime = new OSGiTestHelper().getDefaultRuntime();
+ runtime.addCapability(new JAXBCapability());
+ runtime.addCapability(new HuskyCapability());
+
+ OSGiBundle bundle = runtime.installBundle("example-xml-jaxb.jar");
+ bundle.start();
+ }
+ }
+
+ @After
+ public void afterClass() throws Exception
+ {
+ // Only do this if we are not within the OSGi Runtime
+ if (context == null)
+ runtime.shutdown();
+ }
+
+ @Test
+ @SuppressWarnings("unchecked")
+ public void testUnmarshaller() throws Exception
+ {
+ // Tell Husky to run this test method within the OSGi Runtime
+ if (context == null)
+ BridgeFactory.getBridge().run();
+
+ // Stop here if the context is not injected
+ assumeNotNull(context);
+
+ JAXBContext jaxbContext = getJAXBContext();
+ Unmarshaller unmarshaller = jaxbContext.createUnmarshaller();
+ URL resURL = context.getBundle().getResource("booking.xml");
+ JAXBElement<CourseBooking> rootElement = (JAXBElement<CourseBooking>)unmarshaller.unmarshal(resURL.openStream());
+ assertNotNull("root element not null", rootElement);
+
+ CourseBooking booking = rootElement.getValue();
+ assertNotNull("booking not null", booking);
+
+ CompanyType company = booking.getCompany();
+ assertNotNull("company not null", company);
+ assertEquals("ACME Consulting", company.getName());
+ }
+
+ private JAXBContext getJAXBContext() throws JAXBException
+ {
+ // This service gets registerd by the jboss-osgi-apache-xerces service
+ ServiceReference sref = context.getServiceReference(JAXBService.class.getName());
+ if (sref == null)
+ throw new IllegalStateException("JAXBService not available");
+
+ JAXBService service = (JAXBService)context.getService(sref);
+ JAXBContext jaxbContext = service.newJAXBContext(getClass().getPackage().getName());
+ return jaxbContext;
+ }
+}
\ No newline at end of file
Added: projects/jboss-osgi/trunk/testsuite/example/src/test/java/org/jboss/test/osgi/example/xml/jaxb/ObjectFactory.java
===================================================================
--- projects/jboss-osgi/trunk/testsuite/example/src/test/java/org/jboss/test/osgi/example/xml/jaxb/ObjectFactory.java (rev 0)
+++ projects/jboss-osgi/trunk/testsuite/example/src/test/java/org/jboss/test/osgi/example/xml/jaxb/ObjectFactory.java 2009-07-21 10:05:53 UTC (rev 91494)
@@ -0,0 +1,114 @@
+//
+// 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.example.xml.jaxb;
+
+import javax.xml.bind.JAXBElement;
+import javax.xml.bind.annotation.XmlElementDecl;
+import javax.xml.bind.annotation.XmlRegistry;
+import javax.xml.namespace.QName;
+
+
+/**
+ * This object contains factory methods for each
+ * Java content interface and Java element interface
+ * generated in the org.jboss.test.osgi.example.xml.jaxb package.
+ * <p>An ObjectFactory allows you to programatically
+ * construct new instances of the Java representation
+ * for XML content. The Java representation of XML
+ * content can consist of schema derived interfaces
+ * and classes representing the binding of schema
+ * type definitions, element declarations and model
+ * groups. Factory methods for each of these are
+ * provided in this class.
+ *
+ */
+@XmlRegistry
+public class ObjectFactory {
+
+ private final static QName _Booking_QNAME = new QName("", "booking");
+ private final static QName _Student_QNAME = new QName("", "student");
+ private final static QName _Company_QNAME = new QName("", "company");
+ private final static QName _Contact_QNAME = new QName("", "contact");
+
+ /**
+ * Create a new ObjectFactory that can be used to create new instances of schema derived classes for package: org.jboss.test.osgi.example.xml.jaxb
+ *
+ */
+ public ObjectFactory() {
+ }
+
+ /**
+ * Create an instance of {@link StudentType }
+ *
+ */
+ public StudentType createStudentType() {
+ return new StudentType();
+ }
+
+ /**
+ * Create an instance of {@link CompanyType }
+ *
+ */
+ public CompanyType createCompanyType() {
+ return new CompanyType();
+ }
+
+ /**
+ * Create an instance of {@link CourseBooking }
+ *
+ */
+ public CourseBooking createCourseBooking() {
+ return new CourseBooking();
+ }
+
+ /**
+ * Create an instance of {@link ContactType }
+ *
+ */
+ public ContactType createContactType() {
+ return new ContactType();
+ }
+
+ /**
+ * Create an instance of {@link JAXBElement }{@code <}{@link CourseBooking }{@code >}}
+ *
+ */
+ @XmlElementDecl(namespace = "", name = "booking")
+ public JAXBElement<CourseBooking> createBooking(CourseBooking value) {
+ return new JAXBElement<CourseBooking>(_Booking_QNAME, CourseBooking.class, null, value);
+ }
+
+ /**
+ * Create an instance of {@link JAXBElement }{@code <}{@link StudentType }{@code >}}
+ *
+ */
+ @XmlElementDecl(namespace = "", name = "student")
+ public JAXBElement<StudentType> createStudent(StudentType value) {
+ return new JAXBElement<StudentType>(_Student_QNAME, StudentType.class, null, value);
+ }
+
+ /**
+ * Create an instance of {@link JAXBElement }{@code <}{@link CompanyType }{@code >}}
+ *
+ */
+ @XmlElementDecl(namespace = "", name = "company")
+ public JAXBElement<CompanyType> createCompany(CompanyType value) {
+ return new JAXBElement<CompanyType>(_Company_QNAME, CompanyType.class, null, value);
+ }
+
+ /**
+ * Create an instance of {@link JAXBElement }{@code <}{@link ContactType }{@code >}}
+ *
+ */
+ @XmlElementDecl(namespace = "", name = "contact")
+ public JAXBElement<ContactType> createContact(ContactType value) {
+ return new JAXBElement<ContactType>(_Contact_QNAME, ContactType.class, null, value);
+ }
+
+}
Added: projects/jboss-osgi/trunk/testsuite/example/src/test/java/org/jboss/test/osgi/example/xml/jaxb/StudentType.java
===================================================================
--- projects/jboss-osgi/trunk/testsuite/example/src/test/java/org/jboss/test/osgi/example/xml/jaxb/StudentType.java (rev 0)
+++ projects/jboss-osgi/trunk/testsuite/example/src/test/java/org/jboss/test/osgi/example/xml/jaxb/StudentType.java 2009-07-21 10:05:53 UTC (rev 91494)
@@ -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.example.xml.jaxb;
+
+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")
+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/trunk/testsuite/example/src/test/java/org/jboss/test/osgi/example/xml/parser/DOMParserTestCase.java
===================================================================
--- projects/jboss-osgi/trunk/testsuite/example/src/test/java/org/jboss/test/osgi/example/xml/parser/DOMParserTestCase.java 2009-07-21 09:58:10 UTC (rev 91493)
+++ projects/jboss-osgi/trunk/testsuite/example/src/test/java/org/jboss/test/osgi/example/xml/parser/DOMParserTestCase.java 2009-07-21 10:05:53 UTC (rev 91494)
@@ -50,12 +50,12 @@
import org.w3c.dom.Node;
/**
- * A test that parses XML ducuments
+ * A test that uses a SAX parser to read an XML document.
*
* @see http://www.osgi.org/javadoc/r4v41/org/osgi/util/xml/XMLParserActivator.html
*
* @author thomas.diesler(a)jboss.com
- * @since 12-Feb-2009
+ * @since 21-Jul-2009
*/
public class DOMParserTestCase
{
Modified: projects/jboss-osgi/trunk/testsuite/example/src/test/java/org/jboss/test/osgi/example/xml/parser/SAXParserTestCase.java
===================================================================
--- projects/jboss-osgi/trunk/testsuite/example/src/test/java/org/jboss/test/osgi/example/xml/parser/SAXParserTestCase.java 2009-07-21 09:58:10 UTC (rev 91493)
+++ projects/jboss-osgi/trunk/testsuite/example/src/test/java/org/jboss/test/osgi/example/xml/parser/SAXParserTestCase.java 2009-07-21 10:05:53 UTC (rev 91494)
@@ -48,12 +48,12 @@
import org.xml.sax.helpers.DefaultHandler;
/**
- * A test that parses XML ducuments
+ * A test that uses a SAX parser to read an XML document.
*
* @see http://www.osgi.org/javadoc/r4v41/org/osgi/util/xml/XMLParserActivator.html
*
* @author thomas.diesler(a)jboss.com
- * @since 12-Feb-2009
+ * @since 21-Jul-2009
*/
public class SAXParserTestCase
{
Added: projects/jboss-osgi/trunk/testsuite/example/src/test/resources/xml/jaxb/booking.xml
===================================================================
--- projects/jboss-osgi/trunk/testsuite/example/src/test/resources/xml/jaxb/booking.xml (rev 0)
+++ projects/jboss-osgi/trunk/testsuite/example/src/test/resources/xml/jaxb/booking.xml 2009-07-21 10:05:53 UTC (rev 91494)
@@ -0,0 +1,9 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<booking xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
+ <company name="ACME Consulting">
+ <address>10 Coyote Avenue, Arizona, USA</address>
+ <contact name="Duke" email="duke(a)acme.com" telephone="1234567890" />
+ </company>
+ <student firstName="Jane" surname="Dow" />
+ <student firstName="John" surname="Doe" />
+</booking>
Added: projects/jboss-osgi/trunk/testsuite/example/src/test/resources/xml/jaxb/booking.xsd
===================================================================
--- projects/jboss-osgi/trunk/testsuite/example/src/test/resources/xml/jaxb/booking.xsd (rev 0)
+++ projects/jboss-osgi/trunk/testsuite/example/src/test/resources/xml/jaxb/booking.xsd 2009-07-21 10:05:53 UTC (rev 91494)
@@ -0,0 +1,42 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ This is taken from
+
+ "Java-XML mapping made easy with JAXB 2.0"
+ http://www.javaworld.com/javaworld/jw-06-2006/jw-0626-jaxb.html
+
+ $ xjc src/test/resources/xml/jaxb/booking.xsd -p org.jboss.test.osgi.example.xml.jaxb -d src/test/java
+
+-->
+<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema">
+ <xsd:element name="booking" type="courseBooking" />
+ <xsd:complexType name="courseBooking">
+ <xsd:sequence>
+ <xsd:element ref="company" />
+ <xsd:element ref="student" minOccurs="1" maxOccurs="unbounded" />
+ </xsd:sequence>
+ <xsd:attribute name="courseReference" type="xsd:string" use="required" />
+ <xsd:attribute name="courseDate" type="xsd:date" use="required" />
+ <xsd:attribute name="invoiceReference" type="xsd:string" use="required" />
+ <xsd:attribute name="totalPrice" type="xsd:decimal" use="required" />
+ </xsd:complexType>
+ <xsd:element name="student" type="studentType" />
+ <xsd:complexType name="studentType">
+ <xsd:attribute name="firstName" type="xsd:string" use="required" />
+ <xsd:attribute name="surname" type="xsd:string" use="required" />
+ </xsd:complexType>
+ <xsd:element name="company" type="companyType" />
+ <xsd:complexType name="companyType">
+ <xsd:sequence>
+ <xsd:element name="address" />
+ <xsd:element ref="contact" />
+ </xsd:sequence>
+ <xsd:attribute name="name" type="xsd:string" />
+ </xsd:complexType>
+ <xsd:element name="contact" type="contactType" />
+ <xsd:complexType name="contactType">
+ <xsd:attribute name="name" type="xsd:string" use="required" />
+ <xsd:attribute name="telephone" type="xsd:string" use="required" />
+ <xsd:attribute name="email" type="xsd:string" use="required" />
+ </xsd:complexType>
+</xsd:schema>
\ No newline at end of file
Added: projects/jboss-osgi/trunk/testsuite/example/src/test/resources/xml/jaxb/example-xml-jaxb.bnd
===================================================================
--- projects/jboss-osgi/trunk/testsuite/example/src/test/resources/xml/jaxb/example-xml-jaxb.bnd (rev 0)
+++ projects/jboss-osgi/trunk/testsuite/example/src/test/resources/xml/jaxb/example-xml-jaxb.bnd 2009-07-21 10:05:53 UTC (rev 91494)
@@ -0,0 +1,14 @@
+# bnd build -classpath target/test-classes -output target/test-libs/example-xml-jaxb.jar src/test/resources/xml/jaxb/example-xml-jaxb.bnd
+
+Bundle-SymbolicName: example-xml-jaxb
+
+# Export the package that contains the test case
+Export-Package: org.jboss.test.osgi.example.xml.jaxb
+
+Import-Package: com.sun.xml.bind.v2, javax.xml.bind*, javax.xml.datatype, javax.xml.namespace, \
+ org.jboss.osgi.husky*, org.jboss.osgi.jaxb, org.jboss.osgi.spi*, org.junit, org.osgi.framework
+
+Include-Resource: booking.xml, booking.xsd
+
+# Tell Husky that there are test cases in this package
+Test-Package: org.jboss.test.osgi.example.xml.jaxb
16 years, 5 months
JBoss-OSGI SVN: r91493 - in projects/jboss-osgi/projects/bundles/jaxb/trunk: src/main/java/org/jboss/osgi/jaxb and 1 other directories.
by jboss-osgi-commits@lists.jboss.org
Author: thomas.diesler(a)jboss.com
Date: 2009-07-21 05:58:10 -0400 (Tue, 21 Jul 2009)
New Revision: 91493
Added:
projects/jboss-osgi/projects/bundles/jaxb/trunk/src/main/java/org/jboss/osgi/jaxb/internal/JAXBServiceImpl.java
Modified:
projects/jboss-osgi/projects/bundles/jaxb/trunk/pom.xml
projects/jboss-osgi/projects/bundles/jaxb/trunk/src/main/java/org/jboss/osgi/jaxb/JAXBService.java
projects/jboss-osgi/projects/bundles/jaxb/trunk/src/main/java/org/jboss/osgi/jaxb/internal/JAXBServiceActivator.java
Log:
Expand JAXBService o provide JAXBContext
Modified: projects/jboss-osgi/projects/bundles/jaxb/trunk/pom.xml
===================================================================
--- projects/jboss-osgi/projects/bundles/jaxb/trunk/pom.xml 2009-07-21 09:28:20 UTC (rev 91492)
+++ projects/jboss-osgi/projects/bundles/jaxb/trunk/pom.xml 2009-07-21 09:58:10 UTC (rev 91493)
@@ -95,6 +95,7 @@
<!-- import -->
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.osgi.xml,
org.osgi.framework,
org.osgi.service.log,
@@ -111,6 +112,7 @@
activation;inline=false,
</Embed-Dependency>
<_exportcontents>
+ com.sun.xml.bind.v2*;version=${version.xml.bind},
javax.activation;version=1.1,
javax.xml.bind*;version=2.1,
javax.xml.stream*;version=1.0,
Modified: projects/jboss-osgi/projects/bundles/jaxb/trunk/src/main/java/org/jboss/osgi/jaxb/JAXBService.java
===================================================================
--- projects/jboss-osgi/projects/bundles/jaxb/trunk/src/main/java/org/jboss/osgi/jaxb/JAXBService.java 2009-07-21 09:28:20 UTC (rev 91492)
+++ projects/jboss-osgi/projects/bundles/jaxb/trunk/src/main/java/org/jboss/osgi/jaxb/JAXBService.java 2009-07-21 09:58:10 UTC (rev 91493)
@@ -23,12 +23,44 @@
//$Id$
+import java.util.Map;
+
+import javax.xml.bind.JAXBContext;
+import javax.xml.bind.JAXBException;
+
/**
- * A marker service that is registered by jboss-osgi-jaxb
+ * A service to obtain the JAXBContext
*
* @author thomas.diesler(a)jboss.com
* @since 29-May-2009
*/
public interface JAXBService
{
+ /**
+ * Obtain a new instance of a JAXBContext class.
+ *
+ * @see {@link JAXBContext#newInstance(String)}
+ */
+ JAXBContext newInstance(String contextPath) throws JAXBException;
+
+ /**
+ * Obtain a new instance of a JAXBContext class.
+ *
+ * @see {@link JAXBContext#newInstance(String,ClassLoader,Map)}
+ */
+ JAXBContext newInstance(String contextPath, Map<String,?> props) throws JAXBException;
+
+ /**
+ * Obtain a new instance of a JAXBContext class.
+ *
+ * @see {@link JAXBContext#newInstance(Class...)}
+ */
+ JAXBContext newInstance(Class<?> ... classesToBeBound) throws JAXBException;
+
+ /**
+ * Obtain a new instance of a JAXBContext class.
+ *
+ * @see {@link JAXBContext#newInstance(Class[], Map)}
+ */
+ JAXBContext newInstance(Class<?>[] classesToBeBound, Map<String,?> props) throws JAXBException;
}
\ No newline at end of file
Modified: projects/jboss-osgi/projects/bundles/jaxb/trunk/src/main/java/org/jboss/osgi/jaxb/internal/JAXBServiceActivator.java
===================================================================
--- projects/jboss-osgi/projects/bundles/jaxb/trunk/src/main/java/org/jboss/osgi/jaxb/internal/JAXBServiceActivator.java 2009-07-21 09:28:20 UTC (rev 91492)
+++ projects/jboss-osgi/projects/bundles/jaxb/trunk/src/main/java/org/jboss/osgi/jaxb/internal/JAXBServiceActivator.java 2009-07-21 09:58:10 UTC (rev 91493)
@@ -25,8 +25,11 @@
import org.jboss.osgi.common.log.LogServiceTracker;
import org.jboss.osgi.jaxb.JAXBService;
+import org.osgi.framework.Bundle;
import org.osgi.framework.BundleActivator;
import org.osgi.framework.BundleContext;
+import org.osgi.framework.ServiceFactory;
+import org.osgi.framework.ServiceRegistration;
import org.osgi.service.log.LogService;
/**
@@ -43,8 +46,18 @@
{
log = new LogServiceTracker(context);
- JAXBService service = new JAXBService(){};
- context.registerService(JAXBService.class.getName(), service, null);
+ ServiceFactory factory = new ServiceFactory()
+ {
+ public Object getService(Bundle bundle, ServiceRegistration registration)
+ {
+ return new JAXBServiceImpl(bundle);
+ }
+
+ public void ungetService(Bundle bundle, ServiceRegistration registration, Object service)
+ {
+ }
+ };
+ context.registerService(JAXBService.class.getName(), factory, null);
log.log(LogService.LOG_INFO, "JAXBService registered");
}
Added: projects/jboss-osgi/projects/bundles/jaxb/trunk/src/main/java/org/jboss/osgi/jaxb/internal/JAXBServiceImpl.java
===================================================================
--- projects/jboss-osgi/projects/bundles/jaxb/trunk/src/main/java/org/jboss/osgi/jaxb/internal/JAXBServiceImpl.java (rev 0)
+++ projects/jboss-osgi/projects/bundles/jaxb/trunk/src/main/java/org/jboss/osgi/jaxb/internal/JAXBServiceImpl.java 2009-07-21 09:58:10 UTC (rev 91493)
@@ -0,0 +1,70 @@
+/*
+ * 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.jaxb.internal;
+
+//$Id: JAXBServiceActivator.java 91417 2009-07-20 09:25:44Z thomas.diesler(a)jboss.com $
+
+import java.util.Map;
+
+import javax.xml.bind.JAXBContext;
+import javax.xml.bind.JAXBException;
+
+import org.jboss.osgi.jaxb.JAXBService;
+import org.jboss.osgi.spi.util.BundleClassLoader;
+import org.osgi.framework.Bundle;
+
+/**
+ * An implementation of the {@link JAXBService}
+ *
+ * @author thomas.diesler(a)jboss.com
+ * @since 21-Jul-2009
+ */
+public class JAXBServiceImpl implements JAXBService
+{
+ private Bundle bundle;
+
+ public JAXBServiceImpl(Bundle bundle)
+ {
+ this.bundle = bundle;
+ }
+
+ public JAXBContext newInstance(String contextPath) throws JAXBException
+ {
+ return newInstance(contextPath, null);
+ }
+
+ public JAXBContext newInstance(String contextPath, Map<String, ?> props) throws JAXBException
+ {
+ ClassLoader classLoader = BundleClassLoader.createClassLoader(bundle);
+ return JAXBContext.newInstance(contextPath, classLoader, props);
+ }
+
+ public JAXBContext newInstance(Class<?>... classesToBeBound) throws JAXBException
+ {
+ return JAXBContext.newInstance(classesToBeBound);
+ }
+
+ public JAXBContext newInstance(Class<?>[] classesToBeBound, Map<String, ?> props) throws JAXBException
+ {
+ return JAXBContext.newInstance(classesToBeBound, props);
+ }
+}
\ No newline at end of file
16 years, 5 months
JBoss-OSGI SVN: r91491 - projects/jboss-osgi/trunk/testsuite/example/src/test/java/org/jboss/test/osgi/example/xml/parser.
by jboss-osgi-commits@lists.jboss.org
Author: thomas.diesler(a)jboss.com
Date: 2009-07-21 04:40:23 -0400 (Tue, 21 Jul 2009)
New Revision: 91491
Modified:
projects/jboss-osgi/trunk/testsuite/example/src/test/java/org/jboss/test/osgi/example/xml/parser/SAXParserTestCase.java
Log:
Fix typo
Modified: projects/jboss-osgi/trunk/testsuite/example/src/test/java/org/jboss/test/osgi/example/xml/parser/SAXParserTestCase.java
===================================================================
--- projects/jboss-osgi/trunk/testsuite/example/src/test/java/org/jboss/test/osgi/example/xml/parser/SAXParserTestCase.java 2009-07-21 08:39:45 UTC (rev 91490)
+++ projects/jboss-osgi/trunk/testsuite/example/src/test/java/org/jboss/test/osgi/example/xml/parser/SAXParserTestCase.java 2009-07-21 08:40:23 UTC (rev 91491)
@@ -107,7 +107,7 @@
// This service gets registerd by the jboss-osgi-apache-xerces service
ServiceReference sref = context.getServiceReference(SAXParserFactory.class.getName());
if (sref == null)
- throw new IllegalStateException("DocumentBuilderFactory not available");
+ throw new IllegalStateException("SAXParserFactory not available");
SAXParserFactory factory = (SAXParserFactory)context.getService(sref);
factory.setValidating(false);
16 years, 5 months
JBoss-OSGI SVN: r91490 - in projects/jboss-osgi/trunk/testsuite/example: src/test/java/org/jboss/test/osgi/example and 10 other directories.
by jboss-osgi-commits@lists.jboss.org
Author: thomas.diesler(a)jboss.com
Date: 2009-07-21 04:39:45 -0400 (Tue, 21 Jul 2009)
New Revision: 91490
Added:
projects/jboss-osgi/trunk/testsuite/example/src/test/java/org/jboss/test/osgi/example/dom/
projects/jboss-osgi/trunk/testsuite/example/src/test/java/org/jboss/test/osgi/example/xml/
projects/jboss-osgi/trunk/testsuite/example/src/test/java/org/jboss/test/osgi/example/xml/parser/
projects/jboss-osgi/trunk/testsuite/example/src/test/java/org/jboss/test/osgi/example/xml/parser/DOMParserTestCase.java
projects/jboss-osgi/trunk/testsuite/example/src/test/java/org/jboss/test/osgi/example/xml/parser/SAXParserTestCase.java
projects/jboss-osgi/trunk/testsuite/example/src/test/resources/xml/
projects/jboss-osgi/trunk/testsuite/example/src/test/resources/xml/parser/
projects/jboss-osgi/trunk/testsuite/example/src/test/resources/xml/parser/example-xml-parser.bnd
projects/jboss-osgi/trunk/testsuite/example/src/test/resources/xml/parser/example-xml-parser.xml
Removed:
projects/jboss-osgi/trunk/testsuite/example/src/test/java/org/jboss/test/osgi/example/dom/JMXTestCase.java
projects/jboss-osgi/trunk/testsuite/example/src/test/java/org/jboss/test/osgi/example/dom/bundle/
Modified:
projects/jboss-osgi/trunk/testsuite/example/scripts/antrun-test-jars.xml
projects/jboss-osgi/trunk/testsuite/example/src/test/java/org/jboss/test/osgi/example/http/HttpServiceTestCase.java
projects/jboss-osgi/trunk/testsuite/example/src/test/java/org/jboss/test/osgi/example/jmx/JMXTestCase.java
projects/jboss-osgi/trunk/testsuite/example/src/test/java/org/jboss/test/osgi/example/simple/SimpleHuskyTestCase.java
projects/jboss-osgi/trunk/testsuite/example/src/test/resources/simple/example-simple-husky.bnd
Log:
[JBOSGI-97] Provide SAX/DOM parser example
Modified: projects/jboss-osgi/trunk/testsuite/example/scripts/antrun-test-jars.xml
===================================================================
--- projects/jboss-osgi/trunk/testsuite/example/scripts/antrun-test-jars.xml 2009-07-21 07:13:28 UTC (rev 91489)
+++ projects/jboss-osgi/trunk/testsuite/example/scripts/antrun-test-jars.xml 2009-07-21 08:39:45 UTC (rev 91490)
@@ -62,6 +62,9 @@
<bnd classpath="${tests.classes.dir}" output="${tests.output.dir}/test-libs/example-simple.jar" files="${tests.resources.dir}/simple/example-simple.bnd" />
<bnd classpath="${tests.classes.dir}" output="${tests.output.dir}/test-libs/example-simple-husky.jar" files="${tests.resources.dir}/simple/example-simple-husky.bnd" />
+ <!-- xml/parser -->
+ <bnd classpath="${tests.classes.dir}" output="${tests.output.dir}/test-libs/example-xml-parser.jar" files="${tests.resources.dir}/xml/parser/example-xml-parser.bnd" />
+
<!-- Please add alphabetically -->
</target>
Copied: projects/jboss-osgi/trunk/testsuite/example/src/test/java/org/jboss/test/osgi/example/dom (from rev 91483, projects/jboss-osgi/trunk/testsuite/example/src/test/java/org/jboss/test/osgi/example/jmx)
Deleted: projects/jboss-osgi/trunk/testsuite/example/src/test/java/org/jboss/test/osgi/example/dom/JMXTestCase.java
===================================================================
--- projects/jboss-osgi/trunk/testsuite/example/src/test/java/org/jboss/test/osgi/example/jmx/JMXTestCase.java 2009-07-21 04:23:37 UTC (rev 91483)
+++ projects/jboss-osgi/trunk/testsuite/example/src/test/java/org/jboss/test/osgi/example/dom/JMXTestCase.java 2009-07-21 08:39:45 UTC (rev 91490)
@@ -1,77 +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.example.jmx;
-
-//$Id$
-
-import static org.jboss.test.osgi.example.jmx.bundle.FooMBean.MBEAN_NAME;
-import static org.junit.Assert.assertEquals;
-
-import org.jboss.osgi.jmx.JMXCapability;
-import org.jboss.osgi.jndi.JNDICapability;
-import org.jboss.osgi.spi.management.MBeanProxy;
-import org.jboss.osgi.spi.testing.OSGiBundle;
-import org.jboss.osgi.spi.testing.OSGiRuntime;
-import org.jboss.osgi.spi.testing.OSGiTestHelper;
-import org.jboss.test.osgi.example.jmx.bundle.FooMBean;
-import org.junit.AfterClass;
-import org.junit.BeforeClass;
-import org.junit.Test;
-
-/**
- * A test that deployes a bundle that registeres an MBean
- *
- * @author thomas.diesler(a)jboss.com
- * @since 12-Feb-2009
- */
-public class JMXTestCase
-{
- private static OSGiRuntime runtime;
- private static OSGiBundle bundle;
-
- @BeforeClass
- public static void setUpClass() throws Exception
- {
- runtime = new OSGiTestHelper().getDefaultRuntime();
- runtime.addCapability(new JNDICapability());
- runtime.addCapability(new JMXCapability());
-
- bundle = runtime.installBundle("example-jmx.jar");
- bundle.start();
- }
-
- @AfterClass
- public static void tearDownClass() throws Exception
- {
- if (bundle != null)
- bundle.uninstall();
-
- runtime.shutdown();
- }
-
- @Test
- public void testMBeanAccess() throws Exception
- {
- FooMBean foo = (FooMBean)MBeanProxy.get(FooMBean.class, MBEAN_NAME, runtime.getMBeanServer());
- assertEquals("hello", foo.echo("hello"));
- }
-}
\ No newline at end of file
Modified: projects/jboss-osgi/trunk/testsuite/example/src/test/java/org/jboss/test/osgi/example/http/HttpServiceTestCase.java
===================================================================
--- projects/jboss-osgi/trunk/testsuite/example/src/test/java/org/jboss/test/osgi/example/http/HttpServiceTestCase.java 2009-07-21 07:13:28 UTC (rev 91489)
+++ projects/jboss-osgi/trunk/testsuite/example/src/test/java/org/jboss/test/osgi/example/http/HttpServiceTestCase.java 2009-07-21 08:39:45 UTC (rev 91490)
@@ -65,9 +65,6 @@
@AfterClass
public static void tearDownClass() throws Exception
{
- if (bundle != null)
- bundle.uninstall();
-
runtime.shutdown();
}
Modified: projects/jboss-osgi/trunk/testsuite/example/src/test/java/org/jboss/test/osgi/example/jmx/JMXTestCase.java
===================================================================
--- projects/jboss-osgi/trunk/testsuite/example/src/test/java/org/jboss/test/osgi/example/jmx/JMXTestCase.java 2009-07-21 07:13:28 UTC (rev 91489)
+++ projects/jboss-osgi/trunk/testsuite/example/src/test/java/org/jboss/test/osgi/example/jmx/JMXTestCase.java 2009-07-21 08:39:45 UTC (rev 91490)
@@ -62,9 +62,6 @@
@AfterClass
public static void tearDownClass() throws Exception
{
- if (bundle != null)
- bundle.uninstall();
-
runtime.shutdown();
}
Modified: projects/jboss-osgi/trunk/testsuite/example/src/test/java/org/jboss/test/osgi/example/simple/SimpleHuskyTestCase.java
===================================================================
--- projects/jboss-osgi/trunk/testsuite/example/src/test/java/org/jboss/test/osgi/example/simple/SimpleHuskyTestCase.java 2009-07-21 07:13:28 UTC (rev 91489)
+++ projects/jboss-osgi/trunk/testsuite/example/src/test/java/org/jboss/test/osgi/example/simple/SimpleHuskyTestCase.java 2009-07-21 08:39:45 UTC (rev 91490)
@@ -60,6 +60,7 @@
@Before
public void setUp() throws BundleException
{
+ // Only do this if we are not within the OSGi Runtime
if (context == null)
{
// Get the default runtime
@@ -81,10 +82,6 @@
// Only do this if we are not within the OSGi Runtime
if (context == null)
{
- // Uninstall the bundle
- if (bundle != null)
- bundle.uninstall();
-
// Shutdown the runtime
runtime.shutdown();
}
Copied: projects/jboss-osgi/trunk/testsuite/example/src/test/java/org/jboss/test/osgi/example/xml/parser/DOMParserTestCase.java (from rev 91483, projects/jboss-osgi/trunk/testsuite/example/src/test/java/org/jboss/test/osgi/example/jmx/JMXTestCase.java)
===================================================================
--- projects/jboss-osgi/trunk/testsuite/example/src/test/java/org/jboss/test/osgi/example/xml/parser/DOMParserTestCase.java (rev 0)
+++ projects/jboss-osgi/trunk/testsuite/example/src/test/java/org/jboss/test/osgi/example/xml/parser/DOMParserTestCase.java 2009-07-21 08:39:45 UTC (rev 91490)
@@ -0,0 +1,124 @@
+/*
+ * 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.example.xml.parser;
+
+//$Id$
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertNotNull;
+import static org.junit.Assume.assumeNotNull;
+
+import java.net.URL;
+
+import javax.xml.parsers.DocumentBuilder;
+import javax.xml.parsers.DocumentBuilderFactory;
+import javax.xml.parsers.ParserConfigurationException;
+
+import org.jboss.osgi.husky.BridgeFactory;
+import org.jboss.osgi.husky.HuskyCapability;
+import org.jboss.osgi.husky.annotation.ProvideContext;
+import org.jboss.osgi.spi.testing.OSGiBundle;
+import org.jboss.osgi.spi.testing.OSGiRuntime;
+import org.jboss.osgi.spi.testing.OSGiTestHelper;
+import org.jboss.osgi.xml.XMLParserCapability;
+import org.junit.After;
+import org.junit.Before;
+import org.junit.Test;
+import org.osgi.framework.BundleContext;
+import org.osgi.framework.ServiceReference;
+import org.w3c.dom.Document;
+import org.w3c.dom.Element;
+import org.w3c.dom.Node;
+
+/**
+ * A test that parses XML ducuments
+ *
+ * @see http://www.osgi.org/javadoc/r4v41/org/osgi/util/xml/XMLParserActivator.html
+ *
+ * @author thomas.diesler(a)jboss.com
+ * @since 12-Feb-2009
+ */
+public class DOMParserTestCase
+{
+ @ProvideContext
+ public static BundleContext context;
+ private static OSGiRuntime runtime;
+
+ @Before
+ public void beforeClass() throws Exception
+ {
+ // Only do this if we are not within the OSGi Runtime
+ if (context == null)
+ {
+ runtime = new OSGiTestHelper().getDefaultRuntime();
+ runtime.addCapability(new XMLParserCapability());
+ runtime.addCapability(new HuskyCapability());
+
+ OSGiBundle bundle = runtime.installBundle("example-xml-parser.jar");
+ bundle.start();
+ }
+ }
+
+ @After
+ public void afterClass() throws Exception
+ {
+ // Only do this if we are not within the OSGi Runtime
+ if (context == null)
+ runtime.shutdown();
+ }
+
+ @Test
+ public void testDOMParser() throws Exception
+ {
+ // Tell Husky to run this test method within the OSGi Runtime
+ if (context == null)
+ BridgeFactory.getBridge().run();
+
+ // Stop here if the context is not injected
+ assumeNotNull(context);
+
+ DocumentBuilder domParser = getDocumentBuilder();
+ URL resURL = context.getBundle().getResource("example-xml-parser.xml");
+ Document dom = domParser.parse(resURL.openStream());
+ assertNotNull("Document not null", dom);
+
+ Element root = dom.getDocumentElement();
+ assertEquals("root", root.getLocalName());
+
+ Node child = root.getFirstChild();
+ assertEquals("child", child.getLocalName());
+ assertEquals("content", child.getTextContent());
+ }
+
+ private DocumentBuilder getDocumentBuilder() throws ParserConfigurationException
+ {
+ // This service gets registerd by the jboss-osgi-apache-xerces service
+ ServiceReference sref = context.getServiceReference(DocumentBuilderFactory.class.getName());
+ if (sref == null)
+ throw new IllegalStateException("DocumentBuilderFactory not available");
+
+ DocumentBuilderFactory factory = (DocumentBuilderFactory)context.getService(sref);
+ factory.setValidating(false);
+
+ return factory.newDocumentBuilder();
+ }
+}
\ No newline at end of file
Added: projects/jboss-osgi/trunk/testsuite/example/src/test/java/org/jboss/test/osgi/example/xml/parser/SAXParserTestCase.java
===================================================================
--- projects/jboss-osgi/trunk/testsuite/example/src/test/java/org/jboss/test/osgi/example/xml/parser/SAXParserTestCase.java (rev 0)
+++ projects/jboss-osgi/trunk/testsuite/example/src/test/java/org/jboss/test/osgi/example/xml/parser/SAXParserTestCase.java 2009-07-21 08:39:45 UTC (rev 91490)
@@ -0,0 +1,134 @@
+/*
+ * 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.example.xml.parser;
+
+//$Id: JMXTestCase.java 91196 2009-07-14 09:41:15Z thomas.diesler(a)jboss.com $
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assume.assumeNotNull;
+
+import java.net.URL;
+
+import javax.xml.parsers.ParserConfigurationException;
+import javax.xml.parsers.SAXParser;
+import javax.xml.parsers.SAXParserFactory;
+
+import org.jboss.osgi.husky.BridgeFactory;
+import org.jboss.osgi.husky.HuskyCapability;
+import org.jboss.osgi.husky.annotation.ProvideContext;
+import org.jboss.osgi.spi.testing.OSGiBundle;
+import org.jboss.osgi.spi.testing.OSGiRuntime;
+import org.jboss.osgi.spi.testing.OSGiTestHelper;
+import org.jboss.osgi.xml.XMLParserCapability;
+import org.junit.After;
+import org.junit.Before;
+import org.junit.Test;
+import org.osgi.framework.BundleContext;
+import org.osgi.framework.ServiceReference;
+import org.xml.sax.SAXException;
+import org.xml.sax.helpers.DefaultHandler;
+
+/**
+ * A test that parses XML ducuments
+ *
+ * @see http://www.osgi.org/javadoc/r4v41/org/osgi/util/xml/XMLParserActivator.html
+ *
+ * @author thomas.diesler(a)jboss.com
+ * @since 12-Feb-2009
+ */
+public class SAXParserTestCase
+{
+ @ProvideContext
+ public static BundleContext context;
+ private static OSGiRuntime runtime;
+
+ @Before
+ public void beforeClass() throws Exception
+ {
+ // Only do this if we are not within the OSGi Runtime
+ if (context == null)
+ {
+ runtime = new OSGiTestHelper().getDefaultRuntime();
+ runtime.addCapability(new XMLParserCapability());
+ runtime.addCapability(new HuskyCapability());
+
+ OSGiBundle bundle = runtime.installBundle("example-xml-parser.jar");
+ bundle.start();
+ }
+ }
+
+ @After
+ public void afterClass() throws Exception
+ {
+ // Only do this if we are not within the OSGi Runtime
+ if (context == null)
+ runtime.shutdown();
+ }
+
+ @Test
+ public void testSAXParser() throws Exception
+ {
+ // Tell Husky to run this test method within the OSGi Runtime
+ if (context == null)
+ BridgeFactory.getBridge().run();
+
+ // Stop here if the context is not injected
+ assumeNotNull(context);
+
+ SAXParser saxParser = getSAXParser();
+ URL resURL = context.getBundle().getResource("example-xml-parser.xml");
+
+ SAXHandler saxHandler = new SAXHandler();
+ saxParser.parse(resURL.openStream(), saxHandler);
+ assertEquals("content", saxHandler.getContent());
+ }
+
+ private SAXParser getSAXParser() throws SAXException, ParserConfigurationException
+ {
+ // This service gets registerd by the jboss-osgi-apache-xerces service
+ ServiceReference sref = context.getServiceReference(SAXParserFactory.class.getName());
+ if (sref == null)
+ throw new IllegalStateException("DocumentBuilderFactory not available");
+
+ SAXParserFactory factory = (SAXParserFactory)context.getService(sref);
+ factory.setValidating(false);
+
+ SAXParser saxParser = factory.newSAXParser();
+ return saxParser;
+ }
+
+ static class SAXHandler extends DefaultHandler
+ {
+ private String content;
+
+ @Override
+ public void characters(char[] ch, int start, int length) throws SAXException
+ {
+ content = new String(ch, start, length);
+ }
+
+ public String getContent()
+ {
+ return content;
+ }
+ }
+}
\ No newline at end of file
Modified: projects/jboss-osgi/trunk/testsuite/example/src/test/resources/simple/example-simple-husky.bnd
===================================================================
--- projects/jboss-osgi/trunk/testsuite/example/src/test/resources/simple/example-simple-husky.bnd 2009-07-21 07:13:28 UTC (rev 91489)
+++ projects/jboss-osgi/trunk/testsuite/example/src/test/resources/simple/example-simple-husky.bnd 2009-07-21 08:39:45 UTC (rev 91490)
@@ -6,7 +6,7 @@
Private-Package: org.jboss.test.osgi.example.simple.bundle
-# Export the package that contains tthe test case
+# Export the package that contains the test case
Export-Package: org.jboss.test.osgi.example.simple
# Tell Husky that there are test cases in this package
Added: projects/jboss-osgi/trunk/testsuite/example/src/test/resources/xml/parser/example-xml-parser.bnd
===================================================================
--- projects/jboss-osgi/trunk/testsuite/example/src/test/resources/xml/parser/example-xml-parser.bnd (rev 0)
+++ projects/jboss-osgi/trunk/testsuite/example/src/test/resources/xml/parser/example-xml-parser.bnd 2009-07-21 08:39:45 UTC (rev 91490)
@@ -0,0 +1,10 @@
+# bnd build -classpath target/test-classes -output target/test-libs/example-xml-parser.jar src/test/resources/example/xml/parser/example-xml-parser.bnd
+
+Bundle-SymbolicName: example-xml-parser
+
+# Export the package that contains the test case
+Export-Package: org.jboss.test.osgi.example.xml.parser
+Include-Resource: example-xml-parser.xml
+
+# Tell Husky that there are test cases in this package
+Test-Package: org.jboss.test.osgi.example.xml.parser
Added: projects/jboss-osgi/trunk/testsuite/example/src/test/resources/xml/parser/example-xml-parser.xml
===================================================================
--- projects/jboss-osgi/trunk/testsuite/example/src/test/resources/xml/parser/example-xml-parser.xml (rev 0)
+++ projects/jboss-osgi/trunk/testsuite/example/src/test/resources/xml/parser/example-xml-parser.xml 2009-07-21 08:39:45 UTC (rev 91490)
@@ -0,0 +1,2 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<root><child>content</child></root>
16 years, 5 months
JBoss-OSGI SVN: r91488 - projects/jboss-osgi/trunk/reactor/blueprint.
by jboss-osgi-commits@lists.jboss.org
Author: thomas.diesler(a)jboss.com
Date: 2009-07-21 03:12:48 -0400 (Tue, 21 Jul 2009)
New Revision: 91488
Modified:
projects/jboss-osgi/trunk/reactor/blueprint/pom.xml
Log:
Make blueprint child of reactor
Modified: projects/jboss-osgi/trunk/reactor/blueprint/pom.xml
===================================================================
--- projects/jboss-osgi/trunk/reactor/blueprint/pom.xml 2009-07-21 07:05:08 UTC (rev 91487)
+++ projects/jboss-osgi/trunk/reactor/blueprint/pom.xml 2009-07-21 07:12:48 UTC (rev 91488)
@@ -25,8 +25,8 @@
<!-- Parent -->
<parent>
<groupId>org.jboss.osgi</groupId>
- <artifactId>jboss-osgi-parent</artifactId>
- <version>1.0.1-SNAPSHOT</version>
+ <artifactId>jboss-osgi-reactor</artifactId>
+ <version>1.0.0.Beta3</version>
</parent>
<!-- Properties -->
16 years, 5 months
JBoss-OSGI SVN: r91485 - projects/jboss-osgi/trunk/reactor.
by jboss-osgi-commits@lists.jboss.org
Author: thomas.diesler(a)jboss.com
Date: 2009-07-21 02:50:13 -0400 (Tue, 21 Jul 2009)
New Revision: 91485
Modified:
projects/jboss-osgi/trunk/reactor/pom.xml
Log:
Fix typo
Modified: projects/jboss-osgi/trunk/reactor/pom.xml
===================================================================
--- projects/jboss-osgi/trunk/reactor/pom.xml 2009-07-21 06:45:51 UTC (rev 91484)
+++ projects/jboss-osgi/trunk/reactor/pom.xml 2009-07-21 06:50:13 UTC (rev 91485)
@@ -22,7 +22,7 @@
<parent>
<groupId>org.jboss.osgi</groupId>
- <artifactId>jboss-osgi-parent</artifactId>
+ <artifactId>jboss-osgi</artifactId>
<version>1.0.0.Beta3</version>
</parent>
16 years, 5 months
JBoss-OSGI SVN: r91484 - in projects/jboss-osgi/trunk: reactor and 1 other directory.
by jboss-osgi-commits@lists.jboss.org
Author: thomas.diesler(a)jboss.com
Date: 2009-07-21 02:45:51 -0400 (Tue, 21 Jul 2009)
New Revision: 91484
Added:
projects/jboss-osgi/trunk/reactor/blueprint/
projects/jboss-osgi/trunk/reactor/pom.xml
Removed:
projects/jboss-osgi/trunk/reactor/bundles/
projects/jboss-osgi/trunk/reactor/runtime/
Modified:
projects/jboss-osgi/trunk/pom.xml
projects/jboss-osgi/trunk/reactor/
Log:
Remove svn:externals
Modified: projects/jboss-osgi/trunk/pom.xml
===================================================================
--- projects/jboss-osgi/trunk/pom.xml 2009-07-21 04:23:37 UTC (rev 91483)
+++ projects/jboss-osgi/trunk/pom.xml 2009-07-21 06:45:51 UTC (rev 91484)
@@ -10,7 +10,7 @@
<!-- ====================================================================== -->
<!-- $Id: pom.xml 91197 2009-07-14 09:48:24Z thomas.diesler(a)jboss.com $ -->
-
+
<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>
@@ -28,6 +28,12 @@
<version>1.0.1-SNAPSHOT</version>
</parent>
+ <!-- Modules -->
+ <modules>
+ <module>reactor</module>
+ <module>testsuite</module>
+ </modules>
+
<!-- Properties -->
<properties>
<version.apache.felix.configadmin>1.0.10</version.apache.felix.configadmin>
@@ -98,38 +104,6 @@
<profiles>
<!--
- Name: reactor
- Desc: Build the reactor projects and run the integration testsuite
- -->
- <profile>
- <id>reactor</id>
- <modules>
- <!-- -->
- <module>reactor/spi</module>
- <module>reactor/runtime/equinox</module>
- <module>reactor/runtime/felix</module>
- <module>reactor/runtime/knopflerfish</module>
- <module>reactor/runtime/deployers</module>
- <module>reactor/bundles/common</module>
- <module>reactor/bundles/jboss-common-core</module>
- <module>reactor/bundles/apache-xerces</module>
- <module>reactor/bundles/jaxb</module>
- <module>reactor/bundles/jboss-xml-binding</module>
- <module>reactor/bundles/jndi</module>
- <module>reactor/bundles/jmx</module>
- <module>reactor/bundles/remotelog</module>
- <module>reactor/bundles/webconsole</module>
- <module>reactor/bundles/hotdeploy</module>
- <module>reactor/bundles/microcontainer</module>
- <module>reactor/bundles/husky</module>
- <module>reactor/runtime/jbossas</module>
-
- <module>reactor/bundles/blueprint</module>
- <module>testsuite</module>
- </modules>
- </profile>
-
- <!--
Name: distro
Desc: Build the distribution
-->
@@ -140,7 +114,7 @@
<module>distribution/installer</module>
</modules>
</profile>
-
+
</profiles>
</project>
Property changes on: projects/jboss-osgi/trunk/reactor
___________________________________________________________________
Name: svn:externals
- spi https://svn.jboss.org/repos/jbossas/projects/jboss-osgi/projects/spi/trunk
bundles/apache-xerces https://svn.jboss.org/repos/jbossas/projects/jboss-osgi/projects/bundles/...
bundles/common https://svn.jboss.org/repos/jbossas/projects/jboss-osgi/projects/bundles/...
bundles/hotdeploy https://svn.jboss.org/repos/jbossas/projects/jboss-osgi/projects/bundles/...
bundles/husky https://svn.jboss.org/repos/jbossas/projects/jboss-osgi/projects/bundles/...
bundles/jaxb https://svn.jboss.org/repos/jbossas/projects/jboss-osgi/projects/bundles/...
bundles/jmx https://svn.jboss.org/repos/jbossas/projects/jboss-osgi/projects/bundles/...
bundles/jndi https://svn.jboss.org/repos/jbossas/projects/jboss-osgi/projects/bundles/...
bundles/jboss-common-core https://svn.jboss.org/repos/jbossas/projects/jboss-osgi/projects/bundles/...
bundles/jboss-xml-binding https://svn.jboss.org/repos/jbossas/projects/jboss-osgi/projects/bundles/...
bundles/microcontainer https://svn.jboss.org/repos/jbossas/projects/jboss-osgi/projects/bundles/...
bundles/remotelog https://svn.jboss.org/repos/jbossas/projects/jboss-osgi/projects/bundles/...
bundles/webconsole https://svn.jboss.org/repos/jbossas/projects/jboss-osgi/projects/bundles/...
runtime/deployers https://svn.jboss.org/repos/jbossas/projects/jboss-osgi/projects/runtime/...
runtime/equinox https://svn.jboss.org/repos/jbossas/projects/jboss-osgi/projects/runtime/...
runtime/felix https://svn.jboss.org/repos/jbossas/projects/jboss-osgi/projects/runtime/...
runtime/jbossas https://svn.jboss.org/repos/jbossas/projects/jboss-osgi/projects/runtime/...
runtime/knopflerfish https://svn.jboss.org/repos/jbossas/projects/jboss-osgi/projects/runtime/...
+ #spi https://svn.jboss.org/repos/jbossas/projects/jboss-osgi/projects/spi/trunk
#bundles/apache-xerces https://svn.jboss.org/repos/jbossas/projects/jboss-osgi/projects/bundles/...
#bundles/common https://svn.jboss.org/repos/jbossas/projects/jboss-osgi/projects/bundles/...
#bundles/hotdeploy https://svn.jboss.org/repos/jbossas/projects/jboss-osgi/projects/bundles/...
#bundles/husky https://svn.jboss.org/repos/jbossas/projects/jboss-osgi/projects/bundles/...
#bundles/jaxb https://svn.jboss.org/repos/jbossas/projects/jboss-osgi/projects/bundles/...
#bundles/jmx https://svn.jboss.org/repos/jbossas/projects/jboss-osgi/projects/bundles/...
#bundles/jndi https://svn.jboss.org/repos/jbossas/projects/jboss-osgi/projects/bundles/...
#bundles/jboss-common-core https://svn.jboss.org/repos/jbossas/projects/jboss-osgi/projects/bundles/...
#bundles/jboss-xml-binding https://svn.jboss.org/repos/jbossas/projects/jboss-osgi/projects/bundles/...
#bundles/microcontainer https://svn.jboss.org/repos/jbossas/projects/jboss-osgi/projects/bundles/...
#bundles/remotelog https://svn.jboss.org/repos/jbossas/projects/jboss-osgi/projects/bundles/...
#bundles/webconsole https://svn.jboss.org/repos/jbossas/projects/jboss-osgi/projects/bundles/...
#runtime/deployers https://svn.jboss.org/repos/jbossas/projects/jboss-osgi/projects/runtime/...
#runtime/equinox https://svn.jboss.org/repos/jbossas/projects/jboss-osgi/projects/runtime/...
#runtime/felix https://svn.jboss.org/repos/jbossas/projects/jboss-osgi/projects/runtime/...
#runtime/jbossas https://svn.jboss.org/repos/jbossas/projects/jboss-osgi/projects/runtime/...
#runtime/knopflerfish https://svn.jboss.org/repos/jbossas/projects/jboss-osgi/projects/runtime/...
Name: svn:ignore
+ target
Copied: projects/jboss-osgi/trunk/reactor/blueprint (from rev 91483, projects/jboss-osgi/trunk/reactor/bundles/blueprint)
Added: projects/jboss-osgi/trunk/reactor/pom.xml
===================================================================
--- projects/jboss-osgi/trunk/reactor/pom.xml (rev 0)
+++ projects/jboss-osgi/trunk/reactor/pom.xml 2009-07-21 06:45:51 UTC (rev 91484)
@@ -0,0 +1,33 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+ <!-- ====================================================================== -->
+ <!-- -->
+ <!-- JBoss, the OpenSource J2EE webOS -->
+ <!-- -->
+ <!-- Distributable under LGPL license. -->
+ <!-- See terms of license at http://www.gnu.org. -->
+ <!-- -->
+ <!-- ====================================================================== -->
+
+ <!-- $Id: pom.xml 91403 2009-07-18 14:01:46Z thomas.diesler(a)jboss.com $ -->
+
+<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 Reactor</name>
+
+ <groupId>org.jboss.osgi</groupId>
+ <artifactId>jboss-osgi-reactor</artifactId>
+ <packaging>pom</packaging>
+
+ <parent>
+ <groupId>org.jboss.osgi</groupId>
+ <artifactId>jboss-osgi-parent</artifactId>
+ <version>1.0.0.Beta3</version>
+ </parent>
+
+ <modules>
+ <module>blueprint</module>
+ </modules>
+
+</project>
16 years, 5 months
JBoss-OSGI SVN: r91433 - in projects/jboss-osgi: projects/runtime/jbossas/trunk/src/main and 5 other directories.
by jboss-osgi-commits@lists.jboss.org
Author: thomas.diesler(a)jboss.com
Date: 2009-07-20 14:31:01 -0400 (Mon, 20 Jul 2009)
New Revision: 91433
Removed:
projects/jboss-osgi/projects/runtime/jbossas/trunk/src/main/java/
Modified:
projects/jboss-osgi/projects/parent/trunk/pom.xml
projects/jboss-osgi/projects/spi/trunk/pom.xml
projects/jboss-osgi/trunk/distribution/installer/pom.xml
projects/jboss-osgi/trunk/distribution/installer/src/main/resources/installer/install-definition.xml
projects/jboss-osgi/trunk/pom.xml
projects/jboss-osgi/trunk/reactor/
Log:
[JBOSGI-111] Allign distributed sources with libs
Modified: projects/jboss-osgi/projects/parent/trunk/pom.xml
===================================================================
--- projects/jboss-osgi/projects/parent/trunk/pom.xml 2009-07-20 17:50:14 UTC (rev 91432)
+++ projects/jboss-osgi/projects/parent/trunk/pom.xml 2009-07-20 18:31:01 UTC (rev 91433)
@@ -86,6 +86,20 @@
<failIfNoTests>false</failIfNoTests>
</configuration>
</plugin>
+ <plugin>
+ <artifactId>maven-javadoc-plugin</artifactId>
+ <configuration>
+ <quiet>true</quiet>
+ <excludePackageNames>*.internal</excludePackageNames>
+ </configuration>
+ <executions>
+ <execution>
+ <goals>
+ <goal>jar</goal>
+ </goals>
+ </execution>
+ </executions>
+ </plugin>
</plugins>
<!-- PluginManagement -->
Modified: projects/jboss-osgi/projects/spi/trunk/pom.xml
===================================================================
--- projects/jboss-osgi/projects/spi/trunk/pom.xml 2009-07-20 17:50:14 UTC (rev 91432)
+++ projects/jboss-osgi/projects/spi/trunk/pom.xml 2009-07-20 18:31:01 UTC (rev 91433)
@@ -97,25 +97,9 @@
</dependency>
</dependencies>
+ <!-- Build -->
<build>
<plugins>
- <plugin>
- <artifactId>maven-javadoc-plugin</artifactId>
- <configuration>
- <quiet>true</quiet>
- <excludePackageNames>*.internal</excludePackageNames>
- </configuration>
- <executions>
- <execution>
- <goals>
- <goal>jar</goal>
- </goals>
- <configuration>
- <aggregate>true</aggregate>
- </configuration>
- </execution>
- </executions>
- </plugin>
</plugins>
</build>
Modified: projects/jboss-osgi/trunk/distribution/installer/pom.xml
===================================================================
--- projects/jboss-osgi/trunk/distribution/installer/pom.xml 2009-07-20 17:50:14 UTC (rev 91432)
+++ projects/jboss-osgi/trunk/distribution/installer/pom.xml 2009-07-20 18:31:01 UTC (rev 91433)
@@ -33,6 +33,8 @@
<groupId>org.jboss.logging</groupId>
<artifactId>jboss-logging-log4j</artifactId>
</dependency>
+
+ <!-- jboss.osgi -->
<dependency>
<groupId>org.jboss.osgi</groupId>
<artifactId>jboss-osgi-deployers</artifactId>
@@ -61,6 +63,7 @@
<version>${version.jboss.osgi.runtime.jbossas}</version>
<classifier>sources</classifier>
</dependency>
+ <!-- jboss-osgi-runtime-jbossas: no javadoc -->
<dependency>
<groupId>org.jboss.osgi</groupId>
<artifactId>jboss-osgi-spi</artifactId>
@@ -91,7 +94,7 @@
<type>jdocbook</type>
</dependency>
- <!-- Bundles -->
+ <!-- jboss.osgi.bundles -->
<dependency>
<groupId>org.jboss.osgi.bundles</groupId>
<artifactId>jboss-osgi-apache-xerces</artifactId>
@@ -99,21 +102,59 @@
</dependency>
<dependency>
<groupId>org.jboss.osgi.bundles</groupId>
+ <artifactId>jboss-osgi-apache-xerces</artifactId>
+ <version>${version.jboss.osgi.apache.xerces}</version>
+ <classifier>sources</classifier>
+ </dependency>
+ <dependency>
+ <groupId>org.jboss.osgi.bundles</groupId>
+ <artifactId>jboss-osgi-apache-xerces</artifactId>
+ <version>${version.jboss.osgi.apache.xerces}</version>
+ <classifier>javadoc</classifier>
+ </dependency>
+ <dependency>
+ <groupId>org.jboss.osgi.bundles</groupId>
<artifactId>jboss-osgi-common</artifactId>
<version>${version.jboss.osgi.common}</version>
</dependency>
<dependency>
<groupId>org.jboss.osgi.bundles</groupId>
+ <artifactId>jboss-osgi-common</artifactId>
+ <version>${version.jboss.osgi.common}</version>
+ <classifier>sources</classifier>
+ </dependency>
+ <dependency>
+ <groupId>org.jboss.osgi.bundles</groupId>
+ <artifactId>jboss-osgi-common</artifactId>
+ <version>${version.jboss.osgi.common}</version>
+ <classifier>javadoc</classifier>
+ </dependency>
+ <dependency>
+ <groupId>org.jboss.osgi.bundles</groupId>
<artifactId>jboss-osgi-common-core</artifactId>
<version>${version.jboss.osgi.common.core}</version>
</dependency>
<dependency>
<groupId>org.jboss.osgi.bundles</groupId>
+ <artifactId>jboss-osgi-common-core</artifactId>
+ <version>${version.jboss.osgi.common.core}</version>
+ <classifier>sources</classifier>
+ </dependency>
+ <!-- jboss-osgi-common-core: no javadoc -->
+ <dependency>
+ <groupId>org.jboss.osgi.bundles</groupId>
<artifactId>jboss-osgi-hotdeploy</artifactId>
<version>${version.jboss.osgi.hotdeploy}</version>
</dependency>
<dependency>
<groupId>org.jboss.osgi.bundles</groupId>
+ <artifactId>jboss-osgi-hotdeploy</artifactId>
+ <version>${version.jboss.osgi.hotdeploy}</version>
+ <classifier>sources</classifier>
+ </dependency>
+ <!-- jboss-osgi-hotdeploy: no javadoc -->
+ <dependency>
+ <groupId>org.jboss.osgi.bundles</groupId>
<artifactId>jboss-osgi-husky</artifactId>
<version>${version.jboss.osgi.husky}</version>
</dependency>
@@ -136,29 +177,101 @@
</dependency>
<dependency>
<groupId>org.jboss.osgi.bundles</groupId>
+ <artifactId>jboss-osgi-jaxb</artifactId>
+ <version>${version.jboss.osgi.jaxb}</version>
+ <classifier>sources</classifier>
+ </dependency>
+ <dependency>
+ <groupId>org.jboss.osgi.bundles</groupId>
+ <artifactId>jboss-osgi-jaxb</artifactId>
+ <version>${version.jboss.osgi.jaxb}</version>
+ <classifier>javadoc</classifier>
+ </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.bundles</groupId>
+ <artifactId>jboss-osgi-jmx</artifactId>
+ <version>${version.jboss.osgi.jmx}</version>
+ <classifier>sources</classifier>
+ </dependency>
+ <dependency>
+ <groupId>org.jboss.osgi.bundles</groupId>
+ <artifactId>jboss-osgi-jmx</artifactId>
+ <version>${version.jboss.osgi.jmx}</version>
+ <classifier>javadoc</classifier>
+ </dependency>
+ <dependency>
+ <groupId>org.jboss.osgi.bundles</groupId>
<artifactId>jboss-osgi-jndi</artifactId>
<version>${version.jboss.osgi.jndi}</version>
</dependency>
<dependency>
<groupId>org.jboss.osgi.bundles</groupId>
+ <artifactId>jboss-osgi-jndi</artifactId>
+ <version>${version.jboss.osgi.jndi}</version>
+ <classifier>sources</classifier>
+ </dependency>
+ <dependency>
+ <groupId>org.jboss.osgi.bundles</groupId>
+ <artifactId>jboss-osgi-jndi</artifactId>
+ <version>${version.jboss.osgi.jndi}</version>
+ <classifier>javadoc</classifier>
+ </dependency>
+ <dependency>
+ <groupId>org.jboss.osgi.bundles</groupId>
<artifactId>jboss-osgi-microcontainer</artifactId>
<version>${version.jboss.osgi.microcontainer}</version>
</dependency>
<dependency>
<groupId>org.jboss.osgi.bundles</groupId>
+ <artifactId>jboss-osgi-microcontainer</artifactId>
+ <version>${version.jboss.osgi.microcontainer}</version>
+ <classifier>sources</classifier>
+ </dependency>
+ <dependency>
+ <groupId>org.jboss.osgi.bundles</groupId>
+ <artifactId>jboss-osgi-microcontainer</artifactId>
+ <version>${version.jboss.osgi.microcontainer}</version>
+ <classifier>javadoc</classifier>
+ </dependency>
+ <dependency>
+ <groupId>org.jboss.osgi.bundles</groupId>
<artifactId>jboss-osgi-webconsole</artifactId>
<version>${version.jboss.osgi.webconsole}</version>
</dependency>
<dependency>
<groupId>org.jboss.osgi.bundles</groupId>
+ <artifactId>jboss-osgi-webconsole</artifactId>
+ <version>${version.jboss.osgi.webconsole}</version>
+ <classifier>sources</classifier>
+ </dependency>
+ <dependency>
+ <groupId>org.jboss.osgi.bundles</groupId>
+ <artifactId>jboss-osgi-webconsole</artifactId>
+ <version>${version.jboss.osgi.webconsole}</version>
+ <classifier>javadoc</classifier>
+ </dependency>
+ <dependency>
+ <groupId>org.jboss.osgi.bundles</groupId>
<artifactId>jboss-osgi-xml-binding</artifactId>
<version>${version.jboss.osgi.xml.binding}</version>
</dependency>
+ <dependency>
+ <groupId>org.jboss.osgi.bundles</groupId>
+ <artifactId>jboss-osgi-xml-binding</artifactId>
+ <version>${version.jboss.osgi.xml.binding}</version>
+ <classifier>sources</classifier>
+ </dependency>
+ <dependency>
+ <groupId>org.jboss.osgi.bundles</groupId>
+ <artifactId>jboss-osgi-xml-binding</artifactId>
+ <version>${version.jboss.osgi.xml.binding}</version>
+ <classifier>javadoc</classifier>
+ </dependency>
<!-- Equinox Dependencies -->
<dependency>
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-07-20 17:50:14 UTC (rev 91432)
+++ projects/jboss-osgi/trunk/distribution/installer/src/main/resources/installer/install-definition.xml 2009-07-20 18:31:01 UTC (rev 91433)
@@ -109,36 +109,55 @@
</fileset>
<!-- JBossOSGi Docs -->
- <file src="@{deploy.artifacts.dir}/lib/jboss-osgi-spi-javadoc.jar" targetdir="$INSTALL_PATH/docs/apidocs" unpack="true" override="true" />
<fileset dir="@{deploy.artifacts.dir}/docs/userguide" targetdir="$INSTALL_PATH/docs/userguide" override="true"/>
+ <fileset dir="@{deploy.artifacts.dir}/lib" targetdir="$INSTALL_PATH/docs/javadoc" override="true">
+ <include name="jboss-common-core-javadoc.jar" />
+ <include name="jboss-logging-log4j-javadoc.jar" />
+ <include name="jboss-logging-spi-javadoc.jar" />
+ <include name="jboss-osgi-apache-xerces-javadoc.jar" />
+ <include name="jboss-osgi-common-core-javadoc.jar" />
+ <include name="jboss-osgi-common-javadoc.jar" />
+ <include name="jboss-osgi-deployers-javadoc.jar" />
+ <include name="jboss-osgi-hotdeploy-javadoc.jar" />
+ <include name="jboss-osgi-husky-harness-javadoc.jar" />
+ <include name="jboss-osgi-jaxb-javadoc.jar" />
+ <include name="jboss-osgi-jmx-javadoc.jar" />
+ <include name="jboss-osgi-jndi-javadoc.jar" />
+ <include name="jboss-osgi-microcontainer-javadoc.jar" />
+ <include name="jboss-osgi-runtime-equinox-javadoc.jar" />
+ <include name="jboss-osgi-runtime-felix-javadoc.jar" />
+ <include name="jboss-osgi-runtime-jbossas-javadoc.jar" />
+ <include name="jboss-osgi-runtime-knopflerfish-javadoc.jar" />
+ <include name="jboss-osgi-spi-javadoc.jar" />
+ <include name="jboss-osgi-webconsole-javadoc.jar" />
+ <include name="jboss-osgi-xml-binding-javadoc.jar" />
+ </fileset>
<!-- JBossOSGi Examples -->
<file src="@{deploy.artifacts.dir}/lib/jboss-osgi-testsuite-example.zip" targetdir="$INSTALL_PATH" unpack="true" override="true" />
- <!-- JBossOSGi Lib -->
- <fileset dir="@{deploy.artifacts.dir}/lib" targetdir="$INSTALL_PATH/lib" override="true">
- <include name="jboss-osgi-deployers.jar" />
- <include name="jboss-osgi-runtime-felix.jar" />
- <include name="jboss-osgi-spi.jar" />
- <include name="jboss-osgi-common.jar" />
- <include name="jboss-osgi-husky-harness.jar" />
- <include name="jboss-osgi-webconsole.jar" />
- <include name="org.apache.felix.framework.jar" />
- <include name="org.apache.felix.configadmin.jar" />
- <include name="org.apache.felix.http.jetty.jar" />
- <include name="org.apache.felix.log.jar" />
- <include name="org.apache.felix.metatype.jar" />
- <include name="org.osgi.compendium.jar" />
- <include name="org.osgi.core.jar" />
- </fileset>
-
<!-- JBossOSGi Source -->
<fileset dir="@{deploy.artifacts.dir}/source" targetdir="$INSTALL_PATH/source" override="true">
+ <include name="jboss-common-core-sources.jar" />
+ <include name="jboss-logging-log4j-sources.jar" />
+ <include name="jboss-logging-spi-sources.jar" />
+ <include name="jboss-osgi-apache-xerces-sources.jar" />
+ <include name="jboss-osgi-common-core-sources.jar" />
+ <include name="jboss-osgi-common-sources.jar" />
<include name="jboss-osgi-deployers-sources.jar" />
+ <include name="jboss-osgi-hotdeploy-sources.jar" />
+ <include name="jboss-osgi-husky-harness-sources.jar" />
+ <include name="jboss-osgi-jaxb-sources.jar" />
+ <include name="jboss-osgi-jmx-sources.jar" />
+ <include name="jboss-osgi-jndi-sources.jar" />
+ <include name="jboss-osgi-microcontainer-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" />
+ <include name="jboss-osgi-runtime-knopflerfish-sources.jar" />
<include name="jboss-osgi-spi-sources.jar" />
- <include name="jboss-osgi-common-sources.jar" />
<include name="jboss-osgi-webconsole-sources.jar" />
+ <include name="jboss-osgi-xml-binding-sources.jar" />
</fileset>
</pack>
Modified: projects/jboss-osgi/trunk/pom.xml
===================================================================
--- projects/jboss-osgi/trunk/pom.xml 2009-07-20 17:50:14 UTC (rev 91432)
+++ projects/jboss-osgi/trunk/pom.xml 2009-07-20 18:31:01 UTC (rev 91433)
@@ -104,7 +104,7 @@
<profile>
<id>reactor</id>
<modules>
- <!--
+ <!-- -->
<module>reactor/spi</module>
<module>reactor/runtime/equinox</module>
<module>reactor/runtime/felix</module>
@@ -123,7 +123,7 @@
<module>reactor/bundles/microcontainer</module>
<module>reactor/bundles/husky</module>
<module>reactor/runtime/jbossas</module>
- -->
+
<module>reactor/bundles/blueprint</module>
<module>testsuite</module>
</modules>
Property changes on: projects/jboss-osgi/trunk/reactor
___________________________________________________________________
Name: svn:externals
- #spi https://svn.jboss.org/repos/jbossas/projects/jboss-osgi/projects/spi/trunk
#bundles/apache-xerces https://svn.jboss.org/repos/jbossas/projects/jboss-osgi/projects/bundles/...
#bundles/common https://svn.jboss.org/repos/jbossas/projects/jboss-osgi/projects/bundles/...
#bundles/hotdeploy https://svn.jboss.org/repos/jbossas/projects/jboss-osgi/projects/bundles/...
#bundles/husky https://svn.jboss.org/repos/jbossas/projects/jboss-osgi/projects/bundles/...
#bundles/jaxb https://svn.jboss.org/repos/jbossas/projects/jboss-osgi/projects/bundles/...
#bundles/jmx https://svn.jboss.org/repos/jbossas/projects/jboss-osgi/projects/bundles/...
#bundles/jndi https://svn.jboss.org/repos/jbossas/projects/jboss-osgi/projects/bundles/...
#bundles/jboss-common-core https://svn.jboss.org/repos/jbossas/projects/jboss-osgi/projects/bundles/...
#bundles/jboss-xml-binding https://svn.jboss.org/repos/jbossas/projects/jboss-osgi/projects/bundles/...
#bundles/microcontainer https://svn.jboss.org/repos/jbossas/projects/jboss-osgi/projects/bundles/...
#bundles/remotelog https://svn.jboss.org/repos/jbossas/projects/jboss-osgi/projects/bundles/...
#bundles/webconsole https://svn.jboss.org/repos/jbossas/projects/jboss-osgi/projects/bundles/...
#runtime/deployers https://svn.jboss.org/repos/jbossas/projects/jboss-osgi/projects/runtime/...
#runtime/equinox https://svn.jboss.org/repos/jbossas/projects/jboss-osgi/projects/runtime/...
#runtime/felix https://svn.jboss.org/repos/jbossas/projects/jboss-osgi/projects/runtime/...
#runtime/jbossas https://svn.jboss.org/repos/jbossas/projects/jboss-osgi/projects/runtime/...
#runtime/knopflerfish https://svn.jboss.org/repos/jbossas/projects/jboss-osgi/projects/runtime/...
+ spi https://svn.jboss.org/repos/jbossas/projects/jboss-osgi/projects/spi/trunk
bundles/apache-xerces https://svn.jboss.org/repos/jbossas/projects/jboss-osgi/projects/bundles/...
bundles/common https://svn.jboss.org/repos/jbossas/projects/jboss-osgi/projects/bundles/...
bundles/hotdeploy https://svn.jboss.org/repos/jbossas/projects/jboss-osgi/projects/bundles/...
bundles/husky https://svn.jboss.org/repos/jbossas/projects/jboss-osgi/projects/bundles/...
bundles/jaxb https://svn.jboss.org/repos/jbossas/projects/jboss-osgi/projects/bundles/...
bundles/jmx https://svn.jboss.org/repos/jbossas/projects/jboss-osgi/projects/bundles/...
bundles/jndi https://svn.jboss.org/repos/jbossas/projects/jboss-osgi/projects/bundles/...
bundles/jboss-common-core https://svn.jboss.org/repos/jbossas/projects/jboss-osgi/projects/bundles/...
bundles/jboss-xml-binding https://svn.jboss.org/repos/jbossas/projects/jboss-osgi/projects/bundles/...
bundles/microcontainer https://svn.jboss.org/repos/jbossas/projects/jboss-osgi/projects/bundles/...
bundles/remotelog https://svn.jboss.org/repos/jbossas/projects/jboss-osgi/projects/bundles/...
bundles/webconsole https://svn.jboss.org/repos/jbossas/projects/jboss-osgi/projects/bundles/...
runtime/deployers https://svn.jboss.org/repos/jbossas/projects/jboss-osgi/projects/runtime/...
runtime/equinox https://svn.jboss.org/repos/jbossas/projects/jboss-osgi/projects/runtime/...
runtime/felix https://svn.jboss.org/repos/jbossas/projects/jboss-osgi/projects/runtime/...
runtime/jbossas https://svn.jboss.org/repos/jbossas/projects/jboss-osgi/projects/runtime/...
runtime/knopflerfish https://svn.jboss.org/repos/jbossas/projects/jboss-osgi/projects/runtime/...
16 years, 5 months