Ejemplo n.º 1
0
  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;
  }
Ejemplo n.º 2
0
    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();
      }
    }