Package org.simpleframework.transport.connect

Examples of org.simpleframework.transport.connect.Connection.connect()


   */
  public Closeable initialize() {
    try {
      Connection connection = new SocketConnection(this);
      SocketAddress address = new InetSocketAddress(PORT_NUMBER);
      connection.connect(address);
      logger.info("HTTP service for ExtensionSwap installation running on port {}", PORT_NUMBER);
      return connection;
    } catch (IOException e) {
      logger.warn("Could not host HTTP service for ExtensionSwap installation on port " + PORT_NUMBER
          + ". Automatic installations of extensions will not be available.", e);
View Full Code Here


        Container container = new HelloWorld();
        Server server = new ContainerServer(container);
        Connection connection = new SocketConnection(server);
        SocketAddress address = new InetSocketAddress(8080);

        connection.connect(address);
    }
}
View Full Code Here

            }
         }
      };
      ContainerServer server = new ContainerServer(container);
      Connection connection = new SocketConnection(server);
      InetSocketAddress address = (InetSocketAddress)connection.connect(null); // ephemeral port
     
      return new ServerCriteria(connection, address);
   }
  
   private static class Client extends Thread implements Closeable {
View Full Code Here

        Connection connection;
        try {
            Server server = new ContainerServer(container);
            connection = new SocketConnection(server);

            connection.connect(listen, context);
            container.onServerStart();
        } catch (IOException ex) {
            throw new ProcessingException("IOException thrown when trying to create simple server", ex);
        }
        return connection;
View Full Code Here

        final Connection connection;
        try {
            final Server server = serverProvider.get();
            connection = new SocketConnection(server);

            final SocketAddress socketAddr = connection.connect(listen, context);
            container.onServerStart();

            return new SimpleServer() {

                @Override
View Full Code Here

            }
         }
      };
      ContainerServer server = new ContainerServer(container);
      Connection connection = new SocketConnection(server);
      InetSocketAddress address = (InetSocketAddress)connection.connect(null); // ephemeral port
     
      return new ServerCriteria(connection, address);
   }
  
   private static class Client extends Thread implements Closeable {
View Full Code Here

        try {
            final Server server = new ContainerServer(container);
            Connection connection = new SocketConnection(server);
            InetSocketAddress address = new InetSocketAddress(port);
            InetSocketAddress usedAddress = (InetSocketAddress)connection.connect(address);

            return new SimpleHttpFileServer(contentRoot, usedAddress.getPort(), new Stoppable() {
                public void stop() {
                    try {
                        server.stop();
View Full Code Here

        }
        SocketAddress listen = new InetSocketAddress(port);
        Server server = new ContainerServer(container);
        Connection connection = new SocketConnection(server);

        connection.connect(listen, context);

        return connection;
    }
}
View Full Code Here

           port = defaultPort;
        }        
        SocketAddress listen = new InetSocketAddress(port);
        Connection connection = new SocketConnection(container);
       
        connection.connect(listen, context);
       
        return connection;
   
}
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.