JBoss-OSGI SVN: r90316 - in projects/jboss-osgi/trunk/blueprint/testsuite/src/test: resources/parser and 1 other directory.
by jboss-osgi-commits@lists.jboss.org
Author: thomas.diesler(a)jboss.com
Date: 2009-06-17 07:48:08 -0400 (Wed, 17 Jun 2009)
New Revision: 90316
Modified:
projects/jboss-osgi/trunk/blueprint/testsuite/src/test/java/org/jboss/test/osgi/blueprint/parser/AllElementsParserTestCase.java
projects/jboss-osgi/trunk/blueprint/testsuite/src/test/resources/parser/blueprint-all-elements.xml
Log:
More BP parser test coverage
Modified: projects/jboss-osgi/trunk/blueprint/testsuite/src/test/java/org/jboss/test/osgi/blueprint/parser/AllElementsParserTestCase.java
===================================================================
--- projects/jboss-osgi/trunk/blueprint/testsuite/src/test/java/org/jboss/test/osgi/blueprint/parser/AllElementsParserTestCase.java 2009-06-17 10:51:02 UTC (rev 90315)
+++ projects/jboss-osgi/trunk/blueprint/testsuite/src/test/java/org/jboss/test/osgi/blueprint/parser/AllElementsParserTestCase.java 2009-06-17 11:48:08 UTC (rev 90316)
@@ -27,6 +27,7 @@
import static org.junit.Assert.assertNotNull;
import java.net.URL;
+import java.util.Collection;
import java.util.List;
import org.jboss.osgi.blueprint.parser.BlueprintParser;
@@ -38,6 +39,8 @@
import org.junit.Test;
import org.osgi.service.blueprint.reflect.BeanMetadata;
import org.osgi.service.blueprint.reflect.ReferenceMetadata;
+import org.osgi.service.blueprint.reflect.ServiceMetadata;
+import org.osgi.service.blueprint.reflect.ServiceReferenceMetadata;
/**
* Blueprint parser tests
@@ -106,4 +109,28 @@
BeanMetadata conv5 = (BeanMetadata)converters.get(4);
assertNotNull("Converter not null", conv5);
}
+
+ @Test
+ public void getExportedServicesMetadata() throws Exception
+ {
+ Collection<ServiceMetadata> services = blueprint.getExportedServicesMetadata();
+ assertNotNull("ServiceMetadata not null", services);
+ assertEquals("ServiceMetadata size", 2, services.size());
+ }
+
+ @Test
+ public void getReferencedServicesMetadata() throws Exception
+ {
+ Collection<ServiceReferenceMetadata> serviceRefs = blueprint.getReferencedServicesMetadata();
+ assertNotNull("ServiceReferenceMetadata not null", serviceRefs);
+ assertEquals("ServiceReferenceMetadata size", 3, serviceRefs.size());
+ }
+
+ @Test
+ public void getBeanComponentsMetadata() throws Exception
+ {
+ Collection<BeanMetadata> beans = blueprint.getBeanComponentsMetadata();
+ assertNotNull("BeanMetadata not null", beans);
+ assertEquals("BeanMetadata size", 3, beans.size());
+ }
}
\ No newline at end of file
Modified: projects/jboss-osgi/trunk/blueprint/testsuite/src/test/resources/parser/blueprint-all-elements.xml
===================================================================
--- projects/jboss-osgi/trunk/blueprint/testsuite/src/test/resources/parser/blueprint-all-elements.xml 2009-06-17 10:51:02 UTC (rev 90315)
+++ projects/jboss-osgi/trunk/blueprint/testsuite/src/test/resources/parser/blueprint-all-elements.xml 2009-06-17 11:48:08 UTC (rev 90316)
@@ -47,9 +47,6 @@
</ref-list>
-->
- <bean id="beanA" class="foo.Bean" depends-on="beanDependency" init-method="initMethod" destroy-method="destroyMethod" factory-method="factoryMethod"
- factory-component="factoryComponent" scope="singleton" lazy-init="lazy" />
-
<reference component-name="referenceCompName" interface="foo.referenceInterf" filter="referenceFilter" availablitity="optional">
<description>reference description</description>
<interfaces>
@@ -60,4 +57,7 @@
<listener ref="referenceListenerB" />
</reference>
+ <bean id="beanA" class="foo.Bean" depends-on="beanDependency" init-method="initMethod" destroy-method="destroyMethod" factory-method="factoryMethod"
+ factory-component="factoryComponent" scope="singleton" lazy-init="lazy" />
+
</blueprint>
15 years
JBoss-OSGI SVN: r90313 - in projects/jboss-osgi/trunk: blueprint/impl/src/main/java/org/jboss/osgi/blueprint/context and 8 other directories.
by jboss-osgi-commits@lists.jboss.org
Author: thomas.diesler(a)jboss.com
Date: 2009-06-17 06:37:51 -0400 (Wed, 17 Jun 2009)
New Revision: 90313
Added:
projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/jboss/osgi/blueprint/reflect/BlueprintMetadata.java
Removed:
projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/jboss/osgi/blueprint/reflect/BlueprintImpl.java
Modified:
projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/jboss/osgi/blueprint/context/BlueprintContextImpl.java
projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/jboss/osgi/blueprint/extender/BlueprintExtender.java
projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/jboss/osgi/blueprint/parser/BlueprintParser.java
projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/jboss/osgi/blueprint/reflect/TypeConverters.java
projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/osgi/service/blueprint/reflect/ComponentMetadata.java
projects/jboss-osgi/trunk/blueprint/impl/src/main/resources/schema/blueprint-jbxb.xsd
projects/jboss-osgi/trunk/blueprint/testsuite/src/test/java/org/jboss/test/osgi/blueprint/parser/AllElementsParserTestCase.java
projects/jboss-osgi/trunk/blueprint/testsuite/src/test/java/org/jboss/test/osgi/blueprint/parser/BasicBeansParserTestCase.java
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/BasicServiceParserTestCase.java
projects/jboss-osgi/trunk/blueprint/testsuite/src/test/resources/log4j.xml
projects/jboss-osgi/trunk/blueprint/testsuite/src/test/resources/parser/blueprint-all-elements.xml
projects/jboss-osgi/trunk/pom.xml
Log:
More BP parser test coverage
Modified: projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/jboss/osgi/blueprint/context/BlueprintContextImpl.java
===================================================================
--- projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/jboss/osgi/blueprint/context/BlueprintContextImpl.java 2009-06-17 10:17:23 UTC (rev 90312)
+++ projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/jboss/osgi/blueprint/context/BlueprintContextImpl.java 2009-06-17 10:37:51 UTC (rev 90313)
@@ -23,19 +23,14 @@
//$Id$
-import java.util.ArrayList;
import java.util.Collection;
-import java.util.Collections;
-import java.util.LinkedHashSet;
-import java.util.List;
import java.util.Set;
-import org.jboss.osgi.blueprint.reflect.BlueprintImpl;
+import org.jboss.osgi.blueprint.reflect.BlueprintMetadata;
import org.jboss.osgi.spi.NotImplementedException;
import org.osgi.framework.Bundle;
import org.osgi.framework.BundleContext;
import org.osgi.service.blueprint.context.BlueprintContext;
-import org.osgi.service.blueprint.context.NoSuchComponentException;
import org.osgi.service.blueprint.reflect.BeanMetadata;
import org.osgi.service.blueprint.reflect.ComponentMetadata;
import org.osgi.service.blueprint.reflect.ServiceMetadata;
@@ -53,9 +48,9 @@
public class BlueprintContextImpl implements BlueprintContext
{
private Bundle bundle;
- private BlueprintImpl bpMetadata;
+ private BlueprintMetadata bpMetadata;
- public BlueprintContextImpl(Bundle bundle, BlueprintImpl bpMetadata)
+ public BlueprintContextImpl(Bundle bundle, BlueprintMetadata bpMetadata)
{
this.bundle = bundle;
this.bpMetadata = bpMetadata;
@@ -63,13 +58,7 @@
public Collection<BeanMetadata> getBeanComponentsMetadata()
{
- List<BeanMetadata> beanMetadata = new ArrayList<BeanMetadata>();
- for (ComponentMetadata comp : bpMetadata.getComponents())
- {
- if (comp instanceof BeanMetadata)
- beanMetadata.add((BeanMetadata)comp);
- }
- return Collections.unmodifiableList(beanMetadata);
+ return bpMetadata.getBeanComponentsMetadata();
}
public BundleContext getBundleContext()
@@ -84,50 +73,21 @@
public ComponentMetadata getComponentMetadata(String name)
{
- ComponentMetadata compMetadata = null;
- for (ComponentMetadata aux : bpMetadata.getComponents())
- {
- if (aux.getId().equals(name))
- {
- compMetadata = aux;
- break;
- }
- }
-
- if (compMetadata == null)
- throw new NoSuchComponentException("Cannot get component metadata for: " + name);
-
- return compMetadata;
+ return bpMetadata.getComponentMetadata(name);
}
public Set<String> getComponentNames()
{
- Set<String> compNames = new LinkedHashSet<String>();
- for (ComponentMetadata comp : bpMetadata.getComponents())
- compNames.add(comp.getId());
-
- return Collections.unmodifiableSet(compNames);
+ return bpMetadata.getComponentNames();
}
public Collection<ServiceMetadata> getExportedServicesMetadata()
{
- List<ServiceMetadata> servMetadata = new ArrayList<ServiceMetadata>();
- for (ComponentMetadata comp : bpMetadata.getComponents())
- {
- if (comp instanceof ServiceMetadata)
- servMetadata.add((ServiceMetadata)comp);
- }
- return Collections.unmodifiableList(servMetadata);
+ return bpMetadata.getExportedServicesMetadata();
}
public Collection<ServiceReferenceMetadata> getReferencedServicesMetadata()
{
- List<ServiceReferenceMetadata> srefMetadata = new ArrayList<ServiceReferenceMetadata>();
- for (ComponentMetadata comp : bpMetadata.getComponents())
- {
- if (comp instanceof ServiceReferenceMetadata)
- srefMetadata.add((ServiceReferenceMetadata)comp);
- }
- return Collections.unmodifiableList(srefMetadata);
+ return bpMetadata.getReferencedServicesMetadata();
}
}
\ No newline at end of file
Modified: projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/jboss/osgi/blueprint/extender/BlueprintExtender.java
===================================================================
--- projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/jboss/osgi/blueprint/extender/BlueprintExtender.java 2009-06-17 10:17:23 UTC (rev 90312)
+++ projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/jboss/osgi/blueprint/extender/BlueprintExtender.java 2009-06-17 10:37:51 UTC (rev 90313)
@@ -28,7 +28,7 @@
import org.jboss.osgi.blueprint.context.BlueprintContextImpl;
import org.jboss.osgi.blueprint.parser.BlueprintParser;
-import org.jboss.osgi.blueprint.reflect.BlueprintImpl;
+import org.jboss.osgi.blueprint.reflect.BlueprintMetadata;
import org.jboss.osgi.common.log.LogServiceTracker;
import org.osgi.framework.Bundle;
import org.osgi.framework.BundleContext;
@@ -61,7 +61,7 @@
{
Bundle bundle = event.getBundle();
- BlueprintImpl bpMetadata = null;
+ BlueprintMetadata bpMetadata = null;
if (event.getType() == BundleEvent.STARTING)
{
@@ -78,7 +78,7 @@
for (String descriptor : descritors)
{
- BlueprintImpl aux = processDescriptor(bundle, descriptor);
+ BlueprintMetadata aux = processDescriptor(bundle, descriptor);
bpMetadata = aux.merge(bpMetadata);
}
}
@@ -89,7 +89,7 @@
while (foundEntries.hasMoreElements())
{
URL nextEntry = (URL)foundEntries.nextElement();
- BlueprintImpl aux = processDescriptor(bundle, nextEntry);
+ BlueprintMetadata aux = processDescriptor(bundle, nextEntry);
bpMetadata = aux.merge(bpMetadata);
}
}
@@ -111,15 +111,15 @@
// currently does nothing
}
- private BlueprintImpl processDescriptor(Bundle bundle, String descriptor)
+ private BlueprintMetadata processDescriptor(Bundle bundle, String descriptor)
{
URL descriptorURL = bundle.getResource(descriptor);
return processDescriptor(bundle, descriptorURL);
}
- private BlueprintImpl processDescriptor(Bundle bundle, URL descriptorURL)
+ private BlueprintMetadata processDescriptor(Bundle bundle, URL descriptorURL)
{
- BlueprintImpl blueprint = new BlueprintParser().parse(descriptorURL);
+ BlueprintMetadata blueprint = new BlueprintParser().parse(descriptorURL);
return blueprint;
}
}
\ No newline at end of file
Modified: projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/jboss/osgi/blueprint/parser/BlueprintParser.java
===================================================================
--- projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/jboss/osgi/blueprint/parser/BlueprintParser.java 2009-06-17 10:17:23 UTC (rev 90312)
+++ projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/jboss/osgi/blueprint/parser/BlueprintParser.java 2009-06-17 10:37:51 UTC (rev 90313)
@@ -27,7 +27,7 @@
import org.apache.xerces.dom.DOMXSImplementationSourceImpl;
import org.jboss.osgi.blueprint.BlueprintException;
-import org.jboss.osgi.blueprint.reflect.BlueprintImpl;
+import org.jboss.osgi.blueprint.reflect.BlueprintMetadata;
import org.jboss.xb.binding.JBossXBException;
import org.jboss.xb.binding.Unmarshaller;
import org.jboss.xb.binding.UnmarshallerFactory;
@@ -84,7 +84,7 @@
/*
* * Parse a blueprint descriptor
*/
- public BlueprintImpl parse(URL xmlURL)
+ public BlueprintMetadata parse(URL xmlURL)
{
if (xmlURL == null)
throw new IllegalArgumentException("Cannot parse null descriptor URL");
@@ -96,7 +96,11 @@
Thread.currentThread().setContextClassLoader(bundleCL);
Unmarshaller unmarshaller = UnmarshallerFactory.newInstance().newUnmarshaller();
- return (BlueprintImpl)unmarshaller.unmarshal(xmlURL.toExternalForm(), schemaBinding);
+ BlueprintMetadata bpMetadata = (BlueprintMetadata)unmarshaller.unmarshal(xmlURL.toExternalForm(), schemaBinding);
+
+ bpMetadata.initialize();
+
+ return bpMetadata;
}
catch (JBossXBException ex)
{
Deleted: projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/jboss/osgi/blueprint/reflect/BlueprintImpl.java
===================================================================
--- projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/jboss/osgi/blueprint/reflect/BlueprintImpl.java 2009-06-17 10:17:23 UTC (rev 90312)
+++ projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/jboss/osgi/blueprint/reflect/BlueprintImpl.java 2009-06-17 10:37:51 UTC (rev 90313)
@@ -1,248 +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.blueprint.reflect;
-
-// $Id$
-
-import java.math.BigInteger;
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-
-import javax.xml.namespace.QName;
-
-import org.jboss.osgi.spi.NotImplementedException;
-import org.osgi.service.blueprint.reflect.ComponentMetadata;
-
-/**
- * The blueprint element is the top element.
- *
- * 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>
- * type-converter ::= <bean> | <ref>
- *
- * @author thomas.diesler(a)jboss.com
- * @since 13-May-2009
- */
-public class BlueprintImpl
-{
- protected String description;
- protected TypeConverters typeConverters;
- protected List<ComponentMetadata> components;
- protected Boolean defaultLazyInit;
- protected String defaultInitMethod;
- protected String defaultDestroyMethod;
- protected BigInteger defaultTimeout;
- protected Availability 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 TypeConverters }
- *
- */
- public TypeConverters getTypeConverters()
- {
- return typeConverters;
- }
-
- /**
- * Sets the value of the typeConverters property.
- *
- * @param value allowed object is {@link TypeConverters }
- *
- */
- public void setTypeConverters(TypeConverters value)
- {
- this.typeConverters = value;
- }
-
- /**
- * Gets the value of components
- */
- public List<ComponentMetadata> getComponents()
- {
- if (components == null)
- components = new ArrayList<ComponentMetadata>();
-
- return this.components;
- }
-
- /**
- * Gets the value of the defaultLazyInit property.
- *
- * @return possible object is {@link Boolean }
- *
- */
- 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)
- defaultTimeout = new BigInteger("300000");
-
- 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 Availability getDefaultAvailability()
- {
- if (defaultAvailability == null)
- defaultAvailability = Availability.MANDATORY;
-
- return defaultAvailability;
- }
-
- /**
- * Sets the value of the defaultAvailability property.
- *
- * @param value allowed object is {@link Tavailability }
- *
- */
- public void setDefaultAvailability(Availability 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;
- }
-
- // Merge this Blueprint meta data with the given other, which may be null.
- public BlueprintImpl merge(BlueprintImpl other)
- {
- if (other == null)
- return this;
-
- throw new NotImplementedException("Blueprint metadata merge not yet implemented");
- }
-}
Copied: projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/jboss/osgi/blueprint/reflect/BlueprintMetadata.java (from rev 90297, projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/jboss/osgi/blueprint/reflect/BlueprintImpl.java)
===================================================================
--- projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/jboss/osgi/blueprint/reflect/BlueprintMetadata.java (rev 0)
+++ projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/jboss/osgi/blueprint/reflect/BlueprintMetadata.java 2009-06-17 10:37:51 UTC (rev 90313)
@@ -0,0 +1,329 @@
+/*
+ * 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.blueprint.reflect;
+
+// $Id$
+
+import java.math.BigInteger;
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.LinkedHashSet;
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
+
+import javax.xml.namespace.QName;
+
+import org.jboss.osgi.spi.NotImplementedException;
+import org.osgi.service.blueprint.context.NoSuchComponentException;
+import org.osgi.service.blueprint.reflect.BeanMetadata;
+import org.osgi.service.blueprint.reflect.ComponentMetadata;
+import org.osgi.service.blueprint.reflect.ServiceMetadata;
+import org.osgi.service.blueprint.reflect.ServiceReferenceMetadata;
+
+/**
+ * The blueprint element is the top element.
+ *
+ * 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>
+ * type-converter ::= <bean> | <ref>
+ *
+ * @author thomas.diesler(a)jboss.com
+ * @since 13-May-2009
+ */
+public class BlueprintMetadata
+{
+ protected String description;
+ protected TypeConverters typeConverters;
+ protected List<ComponentMetadata> components;
+ protected Boolean defaultLazyInit;
+ protected String defaultInitMethod;
+ protected String defaultDestroyMethod;
+ protected BigInteger defaultTimeout;
+ protected Availability defaultAvailability;
+ private Map<QName, String> otherAttributes = new HashMap<QName, String>();
+
+ public void initialize()
+ {
+ if (typeConverters != null)
+ typeConverters.resolveRefs(this);
+ }
+
+ /**
+ * 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 TypeConverters }
+ *
+ */
+ public TypeConverters getTypeConverters()
+ {
+ return typeConverters;
+ }
+
+ /**
+ * Sets the value of the typeConverters property.
+ *
+ * @param value allowed object is {@link TypeConverters }
+ *
+ */
+ public void setTypeConverters(TypeConverters value)
+ {
+ this.typeConverters = value;
+ }
+
+ /**
+ * Gets the value of components
+ */
+ public List<ComponentMetadata> getComponents()
+ {
+ if (components == null)
+ components = new ArrayList<ComponentMetadata>();
+
+ return this.components;
+ }
+
+ public Set<String> getComponentNames()
+ {
+ Set<String> compNames = new LinkedHashSet<String>();
+ for (ComponentMetadata comp : getComponents())
+ compNames.add(comp.getId());
+
+ return Collections.unmodifiableSet(compNames);
+ }
+
+ /**
+ * Get ComponentMetadata by name
+ * @throws NoSuchComponentException if not found
+ */
+ public ComponentMetadata getComponentMetadata(String name)
+ {
+ if (name == null)
+ throw new IllegalArgumentException("Cannot get component metadata for 'null' name");
+
+ ComponentMetadata compMetadata = null;
+ for (ComponentMetadata aux : getComponents())
+ {
+ if (name.equals(aux.getId()))
+ {
+ compMetadata = aux;
+ break;
+ }
+ }
+
+ if (compMetadata == null)
+ throw new NoSuchComponentException(name);
+
+ return compMetadata;
+ }
+
+ public Collection<BeanMetadata> getBeanComponentsMetadata()
+ {
+ List<BeanMetadata> beanMetadata = new ArrayList<BeanMetadata>();
+ for (ComponentMetadata comp : getComponents())
+ {
+ if (comp instanceof BeanMetadata)
+ beanMetadata.add((BeanMetadata)comp);
+ }
+ return Collections.unmodifiableList(beanMetadata);
+ }
+
+ public Collection<ServiceMetadata> getExportedServicesMetadata()
+ {
+ List<ServiceMetadata> servMetadata = new ArrayList<ServiceMetadata>();
+ for (ComponentMetadata comp : getComponents())
+ {
+ if (comp instanceof ServiceMetadata)
+ servMetadata.add((ServiceMetadata)comp);
+ }
+ return Collections.unmodifiableList(servMetadata);
+ }
+
+ public Collection<ServiceReferenceMetadata> getReferencedServicesMetadata()
+ {
+ List<ServiceReferenceMetadata> srefMetadata = new ArrayList<ServiceReferenceMetadata>();
+ for (ComponentMetadata comp : getComponents())
+ {
+ if (comp instanceof ServiceReferenceMetadata)
+ srefMetadata.add((ServiceReferenceMetadata)comp);
+ }
+ return Collections.unmodifiableList(srefMetadata);
+ }
+
+ /**
+ * Gets the value of the defaultLazyInit property.
+ *
+ * @return possible object is {@link Boolean }
+ *
+ */
+ 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)
+ defaultTimeout = new BigInteger("300000");
+
+ 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 Availability getDefaultAvailability()
+ {
+ if (defaultAvailability == null)
+ defaultAvailability = Availability.MANDATORY;
+
+ return defaultAvailability;
+ }
+
+ /**
+ * Sets the value of the defaultAvailability property.
+ *
+ * @param value allowed object is {@link Tavailability }
+ *
+ */
+ public void setDefaultAvailability(Availability 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;
+ }
+
+ // Merge this Blueprint meta data with the given other, which may be null.
+ public BlueprintMetadata merge(BlueprintMetadata other)
+ {
+ if (other == null)
+ return this;
+
+ throw new NotImplementedException("Blueprint metadata merge not yet implemented");
+ }
+}
Modified: projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/jboss/osgi/blueprint/reflect/TypeConverters.java
===================================================================
--- projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/jboss/osgi/blueprint/reflect/TypeConverters.java 2009-06-17 10:17:23 UTC (rev 90312)
+++ projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/jboss/osgi/blueprint/reflect/TypeConverters.java 2009-06-17 10:37:51 UTC (rev 90313)
@@ -56,19 +56,33 @@
*/
public class TypeConverters
{
- protected List<Object> beanOrReferenceOrRef;
+ protected List<Object> components;
- /**
- * Gets the value of the beanOrReferenceOrRef property.
- *
- */
- public List<Object> getBeanOrReferenceOrRef()
+ public List<Object> getComponents()
{
- if (beanOrReferenceOrRef == null)
+ if (components == null)
+ components = new ArrayList<Object>();
+
+ return components;
+ }
+
+ public void setComponents(List<Object> converters)
+ {
+ this.components = converters;
+ }
+
+ void resolveRefs(BlueprintMetadata bpMetadata)
+ {
+ for (int i = 0; i < getComponents().size(); i++)
{
- beanOrReferenceOrRef = new ArrayList<Object>();
+ Object comp = components.get(i);
+ if (comp instanceof RefImpl)
+ {
+ RefImpl ref = (RefImpl)comp;
+ String compName = ref.getComponent();
+ comp = bpMetadata.getComponentMetadata(compName);
+ components.set(i, comp);
+ }
}
- return this.beanOrReferenceOrRef;
}
-
}
Modified: projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/osgi/service/blueprint/reflect/ComponentMetadata.java
===================================================================
--- projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/osgi/service/blueprint/reflect/ComponentMetadata.java 2009-06-17 10:17:23 UTC (rev 90312)
+++ projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/osgi/service/blueprint/reflect/ComponentMetadata.java 2009-06-17 10:37:51 UTC (rev 90313)
@@ -15,7 +15,6 @@
*/
package org.osgi.service.blueprint.reflect;
-
/**
* Base class for all components.
*
@@ -23,14 +22,11 @@
* @see ServiceReferenceMetadata
* @see ServiceMetadata
*/
-public interface ComponentMetadata extends NonNullMetadata {
-
- /**
- * The id of the component.
- *
- * ### renamed to getId
- * @return component id. The component id can be <code>null</code> if this is an anonymously
- * defined inner component.
- */
- String getId();
+public interface ComponentMetadata extends NonNullMetadata
+{
+ /*
+ * The id of the component. ### renamed to getId
+ * @return component id. The component id can be <code>null</code> if this is an anonymously defined inner component.
+ */
+ String getId();
}
Modified: projects/jboss-osgi/trunk/blueprint/impl/src/main/resources/schema/blueprint-jbxb.xsd
===================================================================
--- projects/jboss-osgi/trunk/blueprint/impl/src/main/resources/schema/blueprint-jbxb.xsd 2009-06-17 10:17:23 UTC (rev 90312)
+++ projects/jboss-osgi/trunk/blueprint/impl/src/main/resources/schema/blueprint-jbxb.xsd 2009-06-17 10:37:51 UTC (rev 90313)
@@ -85,7 +85,7 @@
<xsd:complexType name="Tblueprint">
<xsd:annotation>
<xsd:appinfo>
- <jbxb:class impl="org.jboss.osgi.blueprint.reflect.BlueprintImpl"></jbxb:class>
+ <jbxb:class impl="org.jboss.osgi.blueprint.reflect.BlueprintMetadata"></jbxb:class>
</xsd:appinfo>
</xsd:annotation>
<xsd:sequence>
Modified: projects/jboss-osgi/trunk/blueprint/testsuite/src/test/java/org/jboss/test/osgi/blueprint/parser/AllElementsParserTestCase.java
===================================================================
--- projects/jboss-osgi/trunk/blueprint/testsuite/src/test/java/org/jboss/test/osgi/blueprint/parser/AllElementsParserTestCase.java 2009-06-17 10:17:23 UTC (rev 90312)
+++ projects/jboss-osgi/trunk/blueprint/testsuite/src/test/java/org/jboss/test/osgi/blueprint/parser/AllElementsParserTestCase.java 2009-06-17 10:37:51 UTC (rev 90313)
@@ -31,11 +31,13 @@
import org.jboss.osgi.blueprint.parser.BlueprintParser;
import org.jboss.osgi.blueprint.reflect.Availability;
-import org.jboss.osgi.blueprint.reflect.BlueprintImpl;
+import org.jboss.osgi.blueprint.reflect.BlueprintMetadata;
import org.jboss.osgi.blueprint.reflect.TypeConverters;
import org.jboss.osgi.spi.testing.OSGiTestHelper;
import org.junit.BeforeClass;
import org.junit.Test;
+import org.osgi.service.blueprint.reflect.BeanMetadata;
+import org.osgi.service.blueprint.reflect.ReferenceMetadata;
/**
* Blueprint parser tests
@@ -45,7 +47,7 @@
*/
public class AllElementsParserTestCase
{
- private static BlueprintImpl blueprint;
+ private static BlueprintMetadata blueprint;
@BeforeClass
public static void beforeClass()
@@ -86,7 +88,22 @@
TypeConverters typeConverters = blueprint.getTypeConverters();
assertNotNull("TypeConverters not null", typeConverters);
- List<Object> beanOrReferenceOrRef = typeConverters.getBeanOrReferenceOrRef();
- assertEquals("TypeConverters size", 5, beanOrReferenceOrRef);
+ List<Object> converters = typeConverters.getComponents();
+ assertEquals("TypeConverters size", 5, converters.size());
+
+ BeanMetadata conv1 = (BeanMetadata)converters.get(0);
+ assertNotNull("Converter not null", conv1);
+
+ ReferenceMetadata conv2 = (ReferenceMetadata)converters.get(1);
+ assertNotNull("Converter not null", conv2);
+
+ ReferenceMetadata conv3 = (ReferenceMetadata)converters.get(2);
+ assertNotNull("Converter not null", conv3);
+
+ BeanMetadata conv4 = (BeanMetadata)converters.get(3);
+ assertNotNull("Converter not null", conv4);
+
+ BeanMetadata conv5 = (BeanMetadata)converters.get(4);
+ assertNotNull("Converter not null", conv5);
}
}
\ No newline at end of file
Modified: projects/jboss-osgi/trunk/blueprint/testsuite/src/test/java/org/jboss/test/osgi/blueprint/parser/BasicBeansParserTestCase.java
===================================================================
--- projects/jboss-osgi/trunk/blueprint/testsuite/src/test/java/org/jboss/test/osgi/blueprint/parser/BasicBeansParserTestCase.java 2009-06-17 10:17:23 UTC (rev 90312)
+++ projects/jboss-osgi/trunk/blueprint/testsuite/src/test/java/org/jboss/test/osgi/blueprint/parser/BasicBeansParserTestCase.java 2009-06-17 10:37:51 UTC (rev 90313)
@@ -30,7 +30,7 @@
import java.util.List;
import org.jboss.osgi.blueprint.parser.BlueprintParser;
-import org.jboss.osgi.blueprint.reflect.BlueprintImpl;
+import org.jboss.osgi.blueprint.reflect.BlueprintMetadata;
import org.jboss.osgi.spi.testing.OSGiTest;
import org.jboss.test.osgi.blueprint.parser.comp.BeanA;
import org.jboss.test.osgi.blueprint.parser.comp.BeanB;
@@ -50,7 +50,7 @@
public void testBasicBeans() throws Exception
{
URL xmlURL = getResourceURL("parser/blueprint-basic-beans.xml");
- BlueprintImpl blueprint = new BlueprintParser().parse(xmlURL);
+ BlueprintMetadata blueprint = new BlueprintParser().parse(xmlURL);
List<ComponentMetadata> compList = blueprint.getComponents();
assertTrue(compList.size() > 0);
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-06-17 10:17:23 UTC (rev 90312)
+++ projects/jboss-osgi/trunk/blueprint/testsuite/src/test/java/org/jboss/test/osgi/blueprint/parser/BasicRootParserTestCase.java 2009-06-17 10:37:51 UTC (rev 90313)
@@ -31,7 +31,7 @@
import org.jboss.osgi.blueprint.parser.BlueprintParser;
import org.jboss.osgi.blueprint.reflect.Availability;
-import org.jboss.osgi.blueprint.reflect.BlueprintImpl;
+import org.jboss.osgi.blueprint.reflect.BlueprintMetadata;
import org.jboss.osgi.spi.testing.OSGiTest;
import org.junit.Test;
@@ -47,7 +47,7 @@
public void testBlueprintDefaultAttributes() throws Exception
{
URL xmlURL = getResourceURL("parser/blueprint-basic-root.xml");
- BlueprintImpl blueprint = new BlueprintParser().parse(xmlURL);
+ BlueprintMetadata blueprint = new BlueprintParser().parse(xmlURL);
// assert default attributes
assertEquals(Availability.MANDATORY, blueprint.getDefaultAvailability());
@@ -61,7 +61,7 @@
public void testBlueprintDescription() throws Exception
{
URL xmlURL = getResourceURL("parser/blueprint-basic-root.xml");
- BlueprintImpl blueprint = new BlueprintParser().parse(xmlURL);
+ BlueprintMetadata blueprint = new BlueprintParser().parse(xmlURL);
// assert description
assertEquals("some text", blueprint.getDescription());
Modified: projects/jboss-osgi/trunk/blueprint/testsuite/src/test/java/org/jboss/test/osgi/blueprint/parser/BasicServiceParserTestCase.java
===================================================================
--- projects/jboss-osgi/trunk/blueprint/testsuite/src/test/java/org/jboss/test/osgi/blueprint/parser/BasicServiceParserTestCase.java 2009-06-17 10:17:23 UTC (rev 90312)
+++ projects/jboss-osgi/trunk/blueprint/testsuite/src/test/java/org/jboss/test/osgi/blueprint/parser/BasicServiceParserTestCase.java 2009-06-17 10:37:51 UTC (rev 90313)
@@ -30,7 +30,7 @@
import java.util.List;
import org.jboss.osgi.blueprint.parser.BlueprintParser;
-import org.jboss.osgi.blueprint.reflect.BlueprintImpl;
+import org.jboss.osgi.blueprint.reflect.BlueprintMetadata;
import org.jboss.osgi.spi.testing.OSGiTest;
import org.jboss.test.osgi.blueprint.parser.comp.BeanA;
import org.jboss.test.osgi.blueprint.parser.comp.ServiceA;
@@ -52,7 +52,7 @@
public void testBasicBeans() throws Exception
{
URL xmlURL = getResourceURL("parser/blueprint-basic-service.xml");
- BlueprintImpl blueprint = new BlueprintParser().parse(xmlURL);
+ BlueprintMetadata blueprint = new BlueprintParser().parse(xmlURL);
List<ComponentMetadata> compList = blueprint.getComponents();
assertTrue(compList.size() > 0);
Modified: projects/jboss-osgi/trunk/blueprint/testsuite/src/test/resources/log4j.xml
===================================================================
--- projects/jboss-osgi/trunk/blueprint/testsuite/src/test/resources/log4j.xml 2009-06-17 10:17:23 UTC (rev 90312)
+++ projects/jboss-osgi/trunk/blueprint/testsuite/src/test/resources/log4j.xml 2009-06-17 10:37:51 UTC (rev 90313)
@@ -38,11 +38,11 @@
</category>
-->
- <!-- Show jboss deployer traces -->
+ <!-- Show jboss deployer traces
<category name="org.jboss.xb">
<priority value="TRACE" />
</category>
-
+ -->
<!-- ======================= -->
<!-- Setup the Root category -->
Modified: projects/jboss-osgi/trunk/blueprint/testsuite/src/test/resources/parser/blueprint-all-elements.xml
===================================================================
--- projects/jboss-osgi/trunk/blueprint/testsuite/src/test/resources/parser/blueprint-all-elements.xml 2009-06-17 10:17:23 UTC (rev 90312)
+++ projects/jboss-osgi/trunk/blueprint/testsuite/src/test/resources/parser/blueprint-all-elements.xml 2009-06-17 10:37:51 UTC (rev 90313)
@@ -12,27 +12,24 @@
<ref component="typeConverterRefA" />
<ref component="typeConverterRefB" />
</type-converters>
+
+ <bean id="typeConverterRefA" class="foo.TypeConverterRefA"/>
+ <bean id="typeConverterRefB" class="foo.TypeConverterRefB"/>
- <service id="idServiceA" auto-export="disabled" depends-on="someServiceDependency" interface="foo.ServiceInterface" ranking="0" ref="NCName">
-
+ <service id="idServiceA" auto-export="disabled" depends-on="someServiceDependency" interface="foo.ServiceInterface" ranking="0">
<description>service description</description>
-
<interfaces>
<value>foo.ServiceInterfA</value>
<value>foo.ServiceInterfB</value>
</interfaces>
-
<service-properties>
<entry key="keyA" value="valueA" />
<entry key="keyB" value="valueB" />
</service-properties>
-
<registration-listener registration-method="regMethod" unregistration-method="unregMethod">
<bean class="foo.RegistrationListenerBean" />
</registration-listener>
-
<registration-listener ref="regListenerRef" />
-
<bean class="foo.ServiceBean" />
</service>
Modified: projects/jboss-osgi/trunk/pom.xml
===================================================================
--- projects/jboss-osgi/trunk/pom.xml 2009-06-17 10:17:23 UTC (rev 90312)
+++ projects/jboss-osgi/trunk/pom.xml 2009-06-17 10:37:51 UTC (rev 90313)
@@ -45,7 +45,7 @@
<version.jboss.osgi.common>1.0.0.Beta2</version.jboss.osgi.common>
<version.jboss.osgi.common.core>2.2.11</version.jboss.osgi.common.core>
<version.jboss.osgi.deployers>1.0.0.Beta2</version.jboss.osgi.deployers>
- <version.jboss.osgi.hotdeploy>1.0.0.Beta2</version.jboss.osgi.hotdeploy>
+ <version.jboss.osgi.hotdeploy>1.0.0-SNAPSHOT</version.jboss.osgi.hotdeploy>
<version.jboss.osgi.integration.jbossas>1.0.0.Beta2</version.jboss.osgi.integration.jbossas>
<version.jboss.osgi.jaxb>2.1.10</version.jboss.osgi.jaxb>
<version.jboss.osgi.jmx>1.0.0.Beta2</version.jboss.osgi.jmx>
15 years
JBoss-OSGI SVN: r90312 - projects/jboss-osgi/trunk/docbook/en/modules.
by jboss-osgi-commits@lists.jboss.org
Author: thomas.diesler(a)jboss.com
Date: 2009-06-17 06:17:23 -0400 (Wed, 17 Jun 2009)
New Revision: 90312
Modified:
projects/jboss-osgi/trunk/docbook/en/modules/ch020-getting-started.xml
Log:
Clarify WebConsole availability
Modified: projects/jboss-osgi/trunk/docbook/en/modules/ch020-getting-started.xml
===================================================================
--- projects/jboss-osgi/trunk/docbook/en/modules/ch020-getting-started.xml 2009-06-17 10:08:31 UTC (rev 90311)
+++ projects/jboss-osgi/trunk/docbook/en/modules/ch020-getting-started.xml 2009-06-17 10:17:23 UTC (rev 90312)
@@ -196,7 +196,8 @@
<para>JBoss OSGi comes with a simple Web Console, which is currently based on the
<ulink url="http://felix.apache.org/site/apache-felix-web-console.html">Apache Felix Web Console</ulink> project.
- By default the JBoss OSGi Web Console is available at <ulink url="http://localhost:8090/jboss-osgi">http://localhost:8090/jboss-osgi</ulink>.
+ The JBoss OSGi Web Console is included in the runtime profiles 'web' or 'all'. After startup you can point your browser
+ to <ulink url="http://localhost:8090/jboss-osgi">http://localhost:8090/jboss-osgi</ulink>.
</para>
<mediaobject>
15 years
JBoss-OSGI SVN: r90309 - projects/jboss-osgi/projects/bundles/hotdeploy/trunk/src/main/java/org/jboss/osgi/service/hotdeploy/internal.
by jboss-osgi-commits@lists.jboss.org
Author: thomas.diesler(a)jboss.com
Date: 2009-06-17 06:06:41 -0400 (Wed, 17 Jun 2009)
New Revision: 90309
Modified:
projects/jboss-osgi/projects/bundles/hotdeploy/trunk/src/main/java/org/jboss/osgi/service/hotdeploy/internal/DeploymentScannerImpl.java
Log:
Prevent NPE in getBundles
Modified: projects/jboss-osgi/projects/bundles/hotdeploy/trunk/src/main/java/org/jboss/osgi/service/hotdeploy/internal/DeploymentScannerImpl.java
===================================================================
--- projects/jboss-osgi/projects/bundles/hotdeploy/trunk/src/main/java/org/jboss/osgi/service/hotdeploy/internal/DeploymentScannerImpl.java 2009-06-17 09:47:34 UTC (rev 90308)
+++ projects/jboss-osgi/projects/bundles/hotdeploy/trunk/src/main/java/org/jboss/osgi/service/hotdeploy/internal/DeploymentScannerImpl.java 2009-06-17 10:06:41 UTC (rev 90309)
@@ -229,19 +229,29 @@
public BundleInfo[] getBundles()
{
List<BundleInfo> bundles = new ArrayList<BundleInfo>();
- for (File file : scanLocation.listFiles())
+
+ File[] listFiles = scanLocation.listFiles();
+ if (listFiles == null)
+ log.log(LogService.LOG_WARNING, "Cannot list files in: " + scanLocation);
+
+ if (listFiles != null)
{
- BundleInfoImpl info = getBundleInfo(file);
-
- Bundle bundle = getInstalledBundle(info);
- if (bundle != null)
- info.initFromBundle(bundle);
-
- bundles.add(info);
+ for (File file : listFiles)
+ {
+ BundleInfoImpl info = getBundleInfo(file);
+
+ Bundle bundle = getInstalledBundle(info);
+ if (bundle != null)
+ info.initFromBundle(bundle);
+
+ bundles.add(info);
+ }
}
+
BundleInfo[] arr = new BundleInfoImpl[bundles.size()];
return bundles.toArray(arr);
}
+
private void initScanner(BundleContext context)
{
scanInterval = 2000;
15 years
JBoss-OSGI SVN: r90293 - in projects/jboss-osgi/trunk/blueprint: impl/src/main/resources/schema and 3 other directories.
by jboss-osgi-commits@lists.jboss.org
Author: thomas.diesler(a)jboss.com
Date: 2009-06-17 02:57:14 -0400 (Wed, 17 Jun 2009)
New Revision: 90293
Added:
projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/jboss/osgi/blueprint/reflect/RefImpl.java
projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/jboss/osgi/blueprint/reflect/ReferenceListenerImpl.java
projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/jboss/osgi/blueprint/reflect/TypeConverters.java
Removed:
projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/jboss/osgi/blueprint/reflect/TReferenceListener.java
projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/jboss/osgi/blueprint/reflect/Tref.java
projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/jboss/osgi/blueprint/reflect/TtypeConverters.java
Modified:
projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/jboss/osgi/blueprint/reflect/BlueprintImpl.java
projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/jboss/osgi/blueprint/reflect/ComparatorImpl.java
projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/jboss/osgi/blueprint/reflect/RegistrationListenerImpl.java
projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/jboss/osgi/blueprint/reflect/ServiceMetadataImpl.java
projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/jboss/osgi/blueprint/reflect/ServiceReferenceMetadataImpl.java
projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/jboss/osgi/blueprint/reflect/Targument.java
projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/jboss/osgi/blueprint/reflect/Tcollection.java
projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/jboss/osgi/blueprint/reflect/Tkey.java
projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/jboss/osgi/blueprint/reflect/TmapEntry.java
projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/jboss/osgi/blueprint/reflect/Tproperty.java
projects/jboss-osgi/trunk/blueprint/impl/src/main/resources/schema/blueprint-jbxb.xsd
projects/jboss-osgi/trunk/blueprint/testsuite/src/test/java/org/jboss/test/osgi/blueprint/parser/AllElementsParserTestCase.java
projects/jboss-osgi/trunk/blueprint/testsuite/src/test/resources/log4j.xml
projects/jboss-osgi/trunk/blueprint/testsuite/src/test/resources/parser/blueprint-all-elements.xml
Log:
BP parsing - WIP
Modified: projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/jboss/osgi/blueprint/reflect/BlueprintImpl.java
===================================================================
--- projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/jboss/osgi/blueprint/reflect/BlueprintImpl.java 2009-06-17 06:28:57 UTC (rev 90292)
+++ projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/jboss/osgi/blueprint/reflect/BlueprintImpl.java 2009-06-17 06:57:14 UTC (rev 90293)
@@ -35,13 +35,15 @@
import org.osgi.service.blueprint.reflect.ComponentMetadata;
/**
- * The blueprint element is the top element. The definitions consist of two sections:
+ * The blueprint element is the top element.
+ *
+ * The definitions consist of two sections:
* the type-converter section and the components section.
*
- * blueprint ::= <type-converters> component *
- * component ::= <bean> | <service> | service-reference
+ * blueprint ::= <type-converters> component
+ * component ::= <bean> | <service> | service-reference
* service-reference ::= <reference> | <ref-list> | <ref-set>
- * type-converter ::= <bean> | <ref> *
+ * type-converter ::= <bean> | <ref>
*
* @author thomas.diesler(a)jboss.com
* @since 13-May-2009
@@ -49,7 +51,7 @@
public class BlueprintImpl
{
protected String description;
- protected TtypeConverters typeConverters;
+ protected TypeConverters typeConverters;
protected List<ComponentMetadata> components;
protected Boolean defaultLazyInit;
protected String defaultInitMethod;
@@ -79,10 +81,10 @@
/**
* Gets the value of the typeConverters property.
*
- * @return possible object is {@link TtypeConverters }
+ * @return possible object is {@link TypeConverters }
*
*/
- public TtypeConverters getTypeConverters()
+ public TypeConverters getTypeConverters()
{
return typeConverters;
}
@@ -90,10 +92,10 @@
/**
* Sets the value of the typeConverters property.
*
- * @param value allowed object is {@link TtypeConverters }
+ * @param value allowed object is {@link TypeConverters }
*
*/
- public void setTypeConverters(TtypeConverters value)
+ public void setTypeConverters(TypeConverters value)
{
this.typeConverters = value;
}
@@ -105,7 +107,7 @@
{
if (components == null)
components = new ArrayList<ComponentMetadata>();
-
+
return this.components;
}
@@ -181,13 +183,9 @@
public BigInteger getDefaultTimeout()
{
if (defaultTimeout == null)
- {
- return new BigInteger("300000");
- }
- else
- {
- return defaultTimeout;
- }
+ defaultTimeout = new BigInteger("300000");
+
+ return defaultTimeout;
}
/**
@@ -207,13 +205,9 @@
public Availability getDefaultAvailability()
{
if (defaultAvailability == null)
- {
- return Availability.MANDATORY;
- }
- else
- {
- return defaultAvailability;
- }
+ defaultAvailability = Availability.MANDATORY;
+
+ return defaultAvailability;
}
/**
@@ -248,7 +242,7 @@
{
if (other == null)
return this;
-
+
throw new NotImplementedException("Blueprint metadata merge not yet implemented");
}
}
Modified: projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/jboss/osgi/blueprint/reflect/ComparatorImpl.java
===================================================================
--- projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/jboss/osgi/blueprint/reflect/ComparatorImpl.java 2009-06-17 06:28:57 UTC (rev 90292)
+++ projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/jboss/osgi/blueprint/reflect/ComparatorImpl.java 2009-06-17 06:57:14 UTC (rev 90293)
@@ -26,6 +26,8 @@
import java.util.ArrayList;
import java.util.List;
+import org.osgi.service.blueprint.reflect.ComponentMetadata;
+
/**
* <p>
* Java class for Tcomparator complex type.
@@ -47,78 +49,20 @@
*/
public class ComparatorImpl
{
- protected BeanMetadataImpl bean;
- protected ReferenceMetadataImpl reference;
- protected Tref refFIXME;
+ protected List<ComponentMetadata> components;
protected List<Object> any;
- /**
- * Gets the value of the bean property.
- *
- * @return possible object is {@link BeanMetadataImpl }
- *
- */
- public BeanMetadataImpl getBean()
+ public List<ComponentMetadata> getComponents()
{
- return bean;
+ return components;
}
- /**
- * Sets the value of the bean property.
- *
- * @param value allowed object is {@link BeanMetadataImpl }
- *
- */
- public void setBean(BeanMetadataImpl value)
+ public void setComponents(List<ComponentMetadata> components)
{
- this.bean = value;
+ this.components = components;
}
/**
- * Gets the value of the reference property.
- *
- * @return possible object is {@link ReferenceMetadataImpl }
- *
- */
- public ReferenceMetadataImpl getReference()
- {
- return reference;
- }
-
- /**
- * Sets the value of the reference property.
- *
- * @param value allowed object is {@link ReferenceMetadataImpl }
- *
- */
- public void setReference(ReferenceMetadataImpl value)
- {
- this.reference = value;
- }
-
- /**
- * Gets the value of the refFIXME property.
- *
- * @return possible object is {@link Tref }
- *
- */
- public Tref getRefFIXME()
- {
- return refFIXME;
- }
-
- /**
- * Sets the value of the refFIXME property.
- *
- * @param value allowed object is {@link Tref }
- *
- */
- public void setRefFIXME(Tref value)
- {
- this.refFIXME = value;
- }
-
- /**
* Gets the value of the any property.
*
* <p>
Copied: projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/jboss/osgi/blueprint/reflect/RefImpl.java (from rev 90249, projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/jboss/osgi/blueprint/reflect/Tref.java)
===================================================================
--- projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/jboss/osgi/blueprint/reflect/RefImpl.java (rev 0)
+++ projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/jboss/osgi/blueprint/reflect/RefImpl.java 2009-06-17 06:57:14 UTC (rev 90293)
@@ -0,0 +1,77 @@
+/*
+ * 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.blueprint.reflect;
+
+//$Id$
+
+/**
+ *
+ *
+ * Tref is the type used for <ref> elements. This specifies a required component id for the reference component.
+ *
+ *
+ *
+ * <p>
+ * Java class for Tref complex type.
+ *
+ * <p>
+ * The following schema fragment specifies the expected content contained within this class.
+ *
+ * <pre>
+ * <complexType name="Tref">
+ * <complexContent>
+ * <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ * <attribute name="component" use="required" type="{http://www.osgi.org/xmlns/blueprint/v1.0.0}Tidref" />
+ * </restriction>
+ * </complexContent>
+ * </complexType>
+ * </pre>
+ *
+ *
+ */
+public class RefImpl
+{
+ protected String component;
+
+ /**
+ * Gets the value of the component property.
+ *
+ * @return possible object is {@link String }
+ *
+ */
+ public String getComponent()
+ {
+ return component;
+ }
+
+ /**
+ * Sets the value of the component property.
+ *
+ * @param value allowed object is {@link String }
+ *
+ */
+ public void setComponent(String value)
+ {
+ this.component = value;
+ }
+
+}
Copied: projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/jboss/osgi/blueprint/reflect/ReferenceListenerImpl.java (from rev 90249, projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/jboss/osgi/blueprint/reflect/TReferenceListener.java)
===================================================================
--- projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/jboss/osgi/blueprint/reflect/ReferenceListenerImpl.java (rev 0)
+++ projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/jboss/osgi/blueprint/reflect/ReferenceListenerImpl.java 2009-06-17 06:57:14 UTC (rev 90293)
@@ -0,0 +1,229 @@
+/*
+ * 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.blueprint.reflect;
+
+//$Id$
+
+import java.util.ArrayList;
+import java.util.List;
+
+/**
+ *
+ *
+ * TReferenceListener defines a reference listener that is attached to a <reference>, <ref-set>, or <ref-list> element. The listener object can be specified as a <ref>
+ * or as an inline <bean> or <reference> component. Listener events are mapped to the indicated bind or unbind methods.
+ *
+ *
+ *
+ * <p>
+ * Java class for TReferenceListener complex type.
+ *
+ * <p>
+ * The following schema fragment specifies the expected content contained within this class.
+ *
+ * <pre>
+ * <complexType name="TReferenceListener">
+ * <complexContent>
+ * <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ * <group ref="{http://www.osgi.org/xmlns/blueprint/v1.0.0}targetComponent&quo...
+ * <attribute name="ref" type="{http://www.w3.org/2001/XMLSchema}token" />
+ * <attribute name="bind-method" use="required" type="{http://www.osgi.org/xmlns/blueprint/v1.0.0}Tmethod" />
+ * <attribute name="unbind-method" use="required" type="{http://www.osgi.org/xmlns/blueprint/v1.0.0}Tmethod" />
+ * </restriction>
+ * </complexContent>
+ * </complexType>
+ * </pre>
+ *
+ *
+ */
+public class ReferenceListenerImpl
+{
+ protected BeanMetadataImpl bean;
+ protected ReferenceMetadataImpl reference;
+ protected RefImpl refFIXME;
+ protected List<Object> any;
+ protected String ref;
+ protected String bindMethod;
+ protected String unbindMethod;
+
+ /**
+ * Gets the value of the bean property.
+ *
+ * @return possible object is {@link BeanMetadataImpl }
+ *
+ */
+ public BeanMetadataImpl getBean()
+ {
+ return bean;
+ }
+
+ /**
+ * Sets the value of the bean property.
+ *
+ * @param value allowed object is {@link BeanMetadataImpl }
+ *
+ */
+ public void setBean(BeanMetadataImpl value)
+ {
+ this.bean = value;
+ }
+
+ /**
+ * Gets the value of the reference property.
+ *
+ * @return possible object is {@link ReferenceMetadataImpl }
+ *
+ */
+ public ReferenceMetadataImpl getReference()
+ {
+ return reference;
+ }
+
+ /**
+ * Sets the value of the reference property.
+ *
+ * @param value allowed object is {@link ReferenceMetadataImpl }
+ *
+ */
+ public void setReference(ReferenceMetadataImpl value)
+ {
+ this.reference = value;
+ }
+
+ /**
+ * Gets the value of the refFIXME property.
+ *
+ * @return possible object is {@link RefImpl }
+ *
+ */
+ public RefImpl getRefFIXME()
+ {
+ return refFIXME;
+ }
+
+ /**
+ * Sets the value of the refFIXME property.
+ *
+ * @param value allowed object is {@link RefImpl }
+ *
+ */
+ public void setRefFIXME(RefImpl value)
+ {
+ this.refFIXME = value;
+ }
+
+ /**
+ * Gets the value of the any 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 any property.
+ *
+ * <p>
+ * For example, to add a new item, do as follows:
+ *
+ * <pre>
+ * getAny().add(newItem);
+ * </pre>
+ *
+ *
+ * <p>
+ * Objects of the following type(s) are allowed in the list {@link Object }
+ *
+ *
+ */
+ public List<Object> getAny()
+ {
+ if (any == null)
+ {
+ any = new ArrayList<Object>();
+ }
+ 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 bindMethod property.
+ *
+ * @return possible object is {@link String }
+ *
+ */
+ public String getBindMethod()
+ {
+ return bindMethod;
+ }
+
+ /**
+ * Sets the value of the bindMethod property.
+ *
+ * @param value allowed object is {@link String }
+ *
+ */
+ public void setBindMethod(String value)
+ {
+ this.bindMethod = value;
+ }
+
+ /**
+ * Gets the value of the unbindMethod property.
+ *
+ * @return possible object is {@link String }
+ *
+ */
+ public String getUnbindMethod()
+ {
+ return unbindMethod;
+ }
+
+ /**
+ * Sets the value of the unbindMethod property.
+ *
+ * @param value allowed object is {@link String }
+ *
+ */
+ public void setUnbindMethod(String value)
+ {
+ this.unbindMethod = value;
+ }
+
+}
Modified: projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/jboss/osgi/blueprint/reflect/RegistrationListenerImpl.java
===================================================================
--- projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/jboss/osgi/blueprint/reflect/RegistrationListenerImpl.java 2009-06-17 06:28:57 UTC (rev 90292)
+++ projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/jboss/osgi/blueprint/reflect/RegistrationListenerImpl.java 2009-06-17 06:57:14 UTC (rev 90293)
@@ -65,7 +65,7 @@
{
protected BeanMetadataImpl bean;
protected ReferenceMetadataImpl reference;
- protected Tref refFIXME;
+ protected RefImpl refFIXME;
protected List<Object> any;
protected String ref;
protected String registrationMethod;
@@ -118,10 +118,10 @@
/**
* Gets the value of the refFIXME property.
*
- * @return possible object is {@link Tref }
+ * @return possible object is {@link RefImpl }
*
*/
- public Tref getRefFIXME()
+ public RefImpl getRefFIXME()
{
return refFIXME;
}
@@ -129,10 +129,10 @@
/**
* Sets the value of the refFIXME property.
*
- * @param value allowed object is {@link Tref }
+ * @param value allowed object is {@link RefImpl }
*
*/
- public void setRefFIXME(Tref value)
+ public void setRefFIXME(RefImpl value)
{
this.refFIXME = value;
}
Modified: projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/jboss/osgi/blueprint/reflect/ServiceMetadataImpl.java
===================================================================
--- projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/jboss/osgi/blueprint/reflect/ServiceMetadataImpl.java 2009-06-17 06:28:57 UTC (rev 90292)
+++ projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/jboss/osgi/blueprint/reflect/ServiceMetadataImpl.java 2009-06-17 06:57:14 UTC (rev 90293)
@@ -50,7 +50,7 @@
protected List<ServicePropertyEntry> serviceProperties;
protected Collection<RegistrationListener> registrationListener;
protected BeanMetadataImpl bean;
- protected Tref refFIXME;
+ protected RefImpl refFIXME;
protected List<Object> any;
protected String ref;
protected String dependsOn;
@@ -148,10 +148,10 @@
/**
* Gets the value of the refFIXME property.
*
- * @return possible object is {@link Tref }
+ * @return possible object is {@link RefImpl }
*
*/
- public Tref getRefFIXME()
+ public RefImpl getRefFIXME()
{
return refFIXME;
}
@@ -159,10 +159,10 @@
/**
* Sets the value of the refFIXME property.
*
- * @param value allowed object is {@link Tref }
+ * @param value allowed object is {@link RefImpl }
*
*/
- public void setRefFIXME(Tref value)
+ public void setRefFIXME(RefImpl value)
{
this.refFIXME = value;
}
Modified: projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/jboss/osgi/blueprint/reflect/ServiceReferenceMetadataImpl.java
===================================================================
--- projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/jboss/osgi/blueprint/reflect/ServiceReferenceMetadataImpl.java 2009-06-17 06:28:57 UTC (rev 90292)
+++ projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/jboss/osgi/blueprint/reflect/ServiceReferenceMetadataImpl.java 2009-06-17 06:57:14 UTC (rev 90293)
@@ -72,7 +72,7 @@
{
protected String description;
protected List<String> interfaces;
- protected List<TReferenceListener> listener;
+ protected List<ReferenceListenerImpl> listener;
protected List<Object> any;
protected String filter;
protected String componentName;
@@ -129,19 +129,23 @@
*
*
* <p>
- * Objects of the following type(s) are allowed in the list {@link TReferenceListener }
+ * Objects of the following type(s) are allowed in the list {@link ReferenceListenerImpl }
*
*
*/
- public List<TReferenceListener> getListener()
+ public List<ReferenceListenerImpl> getListener()
{
if (listener == null)
- {
- listener = new ArrayList<TReferenceListener>();
- }
+ listener = new ArrayList<ReferenceListenerImpl>();
+
return this.listener;
}
+ public void setListener(List<ReferenceListenerImpl> listener)
+ {
+ this.listener = listener;
+ }
+
/**
* Gets the value of the any property.
*
Deleted: projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/jboss/osgi/blueprint/reflect/TReferenceListener.java
===================================================================
--- projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/jboss/osgi/blueprint/reflect/TReferenceListener.java 2009-06-17 06:28:57 UTC (rev 90292)
+++ projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/jboss/osgi/blueprint/reflect/TReferenceListener.java 2009-06-17 06:57:14 UTC (rev 90293)
@@ -1,228 +0,0 @@
-//
-// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vhudson-jaxb-ri-2.1-793
-// 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.05.13 at 02:16:52 PM CEST
-//
-
-
-package org.jboss.osgi.blueprint.reflect;
-
-import java.util.ArrayList;
-import java.util.List;
-
-
-/**
- *
- *
- * TReferenceListener defines a reference listener that is attached
- * to a <reference>, <ref-set>, or <ref-list> element. The listener
- * object can be specified as a <ref> or as an inline <bean> or
- * <reference> component. Listener events are mapped to the indicated
- * bind or unbind methods.
- *
- *
- *
- * <p>Java class for TReferenceListener complex type.
- *
- * <p>The following schema fragment specifies the expected content contained within this class.
- *
- * <pre>
- * <complexType name="TReferenceListener">
- * <complexContent>
- * <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
- * <group ref="{http://www.osgi.org/xmlns/blueprint/v1.0.0}targetComponent"/>
- * <attribute name="ref" type="{http://www.w3.org/2001/XMLSchema}token" />
- * <attribute name="bind-method" use="required" type="{http://www.osgi.org/xmlns/blueprint/v1.0.0}Tmethod" />
- * <attribute name="unbind-method" use="required" type="{http://www.osgi.org/xmlns/blueprint/v1.0.0}Tmethod" />
- * </restriction>
- * </complexContent>
- * </complexType>
- * </pre>
- *
- *
- */
-public class TReferenceListener {
-
- protected BeanMetadataImpl bean;
- protected ReferenceMetadataImpl reference;
- protected Tref refFIXME;
- protected List<Object> any;
- protected String ref;
- protected String bindMethod;
- protected String unbindMethod;
-
- /**
- * Gets the value of the bean property.
- *
- * @return
- * possible object is
- * {@link BeanMetadataImpl }
- *
- */
- public BeanMetadataImpl getBean() {
- return bean;
- }
-
- /**
- * Sets the value of the bean property.
- *
- * @param value
- * allowed object is
- * {@link BeanMetadataImpl }
- *
- */
- public void setBean(BeanMetadataImpl value) {
- this.bean = value;
- }
-
- /**
- * Gets the value of the reference property.
- *
- * @return
- * possible object is
- * {@link ReferenceMetadataImpl }
- *
- */
- public ReferenceMetadataImpl getReference() {
- return reference;
- }
-
- /**
- * Sets the value of the reference property.
- *
- * @param value
- * allowed object is
- * {@link ReferenceMetadataImpl }
- *
- */
- public void setReference(ReferenceMetadataImpl value) {
- this.reference = value;
- }
-
- /**
- * Gets the value of the refFIXME property.
- *
- * @return
- * possible object is
- * {@link Tref }
- *
- */
- public Tref getRefFIXME() {
- return refFIXME;
- }
-
- /**
- * Sets the value of the refFIXME property.
- *
- * @param value
- * allowed object is
- * {@link Tref }
- *
- */
- public void setRefFIXME(Tref value) {
- this.refFIXME = value;
- }
-
- /**
- * Gets the value of the any 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 any property.
- *
- * <p>
- * For example, to add a new item, do as follows:
- * <pre>
- * getAny().add(newItem);
- * </pre>
- *
- *
- * <p>
- * Objects of the following type(s) are allowed in the list
- * {@link Object }
- *
- *
- */
- public List<Object> getAny() {
- if (any == null) {
- any = new ArrayList<Object>();
- }
- 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 bindMethod property.
- *
- * @return
- * possible object is
- * {@link String }
- *
- */
- public String getBindMethod() {
- return bindMethod;
- }
-
- /**
- * Sets the value of the bindMethod property.
- *
- * @param value
- * allowed object is
- * {@link String }
- *
- */
- public void setBindMethod(String value) {
- this.bindMethod = value;
- }
-
- /**
- * Gets the value of the unbindMethod property.
- *
- * @return
- * possible object is
- * {@link String }
- *
- */
- public String getUnbindMethod() {
- return unbindMethod;
- }
-
- /**
- * Sets the value of the unbindMethod property.
- *
- * @param value
- * allowed object is
- * {@link String }
- *
- */
- public void setUnbindMethod(String value) {
- this.unbindMethod = value;
- }
-
-}
Modified: projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/jboss/osgi/blueprint/reflect/Targument.java
===================================================================
--- projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/jboss/osgi/blueprint/reflect/Targument.java 2009-06-17 06:28:57 UTC (rev 90292)
+++ projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/jboss/osgi/blueprint/reflect/Targument.java 2009-06-17 06:57:14 UTC (rev 90293)
@@ -64,9 +64,9 @@
protected RefCollectionImpl refSet;
protected BeanMetadataImpl bean;
protected ReferenceMetadataImpl reference;
- protected Tref refFIXME;
+ protected RefImpl refFIXME;
protected List<Object> any;
- protected Tref idref;
+ protected RefImpl idref;
protected Tvalue value;
protected Tcollection list;
protected Tcollection set;
@@ -228,10 +228,10 @@
*
* @return
* possible object is
- * {@link Tref }
+ * {@link RefImpl }
*
*/
- public Tref getRefFIXME() {
+ public RefImpl getRefFIXME() {
return refFIXME;
}
@@ -240,10 +240,10 @@
*
* @param value
* allowed object is
- * {@link Tref }
+ * {@link RefImpl }
*
*/
- public void setRefFIXME(Tref value) {
+ public void setRefFIXME(RefImpl value) {
this.refFIXME = value;
}
@@ -281,10 +281,10 @@
*
* @return
* possible object is
- * {@link Tref }
+ * {@link RefImpl }
*
*/
- public Tref getIdref() {
+ public RefImpl getIdref() {
return idref;
}
@@ -293,10 +293,10 @@
*
* @param value
* allowed object is
- * {@link Tref }
+ * {@link RefImpl }
*
*/
- public void setIdref(Tref value) {
+ public void setIdref(RefImpl value) {
this.idref = value;
}
Modified: projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/jboss/osgi/blueprint/reflect/Tcollection.java
===================================================================
--- projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/jboss/osgi/blueprint/reflect/Tcollection.java 2009-06-17 06:28:57 UTC (rev 90292)
+++ projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/jboss/osgi/blueprint/reflect/Tcollection.java 2009-06-17 06:57:14 UTC (rev 90293)
@@ -61,9 +61,9 @@
* Objects of the following type(s) are allowed in the list
* {@link JAXBElement }{@code <}{@link Tvalue }{@code >}
* {@link JAXBElement }{@code <}{@link ServiceMetadataImpl }{@code >}
- * {@link JAXBElement }{@code <}{@link Tref }{@code >}
+ * {@link JAXBElement }{@code <}{@link RefImpl }{@code >}
* {@link JAXBElement }{@code <}{@link ReferenceMetadataImpl }{@code >}
- * {@link JAXBElement }{@code <}{@link Tref }{@code >}
+ * {@link JAXBElement }{@code <}{@link RefImpl }{@code >}
* {@link JAXBElement }{@code <}{@link Tmap }{@code >}
* {@link JAXBElement }{@code <}{@link BeanMetadataImpl }{@code >}
* {@link JAXBElement }{@code <}{@link Tnull }{@code >}
Modified: projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/jboss/osgi/blueprint/reflect/Tkey.java
===================================================================
--- projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/jboss/osgi/blueprint/reflect/Tkey.java 2009-06-17 06:28:57 UTC (rev 90292)
+++ projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/jboss/osgi/blueprint/reflect/Tkey.java 2009-06-17 06:57:14 UTC (rev 90293)
@@ -44,9 +44,9 @@
protected RefCollectionImpl refSet;
protected BeanMetadataImpl bean;
protected ReferenceMetadataImpl reference;
- protected Tref refFIXME;
+ protected RefImpl refFIXME;
protected List<Object> any;
- protected Tref idref;
+ protected RefImpl idref;
protected Tvalue value;
protected Tcollection list;
protected Tcollection set;
@@ -179,10 +179,10 @@
*
* @return
* possible object is
- * {@link Tref }
+ * {@link RefImpl }
*
*/
- public Tref getRefFIXME() {
+ public RefImpl getRefFIXME() {
return refFIXME;
}
@@ -191,10 +191,10 @@
*
* @param value
* allowed object is
- * {@link Tref }
+ * {@link RefImpl }
*
*/
- public void setRefFIXME(Tref value) {
+ public void setRefFIXME(RefImpl value) {
this.refFIXME = value;
}
@@ -232,10 +232,10 @@
*
* @return
* possible object is
- * {@link Tref }
+ * {@link RefImpl }
*
*/
- public Tref getIdref() {
+ public RefImpl getIdref() {
return idref;
}
@@ -244,10 +244,10 @@
*
* @param value
* allowed object is
- * {@link Tref }
+ * {@link RefImpl }
*
*/
- public void setIdref(Tref value) {
+ public void setIdref(RefImpl value) {
this.idref = value;
}
Modified: projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/jboss/osgi/blueprint/reflect/TmapEntry.java
===================================================================
--- projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/jboss/osgi/blueprint/reflect/TmapEntry.java 2009-06-17 06:28:57 UTC (rev 90292)
+++ projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/jboss/osgi/blueprint/reflect/TmapEntry.java 2009-06-17 06:57:14 UTC (rev 90293)
@@ -55,9 +55,9 @@
protected RefCollectionImpl refSet;
protected BeanMetadataImpl bean;
protected ReferenceMetadataImpl reference;
- protected Tref refFIXME;
+ protected RefImpl refFIXME;
protected List<Object> any;
- protected Tref idref;
+ protected RefImpl idref;
protected Tvalue value;
protected Tcollection list;
protected Tcollection set;
@@ -219,10 +219,10 @@
*
* @return
* possible object is
- * {@link Tref }
+ * {@link RefImpl }
*
*/
- public Tref getRefFIXME() {
+ public RefImpl getRefFIXME() {
return refFIXME;
}
@@ -231,10 +231,10 @@
*
* @param value
* allowed object is
- * {@link Tref }
+ * {@link RefImpl }
*
*/
- public void setRefFIXME(Tref value) {
+ public void setRefFIXME(RefImpl value) {
this.refFIXME = value;
}
@@ -272,10 +272,10 @@
*
* @return
* possible object is
- * {@link Tref }
+ * {@link RefImpl }
*
*/
- public Tref getIdref() {
+ public RefImpl getIdref() {
return idref;
}
@@ -284,10 +284,10 @@
*
* @param value
* allowed object is
- * {@link Tref }
+ * {@link RefImpl }
*
*/
- public void setIdref(Tref value) {
+ public void setIdref(RefImpl value) {
this.idref = value;
}
Modified: projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/jboss/osgi/blueprint/reflect/Tproperty.java
===================================================================
--- projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/jboss/osgi/blueprint/reflect/Tproperty.java 2009-06-17 06:28:57 UTC (rev 90292)
+++ projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/jboss/osgi/blueprint/reflect/Tproperty.java 2009-06-17 06:57:14 UTC (rev 90293)
@@ -56,9 +56,9 @@
protected RefCollectionImpl refSet;
protected BeanMetadataImpl bean;
protected ReferenceMetadataImpl reference;
- protected Tref refFIXME;
+ protected RefImpl refFIXME;
protected List<Object> any;
- protected Tref idref;
+ protected RefImpl idref;
protected Tvalue value;
protected Tcollection list;
protected Tcollection set;
@@ -219,10 +219,10 @@
*
* @return
* possible object is
- * {@link Tref }
+ * {@link RefImpl }
*
*/
- public Tref getRefFIXME() {
+ public RefImpl getRefFIXME() {
return refFIXME;
}
@@ -231,10 +231,10 @@
*
* @param value
* allowed object is
- * {@link Tref }
+ * {@link RefImpl }
*
*/
- public void setRefFIXME(Tref value) {
+ public void setRefFIXME(RefImpl value) {
this.refFIXME = value;
}
@@ -272,10 +272,10 @@
*
* @return
* possible object is
- * {@link Tref }
+ * {@link RefImpl }
*
*/
- public Tref getIdref() {
+ public RefImpl getIdref() {
return idref;
}
@@ -284,10 +284,10 @@
*
* @param value
* allowed object is
- * {@link Tref }
+ * {@link RefImpl }
*
*/
- public void setIdref(Tref value) {
+ public void setIdref(RefImpl value) {
this.idref = value;
}
Deleted: projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/jboss/osgi/blueprint/reflect/Tref.java
===================================================================
--- projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/jboss/osgi/blueprint/reflect/Tref.java 2009-06-17 06:28:57 UTC (rev 90292)
+++ projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/jboss/osgi/blueprint/reflect/Tref.java 2009-06-17 06:57:14 UTC (rev 90293)
@@ -1,63 +0,0 @@
-//
-// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vhudson-jaxb-ri-2.1-793
-// 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.05.13 at 02:16:52 PM CEST
-//
-
-
-package org.jboss.osgi.blueprint.reflect;
-
-/**
- *
- *
- * Tref is the type used for <ref> elements. This specifies a required
- * component id for the reference component.
- *
- *
- *
- * <p>Java class for Tref complex type.
- *
- * <p>The following schema fragment specifies the expected content contained within this class.
- *
- * <pre>
- * <complexType name="Tref">
- * <complexContent>
- * <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
- * <attribute name="component" use="required" type="{http://www.osgi.org/xmlns/blueprint/v1.0.0}Tidref" />
- * </restriction>
- * </complexContent>
- * </complexType>
- * </pre>
- *
- *
- */
-public class Tref {
-
- protected String component;
-
- /**
- * Gets the value of the component property.
- *
- * @return
- * possible object is
- * {@link String }
- *
- */
- public String getComponent() {
- return component;
- }
-
- /**
- * Sets the value of the component property.
- *
- * @param value
- * allowed object is
- * {@link String }
- *
- */
- public void setComponent(String value) {
- this.component = value;
- }
-
-}
Deleted: projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/jboss/osgi/blueprint/reflect/TtypeConverters.java
===================================================================
--- projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/jboss/osgi/blueprint/reflect/TtypeConverters.java 2009-06-17 06:28:57 UTC (rev 90292)
+++ projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/jboss/osgi/blueprint/reflect/TtypeConverters.java 2009-06-17 06:57:14 UTC (rev 90293)
@@ -1,79 +0,0 @@
-//
-// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vhudson-jaxb-ri-2.1-793
-// 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.05.13 at 02:16:52 PM CEST
-//
-
-
-package org.jboss.osgi.blueprint.reflect;
-
-import java.util.ArrayList;
-import java.util.List;
-
-
-/**
- *
- *
- * The type used for the <type-converters> element. The
- * <type-converters> section is a set of <bean>, <ref>, or
- * <reference> elements that identify the type convert components
- * that will ference components.
- *
- *
- *
- * <p>Java class for Ttype-converters complex type.
- *
- * <p>The following schema fragment specifies the expected content contained within this class.
- *
- * <pre>
- * <complexType name="Ttype-converters">
- * <complexContent>
- * <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
- * <choice maxOccurs="unbounded" minOccurs="0">
- * <group ref="{http://www.osgi.org/xmlns/blueprint/v1.0.0}targetComponent"/>
- * </choice>
- * </restriction>
- * </complexContent>
- * </complexType>
- * </pre>
- *
- *
- */
-public class TtypeConverters {
-
- protected List<Object> beanOrReferenceOrRefFIXME;
-
- /**
- * Gets the value of the beanOrReferenceOrRefFIXME 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 beanOrReferenceOrRefFIXME property.
- *
- * <p>
- * For example, to add a new item, do as follows:
- * <pre>
- * getBeanOrReferenceOrRefFIXME().add(newItem);
- * </pre>
- *
- *
- * <p>
- * Objects of the following type(s) are allowed in the list
- * {@link JAXBElement }{@code <}{@link BeanMetadataImpl }{@code >}
- * {@link JAXBElement }{@code <}{@link ReferenceMetadataImpl }{@code >}
- * {@link Object }
- * {@link JAXBElement }{@code <}{@link Tref }{@code >}
- *
- *
- */
- public List<Object> getBeanOrReferenceOrRefFIXME() {
- if (beanOrReferenceOrRefFIXME == null) {
- beanOrReferenceOrRefFIXME = new ArrayList<Object>();
- }
- return this.beanOrReferenceOrRefFIXME;
- }
-
-}
Copied: projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/jboss/osgi/blueprint/reflect/TypeConverters.java (from rev 90249, projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/jboss/osgi/blueprint/reflect/TtypeConverters.java)
===================================================================
--- projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/jboss/osgi/blueprint/reflect/TypeConverters.java (rev 0)
+++ projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/jboss/osgi/blueprint/reflect/TypeConverters.java 2009-06-17 06:57:14 UTC (rev 90293)
@@ -0,0 +1,74 @@
+/*
+ * 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.blueprint.reflect;
+
+// $Id$
+
+import java.util.ArrayList;
+import java.util.List;
+
+/**
+ *
+ *
+ * The type used for the <type-converters> element. The <type-converters> section is a set of <bean>, <ref>, or <reference> elements that identify the type convert
+ * components that will ference components.
+ *
+ *
+ *
+ * <p>
+ * Java class for Ttype-converters complex type.
+ *
+ * <p>
+ * The following schema fragment specifies the expected content contained within this class.
+ *
+ * <pre>
+ * <complexType name="Ttype-converters">
+ * <complexContent>
+ * <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ * <choice maxOccurs="unbounded" minOccurs="0">
+ * <group ref="{http://www.osgi.org/xmlns/blueprint/v1.0.0}targetComponent&quo...
+ * </choice>
+ * </restriction>
+ * </complexContent>
+ * </complexType>
+ * </pre>
+ *
+ *
+ */
+public class TypeConverters
+{
+ protected List<Object> beanOrReferenceOrRef;
+
+ /**
+ * Gets the value of the beanOrReferenceOrRef property.
+ *
+ */
+ public List<Object> getBeanOrReferenceOrRef()
+ {
+ if (beanOrReferenceOrRef == null)
+ {
+ beanOrReferenceOrRef = new ArrayList<Object>();
+ }
+ return this.beanOrReferenceOrRef;
+ }
+
+}
Modified: projects/jboss-osgi/trunk/blueprint/impl/src/main/resources/schema/blueprint-jbxb.xsd
===================================================================
--- projects/jboss-osgi/trunk/blueprint/impl/src/main/resources/schema/blueprint-jbxb.xsd 2009-06-17 06:28:57 UTC (rev 90292)
+++ projects/jboss-osgi/trunk/blueprint/impl/src/main/resources/schema/blueprint-jbxb.xsd 2009-06-17 06:57:14 UTC (rev 90293)
@@ -173,6 +173,9 @@
<xsd:complexType name="Ttype-converters">
<xsd:annotation>
+ <xsd:appinfo>
+ <jbxb:class impl="org.jboss.osgi.blueprint.reflect.TypeConverters"></jbxb:class>
+ </xsd:appinfo>
<xsd:documentation>
<![CDATA[
The type used for the <type-converters> element. The
@@ -218,7 +221,13 @@
</xsd:appinfo>
</xsd:annotation>
</xsd:element>
- <xsd:element name="ref" type="Tref" />
+ <xsd:element name="ref" type="Tref" >
+ <xsd:annotation>
+ <xsd:appinfo>
+ <jbxb:property name="components"/>
+ </xsd:appinfo>
+ </xsd:annotation>
+ </xsd:element>
<xsd:any namespace="##other" processContents="strict" minOccurs="0" maxOccurs="unbounded" />
</xsd:choice>
</xsd:group>
@@ -618,6 +627,9 @@
<xsd:complexType name="TReferenceListener">
<xsd:annotation>
+ <xsd:appinfo>
+ <jbxb:class impl="org.jboss.osgi.blueprint.reflect.ReferenceListenerImpl"></jbxb:class>
+ </xsd:appinfo>
<xsd:documentation>
<![CDATA[
TReferenceListener defines a reference listener that is attached
@@ -895,6 +907,9 @@
<xsd:complexType name="Tref">
<xsd:annotation>
+ <xsd:appinfo>
+ <jbxb:class impl="org.jboss.osgi.blueprint.reflect.RefImpl"></jbxb:class>
+ </xsd:appinfo>
<xsd:documentation>
<![CDATA[
Tref is the type used for <ref> elements. This specifies a required
Modified: projects/jboss-osgi/trunk/blueprint/testsuite/src/test/java/org/jboss/test/osgi/blueprint/parser/AllElementsParserTestCase.java
===================================================================
--- projects/jboss-osgi/trunk/blueprint/testsuite/src/test/java/org/jboss/test/osgi/blueprint/parser/AllElementsParserTestCase.java 2009-06-17 06:28:57 UTC (rev 90292)
+++ projects/jboss-osgi/trunk/blueprint/testsuite/src/test/java/org/jboss/test/osgi/blueprint/parser/AllElementsParserTestCase.java 2009-06-17 06:57:14 UTC (rev 90293)
@@ -23,14 +23,18 @@
//$Id$
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertNotNull;
+
import java.net.URL;
+import java.util.List;
import org.jboss.osgi.blueprint.parser.BlueprintParser;
+import org.jboss.osgi.blueprint.reflect.Availability;
import org.jboss.osgi.blueprint.reflect.BlueprintImpl;
-import org.jboss.osgi.blueprint.reflect.TtypeConverters;
+import org.jboss.osgi.blueprint.reflect.TypeConverters;
import org.jboss.osgi.spi.testing.OSGiTestHelper;
import org.junit.BeforeClass;
-import org.junit.Ignore;
import org.junit.Test;
/**
@@ -47,13 +51,42 @@
public static void beforeClass()
{
URL xmlURL = new OSGiTestHelper().getResourceURL("parser/blueprint-all-elements.xml");
- //blueprint = new BlueprintParser().parse(xmlURL);
+ blueprint = new BlueprintParser().parse(xmlURL);
}
@Test
- @Ignore
+ public void testRootAttributes() throws Exception
+ {
+ Availability defaultAvailability = blueprint.getDefaultAvailability();
+ assertEquals(Availability.MANDATORY, defaultAvailability);
+
+ String defaultDestroyMethod = blueprint.getDefaultDestroyMethod();
+ assertEquals("defaultDestroyMethod", defaultDestroyMethod);
+
+ String defaultInitMethod = blueprint.getDefaultInitMethod();
+ assertEquals("defaultInitMethod", defaultInitMethod);
+
+ Boolean defaultLazyInit = blueprint.isDefaultLazyInit();
+ assertEquals(Boolean.FALSE, defaultLazyInit);
+
+ long defaultTimeout = blueprint.getDefaultTimeout().longValue();
+ assertEquals(300000, defaultTimeout);
+ }
+
+ @Test
+ public void getDescription() throws Exception
+ {
+ String description = blueprint.getDescription();
+ assertEquals("blueprint description", description);
+ }
+
+ @Test
public void getTypeConverters() throws Exception
{
- TtypeConverters typeConverters = blueprint.getTypeConverters();
+ TypeConverters typeConverters = blueprint.getTypeConverters();
+ assertNotNull("TypeConverters not null", typeConverters);
+
+ List<Object> beanOrReferenceOrRef = typeConverters.getBeanOrReferenceOrRef();
+ assertEquals("TypeConverters size", 5, beanOrReferenceOrRef);
}
}
\ No newline at end of file
Modified: projects/jboss-osgi/trunk/blueprint/testsuite/src/test/resources/log4j.xml
===================================================================
--- projects/jboss-osgi/trunk/blueprint/testsuite/src/test/resources/log4j.xml 2009-06-17 06:28:57 UTC (rev 90292)
+++ projects/jboss-osgi/trunk/blueprint/testsuite/src/test/resources/log4j.xml 2009-06-17 06:57:14 UTC (rev 90293)
@@ -38,11 +38,11 @@
</category>
-->
- <!-- Show jboss deployer traces
+ <!-- Show jboss deployer traces -->
<category name="org.jboss.xb">
<priority value="TRACE" />
</category>
- -->
+
<!-- ======================= -->
<!-- Setup the Root category -->
Modified: projects/jboss-osgi/trunk/blueprint/testsuite/src/test/resources/parser/blueprint-all-elements.xml
===================================================================
--- projects/jboss-osgi/trunk/blueprint/testsuite/src/test/resources/parser/blueprint-all-elements.xml 2009-06-17 06:28:57 UTC (rev 90292)
+++ projects/jboss-osgi/trunk/blueprint/testsuite/src/test/resources/parser/blueprint-all-elements.xml 2009-06-17 06:57:14 UTC (rev 90293)
@@ -1,13 +1,9 @@
<?xml version="1.0" encoding="UTF-8"?>
<blueprint xmlns="http://www.osgi.org/xmlns/blueprint/v1.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.osgi.org/xmlns/blueprint/v1.0.0 blueprint.xsd "
-
default-availability="mandatory" default-destroy-method="defaultDestroyMethod" default-init-method="defaultInitMethod" default-lazy-init="false" default-timeout="300000">
- <!--
- <description>
- Some Blueprint Description
- </description>
+ <description>blueprint description</description>
<type-converters>
<bean class="foo.TypeConverterBean" />
@@ -19,9 +15,7 @@
<service id="idServiceA" auto-export="disabled" depends-on="someServiceDependency" interface="foo.ServiceInterface" ranking="0" ref="NCName">
- <description>
- service description
- </description>
+ <description>service description</description>
<interfaces>
<value>foo.ServiceInterfA</value>
@@ -43,24 +37,24 @@
</service>
<service id="idServiceB" ref="serviceRef" />
- -->
<ref-set id="myServices" interface="com.xyz.MyService" member-type="service-instance" ordering-basis="service" comparator-ref="someComparator" />
<ref-list id="myEventListeners" interface="com.xyz.EventListener" />
+
+ <!--
<ref-list id="myOtherServices" interface="com.xyz.OtherService" ordering-basis="service-reference">
<comparator>
<bean class="MyOtherServiceComparator" />
</comparator>
</ref-list>
+ -->
<bean id="beanA" class="foo.Bean" depends-on="beanDependency" init-method="initMethod" destroy-method="destroyMethod" factory-method="factoryMethod"
factory-component="factoryComponent" scope="singleton" lazy-init="lazy" />
<reference component-name="referenceCompName" interface="foo.referenceInterf" filter="referenceFilter" availablitity="optional">
- <description>
- reference description
- </description>
+ <description>reference description</description>
<interfaces>
<value>foo.ReferenceInterfA</value>
<value>foo.ReferenceInterfB</value>
@@ -69,7 +63,4 @@
<listener ref="referenceListenerB" />
</reference>
- <ref component="refCompA" />
- <ref component="refCompB" />
-
</blueprint>
15 years
JBoss-OSGI SVN: r90271 - in projects/jboss-osgi/trunk/blueprint: impl/src/main/java/org/jboss/osgi/blueprint/reflect and 3 other directories.
by jboss-osgi-commits@lists.jboss.org
Author: thomas.diesler(a)jboss.com
Date: 2009-06-16 16:27:34 -0400 (Tue, 16 Jun 2009)
New Revision: 90271
Added:
projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/jboss/osgi/blueprint/reflect/ComparatorImpl.java
projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/jboss/osgi/blueprint/reflect/RefCollectionImpl.java
projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/jboss/osgi/blueprint/reflect/RegistrationListenerImpl.java
Removed:
projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/jboss/osgi/blueprint/reflect/Tcomparator.java
projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/jboss/osgi/blueprint/reflect/TrefCollection.java
projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/jboss/osgi/blueprint/reflect/TregistrationListener.java
Modified:
projects/jboss-osgi/trunk/blueprint/impl/pom.xml
projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/jboss/osgi/blueprint/reflect/BlueprintImpl.java
projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/jboss/osgi/blueprint/reflect/ComponentMetadataImpl.java
projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/jboss/osgi/blueprint/reflect/ServiceMetadataImpl.java
projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/jboss/osgi/blueprint/reflect/Targument.java
projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/jboss/osgi/blueprint/reflect/Tcollection.java
projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/jboss/osgi/blueprint/reflect/Tkey.java
projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/jboss/osgi/blueprint/reflect/TmapEntry.java
projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/jboss/osgi/blueprint/reflect/Tproperty.java
projects/jboss-osgi/trunk/blueprint/impl/src/main/resources/schema/blueprint-jbxb.xsd
projects/jboss-osgi/trunk/blueprint/testsuite/src/test/java/org/jboss/test/osgi/blueprint/parser/BasicBeansParserTestCase.java
projects/jboss-osgi/trunk/blueprint/testsuite/src/test/java/org/jboss/test/osgi/blueprint/parser/BasicServiceParserTestCase.java
projects/jboss-osgi/trunk/blueprint/testsuite/src/test/resources/parser/blueprint-all-elements.xml
Log:
Add more BP parser tests
Modified: projects/jboss-osgi/trunk/blueprint/impl/pom.xml
===================================================================
--- projects/jboss-osgi/trunk/blueprint/impl/pom.xml 2009-06-16 20:06:19 UTC (rev 90270)
+++ projects/jboss-osgi/trunk/blueprint/impl/pom.xml 2009-06-16 20:27:34 UTC (rev 90271)
@@ -90,6 +90,7 @@
<excludePackageNames>org.jboss.osgi.*</excludePackageNames>
</configuration>
</plugin>
+ <!--
<plugin>
<groupId>xsddoc</groupId>
<artifactId>maven-xsddoc-plugin</artifactId>
@@ -98,6 +99,7 @@
<maven.xsddoc.include>blueprint.xsd</maven.xsddoc.include>
</configuration>
</plugin>
+ -->
</plugins>
</reporting>
Modified: projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/jboss/osgi/blueprint/reflect/BlueprintImpl.java
===================================================================
--- projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/jboss/osgi/blueprint/reflect/BlueprintImpl.java 2009-06-16 20:06:19 UTC (rev 90270)
+++ projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/jboss/osgi/blueprint/reflect/BlueprintImpl.java 2009-06-16 20:27:34 UTC (rev 90271)
@@ -32,6 +32,7 @@
import javax.xml.namespace.QName;
import org.jboss.osgi.spi.NotImplementedException;
+import org.osgi.service.blueprint.reflect.ComponentMetadata;
/**
* The blueprint element is the top element. The definitions consist of two sections:
@@ -49,7 +50,7 @@
{
protected String description;
protected TtypeConverters typeConverters;
- protected List<ComponentMetadataImpl> components;
+ protected List<ComponentMetadata> components;
protected Boolean defaultLazyInit;
protected String defaultInitMethod;
protected String defaultDestroyMethod;
@@ -100,12 +101,11 @@
/**
* Gets the value of components
*/
- public List<ComponentMetadataImpl> getComponents()
+ public List<ComponentMetadata> getComponents()
{
if (components == null)
- {
- components = new ArrayList<ComponentMetadataImpl>();
- }
+ components = new ArrayList<ComponentMetadata>();
+
return this.components;
}
Copied: projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/jboss/osgi/blueprint/reflect/ComparatorImpl.java (from rev 90249, projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/jboss/osgi/blueprint/reflect/Tcomparator.java)
===================================================================
--- projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/jboss/osgi/blueprint/reflect/ComparatorImpl.java (rev 0)
+++ projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/jboss/osgi/blueprint/reflect/ComparatorImpl.java 2009-06-16 20:27:34 UTC (rev 90271)
@@ -0,0 +1,150 @@
+/*
+ * 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.blueprint.reflect;
+
+//$Id$
+
+import java.util.ArrayList;
+import java.util.List;
+
+/**
+ * <p>
+ * Java class for Tcomparator complex type.
+ *
+ * <p>
+ * The following schema fragment specifies the expected content contained within this class.
+ *
+ * <pre>
+ * <complexType name="Tcomparator">
+ * <complexContent>
+ * <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ * <group ref="{http://www.osgi.org/xmlns/blueprint/v1.0.0}targetComponent&quo...
+ * </restriction>
+ * </complexContent>
+ * </complexType>
+ * </pre>
+ *
+ *
+ */
+public class ComparatorImpl
+{
+ protected BeanMetadataImpl bean;
+ protected ReferenceMetadataImpl reference;
+ protected Tref refFIXME;
+ protected List<Object> any;
+
+ /**
+ * Gets the value of the bean property.
+ *
+ * @return possible object is {@link BeanMetadataImpl }
+ *
+ */
+ public BeanMetadataImpl getBean()
+ {
+ return bean;
+ }
+
+ /**
+ * Sets the value of the bean property.
+ *
+ * @param value allowed object is {@link BeanMetadataImpl }
+ *
+ */
+ public void setBean(BeanMetadataImpl value)
+ {
+ this.bean = value;
+ }
+
+ /**
+ * Gets the value of the reference property.
+ *
+ * @return possible object is {@link ReferenceMetadataImpl }
+ *
+ */
+ public ReferenceMetadataImpl getReference()
+ {
+ return reference;
+ }
+
+ /**
+ * Sets the value of the reference property.
+ *
+ * @param value allowed object is {@link ReferenceMetadataImpl }
+ *
+ */
+ public void setReference(ReferenceMetadataImpl value)
+ {
+ this.reference = value;
+ }
+
+ /**
+ * Gets the value of the refFIXME property.
+ *
+ * @return possible object is {@link Tref }
+ *
+ */
+ public Tref getRefFIXME()
+ {
+ return refFIXME;
+ }
+
+ /**
+ * Sets the value of the refFIXME property.
+ *
+ * @param value allowed object is {@link Tref }
+ *
+ */
+ public void setRefFIXME(Tref value)
+ {
+ this.refFIXME = value;
+ }
+
+ /**
+ * Gets the value of the any 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 any property.
+ *
+ * <p>
+ * For example, to add a new item, do as follows:
+ *
+ * <pre>
+ * getAny().add(newItem);
+ * </pre>
+ *
+ *
+ * <p>
+ * Objects of the following type(s) are allowed in the list {@link Object }
+ *
+ *
+ */
+ public List<Object> getAny()
+ {
+ if (any == null)
+ {
+ any = new ArrayList<Object>();
+ }
+ return this.any;
+ }
+
+}
Modified: projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/jboss/osgi/blueprint/reflect/ComponentMetadataImpl.java
===================================================================
--- projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/jboss/osgi/blueprint/reflect/ComponentMetadataImpl.java 2009-06-16 20:06:19 UTC (rev 90270)
+++ projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/jboss/osgi/blueprint/reflect/ComponentMetadataImpl.java 2009-06-16 20:27:34 UTC (rev 90271)
@@ -21,10 +21,10 @@
*/
package org.jboss.osgi.blueprint.reflect;
+//$Id$
+
import org.osgi.service.blueprint.reflect.ComponentMetadata;
-// $Id$
-
/**
* The Component type is the base type for top-level
* Blueprint components. The <bean> <reference>, <service>, <ref-set>, and <ref-list>
Copied: projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/jboss/osgi/blueprint/reflect/RefCollectionImpl.java (from rev 90249, projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/jboss/osgi/blueprint/reflect/TrefCollection.java)
===================================================================
--- projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/jboss/osgi/blueprint/reflect/RefCollectionImpl.java (rev 0)
+++ projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/jboss/osgi/blueprint/reflect/RefCollectionImpl.java 2009-06-16 20:27:34 UTC (rev 90271)
@@ -0,0 +1,165 @@
+/*
+ * 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.blueprint.reflect;
+
+//$Id$
+
+/**
+ *
+ *
+ * The Tref-collection builds in the characteristics of the TserviceReference type to define characteristics of the <ref-set> and <ref-list> elements. This adds in the
+ * characteristics that only apply to collections of references (e.g., sorting).
+ *
+ * <p>
+ * Java class for Tref-collection complex type.
+ *
+ * <p>
+ * The following schema fragment specifies the expected content contained within this class.
+ *
+ * <pre>
+ * <complexType name="Tref-collection">
+ * <complexContent>
+ * <extension base="{http://www.osgi.org/xmlns/blueprint/v1.0.0}TserviceReference&...
+ * <sequence>
+ * <element name="comparator" type="{http://www.osgi.org/xmlns/blueprint/v1.0.0}Tcomparator" minOccurs="0"/>
+ * </sequence>
+ * <attribute name="comparator-ref" type="{http://www.w3.org/2001/XMLSchema}token" />
+ * <attribute name="member-type">
+ * <simpleType>
+ * <restriction base="{http://www.w3.org/2001/XMLSchema}NMTOKEN">
+ * <enumeration value="service-instance"/>
+ * <enumeration value="service-reference"/>
+ * </restriction>
+ * </simpleType>
+ * </attribute>
+ * <attribute name="ordering-basis">
+ * <simpleType>
+ * <restriction base="{http://www.w3.org/2001/XMLSchema}NMTOKEN">
+ * <enumeration value="service"/>
+ * <enumeration value="service-reference"/>
+ * </restriction>
+ * </simpleType>
+ * </attribute>
+ * <anyAttribute processContents='lax' namespace='##other'/>
+ * </extension>
+ * </complexContent>
+ * </complexType>
+ * </pre>
+ *
+ *
+ */
+public class RefCollectionImpl extends ServiceReferenceMetadataImpl
+{
+ protected ComparatorImpl comparator;
+ protected String comparatorRef;
+ protected String memberType;
+ protected String orderingBasis;
+
+ /**
+ * Gets the value of the comparator property.
+ *
+ * @return possible object is {@link ComparatorImpl }
+ *
+ */
+ public ComparatorImpl getComparator()
+ {
+ return comparator;
+ }
+
+ /**
+ * Sets the value of the comparator property.
+ *
+ * @param value allowed object is {@link ComparatorImpl }
+ *
+ */
+ public void setComparator(ComparatorImpl value)
+ {
+ this.comparator = value;
+ }
+
+ /**
+ * Gets the value of the comparatorRef property.
+ *
+ * @return possible object is {@link String }
+ *
+ */
+ public String getComparatorRef()
+ {
+ return comparatorRef;
+ }
+
+ /**
+ * Sets the value of the comparatorRef property.
+ *
+ * @param value allowed object is {@link String }
+ *
+ */
+ public void setComparatorRef(String value)
+ {
+ this.comparatorRef = value;
+ }
+
+ /**
+ * Gets the value of the memberType property.
+ *
+ * @return possible object is {@link String }
+ *
+ */
+ public String getMemberType()
+ {
+ return memberType;
+ }
+
+ /**
+ * Sets the value of the memberType property.
+ *
+ * @param value allowed object is {@link String }
+ *
+ */
+ public void setMemberType(String value)
+ {
+ this.memberType = value;
+ }
+
+ /**
+ * Gets the value of the orderingBasis property.
+ *
+ * @return possible object is {@link String }
+ *
+ */
+ public String getOrderingBasis()
+ {
+ return orderingBasis;
+ }
+
+ /**
+ * Sets the value of the orderingBasis property.
+ *
+ * @param value allowed object is {@link String }
+ *
+ */
+ public void setOrderingBasis(String value)
+ {
+ this.orderingBasis = value;
+ }
+
+}
Copied: projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/jboss/osgi/blueprint/reflect/RegistrationListenerImpl.java (from rev 90249, projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/jboss/osgi/blueprint/reflect/TregistrationListener.java)
===================================================================
--- projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/jboss/osgi/blueprint/reflect/RegistrationListenerImpl.java (rev 0)
+++ projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/jboss/osgi/blueprint/reflect/RegistrationListenerImpl.java 2009-06-16 20:27:34 UTC (rev 90271)
@@ -0,0 +1,249 @@
+/*
+ * 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.blueprint.reflect;
+
+// $Id$
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.jboss.osgi.spi.NotImplementedException;
+import org.osgi.service.blueprint.reflect.RegistrationListener;
+import org.osgi.service.blueprint.reflect.Target;
+
+/**
+ *
+ *
+ * A registration listener definition. The target registration listener can be either a <ref> to a <bean> or <service> component, or an inline <bean> or <service>
+ * component definition. The registration-method and unregistration-method attributes define the methods that will be called for the respective events.
+ *
+ * For the very common case of using a <ref> to a listener component, the ref attribute may also be used as a shortcut.
+ *
+ *
+ *
+ * <p>
+ * Java class for TregistrationListener complex type.
+ *
+ * <p>
+ * The following schema fragment specifies the expected content contained within this class.
+ *
+ * <pre>
+ * <complexType name="TregistrationListener">
+ * <complexContent>
+ * <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ * <group ref="{http://www.osgi.org/xmlns/blueprint/v1.0.0}targetComponent&quo...
+ * <attribute name="ref" type="{http://www.osgi.org/xmlns/blueprint/v1.0.0}Tidref" />
+ * <attribute name="registration-method" use="required" type="{http://www.osgi.org/xmlns/blueprint/v1.0.0}Tmethod" />
+ * <attribute name="unregistration-method" use="required" type="{http://www.osgi.org/xmlns/blueprint/v1.0.0}Tmethod" />
+ * </restriction>
+ * </complexContent>
+ * </complexType>
+ * </pre>
+ *
+ *
+ */
+public class RegistrationListenerImpl implements RegistrationListener
+{
+ protected BeanMetadataImpl bean;
+ protected ReferenceMetadataImpl reference;
+ protected Tref refFIXME;
+ protected List<Object> any;
+ protected String ref;
+ protected String registrationMethod;
+ protected String unregistrationMethod;
+
+ /**
+ * Gets the value of the bean property.
+ *
+ * @return possible object is {@link BeanMetadataImpl }
+ *
+ */
+ public BeanMetadataImpl getBean()
+ {
+ return bean;
+ }
+
+ /**
+ * Sets the value of the bean property.
+ *
+ * @param value allowed object is {@link BeanMetadataImpl }
+ *
+ */
+ public void setBean(BeanMetadataImpl value)
+ {
+ this.bean = value;
+ }
+
+ /**
+ * Gets the value of the reference property.
+ *
+ * @return possible object is {@link ReferenceMetadataImpl }
+ *
+ */
+ public ReferenceMetadataImpl getReference()
+ {
+ return reference;
+ }
+
+ /**
+ * Sets the value of the reference property.
+ *
+ * @param value allowed object is {@link ReferenceMetadataImpl }
+ *
+ */
+ public void setReference(ReferenceMetadataImpl value)
+ {
+ this.reference = value;
+ }
+
+ /**
+ * Gets the value of the refFIXME property.
+ *
+ * @return possible object is {@link Tref }
+ *
+ */
+ public Tref getRefFIXME()
+ {
+ return refFIXME;
+ }
+
+ /**
+ * Sets the value of the refFIXME property.
+ *
+ * @param value allowed object is {@link Tref }
+ *
+ */
+ public void setRefFIXME(Tref value)
+ {
+ this.refFIXME = value;
+ }
+
+ /**
+ * Gets the value of the any 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 any property.
+ *
+ * <p>
+ * For example, to add a new item, do as follows:
+ *
+ * <pre>
+ * getAny().add(newItem);
+ * </pre>
+ *
+ *
+ * <p>
+ * Objects of the following type(s) are allowed in the list {@link Object }
+ *
+ *
+ */
+ public List<Object> getAny()
+ {
+ if (any == null)
+ {
+ any = new ArrayList<Object>();
+ }
+ 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 registrationMethod property.
+ *
+ * @return possible object is {@link String }
+ *
+ */
+ public String getRegistrationMethod()
+ {
+ return registrationMethod;
+ }
+
+ /**
+ * Sets the value of the registrationMethod property.
+ *
+ * @param value allowed object is {@link String }
+ *
+ */
+ public void setRegistrationMethod(String value)
+ {
+ this.registrationMethod = value;
+ }
+
+ /**
+ * Gets the value of the unregistrationMethod property.
+ *
+ * @return possible object is {@link String }
+ *
+ */
+ public String getUnregistrationMethod()
+ {
+ return unregistrationMethod;
+ }
+
+ /**
+ * Sets the value of the unregistrationMethod property.
+ *
+ * @param value allowed object is {@link String }
+ *
+ */
+ public void setUnregistrationMethod(String value)
+ {
+ this.unregistrationMethod = value;
+ }
+
+ public Target getListenerComponent()
+ {
+ throw new NotImplementedException();
+ }
+
+ public String getRegistrationMethodName()
+ {
+ throw new NotImplementedException();
+ }
+
+ public String getUnregistrationMethodName()
+ {
+ throw new NotImplementedException();
+ }
+}
Modified: projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/jboss/osgi/blueprint/reflect/ServiceMetadataImpl.java
===================================================================
--- projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/jboss/osgi/blueprint/reflect/ServiceMetadataImpl.java 2009-06-16 20:06:19 UTC (rev 90270)
+++ projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/jboss/osgi/blueprint/reflect/ServiceMetadataImpl.java 2009-06-16 20:27:34 UTC (rev 90271)
@@ -28,6 +28,7 @@
import java.util.HashMap;
import java.util.List;
import java.util.Map;
+
import javax.xml.namespace.QName;
import org.jboss.osgi.spi.NotImplementedException;
@@ -47,11 +48,10 @@
protected String description;
protected List<String> interfaces;
protected List<ServicePropertyEntry> serviceProperties;
- protected List<TregistrationListener> registrationListener;
+ protected Collection<RegistrationListener> registrationListener;
protected BeanMetadataImpl bean;
protected Tref refFIXME;
protected List<Object> any;
- protected String _interface;
protected String ref;
protected String dependsOn;
protected AutoExportModes autoExport;
@@ -102,35 +102,27 @@
return serviceProperties;
}
+ public void setServiceProperties(List<ServicePropertyEntry> serviceProperties)
+ {
+ this.serviceProperties = serviceProperties;
+ }
+
/**
* Gets the value of the registrationListener 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 registrationListener property.
- *
- * <p>
- * For example, to add a new item, do as follows:
- *
- * <pre>
- * getRegistrationListener().add(newItem);
- * </pre>
- *
- *
- * <p>
- * Objects of the following type(s) are allowed in the list {@link TregistrationListener }
- *
- *
*/
- public List<TregistrationListener> getRegistrationListener()
+ public Collection<RegistrationListener> getRegistrationListeners()
{
if (registrationListener == null)
- {
- registrationListener = new ArrayList<TregistrationListener>();
- }
- return this.registrationListener;
+ registrationListener = new ArrayList<RegistrationListener>();
+
+ return registrationListener;
}
+ public void setRegistrationListeners(Collection<RegistrationListener> registrationListener)
+ {
+ this.registrationListener = registrationListener;
+ }
+
/**
* Gets the value of the bean property.
*
@@ -205,28 +197,6 @@
}
/**
- * Gets the value of the interface property.
- *
- * @return possible object is {@link String }
- *
- */
- public String getInterface()
- {
- return _interface;
- }
-
- /**
- * Sets the value of the interface property.
- *
- * @param value allowed object is {@link String }
- *
- */
- public void setInterface(String value)
- {
- this._interface = value;
- }
-
- /**
* Gets the value of the ref property.
*
* @return possible object is {@link String }
@@ -343,11 +313,6 @@
throw new NotImplementedException();
}
- public Collection<RegistrationListener> getRegistrationListeners()
- {
- throw new NotImplementedException();
- }
-
public Target getServiceComponent()
{
throw new NotImplementedException();
Modified: projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/jboss/osgi/blueprint/reflect/Targument.java
===================================================================
--- projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/jboss/osgi/blueprint/reflect/Targument.java 2009-06-16 20:06:19 UTC (rev 90270)
+++ projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/jboss/osgi/blueprint/reflect/Targument.java 2009-06-16 20:27:34 UTC (rev 90271)
@@ -60,8 +60,8 @@
protected String description;
protected ServiceMetadataImpl service;
- protected TrefCollection refList;
- protected TrefCollection refSet;
+ protected RefCollectionImpl refList;
+ protected RefCollectionImpl refSet;
protected BeanMetadataImpl bean;
protected ReferenceMetadataImpl reference;
protected Tref refFIXME;
@@ -132,10 +132,10 @@
*
* @return
* possible object is
- * {@link TrefCollection }
+ * {@link RefCollectionImpl }
*
*/
- public TrefCollection getRefList() {
+ public RefCollectionImpl getRefList() {
return refList;
}
@@ -144,10 +144,10 @@
*
* @param value
* allowed object is
- * {@link TrefCollection }
+ * {@link RefCollectionImpl }
*
*/
- public void setRefList(TrefCollection value) {
+ public void setRefList(RefCollectionImpl value) {
this.refList = value;
}
@@ -156,10 +156,10 @@
*
* @return
* possible object is
- * {@link TrefCollection }
+ * {@link RefCollectionImpl }
*
*/
- public TrefCollection getRefSet() {
+ public RefCollectionImpl getRefSet() {
return refSet;
}
@@ -168,10 +168,10 @@
*
* @param value
* allowed object is
- * {@link TrefCollection }
+ * {@link RefCollectionImpl }
*
*/
- public void setRefSet(TrefCollection value) {
+ public void setRefSet(RefCollectionImpl value) {
this.refSet = value;
}
Modified: projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/jboss/osgi/blueprint/reflect/Tcollection.java
===================================================================
--- projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/jboss/osgi/blueprint/reflect/Tcollection.java 2009-06-16 20:06:19 UTC (rev 90270)
+++ projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/jboss/osgi/blueprint/reflect/Tcollection.java 2009-06-16 20:27:34 UTC (rev 90271)
@@ -67,8 +67,8 @@
* {@link JAXBElement }{@code <}{@link Tmap }{@code >}
* {@link JAXBElement }{@code <}{@link BeanMetadataImpl }{@code >}
* {@link JAXBElement }{@code <}{@link Tnull }{@code >}
- * {@link JAXBElement }{@code <}{@link TrefCollection }{@code >}
- * {@link JAXBElement }{@code <}{@link TrefCollection }{@code >}
+ * {@link JAXBElement }{@code <}{@link RefCollectionImpl }{@code >}
+ * {@link JAXBElement }{@code <}{@link RefCollectionImpl }{@code >}
* {@link JAXBElement }{@code <}{@link Tcollection }{@code >}
* {@link Object }
* {@link JAXBElement }{@code <}{@link Tcollection }{@code >}
Deleted: projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/jboss/osgi/blueprint/reflect/Tcomparator.java
===================================================================
--- projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/jboss/osgi/blueprint/reflect/Tcomparator.java 2009-06-16 20:06:19 UTC (rev 90270)
+++ projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/jboss/osgi/blueprint/reflect/Tcomparator.java 2009-06-16 20:27:34 UTC (rev 90271)
@@ -1,140 +0,0 @@
-//
-// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vhudson-jaxb-ri-2.1-793
-// 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.05.13 at 02:16:52 PM CEST
-//
-
-
-package org.jboss.osgi.blueprint.reflect;
-
-import java.util.ArrayList;
-import java.util.List;
-
-
-/**
- * <p>Java class for Tcomparator complex type.
- *
- * <p>The following schema fragment specifies the expected content contained within this class.
- *
- * <pre>
- * <complexType name="Tcomparator">
- * <complexContent>
- * <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
- * <group ref="{http://www.osgi.org/xmlns/blueprint/v1.0.0}targetComponent"/>
- * </restriction>
- * </complexContent>
- * </complexType>
- * </pre>
- *
- *
- */
-public class Tcomparator {
-
- protected BeanMetadataImpl bean;
- protected ReferenceMetadataImpl reference;
- protected Tref refFIXME;
- protected List<Object> any;
-
- /**
- * Gets the value of the bean property.
- *
- * @return
- * possible object is
- * {@link BeanMetadataImpl }
- *
- */
- public BeanMetadataImpl getBean() {
- return bean;
- }
-
- /**
- * Sets the value of the bean property.
- *
- * @param value
- * allowed object is
- * {@link BeanMetadataImpl }
- *
- */
- public void setBean(BeanMetadataImpl value) {
- this.bean = value;
- }
-
- /**
- * Gets the value of the reference property.
- *
- * @return
- * possible object is
- * {@link ReferenceMetadataImpl }
- *
- */
- public ReferenceMetadataImpl getReference() {
- return reference;
- }
-
- /**
- * Sets the value of the reference property.
- *
- * @param value
- * allowed object is
- * {@link ReferenceMetadataImpl }
- *
- */
- public void setReference(ReferenceMetadataImpl value) {
- this.reference = value;
- }
-
- /**
- * Gets the value of the refFIXME property.
- *
- * @return
- * possible object is
- * {@link Tref }
- *
- */
- public Tref getRefFIXME() {
- return refFIXME;
- }
-
- /**
- * Sets the value of the refFIXME property.
- *
- * @param value
- * allowed object is
- * {@link Tref }
- *
- */
- public void setRefFIXME(Tref value) {
- this.refFIXME = value;
- }
-
- /**
- * Gets the value of the any 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 any property.
- *
- * <p>
- * For example, to add a new item, do as follows:
- * <pre>
- * getAny().add(newItem);
- * </pre>
- *
- *
- * <p>
- * Objects of the following type(s) are allowed in the list
- * {@link Object }
- *
- *
- */
- public List<Object> getAny() {
- if (any == null) {
- any = new ArrayList<Object>();
- }
- return this.any;
- }
-
-}
Modified: projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/jboss/osgi/blueprint/reflect/Tkey.java
===================================================================
--- projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/jboss/osgi/blueprint/reflect/Tkey.java 2009-06-16 20:06:19 UTC (rev 90270)
+++ projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/jboss/osgi/blueprint/reflect/Tkey.java 2009-06-16 20:27:34 UTC (rev 90271)
@@ -40,8 +40,8 @@
public class Tkey {
protected ServiceMetadataImpl service;
- protected TrefCollection refList;
- protected TrefCollection refSet;
+ protected RefCollectionImpl refList;
+ protected RefCollectionImpl refSet;
protected BeanMetadataImpl bean;
protected ReferenceMetadataImpl reference;
protected Tref refFIXME;
@@ -83,10 +83,10 @@
*
* @return
* possible object is
- * {@link TrefCollection }
+ * {@link RefCollectionImpl }
*
*/
- public TrefCollection getRefList() {
+ public RefCollectionImpl getRefList() {
return refList;
}
@@ -95,10 +95,10 @@
*
* @param value
* allowed object is
- * {@link TrefCollection }
+ * {@link RefCollectionImpl }
*
*/
- public void setRefList(TrefCollection value) {
+ public void setRefList(RefCollectionImpl value) {
this.refList = value;
}
@@ -107,10 +107,10 @@
*
* @return
* possible object is
- * {@link TrefCollection }
+ * {@link RefCollectionImpl }
*
*/
- public TrefCollection getRefSet() {
+ public RefCollectionImpl getRefSet() {
return refSet;
}
@@ -119,10 +119,10 @@
*
* @param value
* allowed object is
- * {@link TrefCollection }
+ * {@link RefCollectionImpl }
*
*/
- public void setRefSet(TrefCollection value) {
+ public void setRefSet(RefCollectionImpl value) {
this.refSet = value;
}
Modified: projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/jboss/osgi/blueprint/reflect/TmapEntry.java
===================================================================
--- projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/jboss/osgi/blueprint/reflect/TmapEntry.java 2009-06-16 20:06:19 UTC (rev 90270)
+++ projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/jboss/osgi/blueprint/reflect/TmapEntry.java 2009-06-16 20:27:34 UTC (rev 90271)
@@ -51,8 +51,8 @@
protected Tkey keyFIXME;
protected ServiceMetadataImpl service;
- protected TrefCollection refList;
- protected TrefCollection refSet;
+ protected RefCollectionImpl refList;
+ protected RefCollectionImpl refSet;
protected BeanMetadataImpl bean;
protected ReferenceMetadataImpl reference;
protected Tref refFIXME;
@@ -123,10 +123,10 @@
*
* @return
* possible object is
- * {@link TrefCollection }
+ * {@link RefCollectionImpl }
*
*/
- public TrefCollection getRefList() {
+ public RefCollectionImpl getRefList() {
return refList;
}
@@ -135,10 +135,10 @@
*
* @param value
* allowed object is
- * {@link TrefCollection }
+ * {@link RefCollectionImpl }
*
*/
- public void setRefList(TrefCollection value) {
+ public void setRefList(RefCollectionImpl value) {
this.refList = value;
}
@@ -147,10 +147,10 @@
*
* @return
* possible object is
- * {@link TrefCollection }
+ * {@link RefCollectionImpl }
*
*/
- public TrefCollection getRefSet() {
+ public RefCollectionImpl getRefSet() {
return refSet;
}
@@ -159,10 +159,10 @@
*
* @param value
* allowed object is
- * {@link TrefCollection }
+ * {@link RefCollectionImpl }
*
*/
- public void setRefSet(TrefCollection value) {
+ public void setRefSet(RefCollectionImpl value) {
this.refSet = value;
}
Modified: projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/jboss/osgi/blueprint/reflect/Tproperty.java
===================================================================
--- projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/jboss/osgi/blueprint/reflect/Tproperty.java 2009-06-16 20:06:19 UTC (rev 90270)
+++ projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/jboss/osgi/blueprint/reflect/Tproperty.java 2009-06-16 20:27:34 UTC (rev 90271)
@@ -52,8 +52,8 @@
protected String description;
protected ServiceMetadataImpl service;
- protected TrefCollection refList;
- protected TrefCollection refSet;
+ protected RefCollectionImpl refList;
+ protected RefCollectionImpl refSet;
protected BeanMetadataImpl bean;
protected ReferenceMetadataImpl reference;
protected Tref refFIXME;
@@ -123,10 +123,10 @@
*
* @return
* possible object is
- * {@link TrefCollection }
+ * {@link RefCollectionImpl }
*
*/
- public TrefCollection getRefList() {
+ public RefCollectionImpl getRefList() {
return refList;
}
@@ -135,10 +135,10 @@
*
* @param value
* allowed object is
- * {@link TrefCollection }
+ * {@link RefCollectionImpl }
*
*/
- public void setRefList(TrefCollection value) {
+ public void setRefList(RefCollectionImpl value) {
this.refList = value;
}
@@ -147,10 +147,10 @@
*
* @return
* possible object is
- * {@link TrefCollection }
+ * {@link RefCollectionImpl }
*
*/
- public TrefCollection getRefSet() {
+ public RefCollectionImpl getRefSet() {
return refSet;
}
@@ -159,10 +159,10 @@
*
* @param value
* allowed object is
- * {@link TrefCollection }
+ * {@link RefCollectionImpl }
*
*/
- public void setRefSet(TrefCollection value) {
+ public void setRefSet(RefCollectionImpl value) {
this.refSet = value;
}
Deleted: projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/jboss/osgi/blueprint/reflect/TrefCollection.java
===================================================================
--- projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/jboss/osgi/blueprint/reflect/TrefCollection.java 2009-06-16 20:06:19 UTC (rev 90270)
+++ projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/jboss/osgi/blueprint/reflect/TrefCollection.java 2009-06-16 20:27:34 UTC (rev 90271)
@@ -1,163 +0,0 @@
-//
-// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vhudson-jaxb-ri-2.1-793
-// 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.05.13 at 02:16:52 PM CEST
-//
-
-
-package org.jboss.osgi.blueprint.reflect;
-
-
-/**
- *
- *
- * The Tref-collection builds in the characteristics of the
- * TserviceReference type to define characteristics of the <ref-set>
- * and <ref-list> elements. This adds in the characteristics that
- * only apply to collections of references (e.g., sorting).
- *
- *
- *
- * <p>Java class for Tref-collection complex type.
- *
- * <p>The following schema fragment specifies the expected content contained within this class.
- *
- * <pre>
- * <complexType name="Tref-collection">
- * <complexContent>
- * <extension base="{http://www.osgi.org/xmlns/blueprint/v1.0.0}TserviceReference">
- * <sequence>
- * <element name="comparator" type="{http://www.osgi.org/xmlns/blueprint/v1.0.0}Tcomparator" minOccurs="0"/>
- * </sequence>
- * <attribute name="comparator-ref" type="{http://www.w3.org/2001/XMLSchema}token" />
- * <attribute name="member-type">
- * <simpleType>
- * <restriction base="{http://www.w3.org/2001/XMLSchema}NMTOKEN">
- * <enumeration value="service-instance"/>
- * <enumeration value="service-reference"/>
- * </restriction>
- * </simpleType>
- * </attribute>
- * <attribute name="ordering-basis">
- * <simpleType>
- * <restriction base="{http://www.w3.org/2001/XMLSchema}NMTOKEN">
- * <enumeration value="service"/>
- * <enumeration value="service-reference"/>
- * </restriction>
- * </simpleType>
- * </attribute>
- * <anyAttribute processContents='lax' namespace='##other'/>
- * </extension>
- * </complexContent>
- * </complexType>
- * </pre>
- *
- *
- */
-public class TrefCollection
- extends ServiceReferenceMetadataImpl
-{
-
- protected Tcomparator comparator;
- protected String comparatorRef;
- protected String memberType;
- protected String orderingBasis;
-
- /**
- * Gets the value of the comparator property.
- *
- * @return
- * possible object is
- * {@link Tcomparator }
- *
- */
- public Tcomparator getComparator() {
- return comparator;
- }
-
- /**
- * Sets the value of the comparator property.
- *
- * @param value
- * allowed object is
- * {@link Tcomparator }
- *
- */
- public void setComparator(Tcomparator value) {
- this.comparator = value;
- }
-
- /**
- * Gets the value of the comparatorRef property.
- *
- * @return
- * possible object is
- * {@link String }
- *
- */
- public String getComparatorRef() {
- return comparatorRef;
- }
-
- /**
- * Sets the value of the comparatorRef property.
- *
- * @param value
- * allowed object is
- * {@link String }
- *
- */
- public void setComparatorRef(String value) {
- this.comparatorRef = value;
- }
-
- /**
- * Gets the value of the memberType property.
- *
- * @return
- * possible object is
- * {@link String }
- *
- */
- public String getMemberType() {
- return memberType;
- }
-
- /**
- * Sets the value of the memberType property.
- *
- * @param value
- * allowed object is
- * {@link String }
- *
- */
- public void setMemberType(String value) {
- this.memberType = value;
- }
-
- /**
- * Gets the value of the orderingBasis property.
- *
- * @return
- * possible object is
- * {@link String }
- *
- */
- public String getOrderingBasis() {
- return orderingBasis;
- }
-
- /**
- * Sets the value of the orderingBasis property.
- *
- * @param value
- * allowed object is
- * {@link String }
- *
- */
- public void setOrderingBasis(String value) {
- this.orderingBasis = value;
- }
-
-}
Deleted: projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/jboss/osgi/blueprint/reflect/TregistrationListener.java
===================================================================
--- projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/jboss/osgi/blueprint/reflect/TregistrationListener.java 2009-06-16 20:06:19 UTC (rev 90270)
+++ projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/jboss/osgi/blueprint/reflect/TregistrationListener.java 2009-06-16 20:27:34 UTC (rev 90271)
@@ -1,230 +0,0 @@
-//
-// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vhudson-jaxb-ri-2.1-793
-// 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.05.13 at 02:16:52 PM CEST
-//
-
-
-package org.jboss.osgi.blueprint.reflect;
-
-import java.util.ArrayList;
-import java.util.List;
-
-/**
- *
- *
- * A registration listener definition. The target registration listener
- * can be either a <ref> to a <bean> or <service> component, or an inline
- * <bean> or <service> component definition. The registration-method and
- * unregistration-method attributes define the methods that will be called
- * for the respective events.
- *
- * For the very common case of using a <ref> to a listener component, the
- * ref attribute may also be used as a shortcut.
- *
- *
- *
- * <p>Java class for TregistrationListener complex type.
- *
- * <p>The following schema fragment specifies the expected content contained within this class.
- *
- * <pre>
- * <complexType name="TregistrationListener">
- * <complexContent>
- * <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
- * <group ref="{http://www.osgi.org/xmlns/blueprint/v1.0.0}targetComponent"/>
- * <attribute name="ref" type="{http://www.osgi.org/xmlns/blueprint/v1.0.0}Tidref" />
- * <attribute name="registration-method" use="required" type="{http://www.osgi.org/xmlns/blueprint/v1.0.0}Tmethod" />
- * <attribute name="unregistration-method" use="required" type="{http://www.osgi.org/xmlns/blueprint/v1.0.0}Tmethod" />
- * </restriction>
- * </complexContent>
- * </complexType>
- * </pre>
- *
- *
- */
-public class TregistrationListener {
-
- protected BeanMetadataImpl bean;
- protected ReferenceMetadataImpl reference;
- protected Tref refFIXME;
- protected List<Object> any;
- protected String ref;
- protected String registrationMethod;
- protected String unregistrationMethod;
-
- /**
- * Gets the value of the bean property.
- *
- * @return
- * possible object is
- * {@link BeanMetadataImpl }
- *
- */
- public BeanMetadataImpl getBean() {
- return bean;
- }
-
- /**
- * Sets the value of the bean property.
- *
- * @param value
- * allowed object is
- * {@link BeanMetadataImpl }
- *
- */
- public void setBean(BeanMetadataImpl value) {
- this.bean = value;
- }
-
- /**
- * Gets the value of the reference property.
- *
- * @return
- * possible object is
- * {@link ReferenceMetadataImpl }
- *
- */
- public ReferenceMetadataImpl getReference() {
- return reference;
- }
-
- /**
- * Sets the value of the reference property.
- *
- * @param value
- * allowed object is
- * {@link ReferenceMetadataImpl }
- *
- */
- public void setReference(ReferenceMetadataImpl value) {
- this.reference = value;
- }
-
- /**
- * Gets the value of the refFIXME property.
- *
- * @return
- * possible object is
- * {@link Tref }
- *
- */
- public Tref getRefFIXME() {
- return refFIXME;
- }
-
- /**
- * Sets the value of the refFIXME property.
- *
- * @param value
- * allowed object is
- * {@link Tref }
- *
- */
- public void setRefFIXME(Tref value) {
- this.refFIXME = value;
- }
-
- /**
- * Gets the value of the any 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 any property.
- *
- * <p>
- * For example, to add a new item, do as follows:
- * <pre>
- * getAny().add(newItem);
- * </pre>
- *
- *
- * <p>
- * Objects of the following type(s) are allowed in the list
- * {@link Object }
- *
- *
- */
- public List<Object> getAny() {
- if (any == null) {
- any = new ArrayList<Object>();
- }
- 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 registrationMethod property.
- *
- * @return
- * possible object is
- * {@link String }
- *
- */
- public String getRegistrationMethod() {
- return registrationMethod;
- }
-
- /**
- * Sets the value of the registrationMethod property.
- *
- * @param value
- * allowed object is
- * {@link String }
- *
- */
- public void setRegistrationMethod(String value) {
- this.registrationMethod = value;
- }
-
- /**
- * Gets the value of the unregistrationMethod property.
- *
- * @return
- * possible object is
- * {@link String }
- *
- */
- public String getUnregistrationMethod() {
- return unregistrationMethod;
- }
-
- /**
- * Sets the value of the unregistrationMethod property.
- *
- * @param value
- * allowed object is
- * {@link String }
- *
- */
- public void setUnregistrationMethod(String value) {
- this.unregistrationMethod = value;
- }
-
-}
Modified: projects/jboss-osgi/trunk/blueprint/impl/src/main/resources/schema/blueprint-jbxb.xsd
===================================================================
--- projects/jboss-osgi/trunk/blueprint/impl/src/main/resources/schema/blueprint-jbxb.xsd 2009-06-16 20:06:19 UTC (rev 90270)
+++ projects/jboss-osgi/trunk/blueprint/impl/src/main/resources/schema/blueprint-jbxb.xsd 2009-06-16 20:27:34 UTC (rev 90271)
@@ -439,6 +439,9 @@
<!-- ref-set, ref-list -->
<xsd:complexType name="Tref-collection">
<xsd:annotation>
+ <xsd:appinfo>
+ <jbxb:class impl="org.jboss.osgi.blueprint.reflect.RefCollectionImpl"></jbxb:class>
+ </xsd:appinfo>
<xsd:documentation>
<![CDATA[
The Tref-collection builds in the characteristics of the
@@ -664,6 +667,11 @@
</xsd:simpleType>
<xsd:complexType name="Tcomparator">
+ <xsd:annotation>
+ <xsd:appinfo>
+ <jbxb:class impl="org.jboss.osgi.blueprint.reflect.ComparatorImpl"></jbxb:class>
+ </xsd:appinfo>
+ </xsd:annotation>
<xsd:group ref="targetComponent" />
</xsd:complexType>
@@ -768,6 +776,9 @@
<xsd:element name="registration-listener" type="TregistrationListener"
minOccurs="0" maxOccurs="unbounded">
<xsd:annotation>
+ <xsd:appinfo>
+ <jbxb:property name="registrationListeners"/>
+ </xsd:appinfo>
<xsd:documentation>
<![CDATA[
A set of 0 or more registration listeners attached to this service
@@ -796,6 +807,9 @@
<xsd:complexType name="TregistrationListener">
<xsd:annotation>
+ <xsd:appinfo>
+ <jbxb:class impl="org.jboss.osgi.blueprint.reflect.RegistrationListenerImpl"></jbxb:class>
+ </xsd:appinfo>
<xsd:documentation>
<![CDATA[
A registration listener definition. The target registration listener
@@ -1033,6 +1047,9 @@
<!-- 'entry' element type -->
<xsd:complexType name="TservicePropertyEntry">
<xsd:annotation>
+ <xsd:appinfo>
+ <jbxb:class impl="org.jboss.osgi.blueprint.reflect.ServicePropertyEntry"></jbxb:class>
+ </xsd:appinfo>
<xsd:documentation>
<![CDATA[
TservicePropertyEntry is an entry value used for the <service-properties>
Modified: projects/jboss-osgi/trunk/blueprint/testsuite/src/test/java/org/jboss/test/osgi/blueprint/parser/BasicBeansParserTestCase.java
===================================================================
--- projects/jboss-osgi/trunk/blueprint/testsuite/src/test/java/org/jboss/test/osgi/blueprint/parser/BasicBeansParserTestCase.java 2009-06-16 20:06:19 UTC (rev 90270)
+++ projects/jboss-osgi/trunk/blueprint/testsuite/src/test/java/org/jboss/test/osgi/blueprint/parser/BasicBeansParserTestCase.java 2009-06-16 20:27:34 UTC (rev 90271)
@@ -31,12 +31,12 @@
import org.jboss.osgi.blueprint.parser.BlueprintParser;
import org.jboss.osgi.blueprint.reflect.BlueprintImpl;
-import org.jboss.osgi.blueprint.reflect.ComponentMetadataImpl;
import org.jboss.osgi.spi.testing.OSGiTest;
import org.jboss.test.osgi.blueprint.parser.comp.BeanA;
import org.jboss.test.osgi.blueprint.parser.comp.BeanB;
import org.junit.Test;
import org.osgi.service.blueprint.reflect.BeanMetadata;
+import org.osgi.service.blueprint.reflect.ComponentMetadata;
/**
* Blueprint parser tests
@@ -52,7 +52,7 @@
URL xmlURL = getResourceURL("parser/blueprint-basic-beans.xml");
BlueprintImpl blueprint = new BlueprintParser().parse(xmlURL);
- List<ComponentMetadataImpl> compList = blueprint.getComponents();
+ List<ComponentMetadata> compList = blueprint.getComponents();
assertTrue(compList.size() > 0);
BeanMetadata beanA = (BeanMetadata)compList.get(0);
Modified: projects/jboss-osgi/trunk/blueprint/testsuite/src/test/java/org/jboss/test/osgi/blueprint/parser/BasicServiceParserTestCase.java
===================================================================
--- projects/jboss-osgi/trunk/blueprint/testsuite/src/test/java/org/jboss/test/osgi/blueprint/parser/BasicServiceParserTestCase.java 2009-06-16 20:06:19 UTC (rev 90270)
+++ projects/jboss-osgi/trunk/blueprint/testsuite/src/test/java/org/jboss/test/osgi/blueprint/parser/BasicServiceParserTestCase.java 2009-06-16 20:27:34 UTC (rev 90271)
@@ -31,13 +31,13 @@
import org.jboss.osgi.blueprint.parser.BlueprintParser;
import org.jboss.osgi.blueprint.reflect.BlueprintImpl;
-import org.jboss.osgi.blueprint.reflect.ComponentMetadataImpl;
import org.jboss.osgi.spi.testing.OSGiTest;
import org.jboss.test.osgi.blueprint.parser.comp.BeanA;
import org.jboss.test.osgi.blueprint.parser.comp.ServiceA;
import org.jboss.test.osgi.blueprint.parser.comp.ServiceB;
import org.junit.Test;
import org.osgi.service.blueprint.reflect.BeanMetadata;
+import org.osgi.service.blueprint.reflect.ComponentMetadata;
import org.osgi.service.blueprint.reflect.ServiceMetadata;
/**
@@ -54,7 +54,7 @@
URL xmlURL = getResourceURL("parser/blueprint-basic-service.xml");
BlueprintImpl blueprint = new BlueprintParser().parse(xmlURL);
- List<ComponentMetadataImpl> compList = blueprint.getComponents();
+ List<ComponentMetadata> compList = blueprint.getComponents();
assertTrue(compList.size() > 0);
BeanMetadata beanA = (BeanMetadata)compList.get(0);
Modified: projects/jboss-osgi/trunk/blueprint/testsuite/src/test/resources/parser/blueprint-all-elements.xml
===================================================================
--- projects/jboss-osgi/trunk/blueprint/testsuite/src/test/resources/parser/blueprint-all-elements.xml 2009-06-16 20:06:19 UTC (rev 90270)
+++ projects/jboss-osgi/trunk/blueprint/testsuite/src/test/resources/parser/blueprint-all-elements.xml 2009-06-16 20:27:34 UTC (rev 90271)
@@ -4,6 +4,7 @@
default-availability="mandatory" default-destroy-method="defaultDestroyMethod" default-init-method="defaultInitMethod" default-lazy-init="false" default-timeout="300000">
+ <!--
<description>
Some Blueprint Description
</description>
@@ -42,6 +43,7 @@
</service>
<service id="idServiceB" ref="serviceRef" />
+ -->
<ref-set id="myServices" interface="com.xyz.MyService" member-type="service-instance" ordering-basis="service" comparator-ref="someComparator" />
15 years
JBoss-OSGI SVN: r90263 - in projects/jboss-osgi/trunk/blueprint: impl/src/main/resources/schema and 3 other directories.
by jboss-osgi-commits@lists.jboss.org
Author: thomas.diesler(a)jboss.com
Date: 2009-06-16 15:06:26 -0400 (Tue, 16 Jun 2009)
New Revision: 90263
Added:
projects/jboss-osgi/trunk/blueprint/testsuite/src/test/java/org/jboss/test/osgi/blueprint/parser/AllElementsParserTestCase.java
projects/jboss-osgi/trunk/blueprint/testsuite/src/test/java/org/jboss/test/osgi/blueprint/parser/comp/
projects/jboss-osgi/trunk/blueprint/testsuite/src/test/java/org/jboss/test/osgi/blueprint/parser/comp/BeanA.java
projects/jboss-osgi/trunk/blueprint/testsuite/src/test/java/org/jboss/test/osgi/blueprint/parser/comp/BeanB.java
projects/jboss-osgi/trunk/blueprint/testsuite/src/test/java/org/jboss/test/osgi/blueprint/parser/comp/ServiceA.java
projects/jboss-osgi/trunk/blueprint/testsuite/src/test/java/org/jboss/test/osgi/blueprint/parser/comp/ServiceB.java
projects/jboss-osgi/trunk/blueprint/testsuite/src/test/resources/parser/blueprint-all-elements.xml
Removed:
projects/jboss-osgi/trunk/blueprint/testsuite/src/test/java/org/jboss/test/osgi/blueprint/parser/BeanA.java
projects/jboss-osgi/trunk/blueprint/testsuite/src/test/java/org/jboss/test/osgi/blueprint/parser/BeanB.java
projects/jboss-osgi/trunk/blueprint/testsuite/src/test/java/org/jboss/test/osgi/blueprint/parser/ServiceA.java
projects/jboss-osgi/trunk/blueprint/testsuite/src/test/java/org/jboss/test/osgi/blueprint/parser/ServiceB.java
Modified:
projects/jboss-osgi/trunk/blueprint/impl/pom.xml
projects/jboss-osgi/trunk/blueprint/impl/src/main/resources/schema/blueprint-jbxb.xsd
projects/jboss-osgi/trunk/blueprint/impl/src/main/resources/schema/blueprint.xsd
projects/jboss-osgi/trunk/blueprint/testsuite/src/test/java/org/jboss/test/osgi/blueprint/parser/BasicBeansParserTestCase.java
projects/jboss-osgi/trunk/blueprint/testsuite/src/test/java/org/jboss/test/osgi/blueprint/parser/BasicServiceParserTestCase.java
projects/jboss-osgi/trunk/blueprint/testsuite/src/test/resources/parser/blueprint-basic-beans.xml
projects/jboss-osgi/trunk/blueprint/testsuite/src/test/resources/parser/blueprint-basic-service.xml
Log:
Add more BP parser tests
Modified: projects/jboss-osgi/trunk/blueprint/impl/pom.xml
===================================================================
--- projects/jboss-osgi/trunk/blueprint/impl/pom.xml 2009-06-16 17:08:00 UTC (rev 90262)
+++ projects/jboss-osgi/trunk/blueprint/impl/pom.xml 2009-06-16 19:06:26 UTC (rev 90263)
@@ -90,6 +90,14 @@
<excludePackageNames>org.jboss.osgi.*</excludePackageNames>
</configuration>
</plugin>
+ <plugin>
+ <groupId>xsddoc</groupId>
+ <artifactId>maven-xsddoc-plugin</artifactId>
+ <configuration>
+ <maven.xsddoc.src>src/main/resources/schema</maven.xsddoc.src>
+ <maven.xsddoc.include>blueprint.xsd</maven.xsddoc.include>
+ </configuration>
+ </plugin>
</plugins>
</reporting>
Modified: projects/jboss-osgi/trunk/blueprint/impl/src/main/resources/schema/blueprint-jbxb.xsd
===================================================================
--- projects/jboss-osgi/trunk/blueprint/impl/src/main/resources/schema/blueprint-jbxb.xsd 2009-06-16 17:08:00 UTC (rev 90262)
+++ projects/jboss-osgi/trunk/blueprint/impl/src/main/resources/schema/blueprint-jbxb.xsd 2009-06-16 19:06:26 UTC (rev 90263)
@@ -218,7 +218,7 @@
</xsd:appinfo>
</xsd:annotation>
</xsd:element>
- <xsd:element name="refFIXME" type="Tref" />
+ <xsd:element name="ref" type="Tref" />
<xsd:any namespace="##other" processContents="strict" minOccurs="0" maxOccurs="unbounded" />
</xsd:choice>
</xsd:group>
@@ -373,7 +373,7 @@
<xsd:attribute name="index" type="xsd:nonNegativeInteger" />
<xsd:attribute name="type" type="Tclass" />
<xsd:attribute name="ref" type="Tidref" />
- <xsd:attribute name="valueFIXME" type="TstringValue" />
+ <xsd:attribute name="value" type="TstringValue" />
</xsd:complexType>
<xsd:complexType name="Tproperty">
@@ -397,7 +397,7 @@
</xsd:sequence>
<xsd:attribute name="name" type="Tmethod" use="required" />
<xsd:attribute name="ref" type="Tidref" />
- <xsd:attribute name="valueFIXME" type="TstringValue" />
+ <xsd:attribute name="value" type="TstringValue" />
</xsd:complexType>
<xsd:complexType name="Tkey">
@@ -788,7 +788,7 @@
</xsd:documentation>
</xsd:annotation>
<xsd:element name="bean" type="Tbean" />
- <xsd:element name="refFIXME" type="Tref" />
+ <xsd:element name="ref" type="Tref" />
</xsd:choice>
</xsd:sequence>
</xsd:group>
@@ -1002,12 +1002,12 @@
</xsd:documentation>
</xsd:annotation>
<xsd:sequence>
- <xsd:element name="keyFIXME" type="Tkey" minOccurs="0" />
+ <xsd:element name="key" type="Tkey" minOccurs="0" />
<xsd:group ref="value" />
</xsd:sequence>
<xsd:attribute name="key" type="TstringValue" />
<xsd:attribute name="key-ref" type="Tidref" />
- <xsd:attribute name="valueFIXME" type="TstringValue" />
+ <xsd:attribute name="value" type="TstringValue" />
<xsd:attribute name="value-ref" type="Tidref" />
</xsd:complexType>
@@ -1045,7 +1045,7 @@
<xsd:group ref="value" />
</xsd:sequence>
<xsd:attribute name="key" type="TstringValue" use="required" />
- <xsd:attribute name="valueFIXME" type="TstringValue" use="optional" />
+ <xsd:attribute name="value" type="TstringValue" use="optional" />
</xsd:complexType>
<!-- General types -->
Modified: projects/jboss-osgi/trunk/blueprint/impl/src/main/resources/schema/blueprint.xsd
===================================================================
--- projects/jboss-osgi/trunk/blueprint/impl/src/main/resources/schema/blueprint.xsd 2009-06-16 17:08:00 UTC (rev 90262)
+++ projects/jboss-osgi/trunk/blueprint/impl/src/main/resources/schema/blueprint.xsd 2009-06-16 19:06:26 UTC (rev 90263)
@@ -200,7 +200,7 @@
<xsd:choice>
<xsd:element name="bean" type="Tbean" />
<xsd:element name="reference" type="Treference" />
- <xsd:element name="refFIXME" type="Tref" />
+ <xsd:element name="ref" type="Tref" />
<xsd:any namespace="##other" processContents="strict" minOccurs="0" maxOccurs="unbounded" />
</xsd:choice>
</xsd:group>
@@ -322,7 +322,7 @@
<xsd:attribute name="index" type="xsd:nonNegativeInteger" />
<xsd:attribute name="type" type="Tclass" />
<xsd:attribute name="ref" type="Tidref" />
- <xsd:attribute name="valueFIXME" type="TstringValue" />
+ <xsd:attribute name="value" type="TstringValue" />
</xsd:complexType>
<xsd:complexType name="Tproperty">
@@ -346,7 +346,7 @@
</xsd:sequence>
<xsd:attribute name="name" type="Tmethod" use="required" />
<xsd:attribute name="ref" type="Tidref" />
- <xsd:attribute name="valueFIXME" type="TstringValue" />
+ <xsd:attribute name="value" type="TstringValue" />
</xsd:complexType>
<xsd:complexType name="Tkey">
@@ -715,7 +715,7 @@
</xsd:documentation>
</xsd:annotation>
<xsd:element name="bean" type="Tbean" />
- <xsd:element name="refFIXME" type="Tref" />
+ <xsd:element name="ref" type="Tref" />
</xsd:choice>
</xsd:sequence>
</xsd:group>
@@ -929,12 +929,12 @@
</xsd:documentation>
</xsd:annotation>
<xsd:sequence>
- <xsd:element name="keyFIXME" type="Tkey" minOccurs="0" />
+ <xsd:element name="key" type="Tkey" minOccurs="0" />
<xsd:group ref="value" />
</xsd:sequence>
<xsd:attribute name="key" type="TstringValue" />
<xsd:attribute name="key-ref" type="Tidref" />
- <xsd:attribute name="valueFIXME" type="TstringValue" />
+ <xsd:attribute name="value" type="TstringValue" />
<xsd:attribute name="value-ref" type="Tidref" />
</xsd:complexType>
@@ -972,7 +972,7 @@
<xsd:group ref="value" />
</xsd:sequence>
<xsd:attribute name="key" type="TstringValue" use="required" />
- <xsd:attribute name="valueFIXME" type="TstringValue" use="optional" />
+ <xsd:attribute name="value" type="TstringValue" use="optional" />
</xsd:complexType>
<!-- General types -->
Added: projects/jboss-osgi/trunk/blueprint/testsuite/src/test/java/org/jboss/test/osgi/blueprint/parser/AllElementsParserTestCase.java
===================================================================
--- projects/jboss-osgi/trunk/blueprint/testsuite/src/test/java/org/jboss/test/osgi/blueprint/parser/AllElementsParserTestCase.java (rev 0)
+++ projects/jboss-osgi/trunk/blueprint/testsuite/src/test/java/org/jboss/test/osgi/blueprint/parser/AllElementsParserTestCase.java 2009-06-16 19:06:26 UTC (rev 90263)
@@ -0,0 +1,59 @@
+/*
+ * 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.blueprint.parser;
+
+//$Id$
+
+import java.net.URL;
+
+import org.jboss.osgi.blueprint.parser.BlueprintParser;
+import org.jboss.osgi.blueprint.reflect.BlueprintImpl;
+import org.jboss.osgi.blueprint.reflect.TtypeConverters;
+import org.jboss.osgi.spi.testing.OSGiTestHelper;
+import org.junit.BeforeClass;
+import org.junit.Ignore;
+import org.junit.Test;
+
+/**
+ * Blueprint parser tests
+ *
+ * @author thomas.diesler(a)jboss.com
+ * @since 13-May-2009
+ */
+public class AllElementsParserTestCase
+{
+ private static BlueprintImpl blueprint;
+
+ @BeforeClass
+ public static void beforeClass()
+ {
+ URL xmlURL = new OSGiTestHelper().getResourceURL("parser/blueprint-all-elements.xml");
+ //blueprint = new BlueprintParser().parse(xmlURL);
+ }
+
+ @Test
+ @Ignore
+ public void getTypeConverters() throws Exception
+ {
+ TtypeConverters typeConverters = blueprint.getTypeConverters();
+ }
+}
\ No newline at end of file
Property changes on: projects/jboss-osgi/trunk/blueprint/testsuite/src/test/java/org/jboss/test/osgi/blueprint/parser/AllElementsParserTestCase.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Modified: projects/jboss-osgi/trunk/blueprint/testsuite/src/test/java/org/jboss/test/osgi/blueprint/parser/BasicBeansParserTestCase.java
===================================================================
--- projects/jboss-osgi/trunk/blueprint/testsuite/src/test/java/org/jboss/test/osgi/blueprint/parser/BasicBeansParserTestCase.java 2009-06-16 17:08:00 UTC (rev 90262)
+++ projects/jboss-osgi/trunk/blueprint/testsuite/src/test/java/org/jboss/test/osgi/blueprint/parser/BasicBeansParserTestCase.java 2009-06-16 19:06:26 UTC (rev 90263)
@@ -33,6 +33,8 @@
import org.jboss.osgi.blueprint.reflect.BlueprintImpl;
import org.jboss.osgi.blueprint.reflect.ComponentMetadataImpl;
import org.jboss.osgi.spi.testing.OSGiTest;
+import org.jboss.test.osgi.blueprint.parser.comp.BeanA;
+import org.jboss.test.osgi.blueprint.parser.comp.BeanB;
import org.junit.Test;
import org.osgi.service.blueprint.reflect.BeanMetadata;
Modified: projects/jboss-osgi/trunk/blueprint/testsuite/src/test/java/org/jboss/test/osgi/blueprint/parser/BasicServiceParserTestCase.java
===================================================================
--- projects/jboss-osgi/trunk/blueprint/testsuite/src/test/java/org/jboss/test/osgi/blueprint/parser/BasicServiceParserTestCase.java 2009-06-16 17:08:00 UTC (rev 90262)
+++ projects/jboss-osgi/trunk/blueprint/testsuite/src/test/java/org/jboss/test/osgi/blueprint/parser/BasicServiceParserTestCase.java 2009-06-16 19:06:26 UTC (rev 90263)
@@ -33,6 +33,9 @@
import org.jboss.osgi.blueprint.reflect.BlueprintImpl;
import org.jboss.osgi.blueprint.reflect.ComponentMetadataImpl;
import org.jboss.osgi.spi.testing.OSGiTest;
+import org.jboss.test.osgi.blueprint.parser.comp.BeanA;
+import org.jboss.test.osgi.blueprint.parser.comp.ServiceA;
+import org.jboss.test.osgi.blueprint.parser.comp.ServiceB;
import org.junit.Test;
import org.osgi.service.blueprint.reflect.BeanMetadata;
import org.osgi.service.blueprint.reflect.ServiceMetadata;
Deleted: projects/jboss-osgi/trunk/blueprint/testsuite/src/test/java/org/jboss/test/osgi/blueprint/parser/BeanA.java
===================================================================
--- projects/jboss-osgi/trunk/blueprint/testsuite/src/test/java/org/jboss/test/osgi/blueprint/parser/BeanA.java 2009-06-16 17:08:00 UTC (rev 90262)
+++ projects/jboss-osgi/trunk/blueprint/testsuite/src/test/java/org/jboss/test/osgi/blueprint/parser/BeanA.java 2009-06-16 19:06:26 UTC (rev 90263)
@@ -1,45 +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.blueprint.parser;
-
-//$Id$
-
-/**
- * A basic bean
- *
- * @author thomas.diesler(a)jboss.com
- * @since 13-May-2009
- */
-public class BeanA
-{
- private BeanB beanB;
-
- public BeanB getBeanB()
- {
- return beanB;
- }
-
- public void setBeanB(BeanB beanB)
- {
- this.beanB = beanB;
- }
-}
\ No newline at end of file
Deleted: projects/jboss-osgi/trunk/blueprint/testsuite/src/test/java/org/jboss/test/osgi/blueprint/parser/BeanB.java
===================================================================
--- projects/jboss-osgi/trunk/blueprint/testsuite/src/test/java/org/jboss/test/osgi/blueprint/parser/BeanB.java 2009-06-16 17:08:00 UTC (rev 90262)
+++ projects/jboss-osgi/trunk/blueprint/testsuite/src/test/java/org/jboss/test/osgi/blueprint/parser/BeanB.java 2009-06-16 19:06:26 UTC (rev 90263)
@@ -1,45 +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.blueprint.parser;
-
-//$Id$
-
-/**
- * A basic bean
- *
- * @author thomas.diesler(a)jboss.com
- * @since 13-May-2009
- */
-public class BeanB
-{
- private BeanA beanA;
-
- public BeanA getBeanA()
- {
- return beanA;
- }
-
- public void setBeanA(BeanA beanA)
- {
- this.beanA = beanA;
- }
-}
\ No newline at end of file
Deleted: projects/jboss-osgi/trunk/blueprint/testsuite/src/test/java/org/jboss/test/osgi/blueprint/parser/ServiceA.java
===================================================================
--- projects/jboss-osgi/trunk/blueprint/testsuite/src/test/java/org/jboss/test/osgi/blueprint/parser/ServiceA.java 2009-06-16 17:08:00 UTC (rev 90262)
+++ projects/jboss-osgi/trunk/blueprint/testsuite/src/test/java/org/jboss/test/osgi/blueprint/parser/ServiceA.java 2009-06-16 19:06:26 UTC (rev 90263)
@@ -1,34 +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.blueprint.parser;
-
-//$Id$
-
-/**
- * A basic service
- *
- * @author thomas.diesler(a)jboss.com
- * @since 13-May-2009
- */
-public interface ServiceA
-{
-}
\ No newline at end of file
Deleted: projects/jboss-osgi/trunk/blueprint/testsuite/src/test/java/org/jboss/test/osgi/blueprint/parser/ServiceB.java
===================================================================
--- projects/jboss-osgi/trunk/blueprint/testsuite/src/test/java/org/jboss/test/osgi/blueprint/parser/ServiceB.java 2009-06-16 17:08:00 UTC (rev 90262)
+++ projects/jboss-osgi/trunk/blueprint/testsuite/src/test/java/org/jboss/test/osgi/blueprint/parser/ServiceB.java 2009-06-16 19:06:26 UTC (rev 90263)
@@ -1,34 +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.blueprint.parser;
-
-//$Id$
-
-/**
- * A basic service
- *
- * @author thomas.diesler(a)jboss.com
- * @since 13-May-2009
- */
-public interface ServiceB
-{
-}
\ No newline at end of file
Copied: projects/jboss-osgi/trunk/blueprint/testsuite/src/test/java/org/jboss/test/osgi/blueprint/parser/comp/BeanA.java (from rev 90249, projects/jboss-osgi/trunk/blueprint/testsuite/src/test/java/org/jboss/test/osgi/blueprint/parser/BeanA.java)
===================================================================
--- projects/jboss-osgi/trunk/blueprint/testsuite/src/test/java/org/jboss/test/osgi/blueprint/parser/comp/BeanA.java (rev 0)
+++ projects/jboss-osgi/trunk/blueprint/testsuite/src/test/java/org/jboss/test/osgi/blueprint/parser/comp/BeanA.java 2009-06-16 19:06:26 UTC (rev 90263)
@@ -0,0 +1,46 @@
+/*
+ * 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.blueprint.parser.comp;
+
+
+//$Id$
+
+/**
+ * A basic bean
+ *
+ * @author thomas.diesler(a)jboss.com
+ * @since 13-May-2009
+ */
+public class BeanA
+{
+ private BeanB beanB;
+
+ public BeanB getBeanB()
+ {
+ return beanB;
+ }
+
+ public void setBeanB(BeanB beanB)
+ {
+ this.beanB = beanB;
+ }
+}
\ No newline at end of file
Copied: projects/jboss-osgi/trunk/blueprint/testsuite/src/test/java/org/jboss/test/osgi/blueprint/parser/comp/BeanB.java (from rev 90249, projects/jboss-osgi/trunk/blueprint/testsuite/src/test/java/org/jboss/test/osgi/blueprint/parser/BeanB.java)
===================================================================
--- projects/jboss-osgi/trunk/blueprint/testsuite/src/test/java/org/jboss/test/osgi/blueprint/parser/comp/BeanB.java (rev 0)
+++ projects/jboss-osgi/trunk/blueprint/testsuite/src/test/java/org/jboss/test/osgi/blueprint/parser/comp/BeanB.java 2009-06-16 19:06:26 UTC (rev 90263)
@@ -0,0 +1,46 @@
+/*
+ * 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.blueprint.parser.comp;
+
+
+//$Id$
+
+/**
+ * A basic bean
+ *
+ * @author thomas.diesler(a)jboss.com
+ * @since 13-May-2009
+ */
+public class BeanB
+{
+ private BeanA beanA;
+
+ public BeanA getBeanA()
+ {
+ return beanA;
+ }
+
+ public void setBeanA(BeanA beanA)
+ {
+ this.beanA = beanA;
+ }
+}
\ No newline at end of file
Copied: projects/jboss-osgi/trunk/blueprint/testsuite/src/test/java/org/jboss/test/osgi/blueprint/parser/comp/ServiceA.java (from rev 90249, projects/jboss-osgi/trunk/blueprint/testsuite/src/test/java/org/jboss/test/osgi/blueprint/parser/ServiceA.java)
===================================================================
--- projects/jboss-osgi/trunk/blueprint/testsuite/src/test/java/org/jboss/test/osgi/blueprint/parser/comp/ServiceA.java (rev 0)
+++ projects/jboss-osgi/trunk/blueprint/testsuite/src/test/java/org/jboss/test/osgi/blueprint/parser/comp/ServiceA.java 2009-06-16 19:06:26 UTC (rev 90263)
@@ -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.test.osgi.blueprint.parser.comp;
+
+//$Id$
+
+/**
+ * A basic service
+ *
+ * @author thomas.diesler(a)jboss.com
+ * @since 13-May-2009
+ */
+public interface ServiceA
+{
+}
\ No newline at end of file
Copied: projects/jboss-osgi/trunk/blueprint/testsuite/src/test/java/org/jboss/test/osgi/blueprint/parser/comp/ServiceB.java (from rev 90249, projects/jboss-osgi/trunk/blueprint/testsuite/src/test/java/org/jboss/test/osgi/blueprint/parser/ServiceB.java)
===================================================================
--- projects/jboss-osgi/trunk/blueprint/testsuite/src/test/java/org/jboss/test/osgi/blueprint/parser/comp/ServiceB.java (rev 0)
+++ projects/jboss-osgi/trunk/blueprint/testsuite/src/test/java/org/jboss/test/osgi/blueprint/parser/comp/ServiceB.java 2009-06-16 19:06:26 UTC (rev 90263)
@@ -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.test.osgi.blueprint.parser.comp;
+
+//$Id$
+
+/**
+ * A basic service
+ *
+ * @author thomas.diesler(a)jboss.com
+ * @since 13-May-2009
+ */
+public interface ServiceB
+{
+}
\ No newline at end of file
Added: projects/jboss-osgi/trunk/blueprint/testsuite/src/test/resources/parser/blueprint-all-elements.xml
===================================================================
--- projects/jboss-osgi/trunk/blueprint/testsuite/src/test/resources/parser/blueprint-all-elements.xml (rev 0)
+++ projects/jboss-osgi/trunk/blueprint/testsuite/src/test/resources/parser/blueprint-all-elements.xml 2009-06-16 19:06:26 UTC (rev 90263)
@@ -0,0 +1,73 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<blueprint xmlns="http://www.osgi.org/xmlns/blueprint/v1.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.osgi.org/xmlns/blueprint/v1.0.0 blueprint.xsd "
+
+ default-availability="mandatory" default-destroy-method="defaultDestroyMethod" default-init-method="defaultInitMethod" default-lazy-init="false" default-timeout="300000">
+
+ <description>
+ Some Blueprint Description
+ </description>
+
+ <type-converters>
+ <bean class="foo.TypeConverterBean" />
+ <reference component-name="typeConverterReferenceA" />
+ <reference component-name="typeConverterReferenceB" />
+ <ref component="typeConverterRefA" />
+ <ref component="typeConverterRefB" />
+ </type-converters>
+
+ <service id="idServiceA" auto-export="disabled" depends-on="someServiceDependency" interface="foo.ServiceInterface" ranking="0" ref="NCName">
+
+ <description>
+ service description
+ </description>
+
+ <interfaces>
+ <value>foo.ServiceInterfA</value>
+ <value>foo.ServiceInterfB</value>
+ </interfaces>
+
+ <service-properties>
+ <entry key="keyA" value="valueA" />
+ <entry key="keyB" value="valueB" />
+ </service-properties>
+
+ <registration-listener registration-method="regMethod" unregistration-method="unregMethod">
+ <bean class="foo.RegistrationListenerBean" />
+ </registration-listener>
+
+ <registration-listener ref="regListenerRef" />
+
+ <bean class="foo.ServiceBean" />
+ </service>
+
+ <service id="idServiceB" ref="serviceRef" />
+
+ <ref-set id="myServices" interface="com.xyz.MyService" member-type="service-instance" ordering-basis="service" comparator-ref="someComparator" />
+
+ <ref-list id="myEventListeners" interface="com.xyz.EventListener" />
+ <ref-list id="myOtherServices" interface="com.xyz.OtherService" ordering-basis="service-reference">
+ <comparator>
+ <bean class="MyOtherServiceComparator" />
+ </comparator>
+ </ref-list>
+
+ <bean id="beanA" class="foo.Bean" depends-on="beanDependency" init-method="initMethod" destroy-method="destroyMethod" factory-method="factoryMethod"
+ factory-component="factoryComponent" scope="singleton" lazy-init="lazy" />
+
+ <reference component-name="referenceCompName" interface="foo.referenceInterf" filter="referenceFilter" availablitity="optional">
+ <description>
+ reference description
+ </description>
+ <interfaces>
+ <value>foo.ReferenceInterfA</value>
+ <value>foo.ReferenceInterfB</value>
+ </interfaces>
+ <listener ref="referenceListenerA" bind-method="bindMethod" unbind-method="unbindMethod" />
+ <listener ref="referenceListenerB" />
+ </reference>
+
+ <ref component="refCompA" />
+ <ref component="refCompB" />
+
+</blueprint>
Property changes on: projects/jboss-osgi/trunk/blueprint/testsuite/src/test/resources/parser/blueprint-all-elements.xml
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Modified: projects/jboss-osgi/trunk/blueprint/testsuite/src/test/resources/parser/blueprint-basic-beans.xml
===================================================================
--- projects/jboss-osgi/trunk/blueprint/testsuite/src/test/resources/parser/blueprint-basic-beans.xml 2009-06-16 17:08:00 UTC (rev 90262)
+++ projects/jboss-osgi/trunk/blueprint/testsuite/src/test/resources/parser/blueprint-basic-beans.xml 2009-06-16 19:06:26 UTC (rev 90263)
@@ -1,10 +1,10 @@
<blueprint xmlns="http://www.osgi.org/xmlns/blueprint/v1.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.osgi.org/xmlns/blueprint/v1.0.0/blueprint.xsd schema/blueprint.xsd">
- <bean id="beanA" class="org.jboss.test.osgi.blueprint.parser.BeanA">
+ <bean id="beanA" class="org.jboss.test.osgi.blueprint.parser.comp.BeanA">
</bean>
- <bean id="beanB" class="org.jboss.test.osgi.blueprint.parser.BeanB">
+ <bean id="beanB" class="org.jboss.test.osgi.blueprint.parser.comp.BeanB">
<property name="beanA" ref="beanA"/>
</bean>
Modified: projects/jboss-osgi/trunk/blueprint/testsuite/src/test/resources/parser/blueprint-basic-service.xml
===================================================================
--- projects/jboss-osgi/trunk/blueprint/testsuite/src/test/resources/parser/blueprint-basic-service.xml 2009-06-16 17:08:00 UTC (rev 90262)
+++ projects/jboss-osgi/trunk/blueprint/testsuite/src/test/resources/parser/blueprint-basic-service.xml 2009-06-16 19:06:26 UTC (rev 90263)
@@ -1,14 +1,14 @@
<blueprint xmlns="http://www.osgi.org/xmlns/blueprint/v1.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.osgi.org/xmlns/blueprint/v1.0.0/blueprint.xsd schema/blueprint.xsd">
- <bean id="beanA" class="org.jboss.test.osgi.blueprint.parser.BeanA">
+ <bean id="beanA" class="org.jboss.test.osgi.blueprint.parser.comp.BeanA">
</bean>
- <service id="serviceA" ref="beanA" interface="org.jboss.test.osgi.blueprint.parser.ServiceA">
+ <service id="serviceA" ref="beanA" interface="org.jboss.test.osgi.blueprint.parser.comp.ServiceA">
</service>
- <service id="serviceB" interface="org.jboss.test.osgi.blueprint.parser.ServiceB">
- <bean class="org.jboss.test.osgi.blueprint.parser.BeanB"/>
+ <service id="serviceB" interface="org.jboss.test.osgi.blueprint.parser.comp.ServiceB">
+ <bean class="org.jboss.test.osgi.blueprint.parser.comp.BeanB"/>
</service>
</blueprint>
\ No newline at end of file
15 years
JBoss-OSGI SVN: r90249 - in projects/jboss-osgi/trunk/blueprint: impl/src/main/java/org/jboss/osgi/blueprint/extender and 8 other directories.
by jboss-osgi-commits@lists.jboss.org
Author: thomas.diesler(a)jboss.com
Date: 2009-06-16 08:45:55 -0400 (Tue, 16 Jun 2009)
New Revision: 90249
Added:
projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/jboss/osgi/blueprint/reflect/BlueprintImpl.java
projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/jboss/osgi/blueprint/reflect/ReferenceMetadataImpl.java
projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/jboss/osgi/blueprint/reflect/ServiceReferenceMetadataImpl.java
Removed:
projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/jboss/osgi/blueprint/reflect/Blueprint.java
projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/jboss/osgi/blueprint/reflect/Treference.java
projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/jboss/osgi/blueprint/reflect/TserviceReference.java
Modified:
projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/jboss/osgi/blueprint/context/BlueprintContextImpl.java
projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/jboss/osgi/blueprint/extender/BlueprintExtender.java
projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/jboss/osgi/blueprint/parser/BlueprintParser.java
projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/jboss/osgi/blueprint/reflect/TReferenceListener.java
projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/jboss/osgi/blueprint/reflect/Targument.java
projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/jboss/osgi/blueprint/reflect/Tcollection.java
projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/jboss/osgi/blueprint/reflect/Tcomparator.java
projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/jboss/osgi/blueprint/reflect/Tkey.java
projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/jboss/osgi/blueprint/reflect/TmapEntry.java
projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/jboss/osgi/blueprint/reflect/Tproperty.java
projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/jboss/osgi/blueprint/reflect/TrefCollection.java
projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/jboss/osgi/blueprint/reflect/TregistrationListener.java
projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/jboss/osgi/blueprint/reflect/TtypeConverters.java
projects/jboss-osgi/trunk/blueprint/impl/src/main/resources/schema/blueprint-jbxb.xsd
projects/jboss-osgi/trunk/blueprint/testsuite/src/test/java/org/jboss/test/osgi/blueprint/context/BlueprintContextTestCase.java
projects/jboss-osgi/trunk/blueprint/testsuite/src/test/java/org/jboss/test/osgi/blueprint/context/bundle/BeanA.java
projects/jboss-osgi/trunk/blueprint/testsuite/src/test/java/org/jboss/test/osgi/blueprint/parser/BasicBeansParserTestCase.java
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/BasicServiceParserTestCase.java
projects/jboss-osgi/trunk/blueprint/testsuite/src/test/resources/context/OSGI-INF/blueprint/basic-service.xml
projects/jboss-osgi/trunk/blueprint/testsuite/src/test/resources/context/context-basic.bnd
Log:
[JBOSGI-103] - Add support for BlueprintContext API
Modified: projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/jboss/osgi/blueprint/context/BlueprintContextImpl.java
===================================================================
--- projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/jboss/osgi/blueprint/context/BlueprintContextImpl.java 2009-06-16 12:14:36 UTC (rev 90248)
+++ projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/jboss/osgi/blueprint/context/BlueprintContextImpl.java 2009-06-16 12:45:55 UTC (rev 90249)
@@ -30,7 +30,7 @@
import java.util.List;
import java.util.Set;
-import org.jboss.osgi.blueprint.reflect.Blueprint;
+import org.jboss.osgi.blueprint.reflect.BlueprintImpl;
import org.jboss.osgi.spi.NotImplementedException;
import org.osgi.framework.Bundle;
import org.osgi.framework.BundleContext;
@@ -53,9 +53,9 @@
public class BlueprintContextImpl implements BlueprintContext
{
private Bundle bundle;
- private Blueprint bpMetadata;
+ private BlueprintImpl bpMetadata;
- public BlueprintContextImpl(Bundle bundle, Blueprint bpMetadata)
+ public BlueprintContextImpl(Bundle bundle, BlueprintImpl bpMetadata)
{
this.bundle = bundle;
this.bpMetadata = bpMetadata;
@@ -122,6 +122,12 @@
public Collection<ServiceReferenceMetadata> getReferencedServicesMetadata()
{
- throw new NotImplementedException();
+ List<ServiceReferenceMetadata> srefMetadata = new ArrayList<ServiceReferenceMetadata>();
+ for (ComponentMetadata comp : bpMetadata.getComponents())
+ {
+ if (comp instanceof ServiceReferenceMetadata)
+ srefMetadata.add((ServiceReferenceMetadata)comp);
+ }
+ return Collections.unmodifiableList(srefMetadata);
}
}
\ No newline at end of file
Modified: projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/jboss/osgi/blueprint/extender/BlueprintExtender.java
===================================================================
--- projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/jboss/osgi/blueprint/extender/BlueprintExtender.java 2009-06-16 12:14:36 UTC (rev 90248)
+++ projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/jboss/osgi/blueprint/extender/BlueprintExtender.java 2009-06-16 12:45:55 UTC (rev 90249)
@@ -28,7 +28,7 @@
import org.jboss.osgi.blueprint.context.BlueprintContextImpl;
import org.jboss.osgi.blueprint.parser.BlueprintParser;
-import org.jboss.osgi.blueprint.reflect.Blueprint;
+import org.jboss.osgi.blueprint.reflect.BlueprintImpl;
import org.jboss.osgi.common.log.LogServiceTracker;
import org.osgi.framework.Bundle;
import org.osgi.framework.BundleContext;
@@ -61,7 +61,7 @@
{
Bundle bundle = event.getBundle();
- Blueprint bpMetadata = null;
+ BlueprintImpl bpMetadata = null;
if (event.getType() == BundleEvent.STARTING)
{
@@ -78,7 +78,7 @@
for (String descriptor : descritors)
{
- Blueprint aux = processDescriptor(bundle, descriptor);
+ BlueprintImpl aux = processDescriptor(bundle, descriptor);
bpMetadata = aux.merge(bpMetadata);
}
}
@@ -89,7 +89,7 @@
while (foundEntries.hasMoreElements())
{
URL nextEntry = (URL)foundEntries.nextElement();
- Blueprint aux = processDescriptor(bundle, nextEntry);
+ BlueprintImpl aux = processDescriptor(bundle, nextEntry);
bpMetadata = aux.merge(bpMetadata);
}
}
@@ -111,15 +111,15 @@
// currently does nothing
}
- private Blueprint processDescriptor(Bundle bundle, String descriptor)
+ private BlueprintImpl processDescriptor(Bundle bundle, String descriptor)
{
URL descriptorURL = bundle.getResource(descriptor);
return processDescriptor(bundle, descriptorURL);
}
- private Blueprint processDescriptor(Bundle bundle, URL descriptorURL)
+ private BlueprintImpl processDescriptor(Bundle bundle, URL descriptorURL)
{
- Blueprint blueprint = new BlueprintParser().parse(descriptorURL);
+ BlueprintImpl blueprint = new BlueprintParser().parse(descriptorURL);
return blueprint;
}
}
\ No newline at end of file
Modified: projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/jboss/osgi/blueprint/parser/BlueprintParser.java
===================================================================
--- projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/jboss/osgi/blueprint/parser/BlueprintParser.java 2009-06-16 12:14:36 UTC (rev 90248)
+++ projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/jboss/osgi/blueprint/parser/BlueprintParser.java 2009-06-16 12:45:55 UTC (rev 90249)
@@ -27,7 +27,7 @@
import org.apache.xerces.dom.DOMXSImplementationSourceImpl;
import org.jboss.osgi.blueprint.BlueprintException;
-import org.jboss.osgi.blueprint.reflect.Blueprint;
+import org.jboss.osgi.blueprint.reflect.BlueprintImpl;
import org.jboss.xb.binding.JBossXBException;
import org.jboss.xb.binding.Unmarshaller;
import org.jboss.xb.binding.UnmarshallerFactory;
@@ -84,7 +84,7 @@
/*
* * Parse a blueprint descriptor
*/
- public Blueprint parse(URL xmlURL)
+ public BlueprintImpl parse(URL xmlURL)
{
if (xmlURL == null)
throw new IllegalArgumentException("Cannot parse null descriptor URL");
@@ -96,7 +96,7 @@
Thread.currentThread().setContextClassLoader(bundleCL);
Unmarshaller unmarshaller = UnmarshallerFactory.newInstance().newUnmarshaller();
- return (Blueprint)unmarshaller.unmarshal(xmlURL.toExternalForm(), schemaBinding);
+ return (BlueprintImpl)unmarshaller.unmarshal(xmlURL.toExternalForm(), schemaBinding);
}
catch (JBossXBException ex)
{
Deleted: projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/jboss/osgi/blueprint/reflect/Blueprint.java
===================================================================
--- projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/jboss/osgi/blueprint/reflect/Blueprint.java 2009-06-16 12:14:36 UTC (rev 90248)
+++ projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/jboss/osgi/blueprint/reflect/Blueprint.java 2009-06-16 12:45:55 UTC (rev 90249)
@@ -1,254 +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.blueprint.reflect;
-
-// $Id$
-
-import java.math.BigInteger;
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-
-import javax.xml.namespace.QName;
-
-import org.jboss.osgi.spi.NotImplementedException;
-
-/**
- * The blueprint element is the top element. 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>
- * type-converter ::= <bean> | <ref> *
- *
- * @author thomas.diesler(a)jboss.com
- * @since 13-May-2009
- */
-public class Blueprint
-{
- protected String description;
- protected TtypeConverters typeConverters;
- protected List<ComponentMetadataImpl> components;
- protected Boolean defaultLazyInit;
- protected String defaultInitMethod;
- protected String defaultDestroyMethod;
- protected BigInteger defaultTimeout;
- protected Availability 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
- */
- public List<ComponentMetadataImpl> getComponents()
- {
- if (components == null)
- {
- components = new ArrayList<ComponentMetadataImpl>();
- }
- return this.components;
- }
-
- /**
- * Gets the value of the defaultLazyInit property.
- *
- * @return possible object is {@link Boolean }
- *
- */
- 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)
- {
- return new BigInteger("300000");
- }
- else
- {
- 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 Availability getDefaultAvailability()
- {
- if (defaultAvailability == null)
- {
- return Availability.MANDATORY;
- }
- else
- {
- return defaultAvailability;
- }
- }
-
- /**
- * Sets the value of the defaultAvailability property.
- *
- * @param value allowed object is {@link Tavailability }
- *
- */
- public void setDefaultAvailability(Availability 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;
- }
-
- // Merge this Blueprint meta data with the given other, which may be null.
- public Blueprint merge(Blueprint other)
- {
- if (other == null)
- return this;
-
- throw new NotImplementedException("Blueprint metadata merge not yet implemented");
- }
-}
Copied: projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/jboss/osgi/blueprint/reflect/BlueprintImpl.java (from rev 90238, projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/jboss/osgi/blueprint/reflect/Blueprint.java)
===================================================================
--- projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/jboss/osgi/blueprint/reflect/BlueprintImpl.java (rev 0)
+++ projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/jboss/osgi/blueprint/reflect/BlueprintImpl.java 2009-06-16 12:45:55 UTC (rev 90249)
@@ -0,0 +1,254 @@
+/*
+ * 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.blueprint.reflect;
+
+// $Id$
+
+import java.math.BigInteger;
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+import javax.xml.namespace.QName;
+
+import org.jboss.osgi.spi.NotImplementedException;
+
+/**
+ * The blueprint element is the top element. 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>
+ * type-converter ::= <bean> | <ref> *
+ *
+ * @author thomas.diesler(a)jboss.com
+ * @since 13-May-2009
+ */
+public class BlueprintImpl
+{
+ protected String description;
+ protected TtypeConverters typeConverters;
+ protected List<ComponentMetadataImpl> components;
+ protected Boolean defaultLazyInit;
+ protected String defaultInitMethod;
+ protected String defaultDestroyMethod;
+ protected BigInteger defaultTimeout;
+ protected Availability 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
+ */
+ public List<ComponentMetadataImpl> getComponents()
+ {
+ if (components == null)
+ {
+ components = new ArrayList<ComponentMetadataImpl>();
+ }
+ return this.components;
+ }
+
+ /**
+ * Gets the value of the defaultLazyInit property.
+ *
+ * @return possible object is {@link Boolean }
+ *
+ */
+ 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)
+ {
+ return new BigInteger("300000");
+ }
+ else
+ {
+ 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 Availability getDefaultAvailability()
+ {
+ if (defaultAvailability == null)
+ {
+ return Availability.MANDATORY;
+ }
+ else
+ {
+ return defaultAvailability;
+ }
+ }
+
+ /**
+ * Sets the value of the defaultAvailability property.
+ *
+ * @param value allowed object is {@link Tavailability }
+ *
+ */
+ public void setDefaultAvailability(Availability 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;
+ }
+
+ // Merge this Blueprint meta data with the given other, which may be null.
+ public BlueprintImpl merge(BlueprintImpl other)
+ {
+ if (other == null)
+ return this;
+
+ throw new NotImplementedException("Blueprint metadata merge not yet implemented");
+ }
+}
Copied: projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/jboss/osgi/blueprint/reflect/ReferenceMetadataImpl.java (from rev 90238, projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/jboss/osgi/blueprint/reflect/Treference.java)
===================================================================
--- projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/jboss/osgi/blueprint/reflect/ReferenceMetadataImpl.java (rev 0)
+++ projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/jboss/osgi/blueprint/reflect/ReferenceMetadataImpl.java 2009-06-16 12:45:55 UTC (rev 90249)
@@ -0,0 +1,80 @@
+/*
+ * 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.blueprint.reflect;
+
+// $Id$
+
+import java.math.BigInteger;
+
+import org.osgi.service.blueprint.reflect.ReferenceMetadata;
+
+/**
+ *
+ *
+ * The Treference type defines the <reference> element. These
+ * are instances of the TserviceReference type, with the addition
+ * of a timeout attribute. If the timeout is not specified,
+ * the default-timeout value is inherited from the encapsulating
+ * <blueprint> definition.
+ *
+ *
+ *
+ * <p>Java class for Treference complex type.
+ *
+ * <p>The following schema fragment specifies the expected content contained within this class.
+ *
+ * <pre>
+ * <complexType name="Treference">
+ * <complexContent>
+ * <extension base="{http://www.osgi.org/xmlns/blueprint/v1.0.0}TserviceReference">
+ * <attribute name="timeout" type="{http://www.osgi.org/xmlns/blueprint/v1.0.0}Ttimeout" />
+ * <anyAttribute processContents='lax' namespace='##other'/>
+ * </extension>
+ * </complexContent>
+ * </complexType>
+ * </pre>
+ *
+ *
+ */
+public class ReferenceMetadataImpl extends ServiceReferenceMetadataImpl implements ReferenceMetadata
+{
+ protected BigInteger timeout;
+
+ /*
+ * Gets the value of the timeout property.
+ * @return possible object is {@link BigInteger }
+ */
+ public long getTimeout()
+ {
+ return timeout.longValue();
+ }
+
+ /*
+ * Sets the value of the timeout property.
+ * @param value allowed object is {@link BigInteger }
+ */
+ public void setTimeout(BigInteger value)
+ {
+ this.timeout = value;
+ }
+
+}
Copied: projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/jboss/osgi/blueprint/reflect/ServiceReferenceMetadataImpl.java (from rev 90238, projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/jboss/osgi/blueprint/reflect/TserviceReference.java)
===================================================================
--- projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/jboss/osgi/blueprint/reflect/ServiceReferenceMetadataImpl.java (rev 0)
+++ projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/jboss/osgi/blueprint/reflect/ServiceReferenceMetadataImpl.java 2009-06-16 12:45:55 UTC (rev 90249)
@@ -0,0 +1,263 @@
+/*
+ * 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.blueprint.reflect;
+
+// $Id$
+
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+import javax.xml.namespace.QName;
+
+import org.jboss.osgi.spi.NotImplementedException;
+import org.osgi.service.blueprint.reflect.Listener;
+import org.osgi.service.blueprint.reflect.ServiceReferenceMetadata;
+import org.w3c.dom.Element;
+
+/**
+ * TserviceReference is the base element type used for <reference>, <ref-set>, and <ref-list> elements. This type defines all of the characteristics common to both
+ * sorts of references.
+ *
+ * <p>
+ * Java class for TserviceReference complex type.
+ *
+ * <p>
+ * The following schema fragment specifies the expected content contained within this class.
+ *
+ * <pre>
+ * <complexType name="TserviceReference">
+ * <complexContent>
+ * <extension base="{http://www.osgi.org/xmlns/blueprint/v1.0.0}Tcomponent">
+ * <sequence>
+ * <element name="description" type="{http://www.osgi.org/xmlns/blueprint/v1.0.0}String" minOccurs="0"/>
+ * <element name="interfaces" type="{http://www.osgi.org/xmlns/blueprint/v1.0.0}Tinterfaces" minOccurs="0"/>
+ * <element name="listener" type="{http://www.osgi.org/xmlns/blueprint/v1.0.0}TReferenceListener... maxOccurs="unbounded" minOccurs="0"/>
+ * <any processContents='lax' namespace='##other' maxOccurs="unbounded" minOccurs="0"/>
+ * </sequence>
+ * <attribute name="interface" type="{http://www.osgi.org/xmlns/blueprint/v1.0.0}Tclass" />
+ * <attribute name="filter" type="{http://www.w3.org/2001/XMLSchema}normalizedString" />
+ * <attribute name="component-name" type="{http://www.osgi.org/xmlns/blueprint/v1.0.0}Tidref" />
+ * <attribute name="availability" type="{http://www.osgi.org/xmlns/blueprint/v1.0.0}Tavailability" />
+ * <anyAttribute processContents='lax' namespace='##other'/>
+ * </extension>
+ * </complexContent>
+ * </complexType>
+ * </pre>
+ *
+ *
+ */
+public class ServiceReferenceMetadataImpl extends ComponentMetadataImpl implements ServiceReferenceMetadata
+{
+ protected String description;
+ protected List<String> interfaces;
+ protected List<TReferenceListener> listener;
+ protected List<Object> any;
+ protected String filter;
+ protected String componentName;
+ protected Availability availability;
+ 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.
+ *
+ */
+ public List<String> getInterfaceNames()
+ {
+ if (interfaces == null)
+ interfaces = new ArrayList<String>();
+
+ return interfaces;
+ }
+
+ /**
+ * Gets the value of the listener 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 listener property.
+ *
+ * <p>
+ * For example, to add a new item, do as follows:
+ *
+ * <pre>
+ * getListener().add(newItem);
+ * </pre>
+ *
+ *
+ * <p>
+ * Objects of the following type(s) are allowed in the list {@link TReferenceListener }
+ *
+ *
+ */
+ public List<TReferenceListener> getListener()
+ {
+ if (listener == null)
+ {
+ listener = new ArrayList<TReferenceListener>();
+ }
+ return this.listener;
+ }
+
+ /**
+ * Gets the value of the any 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 any property.
+ *
+ * <p>
+ * For example, to add a new item, do as follows:
+ *
+ * <pre>
+ * getAny().add(newItem);
+ * </pre>
+ *
+ *
+ * <p>
+ * Objects of the following type(s) are allowed in the list {@link Object } {@link Element }
+ *
+ *
+ */
+ public List<Object> getAny()
+ {
+ if (any == null)
+ {
+ any = new ArrayList<Object>();
+ }
+ return this.any;
+ }
+
+ /**
+ * Gets the value of the filter property.
+ *
+ * @return possible object is {@link String }
+ *
+ */
+ public String getFilter()
+ {
+ return filter;
+ }
+
+ /**
+ * Sets the value of the filter property.
+ *
+ * @param value allowed object is {@link String }
+ *
+ */
+ public void setFilter(String value)
+ {
+ this.filter = value;
+ }
+
+ /**
+ * Gets the value of the componentName property.
+ *
+ * @return possible object is {@link String }
+ *
+ */
+ public String getComponentName()
+ {
+ return componentName;
+ }
+
+ /**
+ * Sets the value of the componentName property.
+ *
+ * @param value allowed object is {@link String }
+ *
+ */
+ public void setComponentName(String value)
+ {
+ this.componentName = value;
+ }
+
+ /**
+ * Gets the value of the availability property.
+ *
+ * @return possible object is {@link Tavailability }
+ *
+ */
+ public int getAvailability()
+ {
+ if (availability == Availability.MANDATORY)
+ return AVAILABILITY_MANDATORY;
+ else
+ return AVAILABILITY_OPTIONAL;
+ }
+
+ /**
+ * Sets the value of the availability property.
+ *
+ * @param value allowed object is {@link Tavailability }
+ *
+ */
+ public void setAvailability(String value)
+ {
+ this.availability = Availability.valueOf(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;
+ }
+
+ public Collection<Listener> getServiceListeners()
+ {
+ throw new NotImplementedException();
+ }
+}
Modified: projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/jboss/osgi/blueprint/reflect/TReferenceListener.java
===================================================================
--- projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/jboss/osgi/blueprint/reflect/TReferenceListener.java 2009-06-16 12:14:36 UTC (rev 90248)
+++ projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/jboss/osgi/blueprint/reflect/TReferenceListener.java 2009-06-16 12:45:55 UTC (rev 90249)
@@ -45,7 +45,7 @@
public class TReferenceListener {
protected BeanMetadataImpl bean;
- protected Treference reference;
+ protected ReferenceMetadataImpl reference;
protected Tref refFIXME;
protected List<Object> any;
protected String ref;
@@ -81,10 +81,10 @@
*
* @return
* possible object is
- * {@link Treference }
+ * {@link ReferenceMetadataImpl }
*
*/
- public Treference getReference() {
+ public ReferenceMetadataImpl getReference() {
return reference;
}
@@ -93,10 +93,10 @@
*
* @param value
* allowed object is
- * {@link Treference }
+ * {@link ReferenceMetadataImpl }
*
*/
- public void setReference(Treference value) {
+ public void setReference(ReferenceMetadataImpl value) {
this.reference = value;
}
Modified: projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/jboss/osgi/blueprint/reflect/Targument.java
===================================================================
--- projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/jboss/osgi/blueprint/reflect/Targument.java 2009-06-16 12:14:36 UTC (rev 90248)
+++ projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/jboss/osgi/blueprint/reflect/Targument.java 2009-06-16 12:45:55 UTC (rev 90249)
@@ -63,7 +63,7 @@
protected TrefCollection refList;
protected TrefCollection refSet;
protected BeanMetadataImpl bean;
- protected Treference reference;
+ protected ReferenceMetadataImpl reference;
protected Tref refFIXME;
protected List<Object> any;
protected Tref idref;
@@ -204,10 +204,10 @@
*
* @return
* possible object is
- * {@link Treference }
+ * {@link ReferenceMetadataImpl }
*
*/
- public Treference getReference() {
+ public ReferenceMetadataImpl getReference() {
return reference;
}
@@ -216,10 +216,10 @@
*
* @param value
* allowed object is
- * {@link Treference }
+ * {@link ReferenceMetadataImpl }
*
*/
- public void setReference(Treference value) {
+ public void setReference(ReferenceMetadataImpl value) {
this.reference = value;
}
Modified: projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/jboss/osgi/blueprint/reflect/Tcollection.java
===================================================================
--- projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/jboss/osgi/blueprint/reflect/Tcollection.java 2009-06-16 12:14:36 UTC (rev 90248)
+++ projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/jboss/osgi/blueprint/reflect/Tcollection.java 2009-06-16 12:45:55 UTC (rev 90249)
@@ -62,7 +62,7 @@
* {@link JAXBElement }{@code <}{@link Tvalue }{@code >}
* {@link JAXBElement }{@code <}{@link ServiceMetadataImpl }{@code >}
* {@link JAXBElement }{@code <}{@link Tref }{@code >}
- * {@link JAXBElement }{@code <}{@link Treference }{@code >}
+ * {@link JAXBElement }{@code <}{@link ReferenceMetadataImpl }{@code >}
* {@link JAXBElement }{@code <}{@link Tref }{@code >}
* {@link JAXBElement }{@code <}{@link Tmap }{@code >}
* {@link JAXBElement }{@code <}{@link BeanMetadataImpl }{@code >}
Modified: projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/jboss/osgi/blueprint/reflect/Tcomparator.java
===================================================================
--- projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/jboss/osgi/blueprint/reflect/Tcomparator.java 2009-06-16 12:14:36 UTC (rev 90248)
+++ projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/jboss/osgi/blueprint/reflect/Tcomparator.java 2009-06-16 12:45:55 UTC (rev 90249)
@@ -32,7 +32,7 @@
public class Tcomparator {
protected BeanMetadataImpl bean;
- protected Treference reference;
+ protected ReferenceMetadataImpl reference;
protected Tref refFIXME;
protected List<Object> any;
@@ -65,10 +65,10 @@
*
* @return
* possible object is
- * {@link Treference }
+ * {@link ReferenceMetadataImpl }
*
*/
- public Treference getReference() {
+ public ReferenceMetadataImpl getReference() {
return reference;
}
@@ -77,10 +77,10 @@
*
* @param value
* allowed object is
- * {@link Treference }
+ * {@link ReferenceMetadataImpl }
*
*/
- public void setReference(Treference value) {
+ public void setReference(ReferenceMetadataImpl value) {
this.reference = value;
}
Modified: projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/jboss/osgi/blueprint/reflect/Tkey.java
===================================================================
--- projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/jboss/osgi/blueprint/reflect/Tkey.java 2009-06-16 12:14:36 UTC (rev 90248)
+++ projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/jboss/osgi/blueprint/reflect/Tkey.java 2009-06-16 12:45:55 UTC (rev 90249)
@@ -43,7 +43,7 @@
protected TrefCollection refList;
protected TrefCollection refSet;
protected BeanMetadataImpl bean;
- protected Treference reference;
+ protected ReferenceMetadataImpl reference;
protected Tref refFIXME;
protected List<Object> any;
protected Tref idref;
@@ -155,10 +155,10 @@
*
* @return
* possible object is
- * {@link Treference }
+ * {@link ReferenceMetadataImpl }
*
*/
- public Treference getReference() {
+ public ReferenceMetadataImpl getReference() {
return reference;
}
@@ -167,10 +167,10 @@
*
* @param value
* allowed object is
- * {@link Treference }
+ * {@link ReferenceMetadataImpl }
*
*/
- public void setReference(Treference value) {
+ public void setReference(ReferenceMetadataImpl value) {
this.reference = value;
}
Modified: projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/jboss/osgi/blueprint/reflect/TmapEntry.java
===================================================================
--- projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/jboss/osgi/blueprint/reflect/TmapEntry.java 2009-06-16 12:14:36 UTC (rev 90248)
+++ projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/jboss/osgi/blueprint/reflect/TmapEntry.java 2009-06-16 12:45:55 UTC (rev 90249)
@@ -54,7 +54,7 @@
protected TrefCollection refList;
protected TrefCollection refSet;
protected BeanMetadataImpl bean;
- protected Treference reference;
+ protected ReferenceMetadataImpl reference;
protected Tref refFIXME;
protected List<Object> any;
protected Tref idref;
@@ -195,10 +195,10 @@
*
* @return
* possible object is
- * {@link Treference }
+ * {@link ReferenceMetadataImpl }
*
*/
- public Treference getReference() {
+ public ReferenceMetadataImpl getReference() {
return reference;
}
@@ -207,10 +207,10 @@
*
* @param value
* allowed object is
- * {@link Treference }
+ * {@link ReferenceMetadataImpl }
*
*/
- public void setReference(Treference value) {
+ public void setReference(ReferenceMetadataImpl value) {
this.reference = value;
}
Modified: projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/jboss/osgi/blueprint/reflect/Tproperty.java
===================================================================
--- projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/jboss/osgi/blueprint/reflect/Tproperty.java 2009-06-16 12:14:36 UTC (rev 90248)
+++ projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/jboss/osgi/blueprint/reflect/Tproperty.java 2009-06-16 12:45:55 UTC (rev 90249)
@@ -55,7 +55,7 @@
protected TrefCollection refList;
protected TrefCollection refSet;
protected BeanMetadataImpl bean;
- protected Treference reference;
+ protected ReferenceMetadataImpl reference;
protected Tref refFIXME;
protected List<Object> any;
protected Tref idref;
@@ -195,10 +195,10 @@
*
* @return
* possible object is
- * {@link Treference }
+ * {@link ReferenceMetadataImpl }
*
*/
- public Treference getReference() {
+ public ReferenceMetadataImpl getReference() {
return reference;
}
@@ -207,10 +207,10 @@
*
* @param value
* allowed object is
- * {@link Treference }
+ * {@link ReferenceMetadataImpl }
*
*/
- public void setReference(Treference value) {
+ public void setReference(ReferenceMetadataImpl value) {
this.reference = value;
}
Modified: projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/jboss/osgi/blueprint/reflect/TrefCollection.java
===================================================================
--- projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/jboss/osgi/blueprint/reflect/TrefCollection.java 2009-06-16 12:14:36 UTC (rev 90248)
+++ projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/jboss/osgi/blueprint/reflect/TrefCollection.java 2009-06-16 12:45:55 UTC (rev 90249)
@@ -56,7 +56,7 @@
*
*/
public class TrefCollection
- extends TserviceReference
+ extends ServiceReferenceMetadataImpl
{
protected Tcomparator comparator;
Deleted: projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/jboss/osgi/blueprint/reflect/Treference.java
===================================================================
--- projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/jboss/osgi/blueprint/reflect/Treference.java 2009-06-16 12:14:36 UTC (rev 90248)
+++ projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/jboss/osgi/blueprint/reflect/Treference.java 2009-06-16 12:45:55 UTC (rev 90249)
@@ -1,72 +0,0 @@
-//
-// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vhudson-jaxb-ri-2.1-793
-// 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.05.13 at 02:16:52 PM CEST
-//
-
-
-package org.jboss.osgi.blueprint.reflect;
-
-import java.math.BigInteger;
-
-
-/**
- *
- *
- * The Treference type defines the <reference> element. These
- * are instances of the TserviceReference type, with the addition
- * of a timeout attribute. If the timeout is not specified,
- * the default-timeout value is inherited from the encapsulating
- * <blueprint> definition.
- *
- *
- *
- * <p>Java class for Treference complex type.
- *
- * <p>The following schema fragment specifies the expected content contained within this class.
- *
- * <pre>
- * <complexType name="Treference">
- * <complexContent>
- * <extension base="{http://www.osgi.org/xmlns/blueprint/v1.0.0}TserviceReference">
- * <attribute name="timeout" type="{http://www.osgi.org/xmlns/blueprint/v1.0.0}Ttimeout" />
- * <anyAttribute processContents='lax' namespace='##other'/>
- * </extension>
- * </complexContent>
- * </complexType>
- * </pre>
- *
- *
- */
-public class Treference
- extends TserviceReference
-{
-
- protected BigInteger timeout;
-
- /**
- * Gets the value of the timeout property.
- *
- * @return
- * possible object is
- * {@link BigInteger }
- *
- */
- public BigInteger getTimeout() {
- return timeout;
- }
-
- /**
- * Sets the value of the timeout property.
- *
- * @param value
- * allowed object is
- * {@link BigInteger }
- *
- */
- public void setTimeout(BigInteger value) {
- this.timeout = value;
- }
-
-}
Modified: projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/jboss/osgi/blueprint/reflect/TregistrationListener.java
===================================================================
--- projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/jboss/osgi/blueprint/reflect/TregistrationListener.java 2009-06-16 12:14:36 UTC (rev 90248)
+++ projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/jboss/osgi/blueprint/reflect/TregistrationListener.java 2009-06-16 12:45:55 UTC (rev 90249)
@@ -47,7 +47,7 @@
public class TregistrationListener {
protected BeanMetadataImpl bean;
- protected Treference reference;
+ protected ReferenceMetadataImpl reference;
protected Tref refFIXME;
protected List<Object> any;
protected String ref;
@@ -83,10 +83,10 @@
*
* @return
* possible object is
- * {@link Treference }
+ * {@link ReferenceMetadataImpl }
*
*/
- public Treference getReference() {
+ public ReferenceMetadataImpl getReference() {
return reference;
}
@@ -95,10 +95,10 @@
*
* @param value
* allowed object is
- * {@link Treference }
+ * {@link ReferenceMetadataImpl }
*
*/
- public void setReference(Treference value) {
+ public void setReference(ReferenceMetadataImpl value) {
this.reference = value;
}
Deleted: projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/jboss/osgi/blueprint/reflect/TserviceReference.java
===================================================================
--- projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/jboss/osgi/blueprint/reflect/TserviceReference.java 2009-06-16 12:14:36 UTC (rev 90248)
+++ projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/jboss/osgi/blueprint/reflect/TserviceReference.java 2009-06-16 12:45:55 UTC (rev 90249)
@@ -1,264 +0,0 @@
-//
-// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vhudson-jaxb-ri-2.1-793
-// 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.05.13 at 02:16:52 PM CEST
-//
-
-package org.jboss.osgi.blueprint.reflect;
-
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-
-import javax.xml.namespace.QName;
-
-import org.w3c.dom.Element;
-
-/**
- *
- *
- * TserviceReference is the base element type used for <reference>, <ref-set>, and <ref-list> elements. This type defines all of the characteristics common to both
- * sorts of references.
- *
- *
- *
- * <p>
- * Java class for TserviceReference complex type.
- *
- * <p>
- * The following schema fragment specifies the expected content contained within this class.
- *
- * <pre>
- * <complexType name="TserviceReference">
- * <complexContent>
- * <extension base="{http://www.osgi.org/xmlns/blueprint/v1.0.0}Tcomponent">
- * <sequence>
- * <element name="description" type="{http://www.osgi.org/xmlns/blueprint/v1.0.0}String" minOccurs="0"/>
- * <element name="interfaces" type="{http://www.osgi.org/xmlns/blueprint/v1.0.0}Tinterfaces" minOccurs="0"/>
- * <element name="listener" type="{http://www.osgi.org/xmlns/blueprint/v1.0.0}TReferenceListener... maxOccurs="unbounded" minOccurs="0"/>
- * <any processContents='lax' namespace='##other' maxOccurs="unbounded" minOccurs="0"/>
- * </sequence>
- * <attribute name="interface" type="{http://www.osgi.org/xmlns/blueprint/v1.0.0}Tclass" />
- * <attribute name="filter" type="{http://www.w3.org/2001/XMLSchema}normalizedString" />
- * <attribute name="component-name" type="{http://www.osgi.org/xmlns/blueprint/v1.0.0}Tidref" />
- * <attribute name="availability" type="{http://www.osgi.org/xmlns/blueprint/v1.0.0}Tavailability" />
- * <anyAttribute processContents='lax' namespace='##other'/>
- * </extension>
- * </complexContent>
- * </complexType>
- * </pre>
- *
- *
- */
-public class TserviceReference extends ComponentMetadataImpl
-{
-
- protected String description;
- protected List<String> interfaces;
- protected List<TReferenceListener> listener;
- protected List<Object> any;
- protected String _interface;
- protected String filter;
- protected String componentName;
- protected Availability availability;
- 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.
- *
- */
- public List<String> getInterfaceNames()
- {
- if (interfaces == null)
- interfaces = new ArrayList<String>();
-
- return interfaces;
- }
-
- /**
- * Gets the value of the listener 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 listener property.
- *
- * <p>
- * For example, to add a new item, do as follows:
- *
- * <pre>
- * getListener().add(newItem);
- * </pre>
- *
- *
- * <p>
- * Objects of the following type(s) are allowed in the list {@link TReferenceListener }
- *
- *
- */
- public List<TReferenceListener> getListener()
- {
- if (listener == null)
- {
- listener = new ArrayList<TReferenceListener>();
- }
- return this.listener;
- }
-
- /**
- * Gets the value of the any 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 any property.
- *
- * <p>
- * For example, to add a new item, do as follows:
- *
- * <pre>
- * getAny().add(newItem);
- * </pre>
- *
- *
- * <p>
- * Objects of the following type(s) are allowed in the list {@link Object } {@link Element }
- *
- *
- */
- public List<Object> getAny()
- {
- if (any == null)
- {
- any = new ArrayList<Object>();
- }
- return this.any;
- }
-
- /**
- * Gets the value of the interface property.
- *
- * @return possible object is {@link String }
- *
- */
- public String getInterface()
- {
- return _interface;
- }
-
- /**
- * Sets the value of the interface property.
- *
- * @param value allowed object is {@link String }
- *
- */
- public void setInterface(String value)
- {
- this._interface = value;
- }
-
- /**
- * Gets the value of the filter property.
- *
- * @return possible object is {@link String }
- *
- */
- public String getFilter()
- {
- return filter;
- }
-
- /**
- * Sets the value of the filter property.
- *
- * @param value allowed object is {@link String }
- *
- */
- public void setFilter(String value)
- {
- this.filter = value;
- }
-
- /**
- * Gets the value of the componentName property.
- *
- * @return possible object is {@link String }
- *
- */
- public String getComponentName()
- {
- return componentName;
- }
-
- /**
- * Sets the value of the componentName property.
- *
- * @param value allowed object is {@link String }
- *
- */
- public void setComponentName(String value)
- {
- this.componentName = value;
- }
-
- /**
- * Gets the value of the availability property.
- *
- * @return possible object is {@link Tavailability }
- *
- */
- public Availability getAvailability()
- {
- return availability;
- }
-
- /**
- * Sets the value of the availability property.
- *
- * @param value allowed object is {@link Tavailability }
- *
- */
- public void setAvailability(String value)
- {
- this.availability = Availability.valueOf(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/reflect/TtypeConverters.java
===================================================================
--- projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/jboss/osgi/blueprint/reflect/TtypeConverters.java 2009-06-16 12:14:36 UTC (rev 90248)
+++ projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/jboss/osgi/blueprint/reflect/TtypeConverters.java 2009-06-16 12:45:55 UTC (rev 90249)
@@ -63,7 +63,7 @@
* <p>
* Objects of the following type(s) are allowed in the list
* {@link JAXBElement }{@code <}{@link BeanMetadataImpl }{@code >}
- * {@link JAXBElement }{@code <}{@link Treference }{@code >}
+ * {@link JAXBElement }{@code <}{@link ReferenceMetadataImpl }{@code >}
* {@link Object }
* {@link JAXBElement }{@code <}{@link Tref }{@code >}
*
Modified: projects/jboss-osgi/trunk/blueprint/impl/src/main/resources/schema/blueprint-jbxb.xsd
===================================================================
--- projects/jboss-osgi/trunk/blueprint/impl/src/main/resources/schema/blueprint-jbxb.xsd 2009-06-16 12:14:36 UTC (rev 90248)
+++ projects/jboss-osgi/trunk/blueprint/impl/src/main/resources/schema/blueprint-jbxb.xsd 2009-06-16 12:45:55 UTC (rev 90249)
@@ -63,9 +63,6 @@
<xsd:element name="blueprint" type="Tblueprint">
<xsd:annotation>
- <xsd:appinfo>
- <jbxb:class impl="org.jboss.osgi.blueprint.reflect.Blueprint"></jbxb:class>
- </xsd:appinfo>
<xsd:documentation>
<![CDATA[
@@ -86,6 +83,11 @@
</xsd:element>
<xsd:complexType name="Tblueprint">
+ <xsd:annotation>
+ <xsd:appinfo>
+ <jbxb:class impl="org.jboss.osgi.blueprint.reflect.BlueprintImpl"></jbxb:class>
+ </xsd:appinfo>
+ </xsd:annotation>
<xsd:sequence>
<xsd:element name="description" type="Tdescription" minOccurs="0" />
<xsd:element name="type-converters" type="Ttype-converters" minOccurs="0"
@@ -209,7 +211,13 @@
</xsd:appinfo>
</xsd:annotation>
</xsd:element>
- <xsd:element name="reference" type="Treference" />
+ <xsd:element name="reference" type="Treference" >
+ <xsd:annotation>
+ <xsd:appinfo>
+ <jbxb:property name="components"/>
+ </xsd:appinfo>
+ </xsd:annotation>
+ </xsd:element>
<xsd:element name="refFIXME" type="Tref" />
<xsd:any namespace="##other" processContents="strict" minOccurs="0" maxOccurs="unbounded" />
</xsd:choice>
@@ -408,6 +416,9 @@
<!-- reference -->
<xsd:complexType name="Treference">
<xsd:annotation>
+ <xsd:appinfo>
+ <jbxb:class impl="org.jboss.osgi.blueprint.reflect.ReferenceMetadataImpl"></jbxb:class>
+ </xsd:appinfo>
<xsd:documentation>
<![CDATA[
The Treference type defines the <reference> element. These
@@ -553,7 +564,14 @@
processContents="lax" />
</xsd:sequence>
- <xsd:attribute name="interface" use="optional" type="Tclass" />
+ <xsd:attribute name="interface" use="optional" type="Tclass" >
+ <xsd:annotation>
+ <xsd:appinfo>
+ <jbxb:property name="interfaceNames"/>
+ </xsd:appinfo>
+ </xsd:annotation>
+ </xsd:attribute>
+
<xsd:attribute name="filter" use="optional" type="xsd:normalizedString">
<xsd:annotation>
<xsd:documentation>
Modified: projects/jboss-osgi/trunk/blueprint/testsuite/src/test/java/org/jboss/test/osgi/blueprint/context/BlueprintContextTestCase.java
===================================================================
--- projects/jboss-osgi/trunk/blueprint/testsuite/src/test/java/org/jboss/test/osgi/blueprint/context/BlueprintContextTestCase.java 2009-06-16 12:14:36 UTC (rev 90248)
+++ projects/jboss-osgi/trunk/blueprint/testsuite/src/test/java/org/jboss/test/osgi/blueprint/context/BlueprintContextTestCase.java 2009-06-16 12:45:55 UTC (rev 90249)
@@ -33,6 +33,8 @@
import java.util.List;
import java.util.Set;
+import javax.management.MBeanServer;
+
import org.jboss.osgi.husky.Bridge;
import org.jboss.osgi.husky.BridgeFactory;
import org.jboss.osgi.husky.annotation.ProvideContext;
@@ -56,6 +58,7 @@
import org.osgi.service.blueprint.reflect.BeanMetadata;
import org.osgi.service.blueprint.reflect.ComponentMetadata;
import org.osgi.service.blueprint.reflect.ServiceMetadata;
+import org.osgi.service.blueprint.reflect.ServiceReferenceMetadata;
/**
* BlueprintContext API tests
@@ -165,7 +168,7 @@
assumeNotNull(context);
BlueprintContext bpContext = getBlueprintContext();
- BeanA beanA = (BeanA)bpContext.getComponent("beanA");
+ bpContext.getComponent("beanA");
}
@Test
@@ -195,10 +198,11 @@
Set<String> compNames = bpContext.getComponentNames();
assertNotNull("ComponentNames not null", compNames);
- assertEquals("ComponentNames size", 3, compNames.size());
+ assertEquals("ComponentNames size", 4, compNames.size());
assertTrue("ComponentNames contains beanA", compNames.contains("beanA"));
assertTrue("ComponentNames contains serviceA", compNames.contains("serviceA"));
assertTrue("ComponentNames contains serviceB", compNames.contains("serviceB"));
+ assertTrue("ComponentNames contains mbeanService", compNames.contains("mbeanService"));
}
@Test
@@ -234,7 +238,6 @@
}
@Test
- @Ignore
public void getReferencedServicesMetadata() throws Exception
{
if (context == null)
@@ -243,7 +246,18 @@
assumeNotNull(context);
BlueprintContext bpContext = getBlueprintContext();
- bpContext.getReferencedServicesMetadata();
+ Collection<ServiceReferenceMetadata> srefsMetadata = bpContext.getReferencedServicesMetadata();
+
+ assertNotNull("ServiceReferenceMetadata not null", srefsMetadata);
+ assertEquals("ServiceReferenceMetadata size", 1, srefsMetadata.size());
+
+ ServiceReferenceMetadata srefMetadata = srefsMetadata.iterator().next();
+ assertEquals("mbeanService", srefMetadata.getId());
+
+ List<String> interfaceNames = srefMetadata.getInterfaceNames();
+ assertNotNull("InterfaceNames not null", interfaceNames);
+ assertEquals("InterfaceNames size", 1, interfaceNames.size());
+ assertEquals("InterfaceName", MBeanServer.class.getName(), interfaceNames.get(0));
}
private BlueprintContext getBlueprintContext()
Modified: projects/jboss-osgi/trunk/blueprint/testsuite/src/test/java/org/jboss/test/osgi/blueprint/context/bundle/BeanA.java
===================================================================
--- projects/jboss-osgi/trunk/blueprint/testsuite/src/test/java/org/jboss/test/osgi/blueprint/context/bundle/BeanA.java 2009-06-16 12:14:36 UTC (rev 90248)
+++ projects/jboss-osgi/trunk/blueprint/testsuite/src/test/java/org/jboss/test/osgi/blueprint/context/bundle/BeanA.java 2009-06-16 12:45:55 UTC (rev 90249)
@@ -21,7 +21,9 @@
*/
package org.jboss.test.osgi.blueprint.context.bundle;
+import javax.management.MBeanServer;
+
//$Id$
/**
@@ -32,8 +34,19 @@
*/
public class BeanA
{
+ private MBeanServer mbeanServer;
private BeanB beanB;
+ public MBeanServer getMbeanServer()
+ {
+ return mbeanServer;
+ }
+
+ public void setMbeanServer(MBeanServer mbeanServer)
+ {
+ this.mbeanServer = mbeanServer;
+ }
+
public BeanB getBeanB()
{
return beanB;
Modified: projects/jboss-osgi/trunk/blueprint/testsuite/src/test/java/org/jboss/test/osgi/blueprint/parser/BasicBeansParserTestCase.java
===================================================================
--- projects/jboss-osgi/trunk/blueprint/testsuite/src/test/java/org/jboss/test/osgi/blueprint/parser/BasicBeansParserTestCase.java 2009-06-16 12:14:36 UTC (rev 90248)
+++ projects/jboss-osgi/trunk/blueprint/testsuite/src/test/java/org/jboss/test/osgi/blueprint/parser/BasicBeansParserTestCase.java 2009-06-16 12:45:55 UTC (rev 90249)
@@ -30,7 +30,7 @@
import java.util.List;
import org.jboss.osgi.blueprint.parser.BlueprintParser;
-import org.jboss.osgi.blueprint.reflect.Blueprint;
+import org.jboss.osgi.blueprint.reflect.BlueprintImpl;
import org.jboss.osgi.blueprint.reflect.ComponentMetadataImpl;
import org.jboss.osgi.spi.testing.OSGiTest;
import org.junit.Test;
@@ -48,7 +48,7 @@
public void testBasicBeans() throws Exception
{
URL xmlURL = getResourceURL("parser/blueprint-basic-beans.xml");
- Blueprint blueprint = new BlueprintParser().parse(xmlURL);
+ BlueprintImpl blueprint = new BlueprintParser().parse(xmlURL);
List<ComponentMetadataImpl> compList = blueprint.getComponents();
assertTrue(compList.size() > 0);
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-06-16 12:14:36 UTC (rev 90248)
+++ projects/jboss-osgi/trunk/blueprint/testsuite/src/test/java/org/jboss/test/osgi/blueprint/parser/BasicRootParserTestCase.java 2009-06-16 12:45:55 UTC (rev 90249)
@@ -31,7 +31,7 @@
import org.jboss.osgi.blueprint.parser.BlueprintParser;
import org.jboss.osgi.blueprint.reflect.Availability;
-import org.jboss.osgi.blueprint.reflect.Blueprint;
+import org.jboss.osgi.blueprint.reflect.BlueprintImpl;
import org.jboss.osgi.spi.testing.OSGiTest;
import org.junit.Test;
@@ -47,7 +47,7 @@
public void testBlueprintDefaultAttributes() throws Exception
{
URL xmlURL = getResourceURL("parser/blueprint-basic-root.xml");
- Blueprint blueprint = new BlueprintParser().parse(xmlURL);
+ BlueprintImpl blueprint = new BlueprintParser().parse(xmlURL);
// assert default attributes
assertEquals(Availability.MANDATORY, blueprint.getDefaultAvailability());
@@ -61,7 +61,7 @@
public void testBlueprintDescription() throws Exception
{
URL xmlURL = getResourceURL("parser/blueprint-basic-root.xml");
- Blueprint blueprint = new BlueprintParser().parse(xmlURL);
+ BlueprintImpl blueprint = new BlueprintParser().parse(xmlURL);
// assert description
assertEquals("some text", blueprint.getDescription());
Modified: projects/jboss-osgi/trunk/blueprint/testsuite/src/test/java/org/jboss/test/osgi/blueprint/parser/BasicServiceParserTestCase.java
===================================================================
--- projects/jboss-osgi/trunk/blueprint/testsuite/src/test/java/org/jboss/test/osgi/blueprint/parser/BasicServiceParserTestCase.java 2009-06-16 12:14:36 UTC (rev 90248)
+++ projects/jboss-osgi/trunk/blueprint/testsuite/src/test/java/org/jboss/test/osgi/blueprint/parser/BasicServiceParserTestCase.java 2009-06-16 12:45:55 UTC (rev 90249)
@@ -30,7 +30,7 @@
import java.util.List;
import org.jboss.osgi.blueprint.parser.BlueprintParser;
-import org.jboss.osgi.blueprint.reflect.Blueprint;
+import org.jboss.osgi.blueprint.reflect.BlueprintImpl;
import org.jboss.osgi.blueprint.reflect.ComponentMetadataImpl;
import org.jboss.osgi.spi.testing.OSGiTest;
import org.junit.Test;
@@ -49,7 +49,7 @@
public void testBasicBeans() throws Exception
{
URL xmlURL = getResourceURL("parser/blueprint-basic-service.xml");
- Blueprint blueprint = new BlueprintParser().parse(xmlURL);
+ BlueprintImpl blueprint = new BlueprintParser().parse(xmlURL);
List<ComponentMetadataImpl> compList = blueprint.getComponents();
assertTrue(compList.size() > 0);
Modified: projects/jboss-osgi/trunk/blueprint/testsuite/src/test/resources/context/OSGI-INF/blueprint/basic-service.xml
===================================================================
--- projects/jboss-osgi/trunk/blueprint/testsuite/src/test/resources/context/OSGI-INF/blueprint/basic-service.xml 2009-06-16 12:14:36 UTC (rev 90248)
+++ projects/jboss-osgi/trunk/blueprint/testsuite/src/test/resources/context/OSGI-INF/blueprint/basic-service.xml 2009-06-16 12:45:55 UTC (rev 90249)
@@ -2,6 +2,7 @@
xsi:schemaLocation="http://www.osgi.org/xmlns/blueprint/v1.0.0/blueprint.xsd schema/blueprint.xsd">
<bean id="beanA" class="org.jboss.test.osgi.blueprint.context.bundle.BeanA">
+ <property name="mbeanServer" ref="mbeanService"/>
</bean>
<service id="serviceA" ref="beanA" interface="org.jboss.test.osgi.blueprint.context.bundle.ServiceA">
@@ -11,4 +12,6 @@
<bean class="org.jboss.test.osgi.blueprint.context.bundle.BeanB"/>
</service>
+ <reference id="mbeanService" interface="javax.management.MBeanServer"/>
+
</blueprint>
\ No newline at end of file
Modified: projects/jboss-osgi/trunk/blueprint/testsuite/src/test/resources/context/context-basic.bnd
===================================================================
--- projects/jboss-osgi/trunk/blueprint/testsuite/src/test/resources/context/context-basic.bnd 2009-06-16 12:14:36 UTC (rev 90248)
+++ projects/jboss-osgi/trunk/blueprint/testsuite/src/test/resources/context/context-basic.bnd 2009-06-16 12:45:55 UTC (rev 90249)
@@ -7,6 +7,7 @@
Private-Package: org.jboss.test.osgi.blueprint.context.bundle
Import-Package: \
+ javax.management, \
org.jboss.osgi.husky, \
org.jboss.osgi.husky.annotation, \
org.jboss.osgi.spi.capability, \
15 years
JBoss-OSGI SVN: r90247 - in projects/jboss-osgi/trunk: blueprint/impl/src/main/java/org/jboss/osgi/blueprint/context and 5 other directories.
by jboss-osgi-commits@lists.jboss.org
Author: thomas.diesler(a)jboss.com
Date: 2009-06-16 06:48:36 -0400 (Tue, 16 Jun 2009)
New Revision: 90247
Modified:
projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/jboss/osgi/blueprint/context/BlueprintContextImpl.java
projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/jboss/osgi/blueprint/extender/BlueprintExtender.java
projects/jboss-osgi/trunk/blueprint/testsuite/src/test/java/org/jboss/test/osgi/blueprint/context/BlueprintContextTestCase.java
projects/jboss-osgi/trunk/blueprint/testsuite/src/test/resources/context/OSGI-INF/blueprint/basic-service.xml
projects/jboss-osgi/trunk/blueprint/testsuite/src/test/resources/context/context-basic.bnd
projects/jboss-osgi/trunk/husky/testsuite/pom.xml
projects/jboss-osgi/trunk/pom.xml
Log:
[JBOSGI-103] - Add support for BlueprintContext API
Modified: projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/jboss/osgi/blueprint/context/BlueprintContextImpl.java
===================================================================
--- projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/jboss/osgi/blueprint/context/BlueprintContextImpl.java 2009-06-16 10:43:20 UTC (rev 90246)
+++ projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/jboss/osgi/blueprint/context/BlueprintContextImpl.java 2009-06-16 10:48:36 UTC (rev 90247)
@@ -23,13 +23,19 @@
//$Id$
+import java.util.ArrayList;
import java.util.Collection;
+import java.util.Collections;
+import java.util.LinkedHashSet;
+import java.util.List;
import java.util.Set;
import org.jboss.osgi.blueprint.reflect.Blueprint;
import org.jboss.osgi.spi.NotImplementedException;
+import org.osgi.framework.Bundle;
import org.osgi.framework.BundleContext;
import org.osgi.service.blueprint.context.BlueprintContext;
+import org.osgi.service.blueprint.context.NoSuchComponentException;
import org.osgi.service.blueprint.reflect.BeanMetadata;
import org.osgi.service.blueprint.reflect.ComponentMetadata;
import org.osgi.service.blueprint.reflect.ServiceMetadata;
@@ -46,21 +52,29 @@
*/
public class BlueprintContextImpl implements BlueprintContext
{
- //private Blueprint blueprintMetadata;
-
- public BlueprintContextImpl(Blueprint blueprintMetadata)
+ private Bundle bundle;
+ private Blueprint bpMetadata;
+
+ public BlueprintContextImpl(Bundle bundle, Blueprint bpMetadata)
{
- //this.blueprintMetadata = blueprintMetadata;
+ this.bundle = bundle;
+ this.bpMetadata = bpMetadata;
}
-
+
public Collection<BeanMetadata> getBeanComponentsMetadata()
{
- throw new NotImplementedException();
+ List<BeanMetadata> beanMetadata = new ArrayList<BeanMetadata>();
+ for (ComponentMetadata comp : bpMetadata.getComponents())
+ {
+ if (comp instanceof BeanMetadata)
+ beanMetadata.add((BeanMetadata)comp);
+ }
+ return Collections.unmodifiableList(beanMetadata);
}
public BundleContext getBundleContext()
{
- throw new NotImplementedException();
+ return bundle.getBundleContext();
}
public Object getComponent(String name)
@@ -70,17 +84,40 @@
public ComponentMetadata getComponentMetadata(String name)
{
- throw new NotImplementedException();
+ ComponentMetadata compMetadata = null;
+ for (ComponentMetadata aux : bpMetadata.getComponents())
+ {
+ if (aux.getId().equals(name))
+ {
+ compMetadata = aux;
+ break;
+ }
+ }
+
+ if (compMetadata == null)
+ throw new NoSuchComponentException("Cannot get component metadata for: " + name);
+
+ return compMetadata;
}
public Set<String> getComponentNames()
{
- throw new NotImplementedException();
+ Set<String> compNames = new LinkedHashSet<String>();
+ for (ComponentMetadata comp : bpMetadata.getComponents())
+ compNames.add(comp.getId());
+
+ return Collections.unmodifiableSet(compNames);
}
public Collection<ServiceMetadata> getExportedServicesMetadata()
{
- throw new NotImplementedException();
+ List<ServiceMetadata> servMetadata = new ArrayList<ServiceMetadata>();
+ for (ComponentMetadata comp : bpMetadata.getComponents())
+ {
+ if (comp instanceof ServiceMetadata)
+ servMetadata.add((ServiceMetadata)comp);
+ }
+ return Collections.unmodifiableList(servMetadata);
}
public Collection<ServiceReferenceMetadata> getReferencedServicesMetadata()
Modified: projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/jboss/osgi/blueprint/extender/BlueprintExtender.java
===================================================================
--- projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/jboss/osgi/blueprint/extender/BlueprintExtender.java 2009-06-16 10:43:20 UTC (rev 90246)
+++ projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/jboss/osgi/blueprint/extender/BlueprintExtender.java 2009-06-16 10:48:36 UTC (rev 90247)
@@ -60,6 +60,7 @@
public void bundleChanged(BundleEvent event)
{
Bundle bundle = event.getBundle();
+
Blueprint bpMetadata = null;
if (event.getType() == BundleEvent.STARTING)
@@ -97,7 +98,7 @@
// Register the BlueprintContext
if (bpMetadata != null)
{
- BlueprintContext bpContext = new BlueprintContextImpl(bpMetadata);
+ BlueprintContext bpContext = new BlueprintContextImpl(bundle, bpMetadata);
context.registerService(BlueprintContext.class.getName(), bpContext, null);
}
}
Modified: projects/jboss-osgi/trunk/blueprint/testsuite/src/test/java/org/jboss/test/osgi/blueprint/context/BlueprintContextTestCase.java
===================================================================
--- projects/jboss-osgi/trunk/blueprint/testsuite/src/test/java/org/jboss/test/osgi/blueprint/context/BlueprintContextTestCase.java 2009-06-16 10:43:20 UTC (rev 90246)
+++ projects/jboss-osgi/trunk/blueprint/testsuite/src/test/java/org/jboss/test/osgi/blueprint/context/BlueprintContextTestCase.java 2009-06-16 10:48:36 UTC (rev 90247)
@@ -25,8 +25,15 @@
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.assertTrue;
import static org.junit.Assume.assumeNotNull;
+import java.util.Collection;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Set;
+
+import org.jboss.osgi.husky.Bridge;
import org.jboss.osgi.husky.BridgeFactory;
import org.jboss.osgi.husky.annotation.ProvideContext;
import org.jboss.osgi.spi.capability.BlueprintCapability;
@@ -35,16 +42,23 @@
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.blueprint.context.bundle.BeanA;
+import org.jboss.test.osgi.blueprint.context.bundle.ServiceA;
+import org.jboss.test.osgi.blueprint.context.bundle.ServiceB;
import org.junit.AfterClass;
import org.junit.BeforeClass;
+import org.junit.Ignore;
import org.junit.Test;
import org.osgi.framework.Bundle;
import org.osgi.framework.BundleContext;
import org.osgi.framework.ServiceReference;
import org.osgi.service.blueprint.context.BlueprintContext;
+import org.osgi.service.blueprint.reflect.BeanMetadata;
+import org.osgi.service.blueprint.reflect.ComponentMetadata;
+import org.osgi.service.blueprint.reflect.ServiceMetadata;
/**
- * Blueprint parser tests
+ * BlueprintContext API tests
*
* @author thomas.diesler(a)jboss.com
* @since 13-May-2009
@@ -55,6 +69,7 @@
public static BundleContext context;
private static OSGiRuntime runtime;
+ private static Bridge huskyBridge;
@BeforeClass
public static void beforeClass() throws Exception
@@ -66,6 +81,8 @@
runtime.addCapability(new MicrocontainerCapability());
runtime.addCapability(new BlueprintCapability());
+ huskyBridge = BridgeFactory.getBridge();
+
OSGiBundle bundle = runtime.installBundle("context-basic.jar");
bundle.start();
}
@@ -82,7 +99,7 @@
public void testBlueprintBundleInstall() throws Exception
{
if (context == null)
- BridgeFactory.getBridge().run();
+ huskyBridge.run();
assumeNotNull(context);
@@ -91,17 +108,148 @@
}
@Test
- public void testBlueprintContext() throws Exception
+ public void testBlueprintContextAvailable() throws Exception
{
if (context == null)
- BridgeFactory.getBridge().run();
+ huskyBridge.run();
assumeNotNull(context);
- ServiceReference sref = context.getServiceReference(BlueprintContext.class.getName());
- assertNotNull("BlueprintContext registered", sref);
+ BlueprintContext bpContext = getBlueprintContext();
+ assertNotNull("BlueprintContext available", bpContext);
+ }
+
+
+ @Test
+ public void getBeanComponentsMetadata() throws Exception
+ {
+ if (context == null)
+ huskyBridge.run();
- BlueprintContext bpContext = (BlueprintContext)context.getService(sref);
+ assumeNotNull(context);
+ BlueprintContext bpContext = getBlueprintContext();
+ Collection<BeanMetadata> bcMetadata = bpContext.getBeanComponentsMetadata();
+
+ assertNotNull("BeanComponentsMetadata not null", bcMetadata);
+ assertEquals("BeanComponentsMetadata size", 1, bcMetadata.size());
+
+ BeanMetadata bmd = bcMetadata.iterator().next();
+ assertEquals("beanA", bmd.getId());
+ assertEquals(BeanA.class.getName(), bmd.getClassName());
}
+
+ @Test
+ public void getBundleContext() throws Exception
+ {
+ if (context == null)
+ huskyBridge.run();
+
+ assumeNotNull(context);
+
+ BlueprintContext bpContext = getBlueprintContext();
+ BundleContext bndContext = bpContext.getBundleContext();
+
+ assertNotNull("BundleContext not null", bndContext);
+ assertEquals("BundleContext equals", context, bndContext);
+ }
+
+
+ @Test
+ @Ignore
+ public void getComponent() throws Exception
+ {
+ if (context == null)
+ huskyBridge.run();
+
+ assumeNotNull(context);
+
+ BlueprintContext bpContext = getBlueprintContext();
+ BeanA beanA = (BeanA)bpContext.getComponent("beanA");
+ }
+
+ @Test
+ public void getComponentMetadata() throws Exception
+ {
+ if (context == null)
+ huskyBridge.run();
+
+ assumeNotNull(context);
+
+ BlueprintContext bpContext = getBlueprintContext();
+ ComponentMetadata compMetadata = bpContext.getComponentMetadata("beanA");
+
+ assertNotNull("ComponentMetadata not null", compMetadata);
+ assertEquals("beanA", compMetadata.getId());
+ }
+
+ @Test
+ public void getComponentNames() throws Exception
+ {
+ if (context == null)
+ huskyBridge.run();
+
+ assumeNotNull(context);
+
+ BlueprintContext bpContext = getBlueprintContext();
+ Set<String> compNames = bpContext.getComponentNames();
+
+ assertNotNull("ComponentNames not null", compNames);
+ assertEquals("ComponentNames size", 3, compNames.size());
+ assertTrue("ComponentNames contains beanA", compNames.contains("beanA"));
+ assertTrue("ComponentNames contains serviceA", compNames.contains("serviceA"));
+ assertTrue("ComponentNames contains serviceB", compNames.contains("serviceB"));
+ }
+
+ @Test
+ public void getExportedServicesMetadata() throws Exception
+ {
+ if (context == null)
+ huskyBridge.run();
+
+ assumeNotNull(context);
+
+ BlueprintContext bpContext = getBlueprintContext();
+ Collection<ServiceMetadata> servicesMetadata = bpContext.getExportedServicesMetadata();
+
+ assertNotNull("ServiceMetadata not null", servicesMetadata);
+ assertEquals("ServiceMetadata size", 2, servicesMetadata.size());
+
+ Iterator<ServiceMetadata> itServices = servicesMetadata.iterator();
+ ServiceMetadata serviceA = itServices.next();
+ assertEquals("serviceA", serviceA.getId());
+
+ List<String> interfaceNamesA = serviceA.getInterfaceNames();
+ assertNotNull("InterfaceNames not null", interfaceNamesA);
+ assertEquals("InterfaceNames size", 1, interfaceNamesA.size());
+ assertEquals("InterfaceName", ServiceA.class.getName(), interfaceNamesA.get(0));
+
+ ServiceMetadata serviceB = itServices.next();
+ assertEquals("serviceB", serviceB.getId());
+
+ List<String> interfaceNamesB = serviceB.getInterfaceNames();
+ assertNotNull("InterfaceNames not null", interfaceNamesB);
+ assertEquals("InterfaceNames size", 1, interfaceNamesB.size());
+ assertEquals("InterfaceName", ServiceB.class.getName(), interfaceNamesB.get(0));
+ }
+
+ @Test
+ @Ignore
+ public void getReferencedServicesMetadata() throws Exception
+ {
+ if (context == null)
+ huskyBridge.run();
+
+ assumeNotNull(context);
+
+ BlueprintContext bpContext = getBlueprintContext();
+ bpContext.getReferencedServicesMetadata();
+ }
+
+ private BlueprintContext getBlueprintContext()
+ {
+ ServiceReference sref = context.getServiceReference(BlueprintContext.class.getName());
+ BlueprintContext bpContext = (BlueprintContext)context.getService(sref);
+ return bpContext;
+ }
}
\ No newline at end of file
Modified: projects/jboss-osgi/trunk/blueprint/testsuite/src/test/resources/context/OSGI-INF/blueprint/basic-service.xml
===================================================================
--- projects/jboss-osgi/trunk/blueprint/testsuite/src/test/resources/context/OSGI-INF/blueprint/basic-service.xml 2009-06-16 10:43:20 UTC (rev 90246)
+++ projects/jboss-osgi/trunk/blueprint/testsuite/src/test/resources/context/OSGI-INF/blueprint/basic-service.xml 2009-06-16 10:48:36 UTC (rev 90247)
@@ -1,14 +1,14 @@
<blueprint xmlns="http://www.osgi.org/xmlns/blueprint/v1.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.osgi.org/xmlns/blueprint/v1.0.0/blueprint.xsd schema/blueprint.xsd">
- <bean id="beanA" class="org.jboss.test.osgi.blueprint.context.BeanA">
+ <bean id="beanA" class="org.jboss.test.osgi.blueprint.context.bundle.BeanA">
</bean>
- <service id="serviceA" ref="beanA" interface="org.jboss.test.osgi.blueprint.context.ServiceA">
+ <service id="serviceA" ref="beanA" interface="org.jboss.test.osgi.blueprint.context.bundle.ServiceA">
</service>
- <service id="serviceB" interface="org.jboss.test.osgi.blueprint.context.ServiceB">
- <bean class="org.jboss.test.osgi.blueprint.context.BeanB"/>
+ <service id="serviceB" interface="org.jboss.test.osgi.blueprint.context.bundle.ServiceB">
+ <bean class="org.jboss.test.osgi.blueprint.context.bundle.BeanB"/>
</service>
</blueprint>
\ No newline at end of file
Modified: projects/jboss-osgi/trunk/blueprint/testsuite/src/test/resources/context/context-basic.bnd
===================================================================
--- projects/jboss-osgi/trunk/blueprint/testsuite/src/test/resources/context/context-basic.bnd 2009-06-16 10:43:20 UTC (rev 90246)
+++ projects/jboss-osgi/trunk/blueprint/testsuite/src/test/resources/context/context-basic.bnd 2009-06-16 10:48:36 UTC (rev 90247)
@@ -4,6 +4,8 @@
Export-Package: org.jboss.test.osgi.blueprint.context
+Private-Package: org.jboss.test.osgi.blueprint.context.bundle
+
Import-Package: \
org.jboss.osgi.husky, \
org.jboss.osgi.husky.annotation, \
Modified: projects/jboss-osgi/trunk/husky/testsuite/pom.xml
===================================================================
--- projects/jboss-osgi/trunk/husky/testsuite/pom.xml 2009-06-16 10:43:20 UTC (rev 90246)
+++ projects/jboss-osgi/trunk/husky/testsuite/pom.xml 2009-06-16 10:48:36 UTC (rev 90247)
@@ -121,6 +121,55 @@
<!-- Profiles -->
<profiles>
+
+ <!--
+ Name: framework-equinox
+ Descr: Setup for Equinox framework integration testing
+ -->
+ <profile>
+ <id>framework-equinox</id>
+ <activation>
+ <property>
+ <name>framework</name>
+ <value>equinox</value>
+ </property>
+ </activation>
+ <build>
+ <plugins>
+ <plugin>
+ <artifactId>maven-surefire-plugin</artifactId>
+ <configuration>
+ <skipTests>true</skipTests>
+ </configuration>
+ </plugin>
+ </plugins>
+ </build>
+ </profile>
+
+ <!--
+ Name: framework-knopflerfish
+ Descr: Setup for Knopflerfish framework integration testing
+ -->
+ <profile>
+ <id>framework-knopflerfish</id>
+ <activation>
+ <property>
+ <name>framework</name>
+ <value>knopflerfish</value>
+ </property>
+ </activation>
+ <build>
+ <plugins>
+ <plugin>
+ <artifactId>maven-surefire-plugin</artifactId>
+ <configuration>
+ <skipTests>true</skipTests>
+ </configuration>
+ </plugin>
+ </plugins>
+ </build>
+ </profile>
+
</profiles>
</project>
Modified: projects/jboss-osgi/trunk/pom.xml
===================================================================
--- projects/jboss-osgi/trunk/pom.xml 2009-06-16 10:43:20 UTC (rev 90246)
+++ projects/jboss-osgi/trunk/pom.xml 2009-06-16 10:48:36 UTC (rev 90247)
@@ -401,7 +401,7 @@
<!--
Name: framework-knopflerfish
- Descr: Setup for Equinox framework integration testing
+ Descr: Setup for Knopflerfish framework integration testing
-->
<profile>
<id>framework-knopflerfish</id>
15 years
JBoss-OSGI SVN: r90244 - projects/jboss-osgi/trunk/spi/src/main/java/org/jboss/osgi/spi/testing/internal.
by jboss-osgi-commits@lists.jboss.org
Author: thomas.diesler(a)jboss.com
Date: 2009-06-16 05:26:50 -0400 (Tue, 16 Jun 2009)
New Revision: 90244
Modified:
projects/jboss-osgi/trunk/spi/src/main/java/org/jboss/osgi/spi/testing/internal/EmbeddedBundle.java
projects/jboss-osgi/trunk/spi/src/main/java/org/jboss/osgi/spi/testing/internal/EmbeddedRuntime.java
projects/jboss-osgi/trunk/spi/src/main/java/org/jboss/osgi/spi/testing/internal/OSGiRuntimeImpl.java
projects/jboss-osgi/trunk/spi/src/main/java/org/jboss/osgi/spi/testing/internal/RemoteBundle.java
projects/jboss-osgi/trunk/spi/src/main/java/org/jboss/osgi/spi/testing/internal/RemoteRuntime.java
Log:
cache basic remote bundle properties
Modified: projects/jboss-osgi/trunk/spi/src/main/java/org/jboss/osgi/spi/testing/internal/EmbeddedBundle.java
===================================================================
--- projects/jboss-osgi/trunk/spi/src/main/java/org/jboss/osgi/spi/testing/internal/EmbeddedBundle.java 2009-06-16 08:55:09 UTC (rev 90243)
+++ projects/jboss-osgi/trunk/spi/src/main/java/org/jboss/osgi/spi/testing/internal/EmbeddedBundle.java 2009-06-16 09:26:50 UTC (rev 90244)
@@ -37,10 +37,12 @@
*/
public class EmbeddedBundle extends OSGiBundle
{
+ private OSGiRuntimeImpl runtime;
private Bundle bundle;
- public EmbeddedBundle(Bundle bundle)
+ public EmbeddedBundle(OSGiRuntimeImpl runtime, Bundle bundle)
{
+ this.runtime = runtime;
this.bundle = bundle;
}
@@ -105,5 +107,6 @@
public void uninstall() throws BundleException
{
bundle.uninstall();
+ runtime.unregisterBundle(this);
}
}
Modified: projects/jboss-osgi/trunk/spi/src/main/java/org/jboss/osgi/spi/testing/internal/EmbeddedRuntime.java
===================================================================
--- projects/jboss-osgi/trunk/spi/src/main/java/org/jboss/osgi/spi/testing/internal/EmbeddedRuntime.java 2009-06-16 08:55:09 UTC (rev 90243)
+++ projects/jboss-osgi/trunk/spi/src/main/java/org/jboss/osgi/spi/testing/internal/EmbeddedRuntime.java 2009-06-16 09:26:50 UTC (rev 90244)
@@ -75,7 +75,7 @@
service.deploy(bundleURL);
OSGiBundle bundle = getBundle(symbolicName, null);
- return registerBundleForUninstall(location, bundle);
+ return registerBundle(location, bundle);
}
public OSGiBundle[] getBundles()
@@ -83,7 +83,7 @@
List<OSGiBundle> absBundles = new ArrayList<OSGiBundle>();
for (Bundle bundle : getBundleContext().getBundles())
{
- absBundles.add(new EmbeddedBundle(bundle));
+ absBundles.add(new EmbeddedBundle(this, bundle));
}
OSGiBundle[] bundleArr = new OSGiBundle[absBundles.size()];
absBundles.toArray(bundleArr);
Modified: projects/jboss-osgi/trunk/spi/src/main/java/org/jboss/osgi/spi/testing/internal/OSGiRuntimeImpl.java
===================================================================
--- projects/jboss-osgi/trunk/spi/src/main/java/org/jboss/osgi/spi/testing/internal/OSGiRuntimeImpl.java 2009-06-16 08:55:09 UTC (rev 90243)
+++ projects/jboss-osgi/trunk/spi/src/main/java/org/jboss/osgi/spi/testing/internal/OSGiRuntimeImpl.java 2009-06-16 09:26:50 UTC (rev 90244)
@@ -29,6 +29,8 @@
import java.util.LinkedHashMap;
import java.util.List;
import java.util.Map;
+import java.util.Set;
+import java.util.Map.Entry;
import java.util.jar.Attributes;
import java.util.jar.JarFile;
import java.util.jar.Manifest;
@@ -44,6 +46,7 @@
import org.jboss.osgi.spi.testing.OSGiRuntime;
import org.jboss.osgi.spi.testing.OSGiServiceReference;
import org.jboss.osgi.spi.testing.OSGiTestHelper;
+import org.osgi.framework.Bundle;
import org.osgi.framework.BundleException;
import org.osgi.framework.Constants;
import org.osgi.service.log.LogReaderService;
@@ -86,12 +89,6 @@
return logReaderService;
}
- protected OSGiBundle registerBundleForUninstall(String location, OSGiBundle bundle)
- {
- bundles.put(location, bundle);
- return bundle;
- }
-
public void addCapability(Capability capability) throws BundleException
{
// Add dependent capabilies
@@ -257,13 +254,43 @@
return symbolicName;
}
+ OSGiBundle registerBundle(String location, OSGiBundle bundle)
+ {
+ if (bundle == null)
+ throw new IllegalArgumentException("Cannot register null bundle for: " + location);
+
+ bundles.put(location, bundle);
+ return bundle;
+ }
+
+ void unregisterBundle(OSGiBundle bundle)
+ {
+ if (bundle == null)
+ throw new IllegalArgumentException("Cannot unregister null bundle");
+
+ if (bundles.containsValue(bundle))
+ {
+ Set<Entry<String, OSGiBundle>> entrySet = bundles.entrySet();
+ for (Entry<String, OSGiBundle> entry : entrySet)
+ {
+ if (bundle.equals(entry.getValue()))
+ {
+ String key = entry.getKey();
+ bundles.remove(key);
+ break;
+ }
+ }
+ }
+ }
+
private void failsafeUninstall(OSGiBundle bundle)
{
if (bundle != null)
{
try
{
- bundle.uninstall();
+ if (bundle.getState() != Bundle.UNINSTALLED)
+ bundle.uninstall();
}
catch (BundleException ex)
{
Modified: projects/jboss-osgi/trunk/spi/src/main/java/org/jboss/osgi/spi/testing/internal/RemoteBundle.java
===================================================================
--- projects/jboss-osgi/trunk/spi/src/main/java/org/jboss/osgi/spi/testing/internal/RemoteBundle.java 2009-06-16 08:55:09 UTC (rev 90243)
+++ projects/jboss-osgi/trunk/spi/src/main/java/org/jboss/osgi/spi/testing/internal/RemoteBundle.java 2009-06-16 09:26:50 UTC (rev 90244)
@@ -46,11 +46,19 @@
private boolean uninstalled;
private String location;
+ private long bundleId;
+ private String symbolicName;
+ private String version;
+
public RemoteBundle(OSGiRuntimeImpl runtime, ManagedBundleMBean bundle, String location)
{
this.runtime = runtime;
this.bundle = bundle;
this.location = location;
+
+ this.bundleId = bundle.getBundleId();
+ this.symbolicName = bundle.getSymbolicName();
+ this.version = getHeaders().get(Constants.BUNDLE_VERSION);
}
@Override
@@ -60,17 +68,21 @@
}
@Override
+ public long getBundleId()
+ {
+ return bundleId;
+ }
+
+ @Override
public String getSymbolicName()
{
- assertNotUninstalled();
- return bundle.getSymbolicName();
+ return symbolicName;
}
@Override
public String getVersion()
{
- assertNotUninstalled();
- return getHeaders().get(Constants.BUNDLE_VERSION);
+ return version;
}
@Override
@@ -81,13 +93,6 @@
}
@Override
- public long getBundleId()
- {
- assertNotUninstalled();
- return bundle.getBundleId();
- }
-
- @Override
public String getProperty(String key)
{
assertNotUninstalled();
@@ -115,6 +120,7 @@
try
{
runtime.undeploy(location);
+ runtime.unregisterBundle(this);
uninstalled = true;
}
catch (RuntimeException rte)
Modified: projects/jboss-osgi/trunk/spi/src/main/java/org/jboss/osgi/spi/testing/internal/RemoteRuntime.java
===================================================================
--- projects/jboss-osgi/trunk/spi/src/main/java/org/jboss/osgi/spi/testing/internal/RemoteRuntime.java 2009-06-16 08:55:09 UTC (rev 90243)
+++ projects/jboss-osgi/trunk/spi/src/main/java/org/jboss/osgi/spi/testing/internal/RemoteRuntime.java 2009-06-16 09:26:50 UTC (rev 90244)
@@ -79,7 +79,7 @@
deploy(location);
ManagedBundleMBean bundleMBean = getRemoteFramework().getBundle(symbolicName);
RemoteBundle bundle = new RemoteBundle(this, bundleMBean, location);
- return registerBundleForUninstall(location, bundle);
+ return registerBundle(location, bundle);
}
catch (RuntimeException rte)
{
15 years