Package pl.icedev.rmi.RMIServer

Examples of pl.icedev.rmi.RMIServer.RMIInterface


            int id = TypeUtil.toInt(json.get("id"));
            String method = (String) json.get("method");
            JSONArray params = (JSONArray) json.get("args");

            RMIInterface interf = int2itf.get(id);

            if (interf == null) {
                sendError(RMIFault.ITF_ID_NOT_FOUND);
                return;
            }

            try {
                sendResult(interf.invoke(method, params.toArray()));
            } catch (InvocationTargetException e) {
              Throwable target = e.getTargetException();
              if(target instanceof Exception) {
                sendException((Exception) target);
              } else {
                    e.printStackTrace();
                    sendError(RMIFault.INTERNAL_ERROR);
              }
            } catch (Exception e) {
                e.printStackTrace();
                sendError(RMIFault.INTERNAL_ERROR);
            }

        } else if (json.containsKey("request")) {
            String itname = (String) json.get("request");

            RMIInterface interf = server.interfaces.get(itname);
            if (interf == null) {
                sendError(RMIFault.ITF_NOT_IMPLEMENTED);
                System.out.println("Got interfaces: ");
                for (String s : server.interfaces.keySet()) {
                    System.out.print(s + ",");
View Full Code Here

TOP

Related Classes of pl.icedev.rmi.RMIServer.RMIInterface

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.