Search in sources :

Example 1 with ObjectStore

use of com.jme3.network.rmi.ObjectStore in project jmonkeyengine by jMonkeyEngine.

the class TestRemoteCall method main.

public static void main(String[] args) throws IOException, InterruptedException {
    Serializer.registerClass(Savable.class, new SavableSerializer());
    createServer();
    Client client = Network.connectToServer("localhost", 5110);
    client.start();
    ObjectStore store = new ObjectStore(client);
    ServerAccess access = store.getExposedObject("access", ServerAccess.class, true);
    boolean result = access.attachChild("Models/Oto/Oto.mesh.xml");
    System.out.println(result);
}
Also used : SavableSerializer(com.jme3.network.serializing.serializers.SavableSerializer) ObjectStore(com.jme3.network.rmi.ObjectStore) Client(com.jme3.network.Client)

Example 2 with ObjectStore

use of com.jme3.network.rmi.ObjectStore in project jmonkeyengine by jMonkeyEngine.

the class TestRemoteCall method createServer.

public static void createServer() {
    serverApp = new SimpleApplication() {

        @Override
        public void simpleInitApp() {
        }
    };
    serverApp.start();
    try {
        Server server = Network.createServer(5110);
        server.start();
        ObjectStore store = new ObjectStore(server);
        store.exposeObject("access", new ServerAccessImpl());
    } catch (IOException ex) {
        ex.printStackTrace();
    }
}
Also used : ObjectStore(com.jme3.network.rmi.ObjectStore) Server(com.jme3.network.Server) SimpleApplication(com.jme3.app.SimpleApplication) IOException(java.io.IOException)

Aggregations

ObjectStore (com.jme3.network.rmi.ObjectStore)2 SimpleApplication (com.jme3.app.SimpleApplication)1 Client (com.jme3.network.Client)1 Server (com.jme3.network.Server)1 SavableSerializer (com.jme3.network.serializing.serializers.SavableSerializer)1 IOException (java.io.IOException)1