Examples of SelectorThread


Examples of com.sun.grizzly.http.SelectorThread

        if (adapter instanceof GrizzlyAdapter) {
            GrizzlyAdapter ga = (GrizzlyAdapter)adapter;
            ga.setResourcesContextPath(u.getRawPath());
        }
       
        final SelectorThread selectorThread = new SelectorThread();

        selectorThread.setAlgorithmClassName(StaticStreamAlgorithm.class.getName());
       
        final int port = (u.getPort() == -1) ? 80 : u.getPort();           
        selectorThread.setPort(port);

        selectorThread.setAdapter(adapter);
       
        try {
            selectorThread.listen();
        } catch (InstantiationException e) {
            IOException _e = new IOException();
            _e.initCause(e);
            throw _e;
        }
View Full Code Here

Examples of com.sun.grizzly.http.SelectorThread

        initParams.put("com.sun.jersey.config.property.packages",
                "$package");

        System.out.println("Starting grizzly...");
        SelectorThread threadSelector = GrizzlyWebContainerFactory.create(BASE_URI, initParams);    
        return threadSelector;
    }
View Full Code Here

Examples of com.sun.grizzly.http.SelectorThread

        SelectorThread threadSelector = GrizzlyWebContainerFactory.create(BASE_URI, initParams);    
        return threadSelector;
    }
   
    public static void main(String[] args) throws IOException {
        SelectorThread threadSelector = startServer();
        System.out.println(String.format("Jersey app started with WADL available at "
                + "%sapplication.wadl\nHit enter to stop it...",
                BASE_URI));
        System.in.read();
        threadSelector.stopEndpoint();
    }   
View Full Code Here

Examples of com.sun.grizzly.http.SelectorThread

        if (adapter instanceof GrizzlyAdapter) {
            GrizzlyAdapter ga = (GrizzlyAdapter)adapter;
            ga.setResourcesContextPath(u.getRawPath());
        }

        final SelectorThread selectorThread = new SelectorThread();

        selectorThread.setAlgorithmClassName(StaticStreamAlgorithm.class.getName());

        final int port = (u.getPort() == -1) ? 80 : u.getPort();
        selectorThread.setPort(port);
        selectorThread.setAddress(InetAddress.getByName(u.getHost()));

        selectorThread.setAdapter(adapter);

        try {
            selectorThread.listen();
        } catch (InstantiationException e) {
            IOException _e = new IOException();
            _e.initCause(e);
            throw _e;
        }
View Full Code Here

Examples of com.sun.grizzly.http.SelectorThread

        final String scheme = u.getScheme();
        if (!scheme.equalsIgnoreCase("http"))
            throw new IllegalArgumentException("The URI scheme, of the URI " + u +
                    ", must be equal (ignoring case) to 'http'");           
       
        final SelectorThread selectorThread = new SelectorThread();

        selectorThread.setAlgorithmClassName(StaticStreamAlgorithm.class.getName());
       
        final int port = (u.getPort() == -1) ? 80 : u.getPort();           
        selectorThread.setPort(port);

        selectorThread.setAdapter(adapter);
       
        try {
            selectorThread.listen();
        } catch (InstantiationException e) {
            IOException _e = new IOException();
            _e.initCause(e);
            throw _e;
        }
View Full Code Here

Examples of com.sun.grizzly.http.SelectorThread

        if (adapter instanceof GrizzlyAdapter) {
            GrizzlyAdapter ga = (GrizzlyAdapter)adapter;
            ga.setResourcesContextPath(u.getRawPath());
        }
       
        final SelectorThread selectorThread = new SelectorThread();

        selectorThread.setAlgorithmClassName(StaticStreamAlgorithm.class.getName());
       
        final int port = (u.getPort() == -1) ? 80 : u.getPort();           
        selectorThread.setPort(port);

        selectorThread.setAdapter(adapter);
       
        try {
            selectorThread.listen();
        } catch (InstantiationException e) {
            IOException _e = new IOException();
            _e.initCause(e);
            throw _e;
        }
View Full Code Here

Examples of com.sun.grizzly.http.SelectorThread

        initParams.put("com.sun.jersey.config.property.resourceConfigClass", "com.sun.jersey.api.core.PackagesResourceConfig");
        initParams.put("com.sun.jersey.config.property.packages", "org.dbpedia.spotlight.web.rest.resources");
        initParams.put("com.sun.jersey.config.property.WadlGeneratorConfig", "org.dbpedia.spotlight.web.rest.wadl.ExternalUriWadlGeneratorConfig");


        SelectorThread threadSelector = GrizzlyWebContainerFactory.create(serverURI, initParams);
        threadSelector.start();

        System.err.println("Server started in " + System.getProperty("user.dir") + " listening on " + serverURI);

        Thread warmUp = new Thread() {
            public void run() {
                //factory.searcher().warmUp((int) (configuration.getMaxCacheSize() * 0.7));
            }
        };
        warmUp.start();


        while(running) {
            Thread.sleep(100);
        }

        //Stop the HTTP server
        //server.stop(0);
        threadSelector.stopEndpoint();
        System.exit(0);

    }
View Full Code Here

Examples of com.sun.grizzly.http.SelectorThread

        create();
    }  

    protected void create() {        
        if ( !secure ){
            selectorThread = new SelectorThread();
         } else {
            selectorThread = new SSLSelectorThread();
        }
        setSoLinger(-1);
        setSoTimeout(30 * 1000);
 
View Full Code Here

Examples of com.sun.grizzly.http.SelectorThread

            if (adapter instanceof GrizzlyAdapter) {
                GrizzlyAdapter ga = (GrizzlyAdapter)adapter;
                ga.setResourcesContextPath(u.getRawPath());
            }

            final SelectorThread selectorThread = new SelectorThread();

            selectorThread.setAlgorithmClassName(StaticStreamAlgorithm.class.getName());

            final int port = (u.getPort() == -1) ? 80 : u.getPort();
            selectorThread.setPort(port);

            selectorThread.setAdapter(adapter);

            return selectorThread;
        }
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.