Package net.jini.jeri.connection

Examples of net.jini.jeri.connection.Connection


    sock = connectToHost(rh);
      } else {
    sock = newSocket();
      }
     
      Connection c = new ConnectionImpl(sock, config);
      if (logger.isLoggable(Level.FINE)) {
    logger.log(Level.FINE, "New connection established:\n{0}",
         new Object[] {c});
      }
      return c;
View Full Code Here


    public static ClientRequestInfo getClientRequestInfo(
  KerberosEndpoint ep, OutboundRequest r)
    {
  ClientRequestInfo info = new ClientRequestInfo();
  Connection c = (Connection) outboundRequestConnection.get(r);
  info.clientConnection = c;
  info.outboundRequestHandle =
      (OutboundRequestHandle) outboundRequestHandle.get(r);
  info.serverPrincipal =
      (KerberosPrincipal) endpointServerPrincipal.get(ep);
View Full Code Here

    {
  CallContext context = CallContext.coerce(handle, endpoint);
  if (active == null || idle == null) {
      throw new NullPointerException("Arguments cannot be null");
  }
  Connection result = null;
  /*
   * Choose the first connection with an appropriate subject, an active
   * suite that is one of the requested suites, and one for which all the
   * requested suites better than the active one were also better for its
   * call context.  That insures that we've gotten the best connection we
View Full Code Here

    sock = connectToHost(rh);
      } else {
    sock = newSocket();
      }
     
      Connection c = new ConnectionImpl(sock, config);
      if (logger.isLoggable(Level.FINE)) {
    logger.log(Level.FINE, "New connection established:\n{0}",
         new Object[] {c});
      }
      return c;
View Full Code Here

    public static ClientRequestInfo getClientRequestInfo(
  KerberosEndpoint ep, OutboundRequest r)
    {
  ClientRequestInfo info = new ClientRequestInfo();
  Connection c = (Connection) outboundRequestConnection.get(r);
  info.clientConnection = c;
  info.outboundRequestHandle =
      (OutboundRequestHandle) outboundRequestHandle.get(r);
  info.serverPrincipal =
      (KerberosPrincipal) endpointServerPrincipal.get(ep);
View Full Code Here

        Field field = null;
        try {
            /* based on class SecureConnectionManager.Outbound */
            field = request.getClass().getDeclaredField("c");
            field.setAccessible(true);
            Connection c =
                (Connection) field.get(request);
            field = c.getClass().getDeclaredField("sslSocket");
            field.setAccessible(true);
            socket = (SSLSocket)field.get(c);
        } catch (Exception e) {
            if (field == null) {
                try {
                /* based on class HttpsServerEndpoint.HtttpsOutboundRequest */
                    field = request.getClass().getDeclaredField("connection");
                    field.setAccessible(true);
                    Connection c =(Connection) field.get(request);
                    field = c.getClass().getSuperclass()
                        .getDeclaredField("sslSocket");
                    field.setAccessible(true);
                    socket = (SSLSocket)field.get(c);
                } catch (Exception eHttp) {
                    eHttp.printStackTrace();
View Full Code Here

    {
  CallContext context = CallContext.coerce(handle, endpoint);
  if (active == null || idle == null) {
      throw new NullPointerException("Arguments cannot be null");
  }
  Connection result = null;
  /*
   * Choose the first connection with an appropriate subject, an active
   * suite that is one of the requested suites, and one for which all the
   * requested suites better than the active one were also better for its
   * call context.  That insures that we've gotten the best connection we
View Full Code Here

  }
  if (constraints == null) {
      constraints = InvocationConstraints.EMPTY;
  }
  ConnectionInfo ci = getConnectionInfo(socket, constraints);
  Connection conn = ci.endpoint.connect(ci.handle);
  try {
      boolean integrity =
    checkIntegrity(conn.getUnfulfilledConstraints(ci.handle));
      OutputStream out =
    new BufferedOutputStream(conn.getOutputStream());
      conn.writeRequestData(ci.handle, out);
      out.write(calcHandshakeHash(sent, received));
      out.flush();

      InputStream in = new BufferedInputStream(conn.getInputStream());
      IOException e = conn.readResponseData(ci.handle, in);
      if (e != null) {
    throw e;
      }
      return Plaintext.readUnicastResponse(
    in, defaultLoader, integrity, verifierLoader, context);
  } finally {
      conn.close();
  }
    }
View Full Code Here

    }

    //inherit javadoc
    public Connection connect(OutboundRequestHandle handle, Collection active,
        Collection idle) {
        Connection connection = null;
        Iterator it = active.iterator();
        connection = it.hasNext()?(Connection)it.next():null;
        if (connection==null) {
            it = idle.iterator();
            connection = it.hasNext()?(Connection)it.next():null;
View Full Code Here

    //inherit javadoc
    public Connection connect(OutboundRequestHandle handle, Collection active,
        Collection idle) {
        ConnectionTransportListener.getListener().called("connect2");
        Connection connection = null;
        Iterator it = active.iterator();
        connection = it.hasNext()?(Connection)it.next():null;
        if (connection==null) {
            it = idle.iterator();
            connection = it.hasNext()?(Connection)it.next():null;
View Full Code Here

TOP

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

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.