File tree Expand file tree Collapse file tree 1 file changed +14
-1
lines changed
Expand file tree Collapse file tree 1 file changed +14
-1
lines changed Original file line number Diff line number Diff line change @@ -45,11 +45,24 @@ public interface IDoingSomethingService {
4545```
4646- Create the service implementation that implements service interface.
4747``` java
48+ @Component (service = { DoingSomethingService . class, IDoingSomethingService . class }, immediate = false )
49+ public class DoingSomethingService implements IDoingSomethingService {
50+
51+ @Override
52+ public void doSomething (){
53+ syserr(" DoingSomethingService did something" );
54+ }
55+
56+ }
4857
4958```
5059
5160
52- - Testing
61+ - Testing: [ ServiceCaller] ( https://help.eclipse.org/latest/nftopic/org.eclipse.platform.doc.isv/reference/api/org/eclipse/core/runtime/ServiceCaller.html )
62+ ``` java
63+ ServiceCaller . callOnce(MyClass . class, IDoingSomethingService . class, (myService) - > myService. doSomething());
64+
65+ ```
5366
5467## 3 DS Annotations
5568### 3.1. @Component
You can’t perform that action at this time.
0 commit comments