use of com.servoy.j2db.server.ngclient.INGClientWebsocketSession in project servoy-client by Servoy.
the class NGClientEndpoint method handleException.
@Override
protected void handleException(final Exception e, final IWebsocketSession session) {
if (e instanceof ApplicationException) {
final ApplicationException ae = (ApplicationException) e;
// if the current window has no endpoint then quickly set it to this instance.
if (CurrentWindow.exists() && !CurrentWindow.get().hasEndpoint())
CurrentWindow.get().setEndpoint(this);
CurrentWindow.runForWindow(new NGClientWebsocketSessionWindows((INGClientWebsocketSession) session), new Runnable() {
@Override
public void run() {
if (ae.getErrorCode() == ServoyException.NO_LICENSE) {
session.getClientService("$sessionService").executeAsyncServiceCall("setNoLicense", new Object[] { getLicenseAndMaintenanceDetail() });
} else if (ae.getErrorCode() == ServoyException.MAINTENANCE_MODE) {
session.getClientService("$sessionService").executeAsyncServiceCall("setMaintenanceMode", new Object[] { getLicenseAndMaintenanceDetail() });
}
}
});
}
try {
((NGClient) ((INGClientWebsocketSession) session).getClient()).shutDown(true);
} catch (Exception e1) {
Debug.error("Error calling shutdown on client that had an exception when starting up: " + e.getMessage(), e1);
}
}
use of com.servoy.j2db.server.ngclient.INGClientWebsocketSession in project servoy-client by Servoy.
the class DebugClientHandler method createDebugNGClient.
public synchronized IDebugClient createDebugNGClient(Object wsSession) throws Exception {
IFlattenedSolutionDebugListener debugListener = null;
if (debugNGClient != null && debugNGClient.getFlattenedSolution() != null) {
debugListener = debugNGClient.getFlattenedSolution().getDebugListener();
}
if (debugNGClient != null && !debugNGClient.isShutDown()) {
debugNGClient.shutDown(true);
}
debugNGClient = new DebugNGClient((INGClientWebsocketSession) wsSession, designerCallback);
if (debugListener != null && debugNGClient.getFlattenedSolution() != null)
debugNGClient.getFlattenedSolution().registerDebugListener(debugListener);
return debugNGClient;
}
Aggregations