Commit the new iPOJO version (0.7.6).
git-svn-id: https://svn.apache.org/repos/asf/felix/trunk@642265 13f79535-47bb-0310-9956-ffa450edef68
diff --git a/ipojo/examples/tutorial-maven/hello.client/metadata.xml b/ipojo/examples/tutorial-maven/hello.client/metadata.xml
new file mode 100644
index 0000000..4141c34
--- /dev/null
+++ b/ipojo/examples/tutorial-maven/hello.client/metadata.xml
@@ -0,0 +1,15 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<iPOJO>
+ <component className="ipojo.example.hello.client.HelloClient"
+ architecture="true">
+ <requires field="m_hello" />
+ <callback transition="validate" method="starting" />
+ <callback transition="invalidate" method="stopping" />
+ <properties>
+ <property field="m_name" name="name" />
+ </properties>
+ </component>
+ <instance component="ipojo.example.hello.client.HelloClient">
+ <property name="name" value="clement" />
+ </instance>
+</iPOJO>
\ No newline at end of file
diff --git a/ipojo/examples/tutorial-maven/hello.client/pom.xml b/ipojo/examples/tutorial-maven/hello.client/pom.xml
new file mode 100644
index 0000000..91cbe69
--- /dev/null
+++ b/ipojo/examples/tutorial-maven/hello.client/pom.xml
@@ -0,0 +1,82 @@
+<!--
+ 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>
+ <modelVersion>4.0.0</modelVersion>
+ <packaging>bundle</packaging><!-- Use the BND Maven plug-in -->
+ <groupId>ipojo.examples</groupId>
+ <artifactId>hello.client</artifactId>
+ <version>0.7.6-SNAPSHOT</version>
+ <name>Hello Service Client</name>
+ <dependencies>
+ <dependency>
+ <groupId>ipojo.examples</groupId>
+ <artifactId>hello.service</artifactId>
+ <version>${pom.version}</version>
+ </dependency>
+ </dependencies>
+
+ <pluginRepositories>
+ <pluginRepository>
+ <id>apache.snapshots</id>
+ <name>snapshot plugins</name>
+ <url>
+ http://people.apache.org/repo/m2-snapshot-repository
+ </url>
+ <releases>
+ <enabled>false</enabled>
+ </releases>
+ <snapshots>
+ <enabled>true</enabled>
+ </snapshots>
+ </pluginRepository>
+ </pluginRepositories>
+
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.felix</groupId>
+ <artifactId>maven-bundle-plugin</artifactId>
+ <extensions>true</extensions>
+ <version>1.4.0</version>
+ <configuration>
+ <instructions>
+ <Bundle-SymbolicName>
+ ${pom.artifactId}
+ </Bundle-SymbolicName>
+ <Private-Package>
+ ipojo.example.hello.client
+ </Private-Package>
+ </instructions>
+ </configuration>
+ </plugin>
+ <plugin>
+ <groupId>org.apache.felix</groupId>
+ <artifactId>maven-ipojo-plugin</artifactId>
+ <version>0.7.6-SNAPSHOT</version>
+ <executions>
+ <execution>
+ <goals>
+ <goal>ipojo-bundle</goal>
+ </goals>
+ </execution>
+ </executions>
+ </plugin>
+ </plugins>
+ </build>
+</project>
diff --git a/ipojo/examples/tutorial-maven/hello.client/src/main/java/ipojo/example/hello/client/HelloClient.java b/ipojo/examples/tutorial-maven/hello.client/src/main/java/ipojo/example/hello/client/HelloClient.java
new file mode 100644
index 0000000..023db3f
--- /dev/null
+++ b/ipojo/examples/tutorial-maven/hello.client/src/main/java/ipojo/example/hello/client/HelloClient.java
@@ -0,0 +1,90 @@
+/*
+ * 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 ipojo.example.hello.client;
+
+import ipojo.example.hello.Hello;
+
+/**
+ * Hello Service simple client.
+ * @author <a href="mailto:dev@felix.apache.org">Felix Project Team</a>
+ */
+public class HelloClient implements Runnable {
+
+ /**
+ * Delay between two invocations.
+ */
+ private static final int DELAY = 10000;
+
+ /**
+ * Hello services.
+ * Injected by the container.
+ * */
+ private Hello[] m_hello; // Service Requirement
+
+ /**
+ * End flag.
+ * */
+ private boolean m_end;
+
+ /**
+ * Name property.
+ * Injected by the container.
+ * */
+ private String m_name;
+
+ /**
+ * Run method.
+ * @see java.lang.Runnable#run()
+ */
+ public void run() {
+ while (!m_end) {
+ try {
+ invokeHelloServices();
+ Thread.sleep(DELAY);
+ } catch (InterruptedException ie) {
+ /* will recheck end */
+ }
+ }
+ }
+
+ /**
+ * Invoke hello services.
+ */
+ public void invokeHelloServices() {
+ for (int i = 0; i < m_hello.length; i++) {
+ System.out.println(m_hello[i].sayHello(m_name));
+ }
+ }
+
+ /**
+ * Starting.
+ */
+ public void starting() {
+ Thread thread = new Thread(this);
+ m_end = false;
+ thread.start();
+ }
+
+ /**
+ * Stopping.
+ */
+ public void stopping() {
+ m_end = true;
+ }
+}
diff --git a/ipojo/examples/tutorial-maven/hello.client/src/main/java/ipojo/example/source.txt b/ipojo/examples/tutorial-maven/hello.client/src/main/java/ipojo/example/source.txt
new file mode 100644
index 0000000..0198756
--- /dev/null
+++ b/ipojo/examples/tutorial-maven/hello.client/src/main/java/ipojo/example/source.txt
@@ -0,0 +1 @@
+PUT YOUR SOURCE FILES HERE
\ No newline at end of file