<dependency>
<groupId>org.apache.felix</groupId>
<artifactId>org.apache.felix.framework</artifactId>
<version>X.X.X</version>
</dependency>
<dependency>
<groupId>org.apache.felix</groupId>
<artifactId>org.apache.felix.ipojo.annotations</artifactId>
<version>X.X.X</version>
</dependency>
import org.apache.felix.ipojo.annotations.Component;
@Component
public class MyComponent {
}
import org.apache.felix.ipojo.annotations.Component;
import org.apache.felix.ipojo.annotations.Property;
@Component
public class MyComponent {
@Property(name = "component.name", value = "exampleComponent")
private String componentName;
}
import org.apache.felix.ipojo.annotations.Component;
import org.apache.felix.ipojo.annotations.Requires;
@Component
public class MyComponent {
@Requires
private AnotherComponent anotherComponent;
}
shell
mvn clean package
import org.apache.felix.ipojo.annotations.Requires;
public class Client {
@Requires
private MyComponent myComponent;
public void doSomething() {
myComponent.doSomething();
}
}