Examples of SocketFactory


Examples of ca.uhn.hl7v2.util.SocketFactory

  @Override
  protected void afterStartup() {
    try {
      super.afterStartup();
      log.info("Starting SimpleServer running on port {}", port);
      SocketFactory ss = this.hapiContext.getSocketFactory();
      acceptor = new AcceptorThread(port, tls, getExecutorService(), queue, ss);
      acceptor.start();
    } catch (Exception e) {
      log.error("Failed starting SimpleServer on port", port);
      throw new RuntimeException(e);
View Full Code Here

Examples of com.googlecode.jmxtrans.connections.SocketFactory

  }

  @Override
  protected void configure() {
    bind(new TypeLiteral<GenericKeyedObjectPool<InetSocketAddress, Socket>>(){})
        .toInstance(getObjectPool(new SocketFactory(), SocketFactory.class.getSimpleName()));
    bind(new TypeLiteral<GenericKeyedObjectPool<JMXConnectionParams, JMXConnector>>(){})
        .toInstance(getObjectPool(new JmxConnectionFactory(), JmxConnectionFactory.class.getSimpleName()));
    bind(new TypeLiteral<GenericKeyedObjectPool<SocketAddress, DatagramSocket>>(){})
        .toInstance(getObjectPool(new DatagramSocketFactory(), DatagramSocketFactory.class.getSimpleName()));
  }
View Full Code Here

Examples of com.jcraft.jsch.SocketFactory

        session.setConfig(props);
        session.setDaemonThread(true);

        // We have to make sure that SSH uses it's own socket factory so
        // that we don't get recursion
        SocketFactory sfactory = new SSHSocketFactory();
        session.setSocketFactory(sfactory);
        UserInfo userinfo = null;
        session.setUserInfo(userinfo);
        session.connect();
        if (!session.isConnected()) {
View Full Code Here

Examples of com.mysql.jdbc.SocketFactory

      Properties hostSpecificProps = NonRegisteringDriver.expandHostKeyValues(hostnameToConnectTo);
     
      String protocol = hostSpecificProps.getProperty(NonRegisteringDriver.PROTOCOL_PROPERTY_KEY);
     
      if ("unix".equalsIgnoreCase(protocol)) {
        SocketFactory factory;
        try {
          factory = (SocketFactory) Class
              .forName(
                  "org.newsclub.net.mysql.AFUNIXDatabaseSocketFactory")
              .newInstance();
        } catch (InstantiationException e) {
          throw new SocketException(e.getMessage());
        } catch (IllegalAccessException e) {
          throw new SocketException(e.getMessage());
        } catch (ClassNotFoundException e) {
          throw new SocketException(e.getMessage());
        }

        String path = hostSpecificProps
            .getProperty(NonRegisteringDriver.PATH_PROPERTY_KEY);

        if (path != null) {
          hostSpecificProps.setProperty("junixsocket.file", path);
        }

        return new HangingSocket(factory.connect(hostnameToConnectTo,
            portNumber, hostSpecificProps), props, hostname);
      }

    }
   
View Full Code Here

Examples of com.sun.faban.driver.transport.sunhttp.SocketFactory

     * @param proxy The proxy
     * @return The socket
     */
  public Socket createSocket(Proxy proxy) {
        if (userFactory instanceof SocketFactory) {
            SocketFactory userFactory = (SocketFactory) this.userFactory;
            return new TimedSocketWrapper(userFactory.createSocket(proxy));
        } else if (proxy == Proxy.NO_PROXY) {
            try {
                return createSocket();
            } catch (IOException e) {
                throw new RuntimeException(
                        "Empty create socket returns IOException!" +
                        e.getMessage(), e);
            }
        } else {
            throw new UnsupportedOperationException(
                    userFactory.getClass().getName() +
                    " does not support creating a socket through a proxy." +
                    proxy.type() + ", " + proxy.address());
        }


View Full Code Here

Examples of fr.dyade.aaa.common.net.SocketFactory

    if (logger.isLoggable(BasicLevel.DEBUG))
      logger.log(BasicLevel.DEBUG,
                 "ReliableTcpClient[" + identity + ',' + key + "].createSocket(" +
                 hostname + "," + port + ") on interface " + outLocalAddrStr + ":" + outLocalPort);

    SocketFactory factory = SocketFactory.getFactory(params.socketFactory);
    Socket socket = factory.createSocket(addr, port,
                                         outLocalAddr, outLocalPort,
                                         params.connectingTimer *1000);

    return socket;
  }
View Full Code Here

Examples of javax.net.SocketFactory

    if (logger.isLoggable(BasicLevel.DEBUG))
      logger.log(BasicLevel.DEBUG,
                 "ReliableSSLTcpClient[" + identity + ',' + key + "].createSocket(" +
                 hostname + "," + port + ") on interface " + outLocalAddrStr + ":" + outLocalPort);

    SocketFactory socketFactory = createSocketFactory();
    // AF: Be careful SSLSocketFactory don't allow to use ConnectTimeout
    Socket socket =  socketFactory.createSocket(hostname, port, outLocalAddr, outLocalPort);

    return socket;
  }
View Full Code Here

Examples of javax.net.SocketFactory

    if (params == null)
    {
      throw new IllegalArgumentException("Parameters may not be null");
    }
    int timeout = params.getConnectionTimeout();
    SocketFactory socketfactory = getSSLContext().getSocketFactory();
    if (timeout == 0)
    {
      return socketfactory.createSocket(host, port, localAddress,
          localPort);
    }
    else
    {
      Socket socket = socketfactory.createSocket();
      SocketAddress localaddr = new InetSocketAddress(localAddress,
          localPort);
      SocketAddress remoteaddr = new InetSocketAddress(host, port);
      socket.bind(localaddr);
      socket.connect(remoteaddr, timeout);
View Full Code Here

Examples of javax.net.SocketFactory

    if (params == null)
      throw new IllegalArgumentException("Parameters may not be null"); //$NON-NLS-1$

    /* Determine Connection Timeout */
    int timeout = params.getConnectionTimeout();
    SocketFactory socketfactory = getSSLContext().getSocketFactory();

    /* Timeout is unlimited */
    if (timeout == 0)
      return socketfactory.createSocket(host, port, localAddress, localPort);

    /* Timeout is defined */
    Socket socket = socketfactory.createSocket();
    SocketAddress localaddr = new InetSocketAddress(localAddress, localPort);
    SocketAddress remoteaddr = new InetSocketAddress(host, port);
    socket.bind(localaddr);
    socket.connect(remoteaddr, timeout);
    return socket;
View Full Code Here

Examples of javax.net.SocketFactory

    ) throws IOException, UnknownHostException, ConnectTimeoutException {
        if (params == null) {
            throw new IllegalArgumentException("Parameters may not be null");
        }
        int timeout = params.getConnectionTimeout();
        SocketFactory socketfactory = getSSLContext().getSocketFactory();
        if (timeout == 0) {
            return socketfactory.createSocket(host, port, localAddress, localPort);
        } else {
            Socket socket = socketfactory.createSocket();
            SocketAddress localaddr = new InetSocketAddress(localAddress, localPort);
            SocketAddress remoteaddr = new InetSocketAddress(host, port);
            socket.bind(localaddr);
            socket.connect(remoteaddr, timeout);
            return socket;
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.