ChallengeScheme.HTTP_DIGEST, "Authentication Required"); guard.getSecrets().put(authLogin, authPassword.toCharArray()); component.getDefaultHost().attach(guard); guard.setNext(new EngineApplication(engine)); component.start();
_component.getDefaultHost().attach(_controllerRestApp);
public static void main(String[] args) throws Exception { // Create a new Component. Component component = new Component(); // Add a new HTTP server listening on port 8182. component.getServers().add(Protocol.HTTP, 8182); // Attach the sample application. component.getDefaultHost().attach("/firstSteps", new FirstStepsApplication()); // Start the component. component.start(); }
Component serverComponent = new Component(); serverComponent.getServers().add(Protocol.HTTP, 8080); final Router router = new Router(serverComponent.getContext().createChildContext()); router.attach("/myrestendpoint", MyServerResource.class); serverComponent.getDefaultHost().attach(router); serverComponent.start();
Component component = new Component(); component.getServers().add(Protocol.HTTP, 8182); MyApplication app = new MyApplication(); component.getDefaultHost().attachDefault(app); component.getInternalRouter().attachDefault(app);
Component component = new Component(); component.getServers().add(Protocol.HTTP, 8182); // JAXRS application JaxRsApplication application = new JaxRsApplication(component.getContext()); application.add(new MyApplication()); // Attachment component.getDefaultHost().attachDefault(application); // Start component.start();
public static void main(String[] args) throws Exception { Component component = new Component(); component.getDefaultHost().attachDefault(CachingServerResource.class); component.getServers().add(Protocol.HTTP, 8111); component.start(); }
public static void main(String[] args) throws Exception { // Create a new Component. Component component = new Component(); // Add a new HTTP server listening on port 8111. component.getServers().add(Protocol.HTTP, 8111); component.getDefaultHost().attach("/firstResource", new FirstResourceApplication()); // Start the component. component.start(); }
public static void main(String[] args) throws Exception { Component c = new Component(); c.getServers().add(Protocol.HTTP, 8182); c.getDefaultHost().attach(new QueryRouterApplication()); c.start(); }
public static void main(String[] args) throws Exception { // Create a new Component. Component component = new Component(); // Add a new HTTP server listening on port 8111. component.getServers().add(Protocol.HTTP, 8111); component.getDefaultHost().attach("/firstResource", new FirstResourceApplication()); // Start the component. component.start(); }
public static void main(String[] args) throws Exception { Component c = new Component(); c.getServers().add(Protocol.HTTP, 8182); c.getDefaultHost().attach(new FileUploadApplication()); c.start(); }
public static void main(String[] args) throws Exception { // Create a component Component component = new Component(); component.getServers().add(Protocol.HTTP, 8111); // Create an application Application application = new SearchRedirector(); // Attach the application to the component and start it component.getDefaultHost().attachDefault(application); component.start(); }
@Override public synchronized void stop() throws Exception { // Stop the server's router getServerRouter().stop(); // Stop all applications stopHostApplications(getHelped().getDefaultHost()); for (VirtualHost host : getHelped().getHosts()) { stopHostApplications(host); } }
public void start() throws Exception { Injector injector = RestletGuice.createInjector(modules); Application instance = injector.getInstance(application); Component component = new Component(); component.getServers().add(Protocol.HTTP, port); component.getClients().add(Protocol.FILE); component.getClients().add(Protocol.CLAP); component.getDefaultHost().attach(instance); component.start(); }
public static void main(String[] args) throws Exception { Component c = new Component(); // server listening on pport 8182 c.getServers().add(Protocol.HTTP, 8182); // client connector required by the Directory. c.getClients().add(Protocol.FILE); c.getDefaultHost().attach(new AuthenticationApplication()); c.start(); }
public static void main(String[] args) throws Exception { Component component = new Component(); component.getServers().add(Protocol.HTTP, 8111); component.getClients().add(Protocol.FILE); component.getDefaultHost().attach(new MergeSitesServicesApplication()); component.start(); }
public static void main(String[] args) throws Exception { Component c = new Component(); // server listening on pport 8182 c.getServers().add(Protocol.HTTP, 8182); // client connector required by the Directory. c.getClients().add(Protocol.FILE); c.getDefaultHost().attach(new HttpDigestAuthenticationApplication()); c.start(); }
public static void main(String[] args) throws Exception { // Setup Restlet Component component = new Component(); component.getClients().add(Protocol.HTTP); component.getClients().add(Protocol.HTTPS); component.getServers().add(Protocol.HTTP, 8888); component.getDefaultHost().attach("/sample", new SampleApplication()); component.start(); } }
@Override public void startServer() throws Exception { configuration.refresh(); component = new Component(); component.getServers().add( Protocol.HTTP, configuration.get().port().get() ); RestApplication application = module.newObject( RestApplication.class, component.getContext() ); component.getDefaultHost().attach( application ); component.start(); }
public static void main(String... args) throws Exception { // Create a component with an HTTP server connector final Component component = new Component(); component.getServers().add(Protocol.HTTP, 8585); component.getClients().add(Protocol.FILE); component.getClients().add(Protocol.CLAP); component.getClients().add(Protocol.HTTP); // Attach the application to the default host and start it component.getDefaultHost().attach("/foaf", new Application()); component.start(); }