Package org.restlet

Examples of org.restlet.Component.start()


            //end TODO
            Engine.getInstance().getRegisteredServers().clear();
            Engine.getInstance().getRegisteredServers().add(new HttpServerHelper(server));
            component.getClients().add(Protocol.FILE);               
            component.getDefaultHost().attach(new FreedomRestServer());
            component.start();
    }   
}
View Full Code Here


        // Create an application
        PiperackApplication application = new PiperackApplication(config, runtime);

        // Attach the application to the component and start it
        component.getDefaultHost().attach(application);
        component.start();

        while (true) {
            try {
                Thread.sleep(10000);
            } catch (InterruptedException e) {
View Full Code Here

                } else {
                  component.getServers().add(Protocol.HTTP, restHost, restPort);
                }
                component.getClients().add(Protocol.CLAP);
                component.getDefaultHost().attach(this);
                component.start();
            } catch (Exception e) {
                throw new RuntimeException(e);
            }
        }
    }
View Full Code Here

  {
    Component component = new Component();
    component.getServers().add(Protocol.HTTP, 8182);
    PlexusRestletApplicationBridge app = (PlexusRestletApplicationBridge) getContainer().lookup(Application.class);
    component.getDefaultHost().attach(app);
    component.start();
    component.stop();
  }
}
View Full Code Here

    TestApplication app = (TestApplication) getContainer().lookup(Application.class, "test");

    component.getDefaultHost().attach(app);

    component.start();

    Status status = post(URL, VALID).getStatus();
    assertTrue(status.toString(), status.isSuccess());
    status = post(URL, INVALID).getStatus();
    assertEquals(status.toString(), 400, status.getCode());
View Full Code Here

   
          // Start background threads:
          EmbeddedRestletApp.setupPollingHandlers();         
         
          // Start the component. 
          component.start();
      }
      catch (Exception e)
      { 
          // Something is wrong. 
          e.printStackTrace()
View Full Code Here

   
          // Start the polls
          AppServer.setupPollingHandlers();
         
          // Start the component. 
          component.start();
      }
      catch (Exception e)
      { 
          // Something is wrong. 
          e.printStackTrace()
View Full Code Here

        Application application = new Main(geogig);
        application.setContext(context);
        Component comp = new Component();
        comp.getDefaultHost().attach(application);
        comp.getServers().add(Protocol.HTTP, 8182);
        comp.start();
    }

    static void setup() {
        GlobalContextBuilder.builder = new CLIContextBuilder();
    }
View Full Code Here

        cli.getConsole().println(
                String.format("Starting server on port %d, use CTRL+C to exit.", port));

        try {
            comp.start();
            cli.setExitOnFinish(false);
        } catch (BindException e) {
            String msg = String.format(
                    "Port %d already in use, use the --port parameter to specify a different port",
                    port);
View Full Code Here

            // Attach the application which has all the mock url added
            component.getDefaultHost().attach("/simplefeatureservice", new MockSimpleFeatureService());

            // Start the component.
            component.start();
        } catch (Exception e) {
           
            System.out.println("Exception in StandAloneApplication "+e.getMessage());
        }
    }
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.