List of usage examples for org.apache.wicket.util.time Duration ONE_HOUR
Duration ONE_HOUR
To view the source code for org.apache.wicket.util.time Duration ONE_HOUR.
Click Source Link
From source file:at.molindo.esi4j.example.Start.java
License:Apache License
public static void main(String[] args) throws Exception { int timeout = (int) Duration.ONE_HOUR.getMilliseconds(); Server server = new Server(); SocketConnector connector = new SocketConnector(); // Set some timeout options to make debugging easier. connector.setMaxIdleTime(timeout);/*from w ww.jav a2 s .co m*/ connector.setSoLingerTime(-1); connector.setPort(8080); server.addConnector(connector); WebAppContext bb = new WebAppContext(); bb.setServer(server); bb.setContextPath("/"); bb.setWar("src/main/webapp"); server.setHandler(bb); try { System.out.println(">>> STARTING EMBEDDED JETTY SERVER, PRESS ANY KEY TO STOP"); server.start(); System.in.read(); System.out.println(">>> STOPPING EMBEDDED JETTY SERVER"); server.stop(); server.join(); } catch (Exception e) { e.printStackTrace(); System.exit(1); } }
From source file:com.apachecon.memories.Start.java
License:Apache License
public static void main(String[] args) throws Exception { int timeout = (int) Duration.ONE_HOUR.getMilliseconds(); Server server = new Server(); SocketConnector connector = new SocketConnector(); // Set some timeout options to make debugging easier. connector.setMaxIdleTime(timeout);// w w w . ja v a 2 s.co m connector.setSoLingerTime(-1); connector.setPort(8080); server.addConnector(connector); // check if a keystore for a SSL certificate is available, and // if so, start a SSL connector on port 8443. By default, the // quickstart comes with a Apache Wicket Quickstart Certificate // that expires about half way september 2021. Do not use this // certificate anywhere important as the passwords are available // in the source. Resource keystore = Resource.newClassPathResource("/keystore"); if (keystore != null && keystore.exists()) { connector.setConfidentialPort(8443); SslContextFactory factory = new SslContextFactory(); factory.setKeyStoreResource(keystore); factory.setKeyStorePassword("wicket"); factory.setTrustStore(keystore); factory.setKeyManagerPassword("wicket"); SslSocketConnector sslConnector = new SslSocketConnector(factory); sslConnector.setMaxIdleTime(timeout); sslConnector.setPort(8443); sslConnector.setAcceptors(4); server.addConnector(sslConnector); System.out.println("SSL access to the quickstart has been enabled on port 8443"); System.out.println("You can access the application using SSL on https://localhost:8443"); System.out.println(); } WebAppContext bb = new WebAppContext(); bb.setServer(server); bb.setContextPath("/"); bb.setWar("src/main/webapp"); // START JMX SERVER // MBeanServer mBeanServer = ManagementFactory.getPlatformMBeanServer(); // MBeanContainer mBeanContainer = new MBeanContainer(mBeanServer); // server.getContainer().addEventListener(mBeanContainer); // mBeanContainer.start(); server.setHandler(bb); try { System.out.println(">>> STARTING EMBEDDED JETTY SERVER, PRESS ANY KEY TO STOP"); server.start(); System.in.read(); System.out.println(">>> STOPPING EMBEDDED JETTY SERVER"); server.stop(); server.join(); } catch (Exception e) { e.printStackTrace(); System.exit(1); } }
From source file:com.comcast.cdn.traffic_control.traffic_monitor.Start.java
License:Apache License
public static void main(String[] args) throws Exception { int timeout = (int) Duration.ONE_HOUR.getMilliseconds(); Server server = new Server(); SocketConnector connector = new SocketConnector(); // Set some timeout options to make debugging easier. connector.setMaxIdleTime(timeout);//ww w .ja va2s.com connector.setSoLingerTime(-1); connector.setPort(8080); server.addConnector(connector); // check if a keystore for a SSL certificate is available, and // if so, start a SSL connector on port 8443. By default, the // quickstart comes with a Apache Wicket Quickstart Certificate // that expires about half way september 2021. Do not use this // certificate anywhere important as the passwords are available // in the source. Resource keystore = Resource.newClassPathResource("/keystore"); if (keystore != null && keystore.exists()) { connector.setConfidentialPort(8443); SslContextFactory factory = new SslContextFactory(); factory.setKeyStoreResource(keystore); factory.setKeyStorePassword("wicket"); factory.setTrustStoreResource(keystore); factory.setKeyManagerPassword("wicket"); SslSocketConnector sslConnector = new SslSocketConnector(factory); sslConnector.setMaxIdleTime(timeout); sslConnector.setPort(8443); sslConnector.setAcceptors(4); server.addConnector(sslConnector); System.out.println("SSL access to the quickstart has been enabled on port 8443"); System.out.println("You can access the application using SSL on https://localhost:8443"); System.out.println(); } WebAppContext bb = new WebAppContext(); bb.setServer(server); bb.setContextPath("/"); bb.setWar("src/main/webapp"); // START JMX SERVER // MBeanServer mBeanServer = ManagementFactory.getPlatformMBeanServer(); // MBeanContainer mBeanContainer = new MBeanContainer(mBeanServer); // server.getContainer().addEventListener(mBeanContainer); // mBeanContainer.start(); server.setHandler(bb); try { System.out.println(">>> STARTING EMBEDDED JETTY SERVER, PRESS ANY KEY TO STOP"); server.start(); System.in.read(); System.out.println(">>> STOPPING EMBEDDED JETTY SERVER"); server.stop(); server.join(); } catch (Exception e) { e.printStackTrace(); System.exit(1); } }
From source file:com.comcast.cdn.traffic_control.traffic_router.api.ApiStart.java
License:Apache License
public static void main(String[] args) throws Exception { PropertyConfigurator.configure("src/test/resources/log4j.properties"); int timeout = (int) Duration.ONE_HOUR.getMilliseconds(); Server server = new Server(); SocketConnector connector = new SocketConnector(); // Set some timeout options to make debugging easier. connector.setMaxIdleTime(timeout);//from www . j ava 2 s .c o m connector.setSoLingerTime(-1); connector.setPort(8082); server.addConnector(connector); // check if a keystore for a SSL certificate is available, and // if so, start a SSL connector on port 8443. By default, the // quickstart comes with a Apache Wicket Quickstart Certificate // that expires about half way september 2021. Do not use this // certificate anywhere important as the passwords are available // in the source. // Resource keystore = Resource.newClassPathResource("/keystore"); // if (keystore != null && keystore.exists()) { // connector.setConfidentialPort(8443); // // SslContextFactory factory = new SslContextFactory(); // factory.setKeyStoreResource(keystore); // factory.setKeyStorePassword("wicket"); // factory.setTrustStoreResource(keystore); // factory.setKeyManagerPassword("wicket"); // SslSocketConnector sslConnector = new SslSocketConnector(factory); // sslConnector.setMaxIdleTime(timeout); // sslConnector.setPort(8443); // sslConnector.setAcceptors(4); // server.addConnector(sslConnector); // // System.out.println("SSL access to the quickstart has been enabled on port 8443"); // System.out.println("You can access the application using SSL on https://localhost:8443"); // System.out.println(); // } WebAppContext bb = new WebAppContext(); bb.setServer(server); bb.setContextPath("/crs"); bb.setWar("src/main/webapp"); // START JMX SERVER // MBeanServer mBeanServer = ManagementFactory.getPlatformMBeanServer(); // MBeanContainer mBeanContainer = new MBeanContainer(mBeanServer); // server.getContainer().addEventListener(mBeanContainer); // mBeanContainer.start(); server.setHandler(bb); try { System.out.println(">>> STARTING EMBEDDED JETTY SERVER, PRESS ANY KEY TO STOP"); server.start(); System.in.read(); System.out.println(">>> STOPPING EMBEDDED JETTY SERVER"); server.stop(); server.join(); } catch (Exception e) { e.printStackTrace(); System.exit(1); } }
From source file:com.comcast.cdn.traffic_control.traffic_router.core.TrafficRouterStart.java
License:Apache License
public static void main(String[] args) throws Exception { PropertyConfigurator.configure("src/test/resources/log4j.properties"); int timeout = (int) Duration.ONE_HOUR.getMilliseconds(); Server server = new Server(); SocketConnector connector = new SocketConnector(); // Set some timeout options to make debugging easier. connector.setMaxIdleTime(timeout);//from w w w . j a v a 2 s . c o m connector.setSoLingerTime(-1); connector.setPort(8081); server.addConnector(connector); // check if a keystore for a SSL certificate is available, and // if so, start a SSL connector on port 8443. By default, the // quickstart comes with a Apache Wicket Quickstart Certificate // that expires about half way september 2021. Do not use this // certificate anywhere important as the passwords are available // in the source. // Resource keystore = Resource.newClassPathResource("/keystore"); // if (keystore != null && keystore.exists()) { // connector.setConfidentialPort(8443); // // SslContextFactory factory = new SslContextFactory(); // factory.setKeyStoreResource(keystore); // factory.setKeyStorePassword("wicket"); // factory.setTrustStoreResource(keystore); // factory.setKeyManagerPassword("wicket"); // SslSocketConnector sslConnector = new SslSocketConnector(factory); // sslConnector.setMaxIdleTime(timeout); // sslConnector.setPort(8443); // sslConnector.setAcceptors(4); // server.addConnector(sslConnector); // // System.out.println("SSL access to the quickstart has been enabled on port 8443"); // System.out.println("You can access the application using SSL on https://localhost:8443"); // System.out.println(); // } WebAppContext bb = new WebAppContext(); bb.setServer(server); bb.setContextPath("/"); bb.setWar("src/main/webapp"); // START JMX SERVER // MBeanServer mBeanServer = ManagementFactory.getPlatformMBeanServer(); // MBeanContainer mBeanContainer = new MBeanContainer(mBeanServer); // server.getContainer().addEventListener(mBeanContainer); // mBeanContainer.start(); server.setHandler(bb); try { System.out.println(">>> STARTING EMBEDDED JETTY SERVER, PRESS ANY KEY TO STOP"); server.start(); System.in.read(); System.out.println(">>> STOPPING EMBEDDED JETTY SERVER"); server.stop(); server.join(); } catch (Exception e) { e.printStackTrace(); System.exit(1); } }
From source file:com.comsysto.insight.test.Start.java
License:Apache License
public static void main(String[] args) throws Exception { // The Server Server server = new Server(); // HTTP Configuration HttpConfiguration http_config = new HttpConfiguration(); http_config.setSecureScheme("https"); http_config.setSecurePort(8443);//from www. jav a 2 s . c om http_config.setOutputBufferSize(32768); // HTTP connector ServerConnector http = new ServerConnector(server, new HttpConnectionFactory(http_config)); http.setPort(8080); http.setIdleTimeout(Duration.ONE_HOUR.getMilliseconds()); // Set the connector server.setConnectors(new Connector[] { http }); WebAppContext context = new WebAppContext(); context.setServer(server); context.setContextPath("/"); context.setWar("src/main/webapp"); server.setHandler(context); try { System.out.println(">>> STARTING EMBEDDED JETTY SERVER, PRESS ANY KEY TO STOP"); server.start(); System.in.read(); System.out.println(">>> STOPPING EMBEDDED JETTY SERVER"); server.stop(); server.join(); } catch (Exception e) { e.printStackTrace(); System.exit(1); } }
From source file:com.github.marting.wicket.datastore.memcached.app.Start.java
License:Apache License
public static void main(String[] args) throws Exception { int timeout = (int) Duration.ONE_HOUR.getMilliseconds(); Server server = new Server(); SocketConnector connector = new SocketConnector(); // Set some timeout options to make debugging easier. connector.setMaxIdleTime(timeout);/*w w w. j a v a 2s . co m*/ connector.setSoLingerTime(-1); connector.setPort(8080); server.addConnector(connector); Resource keystore = Resource.newClassPathResource("/keystore"); if (keystore != null && keystore.exists()) { // if a keystore for a SSL certificate is available, start a SSL // connector on port 8443. // By default, the quickstart comes with a Apache Wicket Quickstart // Certificate that expires about half way september 2021. Do not // use this certificate anywhere important as the passwords are // available in the source. connector.setConfidentialPort(8443); SslContextFactory factory = new SslContextFactory(); factory.setKeyStoreResource(keystore); factory.setKeyStorePassword("wicket"); factory.setTrustStoreResource(keystore); factory.setKeyManagerPassword("wicket"); SslSocketConnector sslConnector = new SslSocketConnector(factory); sslConnector.setMaxIdleTime(timeout); sslConnector.setPort(8443); sslConnector.setAcceptors(4); server.addConnector(sslConnector); System.out.println("SSL access to the quickstart has been enabled on port 8443"); System.out.println("You can access the application using SSL on https://localhost:8443"); System.out.println(); } WebAppContext bb = new WebAppContext(); bb.setServer(server); bb.setContextPath("/"); bb.setWar("src/test/webapp"); // START JMX SERVER // MBeanServer mBeanServer = ManagementFactory.getPlatformMBeanServer(); // MBeanContainer mBeanContainer = new MBeanContainer(mBeanServer); // server.getContainer().addEventListener(mBeanContainer); // mBeanContainer.start(); server.setHandler(bb); try { System.out.println(">>> STARTING EMBEDDED JETTY SERVER, PRESS ANY KEY TO STOP"); server.start(); System.in.read(); System.out.println(">>> STOPPING EMBEDDED JETTY SERVER"); server.stop(); server.join(); } catch (Exception e) { e.printStackTrace(); System.exit(1); } }
From source file:com.tysanclan.site.projectewok.util.StartTysan.java
License:Open Source License
/** * Main function, starts the jetty server. * /* w ww. j a va 2 s .c o m*/ * @param args Program arguments */ public static void main(String[] args) { int timeout = (int) Duration.ONE_HOUR.getMilliseconds(); Server server = new Server(); SocketConnector connector = new SocketConnector(); final String ewokProperties = System.getProperty("ewok.properties"); if (ewokProperties == null) { System.setProperty("ewok.properties", "classpath:inmem.properties"); System.setProperty(TysanApplication.IN_MEMORY.getKey(), TysanApplication.IN_MEMORY.getValue()); } // Set some timeout options to make debugging easier. connector.setMaxIdleTime(timeout); connector.setSoLingerTime(-1); connector.setPort(8081); server.addConnector(connector); WebAppContext bb = new WebAppContext(); bb.setServer(server); bb.setContextPath("/projectewok"); bb.setWar("src/main/webapp"); // START JMX SERVER // MBeanServer mBeanServer = ManagementFactory.getPlatformMBeanServer(); // MBeanContainer mBeanContainer = new MBeanContainer(mBeanServer); // server.getContainer().addEventListener(mBeanContainer); // mBeanContainer.start(); server.setHandler(bb); try { System.out.println(">>> STARTING EMBEDDED JETTY SERVER, PRESS ANY KEY TO STOP"); server.start(); System.in.read(); System.out.println(">>> STOPPING EMBEDDED JETTY SERVER"); server.stop(); server.join(); } catch (Exception e) { e.printStackTrace(); System.exit(1); } }
From source file:de.codepitbull.ajax.Start.java
License:Apache License
public static void main(String[] args) throws Exception { int timeout = (int) Duration.ONE_HOUR.getMilliseconds(); Server server = new Server(); SocketConnector connector = new SocketConnector(); // Set some timeout options to make debugging easier. connector.setMaxIdleTime(timeout);/* w w w . j av a 2s . c o m*/ connector.setSoLingerTime(-1); connector.setPort(8080); server.addConnector(connector); // check if a keystore for a SSL certificate is available, and // if so, start a SSL connector on port 8443. By default, the // quickstart comes with a Apache Wicket Quickstart Certificate // that expires about half way september 2021. Do not use this // certificate anywhere important as the passwords are available // in the source. Resource keystore = Resource.newClassPathResource("/keystore"); if (keystore != null && keystore.exists()) { connector.setConfidentialPort(8443); SslContextFactory factory = new SslContextFactory(); factory.setKeyStoreResource(keystore); factory.setKeyStorePassword("wicket"); factory.setTrustStore(keystore); factory.setKeyManagerPassword("wicket"); SslSocketConnector sslConnector = new SslSocketConnector(factory); sslConnector.setMaxIdleTime(timeout); sslConnector.setPort(8443); sslConnector.setAcceptors(4); server.addConnector(sslConnector); System.out.println("SSL access to the quickstart has been enabled on port 8443"); System.out.println("You can access the application using SSL on https://localhost:8443"); System.out.println(); } WebAppContext bb = new WebAppContext(); bb.setServer(server); bb.setContextPath("/"); File file = new File("src/main/webapp"); //required as the paths are slightly different between idea and eclipse (grrr) if (file.exists()) { bb.setWar("src/main/webapp"); } else { bb.setWar("teil2-ajax/src/main/webapp"); } // START JMX SERVER // MBeanServer mBeanServer = ManagementFactory.getPlatformMBeanServer(); // MBeanContainer mBeanContainer = new MBeanContainer(mBeanServer); // server.getContainer().addEventListener(mBeanContainer); // mBeanContainer.start(); server.setHandler(bb); try { System.out.println(">>> STARTING EMBEDDED JETTY SERVER, PRESS ANY KEY TO STOP"); server.start(); System.in.read(); System.out.println(">>> STOPPING EMBEDDED JETTY SERVER"); server.stop(); server.join(); } catch (Exception e) { e.printStackTrace(); System.exit(1); } }
From source file:de.codepitbull.application.Start.java
License:Apache License
public static void main(String[] args) throws Exception { int timeout = (int) Duration.ONE_HOUR.getMilliseconds(); Server server = new Server(); SocketConnector connector = new SocketConnector(); // Set some timeout options to make debugging easier. connector.setMaxIdleTime(timeout);//from w ww.j av a 2s . c om connector.setSoLingerTime(-1); connector.setPort(8080); server.addConnector(connector); // check if a keystore for a SSL certificate is available, and // if so, start a SSL connector on port 8443. By default, the // quickstart comes with a Apache Wicket Quickstart Certificate // that expires about half way september 2021. Do not use this // certificate anywhere important as the passwords are available // in the source. Resource keystore = Resource.newClassPathResource("/keystore"); if (keystore != null && keystore.exists()) { connector.setConfidentialPort(8443); SslContextFactory factory = new SslContextFactory(); factory.setKeyStoreResource(keystore); factory.setKeyStorePassword("wicket"); factory.setTrustStore(keystore); factory.setKeyManagerPassword("wicket"); SslSocketConnector sslConnector = new SslSocketConnector(factory); sslConnector.setMaxIdleTime(timeout); sslConnector.setPort(8443); sslConnector.setAcceptors(4); server.addConnector(sslConnector); System.out.println("SSL access to the quickstart has been enabled on port 8443"); System.out.println("You can access the application using SSL on https://localhost:8443"); System.out.println(); } WebAppContext bb = new WebAppContext(); bb.setServer(server); bb.setContextPath("/"); File file = new File("src/main/webapp"); //required as the paths are slightly different between idea and eclipse (grrr) if (file.exists()) { bb.setWar("src/main/webapp"); } else { bb.setWar("teil2-application/src/main/webapp"); } // START JMX SERVER // MBeanServer mBeanServer = ManagementFactory.getPlatformMBeanServer(); // MBeanContainer mBeanContainer = new MBeanContainer(mBeanServer); // server.getContainer().addEventListener(mBeanContainer); // mBeanContainer.start(); server.setHandler(bb); try { System.out.println(">>> STARTING EMBEDDED JETTY SERVER, PRESS ANY KEY TO STOP"); server.start(); System.in.read(); System.out.println(">>> STOPPING EMBEDDED JETTY SERVER"); server.stop(); server.join(); } catch (Exception e) { e.printStackTrace(); System.exit(1); } }