Created
March 14, 2013 12:53
-
-
Save njbartlett/5161077 to your computer and use it in GitHub Desktop.
Declarative Services multiple reference example
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@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