@Override public void sendString(final String data) { ActivityComponentContext activityComponentContext = activityComponent.getComponentContext(); try { activityComponentContext.enterHandler(); delegate.sendString(data); } catch (Throwable e) { activityComponent.handleError("Error during web socket string sending", e); } finally { activityComponentContext.exitHandler(); } }
@Override public void onReceive(final Object data) { ActivityComponentContext activityComponentContext = activityComponent.getComponentContext(); if (!activityComponentContext.canHandlerRun()) { return; } try { activityComponentContext.enterHandler(); delegate.onReceive(data); } catch (Throwable e) { activityComponent.handleError("Error during web socket data receive", e); } finally { activityComponentContext.exitHandler(); } }
@Override public void onConnect() { ActivityComponentContext activityComponentContext = activityComponent.getComponentContext(); if (!activityComponentContext.canHandlerRun()) { return; } try { activityComponentContext.enterHandler(); delegate.onConnect(); } catch (Throwable e) { activityComponent.handleError("Error during web socket connection", e); } finally { connected.set(true); activityComponentContext.exitHandler(); } }