You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@aries.apache.org by li...@apache.org on 2010/04/28 23:11:18 UTC
svn commit: r939092 [4/5] - in /incubator/aries/sandbox/linsun: ./
blueprint/ blueprint/blueprint-annotation-api/
blueprint/blueprint-annotation-api/src/
blueprint/blueprint-annotation-api/src/main/
blueprint/blueprint-annotation-api/src/main/java/ blu...
Added: incubator/aries/sandbox/linsun/blueprint/blueprint-annotation-impl/src/main/java/org/apache/aries/blueprint/jaxb/TservicePropertyEntry.java
URL: http://svn.apache.org/viewvc/incubator/aries/sandbox/linsun/blueprint/blueprint-annotation-impl/src/main/java/org/apache/aries/blueprint/jaxb/TservicePropertyEntry.java?rev=939092&view=auto
==============================================================================
--- incubator/aries/sandbox/linsun/blueprint/blueprint-annotation-impl/src/main/java/org/apache/aries/blueprint/jaxb/TservicePropertyEntry.java (added)
+++ incubator/aries/sandbox/linsun/blueprint/blueprint-annotation-impl/src/main/java/org/apache/aries/blueprint/jaxb/TservicePropertyEntry.java Wed Apr 28 21:11:16 2010
@@ -0,0 +1,479 @@
+//
+// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vJAXB 2.1.3 in JDK 1.6
+// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a>
+// Any modifications to this file will be lost upon recompilation of the source schema.
+// Generated on: 2010.04.23 at 12:57:08 PM EDT
+//
+
+
+package org.apache.aries.blueprint.jaxb;
+
+import javax.xml.bind.annotation.XmlAccessType;
+import javax.xml.bind.annotation.XmlAccessorType;
+import javax.xml.bind.annotation.XmlAnyElement;
+import javax.xml.bind.annotation.XmlAttribute;
+import javax.xml.bind.annotation.XmlElement;
+import javax.xml.bind.annotation.XmlRootElement;
+import javax.xml.bind.annotation.XmlType;
+import javax.xml.bind.annotation.adapters.NormalizedStringAdapter;
+import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter;
+
+
+/**
+ *
+ *
+ * TservicePropertyEntry is an entry value used for the <service-properties>
+ * element. This does not allow a child <key> element and there are no
+ * key-ref or value-ref attributes.
+ *
+ *
+ *
+ * <p>Java class for TservicePropertyEntry complex type.
+ *
+ * <p>The following schema fragment specifies the expected content contained within this class.
+ *
+ * <pre>
+ * <complexType name="TservicePropertyEntry">
+ * <complexContent>
+ * <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ * <sequence>
+ * <group ref="{http://www.osgi.org/xmlns/blueprint/v1.0.0}Gvalue" minOccurs="0"/>
+ * </sequence>
+ * <attribute name="key" use="required" type="{http://www.osgi.org/xmlns/blueprint/v1.0.0}TstringValue" />
+ * <attribute name="value" type="{http://www.osgi.org/xmlns/blueprint/v1.0.0}TstringValue" />
+ * </restriction>
+ * </complexContent>
+ * </complexType>
+ * </pre>
+ *
+ *
+ */
+@XmlAccessorType(XmlAccessType.FIELD)
+@XmlType(name = "TservicePropertyEntry", namespace = "http://www.osgi.org/xmlns/blueprint/v1.0.0", propOrder = {
+ "service",
+ "referenceList",
+ "bean",
+ "reference",
+ "ref",
+ "any",
+ "idref",
+ "value",
+ "list",
+ "set",
+ "map",
+ "array",
+ "props",
+ "_null"
+})
+@XmlRootElement(name = "servicePropertyEntry")
+public class TservicePropertyEntry {
+
+ protected TinlinedService service;
+ @XmlElement(name = "reference-list")
+ protected TinlinedReferenceList referenceList;
+ protected TinlinedBean bean;
+ protected TinlinedReference reference;
+ protected Tref ref;
+ @XmlAnyElement(lax = true)
+ protected Object any;
+ protected Tref idref;
+ protected Tvalue value;
+ protected Tcollection list;
+ protected Tcollection set;
+ protected Tmap map;
+ protected Tcollection array;
+ protected Tprops props;
+ @XmlElement(name = "null")
+ protected Tnull _null;
+ @XmlAttribute(required = true)
+ @XmlJavaTypeAdapter(NormalizedStringAdapter.class)
+ protected String key;
+ @XmlAttribute(name = "value")
+ @XmlJavaTypeAdapter(NormalizedStringAdapter.class)
+ protected String valueAttribute;
+
+ /**
+ * Gets the value of the service property.
+ *
+ * @return
+ * possible object is
+ * {@link TinlinedService }
+ *
+ */
+ public TinlinedService getService() {
+ return service;
+ }
+
+ /**
+ * Sets the value of the service property.
+ *
+ * @param value
+ * allowed object is
+ * {@link TinlinedService }
+ *
+ */
+ public void setService(TinlinedService value) {
+ this.service = value;
+ }
+
+ /**
+ * Gets the value of the referenceList property.
+ *
+ * @return
+ * possible object is
+ * {@link TinlinedReferenceList }
+ *
+ */
+ public TinlinedReferenceList getReferenceList() {
+ return referenceList;
+ }
+
+ /**
+ * Sets the value of the referenceList property.
+ *
+ * @param value
+ * allowed object is
+ * {@link TinlinedReferenceList }
+ *
+ */
+ public void setReferenceList(TinlinedReferenceList value) {
+ this.referenceList = value;
+ }
+
+ /**
+ * Gets the value of the bean property.
+ *
+ * @return
+ * possible object is
+ * {@link TinlinedBean }
+ *
+ */
+ public TinlinedBean getBean() {
+ return bean;
+ }
+
+ /**
+ * Sets the value of the bean property.
+ *
+ * @param value
+ * allowed object is
+ * {@link TinlinedBean }
+ *
+ */
+ public void setBean(TinlinedBean value) {
+ this.bean = value;
+ }
+
+ /**
+ * Gets the value of the reference property.
+ *
+ * @return
+ * possible object is
+ * {@link TinlinedReference }
+ *
+ */
+ public TinlinedReference getReference() {
+ return reference;
+ }
+
+ /**
+ * Sets the value of the reference property.
+ *
+ * @param value
+ * allowed object is
+ * {@link TinlinedReference }
+ *
+ */
+ public void setReference(TinlinedReference value) {
+ this.reference = value;
+ }
+
+ /**
+ * Gets the value of the ref property.
+ *
+ * @return
+ * possible object is
+ * {@link Tref }
+ *
+ */
+ public Tref getRef() {
+ return ref;
+ }
+
+ /**
+ * Sets the value of the ref property.
+ *
+ * @param value
+ * allowed object is
+ * {@link Tref }
+ *
+ */
+ public void setRef(Tref value) {
+ this.ref = value;
+ }
+
+ /**
+ * Gets the value of the any property.
+ *
+ * @return
+ * possible object is
+ * {@link Object }
+ *
+ */
+ public Object getAny() {
+ return any;
+ }
+
+ /**
+ * Sets the value of the any property.
+ *
+ * @param value
+ * allowed object is
+ * {@link Object }
+ *
+ */
+ public void setAny(Object value) {
+ this.any = value;
+ }
+
+ /**
+ * Gets the value of the idref property.
+ *
+ * @return
+ * possible object is
+ * {@link Tref }
+ *
+ */
+ public Tref getIdref() {
+ return idref;
+ }
+
+ /**
+ * Sets the value of the idref property.
+ *
+ * @param value
+ * allowed object is
+ * {@link Tref }
+ *
+ */
+ public void setIdref(Tref value) {
+ this.idref = value;
+ }
+
+ /**
+ * Gets the value of the value property.
+ *
+ * @return
+ * possible object is
+ * {@link Tvalue }
+ *
+ */
+ public Tvalue getValue() {
+ return value;
+ }
+
+ /**
+ * Sets the value of the value property.
+ *
+ * @param value
+ * allowed object is
+ * {@link Tvalue }
+ *
+ */
+ public void setValue(Tvalue value) {
+ this.value = value;
+ }
+
+ /**
+ * Gets the value of the list property.
+ *
+ * @return
+ * possible object is
+ * {@link Tcollection }
+ *
+ */
+ public Tcollection getList() {
+ return list;
+ }
+
+ /**
+ * Sets the value of the list property.
+ *
+ * @param value
+ * allowed object is
+ * {@link Tcollection }
+ *
+ */
+ public void setList(Tcollection value) {
+ this.list = value;
+ }
+
+ /**
+ * Gets the value of the set property.
+ *
+ * @return
+ * possible object is
+ * {@link Tcollection }
+ *
+ */
+ public Tcollection getSet() {
+ return set;
+ }
+
+ /**
+ * Sets the value of the set property.
+ *
+ * @param value
+ * allowed object is
+ * {@link Tcollection }
+ *
+ */
+ public void setSet(Tcollection value) {
+ this.set = value;
+ }
+
+ /**
+ * Gets the value of the map property.
+ *
+ * @return
+ * possible object is
+ * {@link Tmap }
+ *
+ */
+ public Tmap getMap() {
+ return map;
+ }
+
+ /**
+ * Sets the value of the map property.
+ *
+ * @param value
+ * allowed object is
+ * {@link Tmap }
+ *
+ */
+ public void setMap(Tmap value) {
+ this.map = value;
+ }
+
+ /**
+ * Gets the value of the array property.
+ *
+ * @return
+ * possible object is
+ * {@link Tcollection }
+ *
+ */
+ public Tcollection getArray() {
+ return array;
+ }
+
+ /**
+ * Sets the value of the array property.
+ *
+ * @param value
+ * allowed object is
+ * {@link Tcollection }
+ *
+ */
+ public void setArray(Tcollection value) {
+ this.array = value;
+ }
+
+ /**
+ * Gets the value of the props property.
+ *
+ * @return
+ * possible object is
+ * {@link Tprops }
+ *
+ */
+ public Tprops getProps() {
+ return props;
+ }
+
+ /**
+ * Sets the value of the props property.
+ *
+ * @param value
+ * allowed object is
+ * {@link Tprops }
+ *
+ */
+ public void setProps(Tprops value) {
+ this.props = value;
+ }
+
+ /**
+ * Gets the value of the null property.
+ *
+ * @return
+ * possible object is
+ * {@link Tnull }
+ *
+ */
+ public Tnull getNull() {
+ return _null;
+ }
+
+ /**
+ * Sets the value of the null property.
+ *
+ * @param value
+ * allowed object is
+ * {@link Tnull }
+ *
+ */
+ public void setNull(Tnull value) {
+ this._null = value;
+ }
+
+ /**
+ * Gets the value of the key property.
+ *
+ * @return
+ * possible object is
+ * {@link String }
+ *
+ */
+ public String getKey() {
+ return key;
+ }
+
+ /**
+ * Sets the value of the key property.
+ *
+ * @param value
+ * allowed object is
+ * {@link String }
+ *
+ */
+ public void setKey(String value) {
+ this.key = value;
+ }
+
+ /**
+ * Gets the value of the valueAttribute property.
+ *
+ * @return
+ * possible object is
+ * {@link String }
+ *
+ */
+ public String getValueAttribute() {
+ return valueAttribute;
+ }
+
+ /**
+ * Sets the value of the valueAttribute property.
+ *
+ * @param value
+ * allowed object is
+ * {@link String }
+ *
+ */
+ public void setValueAttribute(String value) {
+ this.valueAttribute = value;
+ }
+
+}
Propchange: incubator/aries/sandbox/linsun/blueprint/blueprint-annotation-impl/src/main/java/org/apache/aries/blueprint/jaxb/TservicePropertyEntry.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: incubator/aries/sandbox/linsun/blueprint/blueprint-annotation-impl/src/main/java/org/apache/aries/blueprint/jaxb/TservicePropertyEntry.java
------------------------------------------------------------------------------
svn:keywords = Date Revision
Propchange: incubator/aries/sandbox/linsun/blueprint/blueprint-annotation-impl/src/main/java/org/apache/aries/blueprint/jaxb/TservicePropertyEntry.java
------------------------------------------------------------------------------
svn:mime-type = text/plain
Added: incubator/aries/sandbox/linsun/blueprint/blueprint-annotation-impl/src/main/java/org/apache/aries/blueprint/jaxb/TserviceReference.java
URL: http://svn.apache.org/viewvc/incubator/aries/sandbox/linsun/blueprint/blueprint-annotation-impl/src/main/java/org/apache/aries/blueprint/jaxb/TserviceReference.java?rev=939092&view=auto
==============================================================================
--- incubator/aries/sandbox/linsun/blueprint/blueprint-annotation-impl/src/main/java/org/apache/aries/blueprint/jaxb/TserviceReference.java (added)
+++ incubator/aries/sandbox/linsun/blueprint/blueprint-annotation-impl/src/main/java/org/apache/aries/blueprint/jaxb/TserviceReference.java Wed Apr 28 21:11:16 2010
@@ -0,0 +1,237 @@
+//
+// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vJAXB 2.1.3 in JDK 1.6
+// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a>
+// Any modifications to this file will be lost upon recompilation of the source schema.
+// Generated on: 2010.04.23 at 12:57:08 PM EDT
+//
+
+
+package org.apache.aries.blueprint.jaxb;
+
+import java.util.List;
+import java.util.Vector;
+import javax.xml.bind.annotation.XmlAccessType;
+import javax.xml.bind.annotation.XmlAccessorType;
+import javax.xml.bind.annotation.XmlAttribute;
+import javax.xml.bind.annotation.XmlElement;
+import javax.xml.bind.annotation.XmlRootElement;
+import javax.xml.bind.annotation.XmlSchemaType;
+import javax.xml.bind.annotation.XmlSeeAlso;
+import javax.xml.bind.annotation.XmlType;
+import javax.xml.bind.annotation.adapters.CollapsedStringAdapter;
+import javax.xml.bind.annotation.adapters.NormalizedStringAdapter;
+import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter;
+
+
+/**
+ *
+ *
+ * TserviceReference is the base element type used for <reference>
+ * and <reference-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>
+ * <group ref="{http://www.osgi.org/xmlns/blueprint/v1.0.0}GserviceReferenceElements"/>
+ * </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" />
+ * </extension>
+ * </complexContent>
+ * </complexType>
+ * </pre>
+ *
+ *
+ */
+@XmlAccessorType(XmlAccessType.FIELD)
+@XmlType(name = "TserviceReference", namespace = "http://www.osgi.org/xmlns/blueprint/v1.0.0", propOrder = {
+ "description",
+ "referenceListener"
+})
+@XmlSeeAlso({
+ TreferenceList.class,
+ Treference.class
+})
+@XmlRootElement(name = "serviceReference")
+public class TserviceReference
+ extends Tcomponent
+{
+
+ protected Tdescription description;
+ @XmlElement(name = "reference-listener")
+ protected List<TreferenceListener> referenceListener = new Vector<TreferenceListener>();
+ @XmlAttribute(name = "interface")
+ @XmlJavaTypeAdapter(CollapsedStringAdapter.class)
+ protected String _interface;
+ @XmlAttribute
+ @XmlJavaTypeAdapter(NormalizedStringAdapter.class)
+ @XmlSchemaType(name = "normalizedString")
+ protected String filter;
+ @XmlAttribute(name = "component-name")
+ @XmlJavaTypeAdapter(CollapsedStringAdapter.class)
+ protected String componentName;
+ @XmlAttribute
+ @XmlJavaTypeAdapter(CollapsedStringAdapter.class)
+ protected String availability;
+
+ /**
+ * Gets the value of the description property.
+ *
+ * @return
+ * possible object is
+ * {@link Tdescription }
+ *
+ */
+ public Tdescription getDescription() {
+ return description;
+ }
+
+ /**
+ * Sets the value of the description property.
+ *
+ * @param value
+ * allowed object is
+ * {@link Tdescription }
+ *
+ */
+ public void setDescription(Tdescription value) {
+ this.description = value;
+ }
+
+ /**
+ * Gets the value of the referenceListener 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 referenceListener property.
+ *
+ * <p>
+ * For example, to add a new item, do as follows:
+ * <pre>
+ * getReferenceListener().add(newItem);
+ * </pre>
+ *
+ *
+ * <p>
+ * Objects of the following type(s) are allowed in the list
+ * {@link TreferenceListener }
+ *
+ *
+ */
+ public List<TreferenceListener> getReferenceListener() {
+ if (referenceListener == null) {
+ referenceListener = new Vector<TreferenceListener>();
+ }
+ return this.referenceListener;
+ }
+
+ /**
+ * 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 String }
+ *
+ */
+ public String getAvailability() {
+ return availability;
+ }
+
+ /**
+ * Sets the value of the availability property.
+ *
+ * @param value
+ * allowed object is
+ * {@link String }
+ *
+ */
+ public void setAvailability(String value) {
+ this.availability = value;
+ }
+
+}
Propchange: incubator/aries/sandbox/linsun/blueprint/blueprint-annotation-impl/src/main/java/org/apache/aries/blueprint/jaxb/TserviceReference.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: incubator/aries/sandbox/linsun/blueprint/blueprint-annotation-impl/src/main/java/org/apache/aries/blueprint/jaxb/TserviceReference.java
------------------------------------------------------------------------------
svn:keywords = Date Revision
Propchange: incubator/aries/sandbox/linsun/blueprint/blueprint-annotation-impl/src/main/java/org/apache/aries/blueprint/jaxb/TserviceReference.java
------------------------------------------------------------------------------
svn:mime-type = text/plain
Added: incubator/aries/sandbox/linsun/blueprint/blueprint-annotation-impl/src/main/java/org/apache/aries/blueprint/jaxb/TtypeConverters.java
URL: http://svn.apache.org/viewvc/incubator/aries/sandbox/linsun/blueprint/blueprint-annotation-impl/src/main/java/org/apache/aries/blueprint/jaxb/TtypeConverters.java?rev=939092&view=auto
==============================================================================
--- incubator/aries/sandbox/linsun/blueprint/blueprint-annotation-impl/src/main/java/org/apache/aries/blueprint/jaxb/TtypeConverters.java (added)
+++ incubator/aries/sandbox/linsun/blueprint/blueprint-annotation-impl/src/main/java/org/apache/aries/blueprint/jaxb/TtypeConverters.java Wed Apr 28 21:11:16 2010
@@ -0,0 +1,100 @@
+//
+// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vJAXB 2.1.3 in JDK 1.6
+// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a>
+// Any modifications to this file will be lost upon recompilation of the source schema.
+// Generated on: 2010.04.23 at 12:57:08 PM EDT
+//
+
+
+package org.apache.aries.blueprint.jaxb;
+
+import java.util.List;
+import java.util.Vector;
+import javax.xml.bind.JAXBElement;
+import javax.xml.bind.annotation.XmlAccessType;
+import javax.xml.bind.annotation.XmlAccessorType;
+import javax.xml.bind.annotation.XmlAnyElement;
+import javax.xml.bind.annotation.XmlElementRef;
+import javax.xml.bind.annotation.XmlElementRefs;
+import javax.xml.bind.annotation.XmlRootElement;
+import javax.xml.bind.annotation.XmlType;
+
+
+/**
+ *
+ *
+ * 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 converter 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">
+ * <element name="bean" type="{http://www.osgi.org/xmlns/blueprint/v1.0.0}Tbean"/>
+ * <element name="reference" type="{http://www.osgi.org/xmlns/blueprint/v1.0.0}Treference"/>
+ * <element name="ref" type="{http://www.osgi.org/xmlns/blueprint/v1.0.0}Tref"/>
+ * <any/>
+ * </choice>
+ * </restriction>
+ * </complexContent>
+ * </complexType>
+ * </pre>
+ *
+ *
+ */
+@XmlAccessorType(XmlAccessType.FIELD)
+@XmlType(name = "Ttype-converters", namespace = "http://www.osgi.org/xmlns/blueprint/v1.0.0", propOrder = {
+ "beanOrReferenceOrRef"
+})
+@XmlRootElement(name = "typeConverters")
+public class TtypeConverters {
+
+ @XmlElementRefs({
+ @XmlElementRef(name = "ref", namespace = "http://www.osgi.org/xmlns/blueprint/v1.0.0", type = JAXBElement.class),
+ @XmlElementRef(name = "bean", namespace = "http://www.osgi.org/xmlns/blueprint/v1.0.0", type = JAXBElement.class),
+ @XmlElementRef(name = "reference", namespace = "http://www.osgi.org/xmlns/blueprint/v1.0.0", type = JAXBElement.class)
+ })
+ @XmlAnyElement(lax = true)
+ protected List<Object> beanOrReferenceOrRef = new Vector<Object>();
+
+ /**
+ * Gets the value of the beanOrReferenceOrRef 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 beanOrReferenceOrRef property.
+ *
+ * <p>
+ * For example, to add a new item, do as follows:
+ * <pre>
+ * getBeanOrReferenceOrRef().add(newItem);
+ * </pre>
+ *
+ *
+ * <p>
+ * Objects of the following type(s) are allowed in the list
+ * {@link Object }
+ * {@link JAXBElement }{@code <}{@link Tref }{@code >}
+ * {@link JAXBElement }{@code <}{@link Tbean }{@code >}
+ * {@link JAXBElement }{@code <}{@link Treference }{@code >}
+ *
+ *
+ */
+ public List<Object> getBeanOrReferenceOrRef() {
+ if (beanOrReferenceOrRef == null) {
+ beanOrReferenceOrRef = new Vector<Object>();
+ }
+ return this.beanOrReferenceOrRef;
+ }
+
+}
Propchange: incubator/aries/sandbox/linsun/blueprint/blueprint-annotation-impl/src/main/java/org/apache/aries/blueprint/jaxb/TtypeConverters.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: incubator/aries/sandbox/linsun/blueprint/blueprint-annotation-impl/src/main/java/org/apache/aries/blueprint/jaxb/TtypeConverters.java
------------------------------------------------------------------------------
svn:keywords = Date Revision
Propchange: incubator/aries/sandbox/linsun/blueprint/blueprint-annotation-impl/src/main/java/org/apache/aries/blueprint/jaxb/TtypeConverters.java
------------------------------------------------------------------------------
svn:mime-type = text/plain
Added: incubator/aries/sandbox/linsun/blueprint/blueprint-annotation-impl/src/main/java/org/apache/aries/blueprint/jaxb/TtypedCollection.java
URL: http://svn.apache.org/viewvc/incubator/aries/sandbox/linsun/blueprint/blueprint-annotation-impl/src/main/java/org/apache/aries/blueprint/jaxb/TtypedCollection.java?rev=939092&view=auto
==============================================================================
--- incubator/aries/sandbox/linsun/blueprint/blueprint-annotation-impl/src/main/java/org/apache/aries/blueprint/jaxb/TtypedCollection.java (added)
+++ incubator/aries/sandbox/linsun/blueprint/blueprint-annotation-impl/src/main/java/org/apache/aries/blueprint/jaxb/TtypedCollection.java Wed Apr 28 21:11:16 2010
@@ -0,0 +1,82 @@
+//
+// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vJAXB 2.1.3 in JDK 1.6
+// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a>
+// Any modifications to this file will be lost upon recompilation of the source schema.
+// Generated on: 2010.04.23 at 12:57:08 PM EDT
+//
+
+
+package org.apache.aries.blueprint.jaxb;
+
+import javax.xml.bind.annotation.XmlAccessType;
+import javax.xml.bind.annotation.XmlAccessorType;
+import javax.xml.bind.annotation.XmlAttribute;
+import javax.xml.bind.annotation.XmlRootElement;
+import javax.xml.bind.annotation.XmlSeeAlso;
+import javax.xml.bind.annotation.XmlType;
+import javax.xml.bind.annotation.adapters.CollapsedStringAdapter;
+import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter;
+
+
+/**
+ *
+ *
+ * TtypeCollection defines comment attributes shared among different
+ * collection types that allow a default value type to be specified.
+ *
+ *
+ *
+ * <p>Java class for TtypedCollection complex type.
+ *
+ * <p>The following schema fragment specifies the expected content contained within this class.
+ *
+ * <pre>
+ * <complexType name="TtypedCollection">
+ * <complexContent>
+ * <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ * <attribute name="value-type" type="{http://www.osgi.org/xmlns/blueprint/v1.0.0}Ttype" />
+ * </restriction>
+ * </complexContent>
+ * </complexType>
+ * </pre>
+ *
+ *
+ */
+@XmlAccessorType(XmlAccessType.FIELD)
+@XmlType(name = "TtypedCollection", namespace = "http://www.osgi.org/xmlns/blueprint/v1.0.0")
+@XmlSeeAlso({
+ Tmap.class,
+ Tcollection.class
+})
+@XmlRootElement(name = "typedCollection")
+public class TtypedCollection {
+
+ @XmlAttribute(name = "value-type")
+ @XmlJavaTypeAdapter(CollapsedStringAdapter.class)
+ protected String valueType;
+
+ /**
+ * Gets the value of the valueType property.
+ *
+ * @return
+ * possible object is
+ * {@link String }
+ *
+ */
+ public String getValueType() {
+ return valueType;
+ }
+
+ /**
+ * Sets the value of the valueType property.
+ *
+ * @param value
+ * allowed object is
+ * {@link String }
+ *
+ */
+ public void setValueType(String value) {
+ this.valueType = value;
+ }
+
+}
Propchange: incubator/aries/sandbox/linsun/blueprint/blueprint-annotation-impl/src/main/java/org/apache/aries/blueprint/jaxb/TtypedCollection.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: incubator/aries/sandbox/linsun/blueprint/blueprint-annotation-impl/src/main/java/org/apache/aries/blueprint/jaxb/TtypedCollection.java
------------------------------------------------------------------------------
svn:keywords = Date Revision
Propchange: incubator/aries/sandbox/linsun/blueprint/blueprint-annotation-impl/src/main/java/org/apache/aries/blueprint/jaxb/TtypedCollection.java
------------------------------------------------------------------------------
svn:mime-type = text/plain
Added: incubator/aries/sandbox/linsun/blueprint/blueprint-annotation-impl/src/main/java/org/apache/aries/blueprint/jaxb/Tvalue.java
URL: http://svn.apache.org/viewvc/incubator/aries/sandbox/linsun/blueprint/blueprint-annotation-impl/src/main/java/org/apache/aries/blueprint/jaxb/Tvalue.java?rev=939092&view=auto
==============================================================================
--- incubator/aries/sandbox/linsun/blueprint/blueprint-annotation-impl/src/main/java/org/apache/aries/blueprint/jaxb/Tvalue.java (added)
+++ incubator/aries/sandbox/linsun/blueprint/blueprint-annotation-impl/src/main/java/org/apache/aries/blueprint/jaxb/Tvalue.java Wed Apr 28 21:11:16 2010
@@ -0,0 +1,125 @@
+//
+// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vJAXB 2.1.3 in JDK 1.6
+// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a>
+// Any modifications to this file will be lost upon recompilation of the source schema.
+// Generated on: 2010.04.23 at 12:57:08 PM EDT
+//
+
+
+package org.apache.aries.blueprint.jaxb;
+
+import javax.xml.bind.annotation.XmlAccessType;
+import javax.xml.bind.annotation.XmlAccessorType;
+import javax.xml.bind.annotation.XmlAttribute;
+import javax.xml.bind.annotation.XmlRootElement;
+import javax.xml.bind.annotation.XmlType;
+import javax.xml.bind.annotation.XmlValue;
+import javax.xml.bind.annotation.adapters.CollapsedStringAdapter;
+import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter;
+
+
+/**
+ *
+ *
+ * Tvalue is the type used for <value> elements. The <value> element
+ * is used for types that can be created from a single string value.
+ * The string value is the data value for the element. The optional
+ * type attribute allows a target conversion value to be explicitly
+ * specified.
+ *
+ *
+ *
+ * <p>Java class for Tvalue complex type.
+ *
+ * <p>The following schema fragment specifies the expected content contained within this class.
+ *
+ * <pre>
+ * <complexType name="Tvalue">
+ * <complexContent>
+ * <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ * <attribute name="type" type="{http://www.osgi.org/xmlns/blueprint/v1.0.0}Ttype" />
+ * </restriction>
+ * </complexContent>
+ * </complexType>
+ * </pre>
+ *
+ *
+ */
+@XmlAccessorType(XmlAccessType.FIELD)
+@XmlType(name = "Tvalue", namespace = "http://www.osgi.org/xmlns/blueprint/v1.0.0", propOrder = {
+ "content"
+})
+@XmlRootElement(name = "value")
+public class Tvalue {
+
+ @XmlValue
+ protected String content;
+ @XmlAttribute
+ @XmlJavaTypeAdapter(CollapsedStringAdapter.class)
+ protected String type;
+
+ /**
+ *
+ *
+ * Tvalue is the type used for <value> elements. The <value> element
+ * is used for types that can be created from a single string value.
+ * The string value is the data value for the element. The optional
+ * type attribute allows a target conversion value to be explicitly
+ * specified.
+ *
+ *
+ *
+ * @return
+ * possible object is
+ * {@link String }
+ *
+ */
+ public String getContent() {
+ return content;
+ }
+
+ /**
+ *
+ *
+ * Tvalue is the type used for <value> elements. The <value> element
+ * is used for types that can be created from a single string value.
+ * The string value is the data value for the element. The optional
+ * type attribute allows a target conversion value to be explicitly
+ * specified.
+ *
+ *
+ *
+ * @param value
+ * allowed object is
+ * {@link String }
+ *
+ */
+ public void setContent(String value) {
+ this.content = value;
+ }
+
+ /**
+ * Gets the value of the type property.
+ *
+ * @return
+ * possible object is
+ * {@link String }
+ *
+ */
+ public String getType() {
+ return type;
+ }
+
+ /**
+ * Sets the value of the type property.
+ *
+ * @param value
+ * allowed object is
+ * {@link String }
+ *
+ */
+ public void setType(String value) {
+ this.type = value;
+ }
+
+}
Propchange: incubator/aries/sandbox/linsun/blueprint/blueprint-annotation-impl/src/main/java/org/apache/aries/blueprint/jaxb/Tvalue.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: incubator/aries/sandbox/linsun/blueprint/blueprint-annotation-impl/src/main/java/org/apache/aries/blueprint/jaxb/Tvalue.java
------------------------------------------------------------------------------
svn:keywords = Date Revision
Propchange: incubator/aries/sandbox/linsun/blueprint/blueprint-annotation-impl/src/main/java/org/apache/aries/blueprint/jaxb/Tvalue.java
------------------------------------------------------------------------------
svn:mime-type = text/plain
Added: incubator/aries/sandbox/linsun/blueprint/blueprint-annotation-impl/src/main/java/org/apache/aries/blueprint/jaxb/package-info.java
URL: http://svn.apache.org/viewvc/incubator/aries/sandbox/linsun/blueprint/blueprint-annotation-impl/src/main/java/org/apache/aries/blueprint/jaxb/package-info.java?rev=939092&view=auto
==============================================================================
--- incubator/aries/sandbox/linsun/blueprint/blueprint-annotation-impl/src/main/java/org/apache/aries/blueprint/jaxb/package-info.java (added)
+++ incubator/aries/sandbox/linsun/blueprint/blueprint-annotation-impl/src/main/java/org/apache/aries/blueprint/jaxb/package-info.java Wed Apr 28 21:11:16 2010
@@ -0,0 +1,9 @@
+//
+// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vJAXB 2.1.3 in JDK 1.6
+// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a>
+// Any modifications to this file will be lost upon recompilation of the source schema.
+// Generated on: 2010.04.23 at 12:57:08 PM EDT
+//
+
+@javax.xml.bind.annotation.XmlSchema(namespace = "http://www.osgi.org/xmlns/blueprint/v1.0.0", elementFormDefault = javax.xml.bind.annotation.XmlNsForm.QUALIFIED)
+package org.apache.aries.blueprint.jaxb;
Propchange: incubator/aries/sandbox/linsun/blueprint/blueprint-annotation-impl/src/main/java/org/apache/aries/blueprint/jaxb/package-info.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: incubator/aries/sandbox/linsun/blueprint/blueprint-annotation-impl/src/main/java/org/apache/aries/blueprint/jaxb/package-info.java
------------------------------------------------------------------------------
svn:keywords = Date Revision
Propchange: incubator/aries/sandbox/linsun/blueprint/blueprint-annotation-impl/src/main/java/org/apache/aries/blueprint/jaxb/package-info.java
------------------------------------------------------------------------------
svn:mime-type = text/plain
Added: incubator/aries/sandbox/linsun/blueprint/blueprint-annotation-itest/pom.xml
URL: http://svn.apache.org/viewvc/incubator/aries/sandbox/linsun/blueprint/blueprint-annotation-itest/pom.xml?rev=939092&view=auto
==============================================================================
--- incubator/aries/sandbox/linsun/blueprint/blueprint-annotation-itest/pom.xml (added)
+++ incubator/aries/sandbox/linsun/blueprint/blueprint-annotation-itest/pom.xml Wed Apr 28 21:11:16 2010
@@ -0,0 +1,214 @@
+<!--
+ Licensed to the Apache Software Foundation (ASF) under one
+ or more contributor license agreements. See the NOTICE file
+ distributed with this work for additional information
+ regarding copyright ownership. The ASF licenses this file
+ to you under the Apache License, Version 2.0 (the
+ "License"); you may not use this file except in compliance
+ with the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing,
+ software distributed under the License is distributed on an
+ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ KIND, either express or implied. See the License for the
+ specific language governing permissions and limitations
+ under the License.
+-->
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+ <modelVersion>4.0.0</modelVersion>
+ <parent>
+ <groupId>org.apache.aries.blueprint</groupId>
+ <artifactId>blueprint</artifactId>
+ <version>0.2-incubating-SNAPSHOT</version>
+ </parent>
+
+ <artifactId>org.apache.aries.blueprint.annotation.itests</artifactId>
+ <name>Apache Aries Blueprint Annotation iTests</name>
+ <description>
+ Integration tests using the standalone blueprint-bundle for the implementation
+ and blueprint-sample-annotation for the blueprint application to be tested.
+ </description>
+
+ <dependencies>
+ <dependency>
+ <groupId>org.osgi</groupId>
+ <artifactId>org.osgi.core</artifactId>
+ <scope>provided</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.osgi</groupId>
+ <artifactId>org.osgi.compendium</artifactId>
+ <scope>provided</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.eclipse</groupId>
+ <artifactId>osgi</artifactId>
+ <scope>provided</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.aries.blueprint</groupId>
+ <artifactId>org.apache.aries.blueprint</artifactId>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.aries</groupId>
+ <artifactId>org.apache.aries.util</artifactId>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.aries.blueprint</groupId>
+ <artifactId>org.apache.aries.blueprint.sample</artifactId>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.aries.blueprint</groupId>
+ <artifactId>org.apache.aries.blueprint.sample-annotation</artifactId>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.aries.blueprint</groupId>
+ <artifactId>org.apache.aries.blueprint.testbundlea</artifactId>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.aries.blueprint</groupId>
+ <artifactId>org.apache.aries.blueprint.testbundleb</artifactId>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.ops4j.pax.exam</groupId>
+ <artifactId>pax-exam</artifactId>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.ops4j.pax.exam</groupId>
+ <artifactId>pax-exam-junit</artifactId>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.ops4j.pax.exam</groupId>
+ <artifactId>pax-exam-container-default</artifactId>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.ops4j.pax.exam</groupId>
+ <artifactId>pax-exam-junit-extender-impl</artifactId>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.ops4j.pax.runner</groupId>
+ <artifactId>pax-runner-no-jcl</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>junit</groupId>
+ <artifactId>junit</artifactId>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.felix</groupId>
+ <artifactId>org.apache.felix.configadmin</artifactId>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.ops4j.pax.logging</groupId>
+ <artifactId>pax-logging-api</artifactId>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.ops4j.pax.logging</groupId>
+ <artifactId>pax-logging-service</artifactId>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.ops4j.pax.url</groupId>
+ <artifactId>pax-url-mvn</artifactId>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.servicemix.bundles</groupId>
+ <artifactId>org.apache.servicemix.bundles.cglib</artifactId>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>asm</groupId>
+ <artifactId>asm-all</artifactId>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.xbean</groupId>
+ <artifactId>xbean-finder</artifactId>
+ <version>3.7-SNAPSHOT</version>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.aries.blueprint</groupId>
+ <artifactId>org.apache.aries.blueprint.annotation.api</artifactId>
+ <version>${version}</version>
+ </dependency>
+
+ </dependencies>
+
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-surefire-plugin</artifactId>
+ <configuration>
+ <forkMode>pertest</forkMode>
+ <excludes>
+ <exclude>**/*$*</exclude>
+ <exclude>**/Abstract*.java</exclude>
+ </excludes>
+ <includes>
+ <include>**/Test*.java</include>
+ <include>**/*Test.java</include>
+ </includes>
+ </configuration>
+ </plugin>
+ <plugin>
+ <groupId>org.ops4j.pax.exam</groupId>
+ <artifactId>maven-paxexam-plugin</artifactId>
+ <executions>
+ <execution>
+ <id>generate-config</id>
+ <goals>
+ <goal>generate-depends-file</goal>
+ </goals>
+ <configuration>
+ <outputFile>${project.build.directory}/test-classes/META-INF/maven/dependencies.properties</outputFile>
+ </configuration>
+ </execution>
+ </executions>
+ </plugin>
+ </plugins>
+ </build>
+
+ <profiles>
+ <profile>
+ <id>ci-build-profile</id>
+ <activation>
+ <property>
+ <name>maven.repo.local</name>
+ </property>
+ </activation>
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-surefire-plugin</artifactId>
+ <configuration>
+ <!--
+ when the local repo location has been specified, we need to pass
+ on this information to PAX mvn url
+ -->
+ <argLine>-Dorg.ops4j.pax.url.mvn.localRepository=${maven.repo.local}</argLine>
+ </configuration>
+ </plugin>
+ </plugins>
+ </build>
+ </profile>
+ </profiles>
+
+</project>
Propchange: incubator/aries/sandbox/linsun/blueprint/blueprint-annotation-itest/pom.xml
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: incubator/aries/sandbox/linsun/blueprint/blueprint-annotation-itest/pom.xml
------------------------------------------------------------------------------
svn:keywords = Date Revision
Propchange: incubator/aries/sandbox/linsun/blueprint/blueprint-annotation-itest/pom.xml
------------------------------------------------------------------------------
svn:mime-type = text/xml
Added: incubator/aries/sandbox/linsun/blueprint/blueprint-annotation-itest/src/test/java/org/apache/aries/blueprint/itests/AbstractIntegrationTest.java
URL: http://svn.apache.org/viewvc/incubator/aries/sandbox/linsun/blueprint/blueprint-annotation-itest/src/test/java/org/apache/aries/blueprint/itests/AbstractIntegrationTest.java?rev=939092&view=auto
==============================================================================
--- incubator/aries/sandbox/linsun/blueprint/blueprint-annotation-itest/src/test/java/org/apache/aries/blueprint/itests/AbstractIntegrationTest.java (added)
+++ incubator/aries/sandbox/linsun/blueprint/blueprint-annotation-itest/src/test/java/org/apache/aries/blueprint/itests/AbstractIntegrationTest.java Wed Apr 28 21:11:16 2010
@@ -0,0 +1,278 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.aries.blueprint.itests;
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.assertSame;
+import static org.junit.Assert.assertTrue;
+import static org.junit.Assert.fail;
+
+import java.io.*;
+import java.net.URISyntaxException;
+import java.net.URL;
+import java.text.SimpleDateFormat;
+import java.util.ArrayList;
+import java.util.Currency;
+import java.util.List;
+import java.util.Properties;
+
+import org.apache.aries.blueprint.sample.Bar;
+import org.apache.aries.blueprint.sample.Foo;
+import org.junit.After;
+import org.junit.Before;
+import org.ops4j.pax.exam.CoreOptions;
+import static org.ops4j.pax.exam.CoreOptions.options;
+import static org.ops4j.pax.exam.CoreOptions.wrappedBundle;
+import org.ops4j.pax.exam.Inject;
+import org.ops4j.pax.exam.Option;
+import static org.ops4j.pax.exam.OptionUtils.combine;
+import org.ops4j.pax.exam.options.MavenArtifactProvisionOption;
+import org.osgi.framework.Bundle;
+import org.osgi.framework.BundleContext;
+import org.osgi.framework.Constants;
+import org.osgi.framework.Filter;
+import org.osgi.framework.FrameworkUtil;
+import org.osgi.framework.InvalidSyntaxException;
+import org.osgi.service.blueprint.container.BlueprintContainer;
+import org.osgi.util.tracker.ServiceTracker;
+
+public abstract class AbstractIntegrationTest {
+
+ public static final long DEFAULT_TIMEOUT = 30000;
+
+ private List<ServiceTracker> srs;
+
+ @Before
+ public void setUp() {
+ srs = new ArrayList<ServiceTracker>();
+ }
+
+ @After
+ public void tearDown() throws Exception{
+ for (ServiceTracker st : srs) {
+ if (st != null) {
+ st.close();
+ }
+ }
+ }
+
+ @Inject
+ protected BundleContext bundleContext;
+
+ protected BlueprintContainer getBlueprintContainerForBundle(String symbolicName) throws Exception {
+ return getBlueprintContainerForBundle(symbolicName, DEFAULT_TIMEOUT);
+ }
+
+ protected BlueprintContainer getBlueprintContainerForBundle(String symbolicName, long timeout) throws Exception {
+ return getOsgiService(BlueprintContainer.class, "(osgi.blueprint.container.symbolicname=" + symbolicName + ")", timeout);
+ }
+
+ protected BlueprintContainer getBlueprintContainerForBundle(BundleContext bc, String symbolicName, long timeout) throws Exception {
+ return getOsgiService(bc, BlueprintContainer.class, "(osgi.blueprint.container.symbolicname=" + symbolicName + ")", timeout);
+ }
+
+ protected <T> T getOsgiService(Class<T> type, long timeout) {
+ return getOsgiService(type, null, timeout);
+ }
+
+ protected <T> T getOsgiService(Class<T> type) {
+ return getOsgiService(type, null, DEFAULT_TIMEOUT);
+ }
+
+ protected <T> T getOsgiService(BundleContext bc, Class<T> type, String filter, long timeout) {
+ ServiceTracker tracker = null;
+ try {
+ String flt;
+ if (filter != null) {
+ if (filter.startsWith("(")) {
+ flt = "(&(" + Constants.OBJECTCLASS + "=" + type.getName() + ")" + filter + ")";
+ } else {
+ flt = "(&(" + Constants.OBJECTCLASS + "=" + type.getName() + ")(" + filter + "))";
+ }
+ } else {
+ flt = "(" + Constants.OBJECTCLASS + "=" + type.getName() + ")";
+ }
+ Filter osgiFilter = FrameworkUtil.createFilter(flt);
+ tracker = new ServiceTracker(bc == null ? bundleContext : bc, osgiFilter, null);
+ tracker.open();
+
+ // add tracker to the list of trackers we close at tear down
+ srs.add(tracker);
+ Object svc = type.cast(tracker.waitForService(timeout));
+ if (svc == null) {
+ throw new RuntimeException("Gave up waiting for service " + flt);
+ }
+ return type.cast(svc);
+ } catch (InvalidSyntaxException e) {
+ throw new IllegalArgumentException("Invalid filter", e);
+ } catch (InterruptedException e) {
+ throw new RuntimeException(e);
+ }
+ }
+
+ protected <T> T getOsgiService(Class<T> type, String filter, long timeout) {
+ return getOsgiService(null, type, filter, timeout);
+ }
+
+ protected Bundle installBundle(String groupId, String artifactId) throws Exception {
+ MavenArtifactProvisionOption mvnUrl = mavenBundle(groupId, artifactId);
+ return bundleContext.installBundle(mvnUrl.getURL());
+ }
+
+ protected Bundle getInstalledBundle(String symbolicName) {
+ for (Bundle b : bundleContext.getBundles()) {
+ if (b.getSymbolicName().equals(symbolicName)) {
+ return b;
+ }
+ }
+ return null;
+ }
+
+ public static MavenArtifactProvisionOption mavenBundle(String groupId, String artifactId) {
+ return CoreOptions.mavenBundle().groupId(groupId).artifactId(artifactId).versionAsInProject();
+ }
+
+ public static MavenArtifactProvisionOption mavenBundleInTest(String groupId, String artifactId) {
+ return CoreOptions.mavenBundle().groupId(groupId).artifactId(artifactId).version(getArtifactVersion(groupId, artifactId));
+ }
+
+ //TODO getArtifactVersion and getFileFromClasspath are borrowed and modified from pax-exam. They should be moved back ASAP.
+ public static String getArtifactVersion( final String groupId,
+ final String artifactId )
+ {
+ final Properties dependencies = new Properties();
+ try
+ {
+ InputStream in = getFileFromClasspath("META-INF/maven/dependencies.properties");
+ try {
+ dependencies.load(in);
+ } finally {
+ in.close();
+ }
+ final String version = dependencies.getProperty( groupId + "/" + artifactId + "/version" );
+ if( version == null )
+ {
+ throw new RuntimeException(
+ "Could not resolve version. Do you have a dependency for " + groupId + "/" + artifactId
+ + " in your maven project?"
+ );
+ }
+ return version;
+ }
+ catch( IOException e )
+ {
+ // TODO throw a better exception
+ throw new RuntimeException(
+ "Could not resolve version. Did you configured the plugin in your maven project?"
+ + "Or maybe you did not run the maven build and you are using an IDE?"
+ );
+ }
+ }
+
+ private static InputStream getFileFromClasspath( final String filePath )
+ throws FileNotFoundException
+ {
+ try
+ {
+ URL fileURL = AbstractIntegrationTest.class.getClassLoader().getResource( filePath );
+ if( fileURL == null )
+ {
+ throw new FileNotFoundException( "File [" + filePath + "] could not be found in classpath" );
+ }
+ return fileURL.openStream();
+ }
+ catch (IOException e)
+ {
+ throw new FileNotFoundException( "File [" + filePath + "] could not be found: " + e.getMessage() );
+ }
+ }
+
+
+ protected static Option[] updateOptions(Option[] options) {
+ // We need to add pax-exam-junit here when running with the ibm
+ // jdk to avoid the following exception during the test run:
+ // ClassNotFoundException: org.ops4j.pax.exam.junit.Configuration
+ if ("IBM Corporation".equals(System.getProperty("java.vendor"))) {
+ Option[] ibmOptions = options(
+ wrappedBundle(mavenBundle("org.ops4j.pax.exam", "pax-exam-junit"))
+ );
+ options = combine(ibmOptions, options);
+ }
+
+ return options;
+ }
+
+ protected void testBlueprintContainer(Bundle bundle) throws Exception {
+ testBlueprintContainer(bundleContext, bundle);
+ }
+
+
+ protected void testBlueprintContainer(BundleContext bc, Bundle bundle) throws Exception {
+ BlueprintContainer blueprintContainer = getBlueprintContainerForBundle(
+ bc == null ? bundleContext : bc, "org.apache.aries.blueprint.sample",
+ 5000);
+ assertNotNull(blueprintContainer);
+
+ Object obj = blueprintContainer.getComponentInstance("bar");
+ assertNotNull(obj);
+ assertEquals(Bar.class, obj.getClass());
+ Bar bar = (Bar) obj;
+ assertNotNull(bar.getContext());
+ assertEquals("Hello FooBar", bar.getValue());
+ assertNotNull(bar.getList());
+ assertEquals(2, bar.getList().size());
+ assertEquals("a list element", bar.getList().get(0));
+ assertEquals(Integer.valueOf(5), bar.getList().get(1));
+ obj = blueprintContainer.getComponentInstance("foo");
+ assertNotNull(obj);
+ assertEquals(Foo.class, obj.getClass());
+ Foo foo = (Foo) obj;
+ assertEquals(5, foo.getA());
+ assertEquals(10, foo.getB());
+ assertSame(bar, foo.getBar());
+ assertEquals(Currency.getInstance("PLN"), foo.getCurrency());
+ assertEquals(new SimpleDateFormat("yyyy.MM.dd").parse("2009.04.17"),
+ foo.getDate());
+
+ assertTrue(foo.isInitialized());
+ assertFalse(foo.isDestroyed());
+
+ obj = getOsgiService(bc == null ? bundleContext : bc, Foo.class, null, 5000);
+ assertNotNull(obj);
+ assertSame(foo, obj);
+
+ bundle.stop();
+
+ Thread.sleep(1000);
+
+ try {
+ blueprintContainer = getBlueprintContainerForBundle(bc == null ? bundleContext : bc,
+ "org.apache.aries.blueprint.sample", 1);
+ fail("BlueprintContainer should have been unregistered");
+ } catch (Exception e) {
+ // Expected, as the module container should have been unregistered
+ }
+
+ assertTrue(foo.isInitialized());
+ assertTrue(foo.isDestroyed());
+ }
+
+}
Propchange: incubator/aries/sandbox/linsun/blueprint/blueprint-annotation-itest/src/test/java/org/apache/aries/blueprint/itests/AbstractIntegrationTest.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: incubator/aries/sandbox/linsun/blueprint/blueprint-annotation-itest/src/test/java/org/apache/aries/blueprint/itests/AbstractIntegrationTest.java
------------------------------------------------------------------------------
svn:keywords = Date Revision
Propchange: incubator/aries/sandbox/linsun/blueprint/blueprint-annotation-itest/src/test/java/org/apache/aries/blueprint/itests/AbstractIntegrationTest.java
------------------------------------------------------------------------------
svn:mime-type = text/plain
Added: incubator/aries/sandbox/linsun/blueprint/blueprint-annotation-itest/src/test/java/org/apache/aries/blueprint/itests/BlueprintAnnotationTest.java
URL: http://svn.apache.org/viewvc/incubator/aries/sandbox/linsun/blueprint/blueprint-annotation-itest/src/test/java/org/apache/aries/blueprint/itests/BlueprintAnnotationTest.java?rev=939092&view=auto
==============================================================================
--- incubator/aries/sandbox/linsun/blueprint/blueprint-annotation-itest/src/test/java/org/apache/aries/blueprint/itests/BlueprintAnnotationTest.java (added)
+++ incubator/aries/sandbox/linsun/blueprint/blueprint-annotation-itest/src/test/java/org/apache/aries/blueprint/itests/BlueprintAnnotationTest.java Wed Apr 28 21:11:16 2010
@@ -0,0 +1,96 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.aries.blueprint.itests;
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.assertSame;
+import static org.junit.Assert.assertTrue;
+import static org.junit.Assert.fail;
+import static org.ops4j.pax.exam.CoreOptions.equinox;
+import static org.ops4j.pax.exam.CoreOptions.options;
+import static org.ops4j.pax.exam.CoreOptions.systemProperty;
+
+import java.text.SimpleDateFormat;
+import java.util.Currency;
+import java.util.Hashtable;
+
+import org.apache.aries.blueprint.sample.Bar;
+import org.apache.aries.blueprint.sample.Foo;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.ops4j.pax.exam.Option;
+import org.ops4j.pax.exam.junit.JUnit4TestRunner;
+import org.osgi.framework.Bundle;
+import org.osgi.service.blueprint.container.BlueprintContainer;
+import org.osgi.service.cm.Configuration;
+import org.osgi.service.cm.ConfigurationAdmin;
+
+@RunWith(JUnit4TestRunner.class)
+public class BlueprintAnnotationTest extends AbstractIntegrationTest {
+
+ @Test
+ public void test() throws Exception {
+ BlueprintContainer blueprintContainer = getBlueprintContainerForBundle(
+ bundleContext, "org.apache.aries.blueprint.sample-annotation",
+ 5000);
+
+ assertNotNull(blueprintContainer);
+
+ Object obj = blueprintContainer.getComponentInstance("Bar");
+ assertNotNull(obj);
+ assertEquals(Bar.class, obj.getClass());
+ Bar bar = (Bar) obj;
+ assertEquals("Hello Bar", bar.getValue());
+ }
+
+ @org.ops4j.pax.exam.junit.Configuration
+ public static Option[] configuration() {
+ Option[] options = options(
+ // Log
+ mavenBundle("org.ops4j.pax.logging", "pax-logging-api"),
+ mavenBundle("org.ops4j.pax.logging", "pax-logging-service"),
+ // Felix Config Admin
+ mavenBundle("org.apache.felix", "org.apache.felix.configadmin"),
+ // Felix mvn url handler
+ mavenBundle("org.ops4j.pax.url", "pax-url-mvn"),
+
+
+ // this is how you set the default log level when using pax logging (logProfile)
+ systemProperty("org.ops4j.pax.logging.DefaultServiceLog.level").value("DEBUG"),
+
+ // Bundles
+ mavenBundle("org.apache.aries", "org.apache.aries.util"),
+ mavenBundle("asm", "asm-all"),
+ mavenBundle("org.apache.xbean", "xbean-finder"),
+ mavenBundle("org.apache.aries.blueprint", "org.apache.aries.blueprint.annotation.api"),
+ mavenBundle("org.apache.aries.blueprint", "org.apache.aries.blueprint"),
+ mavenBundle("org.apache.aries.blueprint", "org.apache.aries.blueprint.sample-annotation"),
+ //mavenBundle("org.apache.aries.blueprint", "org.apache.aries.blueprint.sample"),
+ mavenBundle("org.osgi", "org.osgi.compendium"),
+ //org.ops4j.pax.exam.container.def.PaxRunnerOptions.vmOption("-Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=5005"),
+
+ equinox().version("3.5.0")
+ );
+ options = updateOptions(options);
+ return options;
+ }
+
+}
Propchange: incubator/aries/sandbox/linsun/blueprint/blueprint-annotation-itest/src/test/java/org/apache/aries/blueprint/itests/BlueprintAnnotationTest.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: incubator/aries/sandbox/linsun/blueprint/blueprint-annotation-itest/src/test/java/org/apache/aries/blueprint/itests/BlueprintAnnotationTest.java
------------------------------------------------------------------------------
svn:keywords = Date Revision
Propchange: incubator/aries/sandbox/linsun/blueprint/blueprint-annotation-itest/src/test/java/org/apache/aries/blueprint/itests/BlueprintAnnotationTest.java
------------------------------------------------------------------------------
svn:mime-type = text/plain
Added: incubator/aries/sandbox/linsun/blueprint/blueprint-binding.xjb
URL: http://svn.apache.org/viewvc/incubator/aries/sandbox/linsun/blueprint/blueprint-binding.xjb?rev=939092&view=auto
==============================================================================
--- incubator/aries/sandbox/linsun/blueprint/blueprint-binding.xjb (added)
+++ incubator/aries/sandbox/linsun/blueprint/blueprint-binding.xjb Wed Apr 28 21:11:16 2010
@@ -0,0 +1,74 @@
+<jxb:bindings version="1.0"
+ xmlns:jxb="http://java.sun.com/xml/ns/jaxb"
+ xmlns:xs="http://www.w3.org/2001/XMLSchema">
+ <jxb:bindings schemaLocation="blueprint.xsd" node="/xs:schema">
+ <jxb:globalBindings
+ fixedAttributeAsConstantProperty="false"
+ collectionType="java.util.Vector"
+ typesafeEnumBase="xs:NCName"
+ choiceContentProperty="false"
+ typesafeEnumMemberName="generateError"
+ enableFailFastCheck="false"
+ generateIsSetMethod="false"
+ underscoreBinding="asCharInWord"/>
+
+<jxb:bindings node="//xs:complexType[@name='TmapEntry']">
+ <jxb:bindings node=".//xs:element[@name='key']">
+ <jxb:property name="keyAttribute"/>
+ </jxb:bindings>
+ <jxb:bindings node=".//xs:attribute[@name='value']">
+ <jxb:property name="valueAttribute"/>
+ </jxb:bindings>
+</jxb:bindings>
+
+
+<jxb:bindings node="//xs:complexType[@name='TreferenceListener']">
+ <jxb:bindings node=".//xs:attribute[@name='ref']">
+ <jxb:property name="refAttribute"/>
+ </jxb:bindings>
+</jxb:bindings>
+
+
+
+<jxb:bindings node="//xs:complexType[@name='Targument']">
+ <jxb:bindings node=".//xs:attribute[@name='ref']">
+ <jxb:property name="refAttribute"/>
+ </jxb:bindings>
+ <jxb:bindings node=".//xs:attribute[@name='value']">
+ <jxb:property name="valueAttribute"/>
+ </jxb:bindings>
+</jxb:bindings>
+
+<jxb:bindings node="//xs:complexType[@name='Tservice']">
+ <jxb:bindings node=".//xs:attribute[@name='ref']">
+ <jxb:property name="refAttribute"/>
+ </jxb:bindings>
+</jxb:bindings>
+
+
+<jxb:bindings node="//xs:complexType[@name='TregistrationListener']">
+ <jxb:bindings node=".//xs:attribute[@name='ref']">
+ <jxb:property name="refAttribute"/>
+ </jxb:bindings>
+</jxb:bindings>
+
+<jxb:bindings node="//xs:complexType[@name='Tproperty']">
+ <jxb:bindings node=".//xs:attribute[@name='ref']">
+ <jxb:property name="refAttribute"/>
+ </jxb:bindings>
+ <jxb:bindings node=".//xs:attribute[@name='value']">
+ <jxb:property name="valueAttribute"/>
+ </jxb:bindings>
+</jxb:bindings>
+
+
+<jxb:bindings node="//xs:complexType[@name='TservicePropertyEntry']">
+ <jxb:bindings node=".//xs:attribute[@name='value']">
+ <jxb:property name="valueAttribute"/>
+ </jxb:bindings>
+</jxb:bindings>
+
+
+
+</jxb:bindings>
+</jxb:bindings>
Added: incubator/aries/sandbox/linsun/blueprint/blueprint-sample-annotation/pom.xml
URL: http://svn.apache.org/viewvc/incubator/aries/sandbox/linsun/blueprint/blueprint-sample-annotation/pom.xml?rev=939092&view=auto
==============================================================================
--- incubator/aries/sandbox/linsun/blueprint/blueprint-sample-annotation/pom.xml (added)
+++ incubator/aries/sandbox/linsun/blueprint/blueprint-sample-annotation/pom.xml Wed Apr 28 21:11:16 2010
@@ -0,0 +1,58 @@
+<!--
+ Licensed to the Apache Software Foundation (ASF) under one or more
+ contributor license agreements. See the NOTICE file distributed with
+ this work for additional information regarding copyright ownership.
+ The ASF licenses this file to You under the Apache License, Version 2.0
+ (the "License"); you may not use this file except in compliance with
+ the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+-->
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+ <modelVersion>4.0.0</modelVersion>
+ <parent>
+ <groupId>org.apache.aries.blueprint</groupId>
+ <artifactId>blueprint</artifactId>
+ <version>0.2-incubating-SNAPSHOT</version>
+ </parent>
+
+ <artifactId>org.apache.aries.blueprint.sample-annotation</artifactId>
+ <name>Apache Aries Blueprint Sample for Testing Annotation</name>
+ <packaging>bundle</packaging>
+ <description>
+ Example blueprint application, mostly used for annotation tests.
+ </description>
+
+ <properties>
+ <aries.osgi.export>
+ org.apache.aries.blueprint.sample;-noimport:=true
+ </aries.osgi.export>
+ <aries.osgi.activator>
+ org.apache.aries.blueprint.sample.Activator
+ </aries.osgi.activator>
+ </properties>
+
+ <dependencies>
+ <dependency>
+ <groupId>org.eclipse</groupId>
+ <artifactId>osgi</artifactId>
+ <scope>provided</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.aries.blueprint</groupId>
+ <artifactId>org.apache.aries.blueprint.api</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.aries.blueprint</groupId>
+ <artifactId>org.apache.aries.blueprint.annotation.api</artifactId>
+ <version>${version}</version>
+ </dependency>
+ </dependencies>
+
+</project>
Propchange: incubator/aries/sandbox/linsun/blueprint/blueprint-sample-annotation/pom.xml
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: incubator/aries/sandbox/linsun/blueprint/blueprint-sample-annotation/pom.xml
------------------------------------------------------------------------------
svn:keywords = Date Revision
Propchange: incubator/aries/sandbox/linsun/blueprint/blueprint-sample-annotation/pom.xml
------------------------------------------------------------------------------
svn:mime-type = text/xml
Added: incubator/aries/sandbox/linsun/blueprint/blueprint-sample-annotation/src/main/java/org/apache/aries/blueprint/sample/Activator.java
URL: http://svn.apache.org/viewvc/incubator/aries/sandbox/linsun/blueprint/blueprint-sample-annotation/src/main/java/org/apache/aries/blueprint/sample/Activator.java?rev=939092&view=auto
==============================================================================
--- incubator/aries/sandbox/linsun/blueprint/blueprint-sample-annotation/src/main/java/org/apache/aries/blueprint/sample/Activator.java (added)
+++ incubator/aries/sandbox/linsun/blueprint/blueprint-sample-annotation/src/main/java/org/apache/aries/blueprint/sample/Activator.java Wed Apr 28 21:11:16 2010
@@ -0,0 +1,32 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.aries.blueprint.sample;
+
+import org.osgi.framework.BundleActivator;
+import org.osgi.framework.BundleContext;
+
+public class Activator implements BundleActivator {
+
+ public void start(BundleContext context) {
+ System.out.println("Bundle start");
+ }
+
+ public void stop(BundleContext context) {
+ System.out.println("Bundle stop");
+ }
+
+}
Propchange: incubator/aries/sandbox/linsun/blueprint/blueprint-sample-annotation/src/main/java/org/apache/aries/blueprint/sample/Activator.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: incubator/aries/sandbox/linsun/blueprint/blueprint-sample-annotation/src/main/java/org/apache/aries/blueprint/sample/Activator.java
------------------------------------------------------------------------------
svn:keywords = Date Revision
Propchange: incubator/aries/sandbox/linsun/blueprint/blueprint-sample-annotation/src/main/java/org/apache/aries/blueprint/sample/Activator.java
------------------------------------------------------------------------------
svn:mime-type = text/plain
Added: incubator/aries/sandbox/linsun/blueprint/blueprint-sample-annotation/src/main/java/org/apache/aries/blueprint/sample/Bar.java
URL: http://svn.apache.org/viewvc/incubator/aries/sandbox/linsun/blueprint/blueprint-sample-annotation/src/main/java/org/apache/aries/blueprint/sample/Bar.java?rev=939092&view=auto
==============================================================================
--- incubator/aries/sandbox/linsun/blueprint/blueprint-sample-annotation/src/main/java/org/apache/aries/blueprint/sample/Bar.java (added)
+++ incubator/aries/sandbox/linsun/blueprint/blueprint-sample-annotation/src/main/java/org/apache/aries/blueprint/sample/Bar.java Wed Apr 28 21:11:16 2010
@@ -0,0 +1,73 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.aries.blueprint.sample;
+
+import java.util.List;
+
+import org.osgi.framework.BundleContext;
+import org.osgi.service.blueprint.annotation.Bean;
+import org.osgi.service.blueprint.annotation.Blueprint;
+import org.osgi.service.blueprint.annotation.Inject;
+import org.osgi.service.blueprint.annotation.Element;
+import org.osgi.service.blueprint.annotation.Element.ElementType;
+
+@Blueprint
+@Bean
+public class Bar {
+
+ @Inject(value="Hello Bar")
+ private String value;
+
+ @Inject
+ private BundleContext context;
+
+ @Inject
+ @org.osgi.service.blueprint.annotation.List ({
+ @Element(value="a list element"),
+ @Element(value="5", type=ElementType.INTEGER)
+ })
+ private List list;
+
+ public BundleContext getContext() {
+ return context;
+ }
+
+ public void setContext(BundleContext ctx) {
+ context = ctx;
+ }
+
+ public String getValue() {
+ return value;
+ }
+
+ public void setValue(String s) {
+ value = s;
+ }
+
+ public List getList() {
+ return list;
+ }
+
+ public void setList(List l) {
+ list = l;
+ }
+
+ public String toString() {
+ return hashCode() + ": " + value + " " + context + " " + list;
+ }
+
+}
Propchange: incubator/aries/sandbox/linsun/blueprint/blueprint-sample-annotation/src/main/java/org/apache/aries/blueprint/sample/Bar.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: incubator/aries/sandbox/linsun/blueprint/blueprint-sample-annotation/src/main/java/org/apache/aries/blueprint/sample/Bar.java
------------------------------------------------------------------------------
svn:keywords = Date Revision
Propchange: incubator/aries/sandbox/linsun/blueprint/blueprint-sample-annotation/src/main/java/org/apache/aries/blueprint/sample/Bar.java
------------------------------------------------------------------------------
svn:mime-type = text/plain
Added: incubator/aries/sandbox/linsun/blueprint/blueprint-sample-annotation/src/main/java/org/apache/aries/blueprint/sample/BindingListener.java
URL: http://svn.apache.org/viewvc/incubator/aries/sandbox/linsun/blueprint/blueprint-sample-annotation/src/main/java/org/apache/aries/blueprint/sample/BindingListener.java?rev=939092&view=auto
==============================================================================
--- incubator/aries/sandbox/linsun/blueprint/blueprint-sample-annotation/src/main/java/org/apache/aries/blueprint/sample/BindingListener.java (added)
+++ incubator/aries/sandbox/linsun/blueprint/blueprint-sample-annotation/src/main/java/org/apache/aries/blueprint/sample/BindingListener.java Wed Apr 28 21:11:16 2010
@@ -0,0 +1,76 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.aries.blueprint.sample;
+
+import java.util.Map;
+import java.util.List;
+import java.io.Serializable;
+
+import org.osgi.framework.ServiceReference;
+import org.osgi.service.blueprint.annotation.Bean;
+import org.osgi.service.blueprint.annotation.Blueprint;
+
+@Blueprint
+@Bean
+public class BindingListener {
+
+ private InterfaceA a;
+ private Map props;
+ private ServiceReference reference;
+ private List list;
+
+ public InterfaceA getA() {
+ return a;
+ }
+
+ public Map getProps() {
+ return props;
+ }
+
+ public ServiceReference getReference() {
+ return reference;
+ }
+
+ public List getList() {
+ return list;
+ }
+
+ public void setList(List list) {
+ this.list = list;
+ }
+
+ public void init() {
+ }
+
+ public void bind(InterfaceA a, Map props) {
+ this.a = a;
+ this.props = props;
+ }
+
+ public void bind(ServiceReference ref) {
+ this.reference = ref;
+ }
+
+ public void unbind(InterfaceA a, Map props) {
+ this.a = null;
+ this.props = null;
+ }
+
+ public void unbind(ServiceReference ref) {
+ this.reference = null;
+ }
+}
Propchange: incubator/aries/sandbox/linsun/blueprint/blueprint-sample-annotation/src/main/java/org/apache/aries/blueprint/sample/BindingListener.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: incubator/aries/sandbox/linsun/blueprint/blueprint-sample-annotation/src/main/java/org/apache/aries/blueprint/sample/BindingListener.java
------------------------------------------------------------------------------
svn:keywords = Date Revision
Propchange: incubator/aries/sandbox/linsun/blueprint/blueprint-sample-annotation/src/main/java/org/apache/aries/blueprint/sample/BindingListener.java
------------------------------------------------------------------------------
svn:mime-type = text/plain
Added: incubator/aries/sandbox/linsun/blueprint/blueprint-sample-annotation/src/main/java/org/apache/aries/blueprint/sample/CurrencyTypeConverter.java
URL: http://svn.apache.org/viewvc/incubator/aries/sandbox/linsun/blueprint/blueprint-sample-annotation/src/main/java/org/apache/aries/blueprint/sample/CurrencyTypeConverter.java?rev=939092&view=auto
==============================================================================
--- incubator/aries/sandbox/linsun/blueprint/blueprint-sample-annotation/src/main/java/org/apache/aries/blueprint/sample/CurrencyTypeConverter.java (added)
+++ incubator/aries/sandbox/linsun/blueprint/blueprint-sample-annotation/src/main/java/org/apache/aries/blueprint/sample/CurrencyTypeConverter.java Wed Apr 28 21:11:16 2010
@@ -0,0 +1,34 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.aries.blueprint.sample;
+
+import java.util.Currency;
+
+import org.osgi.service.blueprint.container.Converter;
+import org.osgi.service.blueprint.container.ReifiedType;
+
+public class CurrencyTypeConverter implements Converter {
+
+ public boolean canConvert(Object fromValue, ReifiedType toType) {
+ return Currency.class.isAssignableFrom(toType.getRawClass());
+ }
+
+ public Object convert(Object source, ReifiedType toType) throws Exception {
+ return Currency.getInstance(source.toString());
+ }
+
+}
Propchange: incubator/aries/sandbox/linsun/blueprint/blueprint-sample-annotation/src/main/java/org/apache/aries/blueprint/sample/CurrencyTypeConverter.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: incubator/aries/sandbox/linsun/blueprint/blueprint-sample-annotation/src/main/java/org/apache/aries/blueprint/sample/CurrencyTypeConverter.java
------------------------------------------------------------------------------
svn:keywords = Date Revision
Propchange: incubator/aries/sandbox/linsun/blueprint/blueprint-sample-annotation/src/main/java/org/apache/aries/blueprint/sample/CurrencyTypeConverter.java
------------------------------------------------------------------------------
svn:mime-type = text/plain
Added: incubator/aries/sandbox/linsun/blueprint/blueprint-sample-annotation/src/main/java/org/apache/aries/blueprint/sample/DateTypeConverter.java
URL: http://svn.apache.org/viewvc/incubator/aries/sandbox/linsun/blueprint/blueprint-sample-annotation/src/main/java/org/apache/aries/blueprint/sample/DateTypeConverter.java?rev=939092&view=auto
==============================================================================
--- incubator/aries/sandbox/linsun/blueprint/blueprint-sample-annotation/src/main/java/org/apache/aries/blueprint/sample/DateTypeConverter.java (added)
+++ incubator/aries/sandbox/linsun/blueprint/blueprint-sample-annotation/src/main/java/org/apache/aries/blueprint/sample/DateTypeConverter.java Wed Apr 28 21:11:16 2010
@@ -0,0 +1,42 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.aries.blueprint.sample;
+
+import java.text.DateFormat;
+import java.text.SimpleDateFormat;
+import java.util.Date;
+
+import org.osgi.service.blueprint.container.Converter;
+import org.osgi.service.blueprint.container.ReifiedType;
+
+public class DateTypeConverter implements Converter {
+
+ DateFormat dateFormat;
+
+ public void setFormat(String format) {
+ dateFormat = new SimpleDateFormat(format);
+ }
+
+ public Object convert(Object source, ReifiedType toType) throws Exception {
+ return dateFormat.parse(source.toString());
+ }
+
+ public boolean canConvert(Object fromValue, ReifiedType toType) {
+ return Date.class.isAssignableFrom(toType.getRawClass());
+ }
+
+}
Propchange: incubator/aries/sandbox/linsun/blueprint/blueprint-sample-annotation/src/main/java/org/apache/aries/blueprint/sample/DateTypeConverter.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: incubator/aries/sandbox/linsun/blueprint/blueprint-sample-annotation/src/main/java/org/apache/aries/blueprint/sample/DateTypeConverter.java
------------------------------------------------------------------------------
svn:keywords = Date Revision
Propchange: incubator/aries/sandbox/linsun/blueprint/blueprint-sample-annotation/src/main/java/org/apache/aries/blueprint/sample/DateTypeConverter.java
------------------------------------------------------------------------------
svn:mime-type = text/plain