IsolateSystemServiceRequestHandler newIsolateRequestHandler(Isolate clientIsolate) { IsolateSystemServiceRequestHandler requestHandler = null; requestHandler = new IsolateSystemServiceRequestHandler(serviceManager, clientIsolate); SystemServiceConnectionLinks requestLinks = requestHandler.getSendReceiveLinks(); NamedLinkPortal.putLink( SystemServiceRequestHandler.SERVICE_TO_CLIENT_LINK_NAME, requestLinks.getSendLink()); NamedLinkPortal.putLink( SystemServiceRequestHandler.CLIENT_TO_SERVICE_LINK_NAME, requestLinks.getReceiveLink()); return requestHandler; }
public void run() { SystemServiceConnectionLinks requestLinks = requestHandler.getSendReceiveLinks(); Link receiveLink = requestLinks.getReceiveLink(); try { while (true) { LinkMessage msg = receiveLink.receive(); requestHandler.handleServiceRequest(); } } catch (ClosedLinkException cle) { // do nothing } catch (InterruptedIOException iioe) { requestLinks.close(); } catch (IOException ioe) { requestLinks.close(); } }