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&am...
minOccurs="0"/>
+ * <element name="listener"
type="{http://www.osgi.org/xmlns/blueprint/v1.0.0}TReferenceList...
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/...
-// 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/...
-// 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&am...
minOccurs="0"/>
- * <element name="listener"
type="{http://www.osgi.org/xmlns/blueprint/v1.0.0}TReferenceList...
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/bluep...
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, \