Package net.jini.jeri.connection

Examples of net.jini.jeri.connection.ServerConnection


    public static ServerRequestInfo getServerRequestInfo(
  KerberosServerEndpoint ep, InboundRequest r)
    {
  ServerRequestInfo info = new ServerRequestInfo();
  ServerConnection c =
      (ServerConnection) inboundRequestConnection.get(r);
  info.serverConnection = c;
  info.inboundRequestHandle =
      (InboundRequestHandle) inboundRequestHandle.get(r);
  info.serverPrincipal =
View Full Code Here


      /* test connection.processRequestData(...) */
      try {
    rh = (InboundRequestHandle) runWithPerms(
        new Action() {
          public Object run() throws Exception {
        ServerConnection conn = info.serverConnection;
        InputStream in = conn.getInputStream();
        OutputStream out = conn.getOutputStream();
        return conn.processRequestData(in, out);
          }
      },
        defaultPermsNoSocketPerm);
      } catch (IOException e) {
    e.printStackTrace(); // for debug
View Full Code Here

    public static ServerRequestInfo getServerRequestInfo(
  KerberosServerEndpoint ep, InboundRequest r)
    {
  ServerRequestInfo info = new ServerRequestInfo();
  ServerConnection c =
      (ServerConnection) inboundRequestConnection.get(r);
  info.serverConnection = c;
  info.inboundRequestHandle =
      (InboundRequestHandle) inboundRequestHandle.get(r);
  info.serverPrincipal =
View Full Code Here

  ServerConnManagerImpl mgr = new ServerConnManagerImpl();
  endpointInternals.setServerConnManager(ep, mgr);

  ListenContextImpl lc = new ListenContextImpl();
  ep.enumerateListenEndpoints(lc);
  ServerConnection conn = mgr.getServerConnection();
  try {
      InputStream in = new BufferedInputStream(conn.getInputStream());
      OutputStream out = new BufferedOutputStream(conn.getOutputStream());
      InboundRequestHandle handle = conn.processRequestData(in, out);
      conn.checkPermissions(handle);
      checkIntegrity(conn.checkConstraints(handle, constraints));
      if (checker != null) {
    checker.checkClientSubject(getClientSubject(conn, handle));
      }

      byte[] hash = calcHandshakeHash(received, sent);
      byte[] clientHash = new byte[hash.length];
      new DataInputStream(in).readFully(clientHash);
      if (!Arrays.equals(clientHash, hash)) {
    throw new DiscoveryProtocolException(
        "handshake hash mismatch");
      }

      Plaintext.writeUnicastResponse(out, response, context);
      out.flush();
  } finally {
      conn.close();
      lc.getListenHandle().close();
  }
    }
View Full Code Here

                    synchronized(listenLock) {
                        listenStarted = true;
                        listenLock.notify();
                    }
                }
                ServerConnection connection =
                    new TestServerConnection(ss.accept());
                manager.handleConnection(connection, rd);
            }
        } catch (IOException e) {
            if (!getStop()) {
View Full Code Here

          new Object[]{ socket, serverSocket });
        }

        setSocketOptions(socket);

        final ServerConnection serverConnection =
      new ServerConnectionImpl(socket);

        AccessController.doPrivileged(securityContext.wrap(
      new PrivilegedAction() {
          public Object run() {
View Full Code Here

                    synchronized(listenLock) {
                        listenStarted = true;
                        listenLock.notify();
                    }
                }
                ServerConnection connection =
                    new TestServerConnection(ss.accept());
                try {
                    manager.handleConnection(null,rd);
                } catch (NullPointerException e) {
                    ConnectionTransportListener.getListener()
View Full Code Here

TOP

Related Classes of net.jini.jeri.connection.ServerConnection

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.