// Call the initializeService method on the Service private void initializeService(SEMplestService service) throws Exception { Class initClass = Class.forName(service.connectionData.getServiceOffered()); Constructor constructor = initClass.getConstructor(); ServiceInterface myService = (ServiceInterface) constructor.newInstance(); String empty = ""; // new String[] {}; Gson gson = new Gson(); String json = gson.toJson(empty); String ret = myService.ServiceGet(INITMETHODNAME, json); logger.debug("Ret = " + ret); }
public static void main(String args[]) { try { // System.out.println("Hello"); ServiceInterface s = (ServiceInterface) Naming.lookup("Hello"); s.increaseStaticInt(); ; System.out.println(s.getStaticInt()); ; // s.setStaticInt(100); System.out.println(s.getStaticInt()); } catch (Exception e) { System.out.println("Client Exception :" + e); } }
public static void main(String[] args) throws Exception { int port = 0; String host = ""; String message = ""; /* * Parse port argument. */ if (args.length > 2) { host = args[0]; try { port = Integer.parseInt(args[1]); if (port == 0) { goodbye("nonzero port argument required", null); } } catch (NumberFormatException e) { goodbye("malformed port argument", e); } message = args[2]; } else { usage(); } /* * Lookup service by name in the registry on the specified host and * port. */ Registry registry = LocateRegistry.getRegistry(host, port); ServiceInterface proxy = (ServiceInterface) registry.lookup("ServiceInterface"); /* * Invoke the 'sendMessage' method on the service passing the * specified message. */ System.out.println("sending message: " + message); System.out.println("received message from proxy: " + proxy.sendMessage(message)); System.out.println("done."); }
{ (new StringBuilder(z[27])).append(((NetworkInfo) (obj)).toString()).toString(); x.b(); if (intent.getBooleanExtra(z[19], false)) { x.b(); a.b = false; ServiceInterface.b(context); return; } if (android.net.NetworkInfo.State.CONNECTED == ((NetworkInfo) (obj)).getState()) { ServiceInterface.f(context); x.b(); a.b = true; if (cn.jpush.android.service.DownloadService.a()) { cn.jpush.android.service.DownloadService.a(context); } if (PushService.r) { cn.jpush.android.service.ServiceInterface.c(context, 3000); } if (a != null) { m.b(context, a); return; } } else if (android.net.NetworkInfo.State.DISCONNECTED == ((NetworkInfo) (obj)).getState()) { x.b(); a.b = false; ServiceInterface.b(context); return; } else { (new StringBuilder(z[24])).append(((NetworkInfo) (obj)).getState()).append(z[0]).toString(); x.b(); return; } }
{ if (ServiceInterface.j(context)) { x.d(); return; } if (!cn.jpush.android.util.a.o(context)) { x.d(); return; } }