Package org.simpleframework.http.core

Examples of org.simpleframework.http.core.ContainerServer


    rootContext = new Context();
    rootContext.setVariableValue("zetesVersion", zetes.hands.About.VERSION);
    rootContext.setVariableValue("parrotVersion", Parrot.VERSION);
   
    executor = Executors.newFixedThreadPool(size);
    server = new ContainerServer(this);
    connection = new SocketConnection(server);
    address = new InetSocketAddress(port);
    dataConnector = new DataConnector(new File(databaseFile));
    System.out.println("Parrot server greets you!");
  }
View Full Code Here


    public HttpMockServer(@Nonnull JSONObject jsonObject, @Nonnull ConfigReader configReader, @Nonnull NetworkType simulatedNetworkType)
            throws IOException, JSONException {
        ConfigResult config = new ConfigParser(configReader).parseConfig(jsonObject);
        this.responseHandler = new ResponseHandler(config.responses, simulatedNetworkType, configReader);
        Server server = new ContainerServer(this);
        conn = new SocketConnection(server);
        final SocketAddress sa = new InetSocketAddress(config.port);
        conn.connect(sa);
    }
View Full Code Here

    * and response objects to the internal container.
    *
    * @param container this is the container that receives requests
    */
   public SocketConnection(Container container) throws IOException {
      this(new ContainerServer(container));
   }
View Full Code Here

    public HttpFileServer start(File contentRoot, int port) {
        Container container = new SimpleFileServerContainer(new FileContext(contentRoot));

        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();
                    } catch (IOException e) {
                        throw new UncheckedIOException(e);
                    }
                }
            });
View Full Code Here

        if (port == -1) {
            port = defaultPort;
        }
        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

                } catch (IOException e) {
                    throw new RuntimeException(e);
                }
            }
        };
        Server server = new ContainerServer(container);
        connection = new SocketConnection(server);
        SocketAddress address = new InetSocketAddress(port);

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

TOP

Related Classes of org.simpleframework.http.core.ContainerServer

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.