-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathTestServer.java
38 lines (31 loc) · 1.04 KB
/
TestServer.java
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
package com.athaydes.osgi.server;
import com.athaydes.osgi.api.MessageService;
import com.athaydes.osgi.api.Messages.TestInfo;
import com.athaydes.osgi.api.Messages.TestResult;
import org.osgi.service.component.annotations.Activate;
import org.osgi.service.component.annotations.Component;
import org.osgi.service.component.annotations.Deactivate;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@Component(immediate = true, property = {
"service.exported.interfaces=*",
"com.athaydes.protobuf.port=5561"
})
public class TestServer implements MessageService {
private static final Logger log = LoggerFactory.getLogger(TestServer.class);
@Activate
public void start() {
log.info("Started server");
}
@Deactivate
public void stop() {
log.info("Stopped server");
}
@Override
public TestResult send(TestInfo message) {
return TestResult.newBuilder()
.setStatus(TestResult.Status.SUCCESS)
.setInfo(message)
.build();
}
}