Last active
August 5, 2019 11:17
-
-
Save danielgospodinow/b02b1f0c7509ab7f2e687a9ff0500a93 to your computer and use it in GitHub Desktop.
Calcualtor Consumer
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
import com.dg.osgi.calculator.provider.api.Calculator; | |
import org.osgi.service.component.annotations.Activate; | |
import org.osgi.service.component.annotations.Component; | |
import org.osgi.service.component.annotations.Reference; | |
@Component | |
public class CalculatorConsumer { | |
@Reference | |
private Calculator calculator; | |
@Activate | |
public void activate() { | |
int a = 7; | |
int b = 14; | |
System.out.println(String.format("The multiplication of %d and %d is: %d", a, b, calculator.multiply(a, b))); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment