当前位置: 首页>>代码示例>>Java>>正文


Java HttpServer.stop方法代码示例

本文整理汇总了Java中org.glassfish.grizzly.http.server.HttpServer.stop方法的典型用法代码示例。如果您正苦于以下问题:Java HttpServer.stop方法的具体用法?Java HttpServer.stop怎么用?Java HttpServer.stop使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.glassfish.grizzly.http.server.HttpServer的用法示例。


在下文中一共展示了HttpServer.stop方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: main

import org.glassfish.grizzly.http.server.HttpServer; //导入方法依赖的package包/类
/**
 * Main method.
 * @param args
 * @throws IOException
 */
public static void main(String[] args) throws IOException {
    Logger log = Logger.getLogger(Main.class.getName());

    log.log(Level.WARNING,"Starting server .....");

    Logger log2 = Logger.getLogger("org.glassfish");
    log2.setLevel(Level.ALL);
    log2.addHandler(new java.util.logging.ConsoleHandler());

    final HttpServer server = 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();
    server.stop();
}
 
开发者ID:Fiware,项目名称:NGSI-LD_Wrapper,代码行数:21,代码来源:Main.java

示例2: main

import org.glassfish.grizzly.http.server.HttpServer; //导入方法依赖的package包/类
public static void main(String[] args) throws IOException {
    Logger root = Logger.getLogger("");
    Handler[] handlers = root.getHandlers();
    for (Handler h : handlers) {
        h.setLevel(Level.INFO);
    }
    if (args.length>=1) CommonResources.CONF_FILE=args[1];
    
    Logger ehcacheL = Logger.getLogger("net.sf.ehcache");
    ehcacheL.setLevel(Level.INFO);
    CommonResources.initialize();
    if (CommonResources.back != null && CommonResources.front != null) {
        try {
            HttpServer httpServer = startServer();
            HttpServer adminServer = startAdminServer();
            System.out.println("Server Started");
            System.in.read();
            httpServer.stop();
            adminServer.stop();
        } catch (CacheException ex) {
            Logger.getLogger(App.class.getName()).log(Level.SEVERE, null, ex);
        }
    } else {
        Logger.getLogger(App.class.getName()).log(Level.SEVERE, "Caches not fully initialized... exiting");
    }
}
 
开发者ID:framegrace,项目名称:beume,代码行数:27,代码来源:App.java

示例3: main

import org.glassfish.grizzly.http.server.HttpServer; //导入方法依赖的package包/类
/**
 * Main method.
 * 
 * @param args
 * @throws IOException
 */
public static void main(String[] args) throws IOException {
	if (args.length < 1) {
		System.out.println("Usage: App [port]");
		System.exit(-1);
	}
	int port = Integer.parseInt(args[0]);
	App.BASE_URI = "http://localhost:" + port + "/myapp/";

	final HttpServer server = 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();
	server.stop();
}
 
开发者ID:vdialani,项目名称:CloudComputing,代码行数:23,代码来源:App.java

示例4: run_rest

import org.glassfish.grizzly.http.server.HttpServer; //导入方法依赖的package包/类
public static void run_rest(int port) throws IOException {
//        startH2Console();
        HttpServer httpServer = startServer(port);
        String addr = InetAddress.getLocalHost().getHostAddress() + ":" + port;
        System.out.println(String.format("Jersey app started with WADL available at "
                        + "%s/application.wadl\nTry out %s/missings\nPress Ctrl-C for exit.",
                        addr, addr));

        try {
            Thread.currentThread().join();
        } catch(Exception ex) {
            System.out.println(ex.getMessage());
        } finally {
            httpServer.stop();
        }
    }
 
开发者ID:dbpedia,项目名称:MissingBot,代码行数:17,代码来源:Main.java

示例5: testJsonSerialization_application

import org.glassfish.grizzly.http.server.HttpServer; //导入方法依赖的package包/类
@Test
public void testJsonSerialization_application() throws Exception {

	// This test guarantees that in an non-OSGi environment,
	// our REST application uses the properties we define.
	// And, in particular, the JSon serialization that we tailored.

	URI uri = UriBuilder.fromUri( "http://localhost/" ).port( 8090 ).build();
	RestApplication restApp = new RestApplication( this.manager );
	HttpServer httpServer = null;
	String received = null;

	try {
		httpServer = GrizzlyServerFactory.createHttpServer( uri, restApp );
		Assert.assertTrue( httpServer.isStarted());
		URI targetUri = UriBuilder.fromUri( uri ).path( UrlConstants.APPLICATIONS ).build();
		received = Utils.readUrlContent( targetUri.toString());

	} finally {
		if( httpServer != null )
			httpServer.stop();
	}

	String expected = JSonBindingUtils.createObjectMapper().writeValueAsString( Arrays.asList( this.app ));
	Assert.assertEquals( expected, received );
}
 
开发者ID:roboconf,项目名称:roboconf-platform,代码行数:27,代码来源:ServletRegistrationComponentTest.java

示例6: main

import org.glassfish.grizzly.http.server.HttpServer; //导入方法依赖的package包/类
public static void main(String[] args) throws IOException 
{
    final HttpServer server = startServer();
    
    System.out.println(
            String.format("NERD API started with WADL available at " + 
                          "%sapplication.wadl", 
            BASE_URI)
     );
    
    Thread warmUp = new Thread() {
        public void run() {}
    };
    warmUp.start();
    while(running) {
        try {
            Thread.sleep(100);
        } catch (InterruptedException e) {
            e.printStackTrace();
        }
    }
    
    System.in.read();
    server.stop();        
}
 
