Versions Compared

Key

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

...

Code Block
java
java
titleAnnotations
@Component
@Provides(specifications= {FooService.class, BarService.class})
public class ProvidesProperties implements FooService, BarService {
    
    @ServiceProperty(name = "foo")
    public int m_foo = 0;
    
    @ServiceProperty(name="bar", mandatory=true)
    public int m_bar;
    
// ...
}
Center

Consuming services

Code Block
xml
xml
titleXML

<component classname="my.consumer.Implementation">
    <requires field="fs" />
    <requires>
	<callback type="bind" method="bind" />
	<callback type="unbind" method="unbind" />
    </requires>	
</component>
Code Block
java
java
titleAnnotations

@Component
public class Dependency {

    @Requires
    public FooService fs;
    
    @Unbind
    public void unbind(BazService bz) {
        //...
    }
    
    @Bind
    public void bind(BazService bz) {
        // ...
    }

  //...
}
Center