Package org.restlet

Examples of org.restlet.Server.start()


      public void handle(Request request, Response response) {
        response.setEntity("Hello, World", MediaType.TEXT_PLAIN);
      }
    });
   
    server.start();
   
    new ClientResource("http://localhost:8182").get().write(System.out);
   
    server.stop();
  }
View Full Code Here


                LOG.debug("Setting parameters: {} to server: {}", params, server);
                server.getContext().setParameters(params);

                servers.put(key, server);
                LOG.debug("Added server: {}", key);
                server.start();
            }
        }
    }

    private static String buildKey(RestletEndpoint endpoint) {
View Full Code Here

                LOG.debug("Setting parameters: {} to server: {}", params, server);
                server.getContext().setParameters(params);

                servers.put(key, server);
                LOG.debug("Added server: {}", key);
                server.start();
            }
        }
    }

    private static String buildKey(RestletEndpoint endpoint) {
View Full Code Here

            if (server == null) {
                server = component.getServers().add(Protocol.valueOf(endpoint.getProtocol()),
                        endpoint.getPort());
                servers.put(key, server);
                LOG.info("Add server: " + key);
                server.start();
            }
        }
    }
   
    private static String buildKey(RestletEndpoint endpoint) {
View Full Code Here

                LOG.debug("Setting parameters: {} to server: {}", params, server);
                server.getContext().setParameters(params);

                servers.put(key, server);
                LOG.debug("Added server: {}", key);
                server.start();
            }
        }
    }

    private static String buildKey(RestletEndpoint endpoint) {
View Full Code Here

                server = component.getServers().add(Protocol.valueOf(endpoint.getProtocol()), endpoint.getPort());
                servers.put(key, server);
                if (LOG.isDebugEnabled()) {
                    LOG.debug("Added server: " + key);
                }
                server.start();
            }
        }
    }
   
    private static String buildKey(RestletEndpoint endpoint) {
View Full Code Here

    public void testRequestUri() throws Exception {
        Engine.register(false);
        Engine.getInstance().getRegisteredServers()
                .add(new HttpServerHelper(null));
        Server server = new Server(new Context(), Protocol.HTTP, 0);
        server.start();

        HttpServerHelper hsh = (HttpServerHelper) server.getContext()
                .getAttributes().get("org.restlet.engine.helper");
        Connection<Server> c = hsh.getConnectionPool().checkout();
View Full Code Here

public class MyServerResource1 extends ServerResource implements MyResource1 {

    public static void main(String[] args) throws Exception {
        Server server = new Server(Protocol.HTTP, 8111);
        server.setNext(MyServerResource1.class);
        server.start();
    }

    private volatile MyBean myBean = new MyBean("myName", "myDescription");

    public boolean accept(MyBean bean) {
View Full Code Here

            }
        };

        // Create the HTTP server and listen on port 8111
        final Server server = new Server(Protocol.HTTP, 8111, restlet);
        server.start();
    }

}
View Full Code Here

                TRACE = Boolean.parseBoolean(str);
            } catch (Throwable e) {
            }
        }

        server.start();
    }

    private static AtomicLong TAG = new AtomicLong(1000);

    public void acknowledge() {
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.