Package one.nio.net

Examples of one.nio.net.ConnectionString


    public ManagementServer(ConnectionString conn, Object... routers) throws IOException {
        super(conn, routers);
    }

    public ManagementServer(String address, Object... routers) throws IOException {
        super(new ConnectionString(address + "?selectors=1&jmx=false"), routers);
    }
View Full Code Here


import one.nio.net.ConnectionString;

public class HttpClientTest {

    public static void main(String[] args) throws Exception {
        HttpClient client = new HttpClient(new ConnectionString(args[0]));
        String path = args[1];

        Response response = client.get(path);
        System.out.println("Status code: " + response.getStatus());
        System.out.println(response.toString());
View Full Code Here

        session.writeResponse(request, response);
    }

    public static void main(String[] args) throws Exception {
        String url = args.length > 0 ? args[0] : "socket://0.0.0.0:8080";
        HttpServerTest server = new HttpServerTest(new ConnectionString(url));
        server.start();
    }
View Full Code Here

        System.exit(1);
    }

    @SuppressWarnings("unchecked")
    private static CacheService<Entity> getCacheService(String host) throws IOException {
        ConnectionString conn = new ConnectionString(host + ':' + CacheService.DEFAULT_PORT);
        RpcClient client = new RpcClient(conn);
        return (CacheService<Entity>) Proxy.newProxyInstance(
                CacheService.class.getClassLoader(), new Class[] { CacheService.class }, client);
    }
View Full Code Here

    public void configure(String configuration) throws IOException {
        HashMap<HttpProvider, Integer> newProviders = new HashMap<HttpProvider, Integer>();
        for (StringTokenizer st = new StringTokenizer(configuration); st.hasMoreElements(); ) {
            String host = st.nextToken();
            int weight = Integer.parseInt(st.nextToken());
            newProviders.put(new HttpProvider(new ConnectionString(host)), weight);
        }

        List<HttpProvider> oldProviders = replaceProviders(newProviders);
        for (HttpProvider provider : oldProviders) {
            provider.close();
View Full Code Here

    public void set(long key, Entity value) {
        cacheImpl.put(key, value);
    }

    public static void main(String[] args) throws Exception {
        ConnectionString conn = new ConnectionString("0.0.0.0:" + DEFAULT_PORT);
        RpcServer<CacheService> server = new RpcServer<CacheService>(conn, new RemoteCacheServer());
        server.start();
    }
View Full Code Here

TOP

Related Classes of one.nio.net.ConnectionString

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.