Package com.dragome.remote

Examples of com.dragome.remote.ApplicationExecutor


      return createProductionApplicationExecutor();
  }

  private ApplicationExecutor createProductionApplicationExecutor()
  {
    return new ApplicationExecutor()
    {
      public void pushResult(ServiceInvocationResult result)
      {
      }
View Full Code Here


    };
  }

  private ApplicationExecutor createDebuggingApplicationExecutor()
  {
    final ApplicationExecutor applicationExecutor= RequestExecutorImpl.createRemoteServiceByWebSocket(ApplicationExecutor.class);
    ServiceLocator.getInstance().getClientToServerMessageChannel().setReceiver(new Receiver()
    {
      public void reset()
      {
      }

      public void messageReceived(String aMessage)
      {
        List<ServiceInvocation> serviceInvocations= (List<ServiceInvocation>) TempHelper.getObjectFromMessage(aMessage);
        for (ServiceInvocation serviceInvocation : serviceInvocations)
        {
          try
          {
            Object result= serviceInvocation.invoke();
            if (!ServiceLocator.getInstance().isMethodVoid(serviceInvocation.getMethod()))
            {
              applicationExecutor.pushResult(new ServiceInvocationResult(serviceInvocation, result));
//              System.out.println("response message: " + responseMessagesCounter++);
            }
          }
          catch (Exception e)
          {
            //          applicationExecutor.pushException(new DragomeJsException(e, e.getMessage()));
            applicationExecutor.pushResult(new ServiceInvocationResult(serviceInvocation, new DragomeJsException(e, "Execution failed in browser: " + e.getMessage())));
          }
        }
      }
    });
    return applicationExecutor;
View Full Code Here

    return applicationExecutor;
  }

  public void launch(final String typeName)
  {
    final ApplicationExecutor applicationExecutor= prepareLaunch();
    Runnable runnable= new Runnable()
    {
      public void run()
      {
        Executor executor= ServiceLocator.getInstance().getConfigurator().getExecutionHandler().getExecutor();
        executor.execute(new Runnable()
        {
          public void run()
          {
            applicationExecutor.executeByClassName(typeName);
          }
        });
      }
    };
View Full Code Here

TOP

Related Classes of com.dragome.remote.ApplicationExecutor

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.