[maven-scm] copy for tag org.apache.aries.blueprint.sample-fragment-0.3.2
git-svn-id: https://svn.apache.org/repos/asf/aries/tags/org.apache.aries.blueprint.sample-fragment-0.3.2@1187405 13f79535-47bb-0310-9956-ffa450edef68
diff --git a/pom.xml b/pom.xml
index 19139e1..0d140f2 100644
--- a/pom.xml
+++ b/pom.xml
@@ -24,27 +24,24 @@
</parent>
<groupId>org.apache.aries.blueprint</groupId>
- <artifactId>org.apache.aries.blueprint.sample-annotation</artifactId>
- <name>Apache Aries Blueprint Sample for Testing Annotation</name>
+ <artifactId>org.apache.aries.blueprint.sample-fragment</artifactId>
+ <name>Apache Aries Blueprint Sample Fragment for Testing Annotation</name>
<version>0.3.2</version>
<packaging>bundle</packaging>
<description>
- Example blueprint application, mostly used for annotation tests.
+ Example blueprint fragment, mostly used for annotation tests.
</description>
<scm>
- <connection>scm:svn:http://svn.apache.org/repos/asf/aries/branches/oct-2011-release/blueprint/blueprint-sample-annotation</connection>
- <developerConnection>scm:svn:https://svn.apache.org/repos/asf/aries/branches/oct-2011-release/blueprint/blueprint-sample-annotation</developerConnection>
- <url>http://svn.apache.org/viewvc/aries/branches/oct-2011-release/blueprint/blueprint-sample-annotation</url>
+ <connection>scm:svn:http://svn.apache.org/repos/asf/aries/tags/org.apache.aries.blueprint.sample-fragment-0.3.2</connection>
+ <developerConnection>scm:svn:https://svn.apache.org/repos/asf/aries/tags/org.apache.aries.blueprint.sample-fragment-0.3.2</developerConnection>
+ <url>http://svn.apache.org/viewvc/aries/tags/org.apache.aries.blueprint.sample-fragment-0.3.2</url>
</scm>
<properties>
<aries.osgi.export>
- org.apache.aries.blueprint.sample;-noimport:=true
+ org.apache.aries.blueprint.fragment;-noimport:=true
</aries.osgi.export>
- <aries.osgi.activator>
- org.apache.aries.blueprint.sample.Activator
- </aries.osgi.activator>
<aries.osgi.import>
org.apache.aries.blueprint.annotation;version="$<range;[==,=+)>",
*
@@ -81,7 +78,7 @@
<configuration>
<excludeDependencies>${aries.osgi.exclude.dependencies}</excludeDependencies>
<instructions>
- <Bundle-Blueprint-Annotation>true</Bundle-Blueprint-Annotation>
+ <Fragment-Host>org.apache.aries.blueprint.sample-annotation</Fragment-Host>
</instructions>
</configuration>
</plugin>
diff --git a/src/main/java/org/apache/aries/blueprint/sample/InterfaceB.java b/src/main/java/org/apache/aries/blueprint/fragment/FragmentBean.java
similarity index 84%
rename from src/main/java/org/apache/aries/blueprint/sample/InterfaceB.java
rename to src/main/java/org/apache/aries/blueprint/fragment/FragmentBean.java
index 9336017..7f23272 100644
--- a/src/main/java/org/apache/aries/blueprint/sample/InterfaceB.java
+++ b/src/main/java/org/apache/aries/blueprint/fragment/FragmentBean.java
@@ -14,9 +14,10 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-package org.apache.aries.blueprint.sample;
+package org.apache.aries.blueprint.fragment;
-public interface InterfaceB {
+import org.apache.aries.blueprint.annotation.Bean;
- String hello(String msg);
-}
+@Bean(id="fragment")
+public class FragmentBean {}
+
diff --git a/src/main/java/org/apache/aries/blueprint/sample/Account.java b/src/main/java/org/apache/aries/blueprint/sample/Account.java
deleted file mode 100644
index 1b56017..0000000
--- a/src/main/java/org/apache/aries/blueprint/sample/Account.java
+++ /dev/null
@@ -1,38 +0,0 @@
-/**
- * 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.apache.aries.blueprint.annotation.Arg;
-import org.apache.aries.blueprint.annotation.Bean;
-
-@Bean(id="accountOne", args=@Arg(value="1"))
-public class Account {
-
- private long accountNumber;
-
- public Account(long number) {
- this.accountNumber = number;
- }
-
- public long getAccountNumber() {
- return this.accountNumber;
- }
-
- public void setAccountNumber(long number) {
- this.accountNumber = number;
- }
-}
diff --git a/src/main/java/org/apache/aries/blueprint/sample/AccountFactory.java b/src/main/java/org/apache/aries/blueprint/sample/AccountFactory.java
deleted file mode 100644
index 9d9638c..0000000
--- a/src/main/java/org/apache/aries/blueprint/sample/AccountFactory.java
+++ /dev/null
@@ -1,38 +0,0 @@
-/**
- * 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.apache.aries.blueprint.annotation.Bean;
-import org.apache.aries.blueprint.annotation.Arg;
-
-@Bean(id="accountFactory", args=@Arg(value="account factory"))
-public class AccountFactory {
- private String factoryName;
-
- public AccountFactory(String factoryName) {
- this.factoryName = factoryName;
- }
-
- public NewAccount createAccount(long number) {
- return new NewAccount(number);
- }
-
- public String getFactoryName() {
- return this.factoryName;
- }
-
-}
diff --git a/src/main/java/org/apache/aries/blueprint/sample/Activator.java b/src/main/java/org/apache/aries/blueprint/sample/Activator.java
deleted file mode 100644
index 82eff8a..0000000
--- a/src/main/java/org/apache/aries/blueprint/sample/Activator.java
+++ /dev/null
@@ -1,32 +0,0 @@
-/**
- * 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");
- }
-
-}
diff --git a/src/main/java/org/apache/aries/blueprint/sample/Bar.java b/src/main/java/org/apache/aries/blueprint/sample/Bar.java
deleted file mode 100644
index 655addd..0000000
--- a/src/main/java/org/apache/aries/blueprint/sample/Bar.java
+++ /dev/null
@@ -1,73 +0,0 @@
-/**
- * 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.apache.aries.blueprint.annotation.Blueprint;
-import org.apache.aries.blueprint.annotation.Bean;
-import org.apache.aries.blueprint.annotation.Inject;
-import org.apache.aries.blueprint.annotation.Element;
-import org.apache.aries.blueprint.annotation.Element.ElementType;
-
-@Blueprint(defaultActivation="eager", defaultTimeout=300, defaultAvailability="optional")
-@Bean(id="bar")
-public class Bar {
-
- @Inject(value="Hello FooBar")
- private String value;
-
- @Inject(ref="blueprintBundleContext")
- private BundleContext context;
-
- /*@Inject
- @org.apache.aries.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;
- }
-
-}
diff --git a/src/main/java/org/apache/aries/blueprint/sample/BindingListener.java b/src/main/java/org/apache/aries/blueprint/sample/BindingListener.java
deleted file mode 100644
index 973e1bb..0000000
--- a/src/main/java/org/apache/aries/blueprint/sample/BindingListener.java
+++ /dev/null
@@ -1,88 +0,0 @@
-/**
- * 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 java.util.Map;
-
-import org.apache.aries.blueprint.annotation.Bean;
-import org.apache.aries.blueprint.annotation.Bind;
-import org.apache.aries.blueprint.annotation.Init;
-import org.apache.aries.blueprint.annotation.Inject;
-import org.apache.aries.blueprint.annotation.Reference;
-import org.apache.aries.blueprint.annotation.ReferenceListener;
-import org.apache.aries.blueprint.annotation.Unbind;
-import org.osgi.framework.ServiceReference;
-
-@Bean(id="bindingListener")
-@ReferenceListener
-public class BindingListener {
-
- @Inject @Reference (id="ref2",
- serviceInterface = InterfaceA.class,
- timeout=100, referenceListeners=@ReferenceListener(ref="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;
- }
-
- @Init
- public void init() {
- }
-
- @Bind
- public void bind(InterfaceA a, Map props) {
- this.a = a;
- this.props = props;
- }
-
- @Bind
- public void bind(ServiceReference ref) {
- this.reference = ref;
- }
-
- @Unbind
- public void unbind(InterfaceA a, Map props) {
- this.a = null;
- this.props = null;
- }
-
- @Unbind
- public void unbind(ServiceReference ref) {
- this.reference = null;
- }
-}
diff --git a/src/main/java/org/apache/aries/blueprint/sample/CurrencyTypeConverter.java b/src/main/java/org/apache/aries/blueprint/sample/CurrencyTypeConverter.java
deleted file mode 100644
index 6910616..0000000
--- a/src/main/java/org/apache/aries/blueprint/sample/CurrencyTypeConverter.java
+++ /dev/null
@@ -1,36 +0,0 @@
-/**
- * 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.apache.aries.blueprint.annotation.Bean;
-import org.osgi.service.blueprint.container.Converter;
-import org.osgi.service.blueprint.container.ReifiedType;
-
-@Bean(id="converter2")
-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());
- }
-
-}
diff --git a/src/main/java/org/apache/aries/blueprint/sample/DateTypeConverter.java b/src/main/java/org/apache/aries/blueprint/sample/DateTypeConverter.java
deleted file mode 100644
index 078b476..0000000
--- a/src/main/java/org/apache/aries/blueprint/sample/DateTypeConverter.java
+++ /dev/null
@@ -1,46 +0,0 @@
-/**
- * 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.apache.aries.blueprint.annotation.Bean;
-import org.apache.aries.blueprint.annotation.Inject;
-import org.osgi.service.blueprint.container.Converter;
-import org.osgi.service.blueprint.container.ReifiedType;
-
-@Bean(id="converter1")
-public class DateTypeConverter implements Converter {
-
- @Inject(name="format", value="yyyy.MM.dd")
- DateFormat dateFormat;
-
- public void setFormat(String format) {
- this.dateFormat = new SimpleDateFormat(format);
- }
-
- public Object convert(Object source, ReifiedType toType) throws Exception {
- return this.dateFormat.parse(source.toString());
- }
-
- public boolean canConvert(Object fromValue, ReifiedType toType) {
- return Date.class.isAssignableFrom(toType.getRawClass());
- }
-
-}
diff --git a/src/main/java/org/apache/aries/blueprint/sample/Foo.java b/src/main/java/org/apache/aries/blueprint/sample/Foo.java
deleted file mode 100644
index 8ee7685..0000000
--- a/src/main/java/org/apache/aries/blueprint/sample/Foo.java
+++ /dev/null
@@ -1,131 +0,0 @@
-/**
- * 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.io.Serializable;
-import java.util.Currency;
-import java.util.Date;
-import java.util.Map;
-
-import org.apache.aries.blueprint.annotation.Bean;
-import org.apache.aries.blueprint.annotation.Destroy;
-import org.apache.aries.blueprint.annotation.Init;
-import org.apache.aries.blueprint.annotation.Inject;
-import org.apache.aries.blueprint.annotation.RegistrationListener;
-import org.apache.aries.blueprint.annotation.Service;
-import org.apache.aries.blueprint.annotation.ServiceProperty;
-
-@Bean(id="foo")
-@Service(autoExport="all-classes",
- serviceProperties = @ServiceProperty(key="blueprint.annotation.sample", value="true"),
- registerationListeners = @RegistrationListener(ref="fooRegistrationListener"),
- ranking=0)
-public class Foo implements Serializable {
-
- @Inject(value="5")
- private int a;
-
- //@Inject(value="${key.b}")
- private int b;
-
- //@Inject(ref="bar")
- private Bar bar;
-
- @Inject(value="PLN")
- private Currency currency;
-
- @Inject(value="2009.04.17")
- private Date date;
-
- public boolean initialized;
- public boolean destroyed;
- private Map<String, Object> props;
-
- public int getA() {
- return a;
- }
-
- public void setA(int i) {
- a = i;
- }
-
- public int getB() {
- return b;
- }
-
- public void setB(int i) {
- b = i;
- }
-
- public Bar getBar() {
- return bar;
- }
-
- @Inject(ref="bar")
- public void setBar(Bar b) {
- bar = b;
- }
-
- public Currency getCurrency() {
- return currency;
- }
-
- public void setCurrency(Currency c) {
- currency = c;
- }
-
- public Date getDate() {
- return date;
- }
-
- public void setDate(Date d) {
- date = d;
- }
-
- public String toString() {
- return a + " " + b + " " + bar + " " + currency + " " + date;
- }
-
- @Init
- public void init() {
- System.out.println("======== Initializing Foo =========");
- initialized = true;
- }
-
- @Destroy
- public void destroy() {
- System.out.println("======== Destroying Foo =========");
- destroyed = true;
- }
-
- public boolean isInitialized() {
- return initialized;
- }
-
- public boolean isDestroyed() {
- return destroyed;
- }
-
- public void update(Map<String,Object> props) {
- this.props = props;
- }
-
- public Map<String, Object> getProps() {
- return props;
- }
-}
-
diff --git a/src/main/java/org/apache/aries/blueprint/sample/FooRegistrationListener.java b/src/main/java/org/apache/aries/blueprint/sample/FooRegistrationListener.java
deleted file mode 100644
index ea5ed85..0000000
--- a/src/main/java/org/apache/aries/blueprint/sample/FooRegistrationListener.java
+++ /dev/null
@@ -1,41 +0,0 @@
-/**
- * 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.io.Serializable;
-import java.util.Map;
-
-import org.apache.aries.blueprint.annotation.Bean;
-import org.apache.aries.blueprint.annotation.Register;
-import org.apache.aries.blueprint.annotation.RegistrationListener;
-import org.apache.aries.blueprint.annotation.Unregister;
-
-@Bean(id="fooRegistrationListener")
-@RegistrationListener
-public class FooRegistrationListener {
-
- @Register
- public void serviceRegistered(Serializable foo, Map props) {
- System.out.println("Service registration notification: " + foo + " " + props);
- }
-
- @Unregister
- public void serviceUnregistered(Foo foo, Map props) {
- System.out.println("Service unregistration notification: " + foo + " " + props);
- }
-
-}
diff --git a/src/main/java/org/apache/aries/blueprint/sample/InterfaceA.java b/src/main/java/org/apache/aries/blueprint/sample/InterfaceA.java
deleted file mode 100644
index 97e0947..0000000
--- a/src/main/java/org/apache/aries/blueprint/sample/InterfaceA.java
+++ /dev/null
@@ -1,22 +0,0 @@
-/**
- * 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;
-
-public interface InterfaceA {
-
- String hello(String msg);
-}
diff --git a/src/main/java/org/apache/aries/blueprint/sample/ListBindingListener.java b/src/main/java/org/apache/aries/blueprint/sample/ListBindingListener.java
deleted file mode 100644
index 797cffe..0000000
--- a/src/main/java/org/apache/aries/blueprint/sample/ListBindingListener.java
+++ /dev/null
@@ -1,88 +0,0 @@
-/**
- * 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 java.util.Map;
-
-import org.apache.aries.blueprint.annotation.Bean;
-import org.apache.aries.blueprint.annotation.Bind;
-import org.apache.aries.blueprint.annotation.Init;
-import org.apache.aries.blueprint.annotation.Inject;
-import org.apache.aries.blueprint.annotation.ReferenceList;
-import org.apache.aries.blueprint.annotation.ReferenceListener;
-import org.apache.aries.blueprint.annotation.Unbind;
-import org.osgi.framework.ServiceReference;
-
-@Bean(id="listBindingListener")
-@ReferenceListener
-public class ListBindingListener {
-
- @Inject @ReferenceList (id="ref-list",
- serviceInterface = InterfaceA.class,
- referenceListeners=@ReferenceListener(ref="listBindingListener"))
- 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;
- }
-
- @Init
- public void init() {
- }
-
- @Bind
- public void bind(InterfaceA a, Map props) {
- this.a = a;
- this.props = props;
- }
-
- @Bind
- public void bind(ServiceReference ref) {
- this.reference = ref;
- }
-
- @Unbind
- public void unbind(InterfaceA a, Map props) {
- this.a = null;
- this.props = null;
- }
-
- @Unbind
- public void unbind(ServiceReference ref) {
- this.reference = null;
- }
-}
diff --git a/src/main/java/org/apache/aries/blueprint/sample/NewAccount.java b/src/main/java/org/apache/aries/blueprint/sample/NewAccount.java
deleted file mode 100644
index 4d7539b..0000000
--- a/src/main/java/org/apache/aries/blueprint/sample/NewAccount.java
+++ /dev/null
@@ -1,41 +0,0 @@
-/**
- * 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.apache.aries.blueprint.annotation.Bean;
-import org.apache.aries.blueprint.annotation.Arg;
-
-@Bean(id="accountThree",
- factoryRef="accountFactory",
- factoryMethod="createAccount",
- args=@Arg(value="3"))
-public class NewAccount {
-
- private long accountNumber;
-
- public NewAccount(long number) {
- this.accountNumber = number;
- }
-
- public long getAccountNumber() {
- return this.accountNumber;
- }
-
- public void setAccountNumber(long number) {
- this.accountNumber = number;
- }
-}
diff --git a/src/main/java/org/apache/aries/blueprint/sample/StaticAccountFactory.java b/src/main/java/org/apache/aries/blueprint/sample/StaticAccountFactory.java
deleted file mode 100644
index 5ab9cf4..0000000
--- a/src/main/java/org/apache/aries/blueprint/sample/StaticAccountFactory.java
+++ /dev/null
@@ -1,30 +0,0 @@
-/**
- * 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.apache.aries.blueprint.annotation.Arg;
-import org.apache.aries.blueprint.annotation.Bean;
-
-@Bean(id="accountTwo",
- factoryMethod="createAccount",
- args = @Arg(value="2"))
-public class StaticAccountFactory {
-
- public static Account createAccount(long number) {
- return new Account(number);
- }
-}