Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Code Block
package ipojo.example.hello.impl;

import ipojo.example.hello.Hello;

import org.apache.felix.ipojo.annotations.Component;
import org.apache.felix.ipojo.annotations.Provides;

/**
  * Component implementing the Hello service.
 **/
@Component(name="HelloImpl")
@Provides
public class HelloImpl implements Hello {
    public String sayHello(String name) { return "hello " + name;  }
}

...

  • name : defines the component type name (mandatoryoptional, default = the class name)
  • factory: defines the factory name (optional, default = "nofalse")
  • immediate: defines the component type as immediate (optional, default = "false")
  • architecture: enable the architecture exposition (optional, default = "false")
  • propagation: enable configuration property propagation (on provided services) (optional, default = "false")

...

Code Block
xml
xml
<instance component="ipojo.example.hello.impl.HelloImpl"/>
<instance component="AnnotedHelloClient"/>

...