Server builds
This commit is contained in:
parent
d6e73cf7ad
commit
e476438c8c
1 changed files with 5 additions and 6 deletions
|
|
@ -16,12 +16,12 @@ public class JobServServer {
|
||||||
private void start() throws IOException {
|
private void start() throws IOException {
|
||||||
// TODO: this should be passed in from a configuration manager
|
// TODO: this should be passed in from a configuration manager
|
||||||
int port = 8448;
|
int port = 8448;
|
||||||
server = ServerBUilder.forPort(port)
|
server = ServerBuilder.forPort(port)
|
||||||
.addService(new JobServImpl())
|
.addService(new ShellServerImpl())
|
||||||
.build()
|
.build()
|
||||||
.start();
|
.start();
|
||||||
logger.info("Server initialized without tls");
|
logger.info("Server initialized without tls");
|
||||||
Runtime.getRuntime().addShutdownHook(new thread() {
|
Runtime.getRuntime().addShutdownHook(new Thread() {
|
||||||
@Override
|
@Override
|
||||||
public void run() {
|
public void run() {
|
||||||
// JVM shutdown might break logger functionality
|
// JVM shutdown might break logger functionality
|
||||||
|
|
@ -53,7 +53,7 @@ public class JobServServer {
|
||||||
}
|
}
|
||||||
|
|
||||||
// wrap around stub code generated by GRPC
|
// wrap around stub code generated by GRPC
|
||||||
static class JobServImpl extends JobServ.JobServImplBase {
|
static class ShellServerImpl extends ShellServerGrpc.ShellServerImplBase {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void getStatusDetail(RequestMessage request,
|
public void getStatusDetail(RequestMessage request,
|
||||||
|
|
@ -72,7 +72,6 @@ public class JobServServer {
|
||||||
StreamObserver<OutputMessage> responder) {
|
StreamObserver<OutputMessage> responder) {
|
||||||
// TODO: Implement job controller, get output, do the thing
|
// TODO: Implement job controller, get output, do the thing
|
||||||
OutputMessage reply = OutputMessage.newBuilder()
|
OutputMessage reply = OutputMessage.newBuilder()
|
||||||
.setPID(-1)
|
|
||||||
.build();
|
.build();
|
||||||
responder.onNext(reply);
|
responder.onNext(reply);
|
||||||
responder.onCompleted();
|
responder.onCompleted();
|
||||||
|
|
@ -84,7 +83,7 @@ public class JobServServer {
|
||||||
// TODO: Implement job controller, Start Job, do the thing
|
// TODO: Implement job controller, Start Job, do the thing
|
||||||
JobStatusMessage reply = JobStatusMessage.newBuilder()
|
JobStatusMessage reply = JobStatusMessage.newBuilder()
|
||||||
.setPID(-1)
|
.setPID(-1)
|
||||||
.setJobStatus(-1)
|
.setProcessStatus(-1)
|
||||||
.build();
|
.build();
|
||||||
responder.onNext(reply);
|
responder.onNext(reply);
|
||||||
responder.onCompleted();
|
responder.onCompleted();
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue