Skip to content

Instantly share code, notes, and snippets.

@njbartlett
Created March 14, 2013 12:53
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save njbartlett/5161077 to your computer and use it in GitHub Desktop.
Save njbartlett/5161077 to your computer and use it in GitHub Desktop.
Declarative Services multiple reference example
@Component
public class Example {
private ServiceA svcA;
private ServiceB svcB;
@Reference
public void setServiceA(ServiceA a) {
this.svcA = a;
}
@Reference
public void setServiceB(ServiceB b) {
this.svcB = b;
}
@Activate
public void activate() {
// called when both references A and B are bound
}
@Deactivate
public void deactivate() {
// called when either A or B becomes unbound
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment