/** * Create an HTTPS restlet Server instance matching the given parameters. * * @param port * @param address * @param keystorePath * @param keystorePassword * @param keyPassword */ protected void setupServer(int port, String address, String keystorePath, String keystorePassword, String keyPassword) { Server server = new Server(Protocol.HTTPS,address,port,null); component.getServers().add(server); server.getContext().getParameters().add("keystorePath", keystorePath); server.getContext().getParameters().add("keystorePassword", keystorePassword); server.getContext().getParameters().add("keyPassword", keyPassword); }
public static void main(String[] args) throws Exception { Server helloServer = new Server(Protocol.HTTP, 8111, HelloServerResource.class); helloServer.start(); } }
public static void main(String[] args) throws Exception { // Instantiating the HTTP server and listening on port 8111 new Server(Protocol.HTTP, 8111, VerifiedServerResource.class).start(); }
public static void main(String[] args) throws Exception { // Create the HTTP server and listen on port 8111 new Server(Protocol.HTTP, 8111, Part03_ListenToBrowsers.class).start(); }
public static void main(String[] args) throws Exception { // Instantiating the HTTP server and listening on port 8111 new Server(Protocol.HTTP, 8111, DynamicContentServerResource.class) .start(); }
/** * Adds a new server connector in the map supporting the given protocol on * the specified port. * * @param protocol * The connector protocol. * @param port * The listening port. * @return The added server. */ public Server add(Protocol protocol, int port) { Server result = new Server(protocol, null, port, getNext()); add(result); return result; }
/** * Adds a new server connector in the map supporting the given protocol on * the specified IP address and port. * * @param protocol * The connector protocol. * @param address * The optional listening IP address (useful if multiple IP * addresses available). * @param port * The listening port. * @return The added server. */ public Server add(Protocol protocol, String address, int port) { Server result = new Server(protocol, address, port, getNext()); add(result); return result; }
/** * Launches the application with an HTTP server. * * @param args * The arguments. * @throws Exception */ public static void main(String[] args) throws Exception { Server mailServer = new Server(Protocol.HTTP, 8111); mailServer.setNext(new MailServerApplication()); mailServer.start(); }
/** * Launches the application with an HTTP server. * * @param args * The arguments. * @throws Exception */ public static void main(String[] args) throws Exception { Server mailServer = new Server(Protocol.HTTP, 8111); mailServer.setNext(new MailServerApplication()); mailServer.start(); }
/** * Launches the application with an HTTP server. * * @param args * The arguments. * @throws Exception */ public static void main(String[] args) throws Exception { Server mailServer = new Server(Protocol.HTTP, 8111); mailServer.setNext(new MailServerApplication()); mailServer.start(); }
/** * Launches the application with an HTTP server. * * @param args * The arguments. * @throws Exception */ public static void main(String[] args) throws Exception { Server mailServer = new Server(Protocol.HTTP, 8111); mailServer.setNext(new MailServerApplication()); mailServer.start(); }
public static void main(String[] args) throws Exception { // Instantiating the Application providing the Range Service Application app = new Application(); // Plug the server resource. app.setInboundRoot(HelloServerResource.class); // Instantiating the HTTP server and listening on port 8111 new Server(Protocol.HTTP, 8111, app).start(); }
/** * Adds a new server connector in the map supporting the given protocol. * * @param protocol * The connector protocol. * @return The added server. */ public Server add(Protocol protocol) { Server result = new Server(protocol, null, protocol.getDefaultPort(), getNext()); add(result); return result; }
/** * Launches the application with an HTTP server. * * @param args * The arguments. * @throws Exception */ public static void main(String[] args) throws Exception { Server mailServer = new Server(Protocol.HTTP, 8111); mailServer.setNext(new MailServerApplication()); mailServer.start(); }
/** * Launches the application with an HTTP server. * * @param args * The arguments. * @throws Exception */ public static void main(String[] args) throws Exception { Server mailServer = new Server(Protocol.HTTP, 8111); mailServer.setNext(new MailServerApplication()); mailServer.start(); }
/** * Launches the application with an HTTP server. * * @param args * The arguments. * @throws Exception */ public static void main(String[] args) throws Exception { Server mailServer = new Server(Protocol.HTTP, 8111); mailServer.setNext(new MailServerApplication()); mailServer.start(); }
/** * Adds a new server connector in the map supporting the given protocol on * the specified port. * * @param protocol * The connector protocol. * @param port * The listening port. * @return The added server. */ public Server add(Protocol protocol, int port) { Server result = new Server(protocol, null, port, getTarget()); result.setContext(getContext().createChildContext()); add(result); return result; }
/** * Adds a new server connector in the map supporting the given protocol. * * @param protocol * The connector protocol. * @return The added server. */ public Server add(Protocol protocol) { Server result = new Server(protocol, null, protocol.getDefaultPort(), getTarget()); result.setContext(getContext().createChildContext()); add(result); return result; }
/** * default constructor for UmlgRestletComponent */ public UmlgRestletComponent() { setName("restAndJson"); setDescription("Halo, I am your first comment."); getClients().add(Protocol.FILE); getClients().add(Protocol.CLAP); getClients().add(Protocol.RIAP); Server server = new Server(new Context(), Protocol.HTTP, 8111); server.getContext().getParameters().set("tracing", "true"); getServers().add(server); attachApplications(); }