JBoss-OSGI SVN: r90805 - projects/jboss-osgi/projects/3rdparty/jboss-xml-binding/trunk.
by jboss-osgi-commits@lists.jboss.org
Author: thomas.diesler(a)jboss.com
Date: 2009-07-03 03:40:51 -0400 (Fri, 03 Jul 2009)
New Revision: 90805
Modified:
projects/jboss-osgi/projects/3rdparty/jboss-xml-binding/trunk/pom.xml
Log:
Update to jbossxb-2.0.1.GA
Modified: projects/jboss-osgi/projects/3rdparty/jboss-xml-binding/trunk/pom.xml
===================================================================
--- projects/jboss-osgi/projects/3rdparty/jboss-xml-binding/trunk/pom.xml 2009-07-03 06:32:24 UTC (rev 90804)
+++ projects/jboss-osgi/projects/3rdparty/jboss-xml-binding/trunk/pom.xml 2009-07-03 07:40:51 UTC (rev 90805)
@@ -9,7 +9,7 @@
<artifactId>jboss-osgi-xml-binding</artifactId>
<packaging>bundle</packaging>
- <version>2.0.0-SNAPSHOT</version>
+ <version>2.0.1-SNAPSHOT</version>
<parent>
<groupId>org.jboss.osgi</groupId>
@@ -18,7 +18,7 @@
</parent>
<properties>
- <version.jboss.xb>2.0.0.GA</version.jboss.xb>
+ <version.jboss.xb>2.0.1.GA</version.jboss.xb>
<version.javassist>3.9.0.GA</version.javassist>
<version.jboss.osgi.common>1.0.0.Beta2</version.jboss.osgi.common>
<version.jboss.osgi.jaxb>2.1.10</version.jboss.osgi.jaxb>
@@ -37,7 +37,7 @@
<artifactId>javassist</artifactId>
<version>${version.javassist}</version>
</dependency>
-
+
<!-- Bundle Dependencies -->
<dependency>
<groupId>org.jboss.osgi.bundles</groupId>
16 years, 5 months
JBoss-OSGI SVN: r90742 - in projects/jboss-osgi/trunk: distribution/src/main/resources/installer and 1 other directories.
by jboss-osgi-commits@lists.jboss.org
Author: thomas.diesler(a)jboss.com
Date: 2009-07-01 06:51:48 -0400 (Wed, 01 Jul 2009)
New Revision: 90742
Added:
projects/jboss-osgi/trunk/spi/src/main/java/org/jboss/osgi/spi/BundleClassLoader.java
Modified:
projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/jboss/osgi/blueprint/container/BeanManager.java
projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/jboss/osgi/blueprint/container/BlueprintContainerImpl.java
projects/jboss-osgi/trunk/distribution/src/main/resources/installer/install-definition.xml
projects/jboss-osgi/trunk/distribution/src/main/resources/installer/user-input-spec.xml
Log:
Support BP tests in jbossas
Modified: projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/jboss/osgi/blueprint/container/BeanManager.java
===================================================================
--- projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/jboss/osgi/blueprint/container/BeanManager.java 2009-07-01 10:50:45 UTC (rev 90741)
+++ projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/jboss/osgi/blueprint/container/BeanManager.java 2009-07-01 10:51:48 UTC (rev 90742)
@@ -96,6 +96,7 @@
String clazz = compMetadata.getClassName();
BeanMetaDataBuilder builder = BeanMetaDataBuilderFactory.createBuilder(key, clazz);
+ builder.setClassLoader(((BlueprintContainerImpl)container).getClassLoader());
mcBeanMetadata = builder.getBeanMetaData();
for (BeanProperty prop : bpBeanMetadata.getProperties())
Modified: projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/jboss/osgi/blueprint/container/BlueprintContainerImpl.java
===================================================================
--- projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/jboss/osgi/blueprint/container/BlueprintContainerImpl.java 2009-07-01 10:50:45 UTC (rev 90741)
+++ projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/jboss/osgi/blueprint/container/BlueprintContainerImpl.java 2009-07-01 10:51:48 UTC (rev 90742)
@@ -37,6 +37,7 @@
import org.jboss.osgi.blueprint.BlueprintContext;
import org.jboss.osgi.blueprint.parser.BlueprintParser;
import org.jboss.osgi.blueprint.reflect.BlueprintMetadata;
+import org.jboss.osgi.spi.BundleClassLoader;
import org.osgi.framework.Bundle;
import org.osgi.framework.BundleContext;
import org.osgi.framework.Constants;
@@ -73,6 +74,7 @@
public static final String PROPERTY_BLUEPRINT_BUNDLE_SYMBOLIC_NAME = "osgi.blueprint.container.symbolicname";
public static final String PROPERTY_BLUEPRINT_BUNDLE_VERSION = "osgi.blueprint.container.version";
+ private BundleClassLoader classLoader;
private BlueprintContext context;
private Bundle bundle;
@@ -82,6 +84,8 @@
{
this.context = context;
this.bundle = bundle;
+
+ this.classLoader = BundleClassLoader.createClassLoader(bundle);
}
public void initialize()
@@ -112,6 +116,11 @@
for (AbstractManager manager : list)
manager.shutdown();
}
+
+ public ClassLoader getClassLoader()
+ {
+ return classLoader;
+ }
public BundleContext getBundleContext()
{
Modified: projects/jboss-osgi/trunk/distribution/src/main/resources/installer/install-definition.xml
===================================================================
--- projects/jboss-osgi/trunk/distribution/src/main/resources/installer/install-definition.xml 2009-07-01 10:50:45 UTC (rev 90741)
+++ projects/jboss-osgi/trunk/distribution/src/main/resources/installer/install-definition.xml 2009-07-01 10:51:48 UTC (rev 90742)
@@ -259,12 +259,12 @@
<!--
********************************
* *
- * JBoss Integration *
+ * JBossAS Integration *
* *
********************************
-->
- <pack name="JBossOSGi Integration" required="no" preselected="yes">
+ <pack name="JBossAS Integration" required="no" preselected="yes">
<description>Integration with an existing JBossAS instance</description>
Modified: projects/jboss-osgi/trunk/distribution/src/main/resources/installer/user-input-spec.xml
===================================================================
--- projects/jboss-osgi/trunk/distribution/src/main/resources/installer/user-input-spec.xml 2009-07-01 10:50:45 UTC (rev 90741)
+++ projects/jboss-osgi/trunk/distribution/src/main/resources/installer/user-input-spec.xml 2009-07-01 10:51:48 UTC (rev 90742)
@@ -10,7 +10,7 @@
</field>
</panel>
<panel order="1">
- <createForPack name="JBossOSGi Integration" />
+ <createForPack name="JBossAS Integration" />
<field type="radio" variable="jbossSelection">
<description align="left" txt="Please choose your target container" />
<spec>
@@ -25,7 +25,7 @@
</field>
</panel>
<panel order="2">
- <createForPack name="JBossOSGi Integration" />
+ <createForPack name="JBossAS Integration" />
<field type="dir" align="left" variable="jbossInstallPath">
<spec txt="JBoss Home:" size="25" set="${jboss.home}" />
</field>
Copied: projects/jboss-osgi/trunk/spi/src/main/java/org/jboss/osgi/spi/BundleClassLoader.java (from rev 90698, projects/jboss-osgi/projects/integration/deployers/trunk/src/main/java/org/jboss/osgi/deployer/helpers/BundleClassLoader.java)
===================================================================
--- projects/jboss-osgi/trunk/spi/src/main/java/org/jboss/osgi/spi/BundleClassLoader.java (rev 0)
+++ projects/jboss-osgi/trunk/spi/src/main/java/org/jboss/osgi/spi/BundleClassLoader.java 2009-07-01 10:51:48 UTC (rev 90742)
@@ -0,0 +1,115 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2008, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.osgi.spi;
+
+// $Id: $
+
+import java.io.IOException;
+import java.net.URL;
+import java.security.AccessController;
+import java.security.PrivilegedAction;
+import java.util.Dictionary;
+import java.util.Enumeration;
+
+import org.osgi.framework.Bundle;
+import org.osgi.framework.Constants;
+
+/**
+ * A BundleClassLoader delegates all classloading concerns to the underlying Bundle.
+ *
+ * @author Ales.Justin(a)jboss.org
+ * @author thomas.Diesler(a)jboss.org
+ * @since 03-Feb-2009
+ */
+public class BundleClassLoader extends ClassLoader
+{
+ private final Bundle bundle;
+
+ public static BundleClassLoader createClassLoader(final Bundle bundle)
+ {
+ if (bundle == null)
+ throw new IllegalArgumentException("Null bundle");
+
+ return AccessController.doPrivileged(new PrivilegedAction<BundleClassLoader>()
+ {
+ public BundleClassLoader run()
+ {
+ return new BundleClassLoader(bundle);
+ }
+ });
+ }
+
+ private BundleClassLoader(Bundle bundle)
+ {
+ this.bundle = bundle;
+ }
+
+ protected Class<?> findClass(String name) throws ClassNotFoundException
+ {
+ return bundle.loadClass(name);
+ }
+
+ protected URL findResource(String name)
+ {
+ return bundle.getResource(name);
+ }
+
+ @SuppressWarnings("unchecked")
+ protected Enumeration<URL> findResources(String name) throws IOException
+ {
+ return bundle.getResources(name);
+ }
+
+ public URL getResource(String name)
+ {
+ return findResource(name);
+ }
+
+ public Class<?> loadClass(String name) throws ClassNotFoundException
+ {
+ return findClass(name);
+ }
+
+ public boolean equals(Object obj)
+ {
+ if (this == obj)
+ return true;
+
+ if (obj instanceof BundleClassLoader == false)
+ return false;
+
+ final BundleClassLoader bundleClassLoader = (BundleClassLoader)obj;
+ return bundle.equals(bundleClassLoader.bundle);
+ }
+
+ public int hashCode()
+ {
+ return bundle.hashCode();
+ }
+
+ public String toString()
+ {
+ Dictionary<?, ?> headers = bundle.getHeaders();
+ String bundleId = bundle.getSymbolicName() + ":" + headers.get(Constants.BUNDLE_VERSION);
+ return "BundleClassLoader for [" + bundleId + "]";
+ }
+}
16 years, 5 months
JBoss-OSGI SVN: r90741 - in projects/jboss-osgi/projects: runtime/felix/trunk/src/main/resources and 1 other directory.
by jboss-osgi-commits@lists.jboss.org
Author: thomas.diesler(a)jboss.com
Date: 2009-07-01 06:50:45 -0400 (Wed, 01 Jul 2009)
New Revision: 90741
Modified:
projects/jboss-osgi/projects/integration/deployers/trunk/src/main/java/org/jboss/osgi/deployer/BundleClassLoaderDeployer.java
projects/jboss-osgi/projects/runtime/felix/trunk/src/main/resources/osgi-deployers-jboss-beans.xml
Log:
Support BP tests in jbossas
Modified: projects/jboss-osgi/projects/integration/deployers/trunk/src/main/java/org/jboss/osgi/deployer/BundleClassLoaderDeployer.java
===================================================================
--- projects/jboss-osgi/projects/integration/deployers/trunk/src/main/java/org/jboss/osgi/deployer/BundleClassLoaderDeployer.java 2009-07-01 10:28:25 UTC (rev 90740)
+++ projects/jboss-osgi/projects/integration/deployers/trunk/src/main/java/org/jboss/osgi/deployer/BundleClassLoaderDeployer.java 2009-07-01 10:50:45 UTC (rev 90741)
@@ -31,8 +31,8 @@
import org.jboss.deployers.structure.spi.DeploymentUnitFilter;
import org.jboss.osgi.deployer.helpers.BundleDeploymentUnitFilter;
import org.jboss.osgi.deployer.helpers.PackageAdminDependencyItem;
+import org.jboss.osgi.spi.BundleClassLoader;
import org.jboss.osgi.spi.Constants;
-import org.jboss.osgi.spi.framework.BundleClassLoader;
import org.osgi.framework.Bundle;
import org.osgi.framework.BundleContext;
Modified: projects/jboss-osgi/projects/runtime/felix/trunk/src/main/resources/osgi-deployers-jboss-beans.xml
===================================================================
--- projects/jboss-osgi/projects/runtime/felix/trunk/src/main/resources/osgi-deployers-jboss-beans.xml 2009-07-01 10:28:25 UTC (rev 90740)
+++ projects/jboss-osgi/projects/runtime/felix/trunk/src/main/resources/osgi-deployers-jboss-beans.xml 2009-07-01 10:50:45 UTC (rev 90741)
@@ -37,10 +37,12 @@
org.jboss.osgi.spi.testing;version=1.0,
<!-- jboss -->
+ org.jboss.beans.metadata.plugins,
org.jboss.beans.metadata.plugins.builder,
org.jboss.beans.metadata.spi.builder,
org.jboss.beans.metadata.spi,
org.jboss.dependency.spi,
+ org.jboss.kernel.spi.dependency,
org.jboss.logging,
org.jboss.virtual,
org.jboss.virtual.plugins.registry,
16 years, 5 months
JBoss-OSGI SVN: r90740 - projects/jboss-osgi/projects/integration/deployers/trunk/src/main/java/org/jboss/osgi/deployer.
by jboss-osgi-commits@lists.jboss.org
Author: thomas.diesler(a)jboss.com
Date: 2009-07-01 06:28:25 -0400 (Wed, 01 Jul 2009)
New Revision: 90740
Modified:
projects/jboss-osgi/projects/integration/deployers/trunk/src/main/java/org/jboss/osgi/deployer/BundleClassLoaderDeployer.java
Log:
createBundleClassLoader -> createClassLoader
Modified: projects/jboss-osgi/projects/integration/deployers/trunk/src/main/java/org/jboss/osgi/deployer/BundleClassLoaderDeployer.java
===================================================================
--- projects/jboss-osgi/projects/integration/deployers/trunk/src/main/java/org/jboss/osgi/deployer/BundleClassLoaderDeployer.java 2009-07-01 10:21:17 UTC (rev 90739)
+++ projects/jboss-osgi/projects/integration/deployers/trunk/src/main/java/org/jboss/osgi/deployer/BundleClassLoaderDeployer.java 2009-07-01 10:28:25 UTC (rev 90740)
@@ -89,7 +89,7 @@
{
public ClassLoader createClassLoader(DeploymentUnit unit) throws Exception
{
- return BundleClassLoader.createBundleClassLoader(bundle);
+ return BundleClassLoader.createClassLoader(bundle);
}
public void removeClassLoader(DeploymentUnit unit) throws Exception
16 years, 5 months
JBoss-OSGI SVN: r90739 - in projects/jboss-osgi/projects/integration/deployers/trunk: src/main/java/org/jboss/osgi/deployer and 1 other directories.
by jboss-osgi-commits@lists.jboss.org
Author: thomas.diesler(a)jboss.com
Date: 2009-07-01 06:21:17 -0400 (Wed, 01 Jul 2009)
New Revision: 90739
Removed:
projects/jboss-osgi/projects/integration/deployers/trunk/src/main/java/org/jboss/osgi/deployer/helpers/BundleClassLoader.java
Modified:
projects/jboss-osgi/projects/integration/deployers/trunk/pom.xml
projects/jboss-osgi/projects/integration/deployers/trunk/src/main/java/org/jboss/osgi/deployer/BundleClassLoaderDeployer.java
Log:
Move BundleClassLoader to SPI
Modified: projects/jboss-osgi/projects/integration/deployers/trunk/pom.xml
===================================================================
--- projects/jboss-osgi/projects/integration/deployers/trunk/pom.xml 2009-07-01 09:38:09 UTC (rev 90738)
+++ projects/jboss-osgi/projects/integration/deployers/trunk/pom.xml 2009-07-01 10:21:17 UTC (rev 90739)
@@ -17,7 +17,7 @@
</parent>
<properties>
- <version.jboss.osgi.spi>1.0.0.Beta2</version.jboss.osgi.spi>
+ <version.jboss.osgi.spi>1.0.0-SNAPSHOT</version.jboss.osgi.spi>
<version.osgi>r4v41</version.osgi>
</properties>
Modified: projects/jboss-osgi/projects/integration/deployers/trunk/src/main/java/org/jboss/osgi/deployer/BundleClassLoaderDeployer.java
===================================================================
--- projects/jboss-osgi/projects/integration/deployers/trunk/src/main/java/org/jboss/osgi/deployer/BundleClassLoaderDeployer.java 2009-07-01 09:38:09 UTC (rev 90738)
+++ projects/jboss-osgi/projects/integration/deployers/trunk/src/main/java/org/jboss/osgi/deployer/BundleClassLoaderDeployer.java 2009-07-01 10:21:17 UTC (rev 90739)
@@ -29,10 +29,10 @@
import org.jboss.deployers.structure.spi.ClassLoaderFactory;
import org.jboss.deployers.structure.spi.DeploymentUnit;
import org.jboss.deployers.structure.spi.DeploymentUnitFilter;
-import org.jboss.osgi.deployer.helpers.BundleClassLoader;
import org.jboss.osgi.deployer.helpers.BundleDeploymentUnitFilter;
import org.jboss.osgi.deployer.helpers.PackageAdminDependencyItem;
import org.jboss.osgi.spi.Constants;
+import org.jboss.osgi.spi.framework.BundleClassLoader;
import org.osgi.framework.Bundle;
import org.osgi.framework.BundleContext;
Deleted: projects/jboss-osgi/projects/integration/deployers/trunk/src/main/java/org/jboss/osgi/deployer/helpers/BundleClassLoader.java
===================================================================
--- projects/jboss-osgi/projects/integration/deployers/trunk/src/main/java/org/jboss/osgi/deployer/helpers/BundleClassLoader.java 2009-07-01 09:38:09 UTC (rev 90738)
+++ projects/jboss-osgi/projects/integration/deployers/trunk/src/main/java/org/jboss/osgi/deployer/helpers/BundleClassLoader.java 2009-07-01 10:21:17 UTC (rev 90739)
@@ -1,115 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source.
- * Copyright 2008, Red Hat Middleware LLC, and individual contributors
- * as indicated by the @author tags. See the copyright.txt file in the
- * distribution for a full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.jboss.osgi.deployer.helpers;
-
-// $Id: $
-
-import java.io.IOException;
-import java.net.URL;
-import java.security.AccessController;
-import java.security.PrivilegedAction;
-import java.util.Dictionary;
-import java.util.Enumeration;
-
-import org.osgi.framework.Bundle;
-import org.osgi.framework.Constants;
-
-/**
- * A BundleClassLoader delegates all classloading concerns to the underlying Bundle.
- *
- * @author Ales.Justin(a)jboss.org
- * @author thomas.Diesler(a)jboss.org
- * @since 03-Feb-2009
- */
-public class BundleClassLoader extends ClassLoader
-{
- private final Bundle bundle;
-
- public static BundleClassLoader createBundleClassLoader(final Bundle bundle)
- {
- if (bundle == null)
- throw new IllegalArgumentException("Null bundle");
-
- return AccessController.doPrivileged(new PrivilegedAction<BundleClassLoader>()
- {
- public BundleClassLoader run()
- {
- return new BundleClassLoader(bundle);
- }
- });
- }
-
- private BundleClassLoader(Bundle bundle)
- {
- this.bundle = bundle;
- }
-
- protected Class<?> findClass(String name) throws ClassNotFoundException
- {
- return bundle.loadClass(name);
- }
-
- protected URL findResource(String name)
- {
- return bundle.getResource(name);
- }
-
- @SuppressWarnings("unchecked")
- protected Enumeration<URL> findResources(String name) throws IOException
- {
- return bundle.getResources(name);
- }
-
- public URL getResource(String name)
- {
- return findResource(name);
- }
-
- public Class<?> loadClass(String name) throws ClassNotFoundException
- {
- return findClass(name);
- }
-
- public boolean equals(Object o)
- {
- if (this == o)
- return true;
-
- if (o instanceof BundleClassLoader == false)
- return false;
-
- final BundleClassLoader bundleClassLoader = (BundleClassLoader)o;
- return bundle.equals(bundleClassLoader.bundle);
- }
-
- public int hashCode()
- {
- return bundle.hashCode();
- }
-
- public String toString()
- {
- Dictionary<?, ?> dictionary = bundle.getHeaders();
- String bname = dictionary.get(Constants.BUNDLE_NAME) + "(" + dictionary.get(Constants.BUNDLE_SYMBOLICNAME) + ")";
- return "BundleClassLoader for [" + bname + "]";
- }
-}
16 years, 5 months
JBoss-OSGI SVN: r90738 - projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/jboss/osgi/blueprint/parser.
by jboss-osgi-commits@lists.jboss.org
Author: thomas.diesler(a)jboss.com
Date: 2009-07-01 05:38:09 -0400 (Wed, 01 Jul 2009)
New Revision: 90738
Modified:
projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/jboss/osgi/blueprint/parser/SchemaResolverParser.java
Log:
set namespace awareness and validation
Modified: projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/jboss/osgi/blueprint/parser/SchemaResolverParser.java
===================================================================
--- projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/jboss/osgi/blueprint/parser/SchemaResolverParser.java 2009-07-01 08:15:22 UTC (rev 90737)
+++ projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/jboss/osgi/blueprint/parser/SchemaResolverParser.java 2009-07-01 09:38:09 UTC (rev 90738)
@@ -67,6 +67,9 @@
Thread.currentThread().setContextClassLoader(bundleCL);
Unmarshaller unmarshaller = UnmarshallerFactory.newInstance().newUnmarshaller();
+ unmarshaller.setNamespaceAware(true);
+ unmarshaller.setValidation(true);
+
TBlueprint tBlueprint = (TBlueprint)unmarshaller.unmarshal(xmlURL.toExternalForm(), resolver);
return tBlueprint;
16 years, 5 months
JBoss-OSGI SVN: r90737 - in projects/jboss-osgi/trunk: blueprint/testsuite/src/test/java/org/jboss/test/osgi/blueprint/parser and 1 other directories.
by jboss-osgi-commits@lists.jboss.org
Author: thomas.diesler(a)jboss.com
Date: 2009-07-01 04:15:22 -0400 (Wed, 01 Jul 2009)
New Revision: 90737
Modified:
projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/jboss/osgi/blueprint/parser/xb/TBean.java
projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/jboss/osgi/blueprint/parser/xb/TBlueprint.java
projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/jboss/osgi/blueprint/parser/xb/TComponent.java
projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/jboss/osgi/blueprint/parser/xb/TProperty.java
projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/jboss/osgi/blueprint/parser/xb/TService.java
projects/jboss-osgi/trunk/blueprint/testsuite/src/test/java/org/jboss/test/osgi/blueprint/parser/BasicRootParserTestCase.java
projects/jboss-osgi/trunk/eclipse/readme-commiters.txt
Log:
More JAXB based parsing
Modified: projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/jboss/osgi/blueprint/parser/xb/TBean.java
===================================================================
--- projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/jboss/osgi/blueprint/parser/xb/TBean.java 2009-07-01 07:45:21 UTC (rev 90736)
+++ projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/jboss/osgi/blueprint/parser/xb/TBean.java 2009-07-01 08:15:22 UTC (rev 90737)
@@ -27,6 +27,8 @@
import java.util.List;
import java.util.Map;
+import javax.xml.bind.annotation.XmlAttribute;
+import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlType;
import javax.xml.namespace.QName;
@@ -53,22 +55,17 @@
protected Boolean lazyInit;
private Map<QName, String> otherAttributes = new HashMap<QName, String>();
- /**
- * Gets the value of the description property.
- */
public String getDescription()
{
return description;
}
- /**
- * Sets the value of the description property.
- */
public void setDescription(String value)
{
this.description = value;
}
+ @XmlElement(name = "property", namespace = BlueprintContext.XMLNS_BLUEPRINT)
public List<TProperty> getProperties()
{
return properties;
@@ -89,161 +86,77 @@
this.arguments = arguments;
}
- /**
- * Gets the value of the class property.
- */
+ @XmlAttribute(name = "class")
public String getClassName()
{
return className;
}
- /**
- * Sets the value of the class property.
- */
public void setClassName(String value)
{
this.className = value;
}
- /**
- * Gets the value of the initMethod property.
- *
- * @return possible object is {@link String }
- *
- */
public String getInitMethod()
{
return initMethod;
}
- /**
- * Sets the value of the initMethod property.
- *
- * @param value allowed object is {@link String }
- *
- */
public void setInitMethod(String value)
{
this.initMethod = value;
}
- /**
- * Gets the value of the destroyMethod property.
- *
- * @return possible object is {@link String }
- *
- */
public String getDestroyMethod()
{
return destroyMethod;
}
- /**
- * Sets the value of the destroyMethod property.
- *
- * @param value allowed object is {@link String }
- *
- */
public void setDestroyMethod(String value)
{
this.destroyMethod = value;
}
- /**
- * Gets the value of the factoryMethod property.
- *
- * @return possible object is {@link String }
- *
- */
public String getFactoryMethod()
{
return factoryMethod;
}
- /**
- * Sets the value of the factoryMethod property.
- *
- * @param value allowed object is {@link String }
- *
- */
public void setFactoryMethod(String value)
{
this.factoryMethod = value;
}
- /**
- * Gets the value of the factoryComponent property.
- *
- */
public String getFactoryComponentId()
{
return factoryComponent;
}
- /**
- * Sets the value of the factoryComponent property.
- *
- */
public void setFactoryComponentId(String value)
{
this.factoryComponent = value;
}
- /**
- * Gets the value of the scope property.
- *
- * @return possible object is {@link String }
- *
- */
public String getScope()
{
return scope;
}
- /**
- * Sets the value of the scope property.
- *
- * @param value allowed object is {@link String }
- *
- */
public void setScope(String value)
{
this.scope = value;
}
- /**
- * Gets the value of the lazyInit property.
- *
- * @return possible object is {@link Boolean }
- *
- */
public boolean isLazyInit()
{
return lazyInit;
}
- /**
- * Sets the value of the lazyInit property.
- *
- * @param value allowed object is {@link Boolean }
- *
- */
public void setLazyInit(boolean value)
{
this.lazyInit = value;
}
- /**
- * Gets a map that contains attributes that aren't bound to any typed property on this class.
- *
- * <p>
- * the map is keyed by the name of the attribute and the value is the string value of the attribute.
- *
- * the map returned by this method is live, and you can add new attribute by updating the map directly. Because of this design, there's no setter.
- *
- *
- * @return always non-null
- */
public Map<QName, String> getOtherAttributes()
{
return otherAttributes;
Modified: projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/jboss/osgi/blueprint/parser/xb/TBlueprint.java
===================================================================
--- projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/jboss/osgi/blueprint/parser/xb/TBlueprint.java 2009-07-01 07:45:21 UTC (rev 90736)
+++ projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/jboss/osgi/blueprint/parser/xb/TBlueprint.java 2009-07-01 08:15:22 UTC (rev 90737)
@@ -33,6 +33,7 @@
import java.util.Map;
import java.util.Set;
+import javax.xml.bind.annotation.XmlAttribute;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlElements;
import javax.xml.bind.annotation.XmlNsForm;
@@ -50,9 +51,7 @@
*
* The definitions consist of two sections: the type-converter section and the components section.
*
- * blueprint ::= <type-converters> component
- * component ::= <bean> | <service> | service-reference
- * service-reference ::= <reference> | <ref-list> | <ref-set>
+ * blueprint ::= <type-converters> component component ::= <bean> | <service> | service-reference service-reference ::= <reference> | <ref-list> | <ref-set>
* type-converter ::= <bean> | <ref>
*
* @author thomas.diesler(a)jboss.com
@@ -65,10 +64,6 @@
{
protected String description;
protected TTypeConverters typeConverters;
- @XmlElements({
- @XmlElement(name="bean", namespace = BlueprintContext.XMLNS_BLUEPRINT, type=TBean.class),
- @XmlElement(name="service", namespace = BlueprintContext.XMLNS_BLUEPRINT, type=TService.class),
- @XmlElement(name="reference", namespace = BlueprintContext.XMLNS_BLUEPRINT, type=TReference.class)})
protected List<TComponent> components;
protected Boolean defaultLazyInit;
protected String defaultInitMethod;
@@ -77,49 +72,29 @@
protected TAvailability defaultAvailability;
private Map<QName, String> otherAttributes = new HashMap<QName, String>();
- /**
- * Gets the value of the description property.
- *
- */
public String getDescription()
{
return description;
}
- /**
- * Sets the value of the description property.
- *
- */
public void setDescription(String value)
{
this.description = value;
}
- /**
- * Gets the value of the typeConverters property.
- *
- * @return possible object is {@link TTypeConverters }
- *
- */
public TTypeConverters getTypeConverters()
{
return typeConverters;
}
- /**
- * Sets the value of the typeConverters property.
- *
- * @param value allowed object is {@link TTypeConverters }
- *
- */
public void setTypeConverters(TTypeConverters value)
{
this.typeConverters = value;
}
- /**
- * Gets the value of components
- */
+ @XmlElements( { @XmlElement(name = "bean", namespace = BlueprintContext.XMLNS_BLUEPRINT, type = TBean.class),
+ @XmlElement(name = "service", namespace = BlueprintContext.XMLNS_BLUEPRINT, type = TService.class),
+ @XmlElement(name = "reference", namespace = BlueprintContext.XMLNS_BLUEPRINT, type = TReference.class) })
public List<TComponent> getComponents()
{
if (components == null)
@@ -171,75 +146,37 @@
return compMetadata;
}
- /**
- * Gets the value of the defaultLazyInit property.
- *
- * @return possible object is {@link Boolean }
- *
- */
+ @XmlAttribute(name = "default-lazy-init")
public Boolean isDefaultLazyInit()
{
return defaultLazyInit;
}
- /**
- * Sets the value of the defaultLazyInit property.
- *
- * @param value allowed object is {@link Boolean }
- *
- */
public void setDefaultLazyInit(Boolean value)
{
this.defaultLazyInit = value;
}
- /**
- * Gets the value of the defaultInitMethod property.
- *
- * @return possible object is {@link String }
- *
- */
public String getDefaultInitMethod()
{
return defaultInitMethod;
}
- /**
- * Sets the value of the defaultInitMethod property.
- *
- * @param value allowed object is {@link String }
- *
- */
public void setDefaultInitMethod(String value)
{
this.defaultInitMethod = value;
}
- /**
- * Gets the value of the defaultDestroyMethod property.
- *
- * @return possible object is {@link String }
- *
- */
public String getDefaultDestroyMethod()
{
return defaultDestroyMethod;
}
- /**
- * Sets the value of the defaultDestroyMethod property.
- *
- * @param value allowed object is {@link String }
- *
- */
public void setDefaultDestroyMethod(String value)
{
this.defaultDestroyMethod = value;
}
- /**
- * Gets the value of the defaultTimeout property.
- */
public BigInteger getDefaultTimeout()
{
if (defaultTimeout == null)
@@ -248,20 +185,11 @@
return defaultTimeout;
}
- /**
- * Sets the value of the defaultTimeout property.
- */
public void setDefaultTimeout(BigInteger value)
{
this.defaultTimeout = value;
}
- /**
- * Gets the value of the defaultAvailability property.
- *
- * @return possible object is {@link Tavailability }
- *
- */
public TAvailability getDefaultAvailability()
{
if (defaultAvailability == null)
@@ -270,28 +198,11 @@
return defaultAvailability;
}
- /**
- * Sets the value of the defaultAvailability property.
- *
- * @param value allowed object is {@link Tavailability }
- *
- */
public void setDefaultAvailability(TAvailability value)
{
this.defaultAvailability = value;
}
- /**
- * Gets a map that contains attributes that aren't bound to any typed property on this class.
- *
- * <p>
- * the map is keyed by the name of the attribute and the value is the string value of the attribute.
- *
- * the map returned by this method is live, and you can add new attribute by updating the map directly. Because of this design, there's no setter.
- *
- *
- * @return always non-null
- */
public Map<QName, String> getOtherAttributes()
{
return otherAttributes;
Modified: projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/jboss/osgi/blueprint/parser/xb/TComponent.java
===================================================================
--- projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/jboss/osgi/blueprint/parser/xb/TComponent.java 2009-07-01 07:45:21 UTC (rev 90736)
+++ projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/jboss/osgi/blueprint/parser/xb/TComponent.java 2009-07-01 08:15:22 UTC (rev 90737)
@@ -26,6 +26,10 @@
import java.util.ArrayList;
import java.util.List;
+import javax.xml.bind.annotation.XmlAttribute;
+import javax.xml.bind.annotation.XmlType;
+
+import org.jboss.osgi.blueprint.BlueprintContext;
import org.osgi.service.blueprint.reflect.ComponentMetadata;
/**
@@ -41,23 +45,19 @@
* @author thomas.diesler(a)jboss.com
* @since 13-May-2009
*/
+@XmlType(name = "TComponent", namespace = BlueprintContext.XMLNS_BLUEPRINT)
public abstract class TComponent
{
protected String id;
protected List<String> dependsOn;
protected int initialization;
- /**
- * Gets the value of the id property.
- */
+ @XmlAttribute(name = "id")
public String getId()
{
return id;
}
- /**
- * Sets the value of the id property.
- */
public void setId(String value)
{
this.id = value;
Modified: projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/jboss/osgi/blueprint/parser/xb/TProperty.java
===================================================================
--- projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/jboss/osgi/blueprint/parser/xb/TProperty.java 2009-07-01 07:45:21 UTC (rev 90736)
+++ projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/jboss/osgi/blueprint/parser/xb/TProperty.java 2009-07-01 08:15:22 UTC (rev 90737)
@@ -26,6 +26,10 @@
import java.util.ArrayList;
import java.util.List;
+import javax.xml.bind.annotation.XmlType;
+
+import org.jboss.osgi.blueprint.BlueprintContext;
+
/**
*
*
@@ -60,6 +64,7 @@
*
*
*/
+@XmlType(name = "TProperty", namespace = BlueprintContext.XMLNS_BLUEPRINT)
public class TProperty
{
protected String description;
Modified: projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/jboss/osgi/blueprint/parser/xb/TService.java
===================================================================
--- projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/jboss/osgi/blueprint/parser/xb/TService.java 2009-07-01 07:45:21 UTC (rev 90736)
+++ projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/jboss/osgi/blueprint/parser/xb/TService.java 2009-07-01 08:15:22 UTC (rev 90737)
@@ -29,6 +29,7 @@
import java.util.List;
import java.util.Map;
+import javax.xml.bind.annotation.XmlAttribute;
import javax.xml.bind.annotation.XmlType;
import javax.xml.namespace.QName;
@@ -55,31 +56,28 @@
protected int ranking;
private Map<QName, String> otherAttributes = new HashMap<QName, String>();
- /**
- * Gets the value of the description property.
- *
- * @return possible object is {@link String }
- *
- */
public String getDescription()
{
return description;
}
- /**
- * Sets the value of the description property.
- *
- * @param value allowed object is {@link String }
- *
- */
public void setDescription(String value)
{
this.description = value;
}
- /**
- * Gets the value of the interfaces property.
- */
+ @XmlAttribute(name = "interface")
+ public String getInterface()
+ {
+ List<String> interfaceNames = getInterfaceNames();
+ return interfaceNames.size() > 0 ? interfaceNames.get(0) : null;
+ }
+
+ public void setInterface(String interf)
+ {
+ getInterfaceNames().add(interf);
+ }
+
public List<String> getInterfaceNames()
{
if (interfaceNames == null)
@@ -93,9 +91,6 @@
this.interfaceNames = interfaces;
}
- /**
- * Gets the value of the serviceProperties property.
- */
public List<TServicePropertyEntry> getServiceProperties()
{
if (serviceProperties == null)
@@ -109,9 +104,6 @@
this.serviceProperties = serviceProperties;
}
- /**
- * Gets the value of the registrationListener property.
- */
public Collection<TRegistrationListener> getRegistrationListeners()
{
if (registrationListener == null)
@@ -125,31 +117,16 @@
this.registrationListener = registrationListener;
}
- /**
- * Gets the value of the bean property.
- *
- * @return possible object is {@link TBean }
- *
- */
public TBean getBean()
{
return bean;
}
- /**
- * Sets the value of the bean property.
- *
- * @param value allowed object is {@link TBean }
- *
- */
public void setBean(TBean value)
{
this.bean = value;
}
- /**
- * Gets the value of the any property.
- */
public List<Object> getAny()
{
if (any == null)
@@ -159,33 +136,16 @@
return this.any;
}
- /**
- * Gets the value of the ref property.
- *
- * @return possible object is {@link String }
- *
- */
public String getRef()
{
return ref;
}
- /**
- * Sets the value of the ref property.
- *
- * @param value allowed object is {@link String }
- *
- */
public void setRef(String value)
{
this.ref = value;
}
- /**
- * Gets the value of the autoExport property.
- *
- * @return possible object is {@link TAutoExportModes }
- */
public TAutoExportModes getAutoExportMode()
{
if (autoExportMode == null)
@@ -194,35 +154,21 @@
return autoExportMode;
}
- /**
- * Sets the value of the autoExport property.
- *
- * @param value allowed object is {@link TAutoExportModes }
- */
public void setAutoExportMode(TAutoExportModes value)
{
this.autoExportMode = value;
}
- /**
- * Gets the value of the ranking property.
- */
public int getRanking()
{
return ranking;
}
- /**
- * Sets the value of the ranking property.
- */
public void setRanking(int value)
{
this.ranking = value;
}
- /**
- * Gets a map that contains attributes that aren't bound to any typed property on this class.
- */
public Map<QName, String> getOtherAttributes()
{
return otherAttributes;
Modified: projects/jboss-osgi/trunk/blueprint/testsuite/src/test/java/org/jboss/test/osgi/blueprint/parser/BasicRootParserTestCase.java
===================================================================
--- projects/jboss-osgi/trunk/blueprint/testsuite/src/test/java/org/jboss/test/osgi/blueprint/parser/BasicRootParserTestCase.java 2009-07-01 07:45:21 UTC (rev 90736)
+++ projects/jboss-osgi/trunk/blueprint/testsuite/src/test/java/org/jboss/test/osgi/blueprint/parser/BasicRootParserTestCase.java 2009-07-01 08:15:22 UTC (rev 90737)
@@ -51,11 +51,11 @@
TBlueprint blueprint = new BlueprintParser(new MockBlueprintContext()).parse(xmlURL);
// assert default attributes
- assertEquals(TAvailability.MANDATORY, blueprint.getDefaultAvailability());
- assertEquals(new BigInteger("300000"), blueprint.getDefaultTimeout());
- assertEquals(Boolean.FALSE, blueprint.isDefaultLazyInit());
- assertNull(blueprint.getDefaultInitMethod());
- assertNull(blueprint.getDefaultDestroyMethod());
+ assertEquals("default-availability: mandatory", TAvailability.MANDATORY, blueprint.getDefaultAvailability());
+ assertEquals("default-timeout: 300000", new BigInteger("300000"), blueprint.getDefaultTimeout());
+ assertEquals("default-lazy-init: FALSE", Boolean.FALSE, blueprint.isDefaultLazyInit());
+ assertNull("default-init-method: null", blueprint.getDefaultInitMethod());
+ assertNull("default-destroy-method: null", blueprint.getDefaultDestroyMethod());
}
@Test
Modified: projects/jboss-osgi/trunk/eclipse/readme-commiters.txt
===================================================================
--- projects/jboss-osgi/trunk/eclipse/readme-commiters.txt 2009-07-01 07:45:21 UTC (rev 90736)
+++ projects/jboss-osgi/trunk/eclipse/readme-commiters.txt 2009-07-01 08:15:22 UTC (rev 90737)
@@ -10,6 +10,7 @@
[auto-props]
*.bat = svn:keywords=Id Revision;svn:eol-style=LF
*.java = svn:keywords=Id Revision;svn:eol-style=LF
+*.properties = svn:keywords=Id Revision;svn:eol-style=LF
*.sh = svn:keywords=Id Revision;svn:eol-style=LF
*.txt = svn:keywords=Id Revision;svn:eol-style=LF
*.wsdl = svn:keywords=Id Revision;svn:eol-style=LF
16 years, 5 months