};
}
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;