开发者ID:NERD-project,项目名称:nerd-api,代码行数:26,代码来源:Server.java

示例7: main

import org.glassfish.grizzly.http.server.HttpServer; //导入方法依赖的package包/类
public static void main(String[] args) throws IOException {
    try {
        FileHandler fh = new FileHandler("Doodle.log");
        logger.addHandler(fh);
        //logger.setLevel(Level.ALL);  
        SimpleFormatter formatter = new SimpleFormatter();
        fh.setFormatter(formatter);
        Engine.getInstance();
        // the following statement is used to log any messages  
        logger.info("Service started");
        HttpServer httpServer = startServer();
        System.out.println(String.format("Jersey app started with WADL available at "
                + "%sapplication.wadl\nTry out %sverbalizer\nHit enter to stop it...",
                BASE_URI, BASE_URI));
        System.in.read();
        httpServer.stop();
    } catch (Exception e) {
        logger.warning("Messed up handlers");
        e.printStackTrace();
    }
}
 
开发者ID:dice-group,项目名称:DALI,代码行数:22,代码来源:Main.java

示例8: main

import org.glassfish.grizzly.http.server.HttpServer; //导入方法依赖的package包/类
/**
 * Main method.
 * @param args
 * @throws IOException
 */
public static void main(String[] args) throws IOException {
    final HttpServer server = 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();
    server.stop();
}
 
开发者ID:ljug,项目名称:java-tutorials,代码行数:13,代码来源:Main.java

示例9: main

import org.glassfish.grizzly.http.server.HttpServer; //导入方法依赖的package包/类
/**
 * Main method.
 * @param args
 * @throws IOException
 */
public static void main(String[] args) throws IOException {
    EntityManagerFactory emf =
  Persistence.createEntityManagerFactory("net.cofares.ljug_jersey-service_jar_1.0-SNAPSHOTPU");
 
 //EntityManager em = emf.createEntityManager();
    final HttpServer server = 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();
    server.stop();
}
 
开发者ID:ljug,项目名称:java-tutorials,代码行数:17,代码来源:Main.java

示例10: main

import org.glassfish.grizzly.http.server.HttpServer; //导入方法依赖的package包/类
/**
 * Main method.
 * 
 * @param args
 * @throws IOException
 */
public static void main(String[] args) throws IOException {
	SLF4JBridgeHandler.removeHandlersForRootLogger();
	SLF4JBridgeHandler.install();
	final HttpServer server = 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();
	server.stop();
}
 
开发者ID:nherbaut,项目名称:jersey-hateos-example,代码行数:18,代码来源:Main.java

示例11: main

import org.glassfish.grizzly.http.server.HttpServer; //导入方法依赖的package包/类
public static void main(String[] args) throws IOException {
    final HttpServer server = startServer();
    logger.info(String.format("Jersey app started with WADL available at "
            + "%sapplication.wadl\nHit enter to stop it...", BASE_URI));
    System.in.read();
    server.stop();
}
 
开发者ID:psenger,项目名称:Jersey2-Security-JWT,代码行数:8,代码来源:Main.java

示例12: main

import org.glassfish.grizzly.http.server.HttpServer; //导入方法依赖的package包/类
/**
 * Main method.
 * @param args
 * @throws IOException
 */
public static void main(String[] args) throws IOException {

	final HttpServer server = startServer();
	
	CycleOurCityManager.getInstance();
	CycleOurCitySecurityManager.getManager();
	
    System.out.println(String.format("Jersey app started with WADL available at "
            + "%sapplication.wadl\nHit enter to stop it...", BASE_URI));
    System.in.read();
    server.stop();
}
 
开发者ID:rodrigojmlourenco,项目名称:CycleOurCity,代码行数:18,代码来源:Main.java

示例13: main

import org.glassfish.grizzly.http.server.HttpServer; //导入方法依赖的package包/类
public static void main(String... args) throws Exception {
    ResourceConfig rc = new ResourceConfig(
        ContactsResource.class, Main.class
    );
    URI u = new URI("http://0.0.0.0:8080/");
    HttpServer server = GrizzlyHttpServerFactory.createHttpServer(u, rc);
    System.err.println("Server running on following IP addresses:");
    dumpIPs();
    System.err.println("Press Enter to shutdown the server");
    System.in.read();
    server.stop();
}
 
开发者ID:dukescript,项目名称:maven-archetypes,代码行数:13,代码来源:Main.java

示例14: main

import org.glassfish.grizzly.http.server.HttpServer; //导入方法依赖的package包/类
/**
 * Main method.
 * @param args
 * @throws IOException
 */
public static void main(String[] args) throws IOException {
    logger.info("Entered the main method...");
    final HttpServer server = startServer();


    logger.info(String.format("Jersey app started with WADL available at "
            + "%sapplication.wadl\nHit enter to stop it...", BASE_URI));

    System.in.read();
    server.stop();
}
 
开发者ID:jtmrice,项目名称:IEPD-Java-Bindings,代码行数:17,代码来源:Main.java

示例15: main

import org.glassfish.grizzly.http.server.HttpServer; //导入方法依赖的package包/类
/**
 * Main method.
 * @param args
 * @throws IOException
 */
public static void main(String[] args) throws IOException {
		Resource.populateData();
    final HttpServer server = 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();
    server.stop();
}
 
开发者ID:vdialani,项目名称:CloudComputing,代码行数:14,代码来源:App.java


注:本文中的org.glassfish.grizzly.http.server.HttpServer.stop方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。