m-chrzan.xyz
aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/pl/edu/mimuw/cloudatlas/querysigner/QuerySigner.java
blob: 69a25d7b678ef1438a938c19732429bab52bf46a (plain)
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
package pl.edu.mimuw.cloudatlas.querysigner;

import pl.edu.mimuw.cloudatlas.agent.EventBus;
import pl.edu.mimuw.cloudatlas.api.Api;
import pl.edu.mimuw.cloudatlas.querysignerapi.QuerySignerApi;

import java.rmi.registry.LocateRegistry;
import java.rmi.registry.Registry;
import java.rmi.server.UnicastRemoteObject;

public class QuerySigner {

    public static void runRegistry() {
        try {
            QuerySignerApiImplementation api = new QuerySignerApiImplementation();
            QuerySignerApi apiStub =
                    (QuerySignerApi) UnicastRemoteObject.exportObject(api, 0);
            Registry registry = LocateRegistry.getRegistry();
            registry.rebind("QuerySignerApi", apiStub);
            System.out.println("QuerySigner: api bound");
        } catch (Exception e) {
            System.err.println("QuerySigner registry initialization exception:");
            e.printStackTrace();
        }
    }

    public static void main(String[] args) {
        runRegistry();
    }
}