Package org.mortbay.jetty

Examples of org.mortbay.jetty.Handler


    public JettyWrapper(int port) throws Exception {
        _server = new Server(port);
        // Adding the buildr handler to control our server lifecycle
        ContextHandler context = new ContextHandler();
        context.setContextPath("/buildr");
        Handler handler = new BuildrHandler();
        context.setHandler(handler);

        _handlerColl = new ContextHandlerCollection();
        _handlerColl.setHandlers(new Handler[] {context});
View Full Code Here


        ContextHandler context = new ContextHandler();
        context.setContextPath("/");
        final ServletContext servletContext = context.getServletContext();
        server.setHandler(context);

        Handler handler = new AbstractHandler() {
            public void handle(String target, HttpServletRequest req, HttpServletResponse res, int dispatch) throws IOException, ServletException {
                try {
                    ((Request) req).setHandled(true);
                    HttpRequest httpRequest = new ServletRequestAdapter(req, res, servletContext);
                    HttpResponse httpResponse = new ServletResponseAdapter(res);
View Full Code Here

   
    public SimpleDavServerHandler(final File targetPath )
        throws Exception
    {
        this.siteTargetPath = targetPath;
        Handler repoHandler = new AbstractHandler()
        {
            public void handle( String target, HttpServletRequest request, HttpServletResponse response, int dispatch )
                throws IOException, ServletException
            {
                String targetPath = request.getPathInfo();
View Full Code Here

        final ContextHandler context = new ContextHandler();
        context.setContextPath("/");
        final ServletContext servletContext = context.getServletContext();
        server.setHandler(context);

        final Handler handler = new AbstractHandler() {
            @Override
            public void handle(final String target, final HttpServletRequest req, final HttpServletResponse res, final int dispatch) throws IOException, ServletException {
                try {
                    ((Request) req).setHandled(true);
                    final HttpRequest httpRequest = new ServletRequestAdapter(req, res, servletContext);
View Full Code Here

   * Creates an {@link AbstractHandler handler} returning an arbitrary String as a response.
   *
   * @return never <code>null</code>.
   */
  public Handler getMockHandler() {
    Handler handler = new AbstractHandler() {

      public void handle(String target, HttpServletRequest request, HttpServletResponse response, int dispatch) throws IOException, ServletException {
        // SONARPLUGINS-3061
        if (target.startsWith("//")) {
          throw new HttpException(404, "Not found");
View Full Code Here

        new ValidationUtil("test-deps-i").validate(resolved);
    }

    private Server startHttpServer() {
        // Start an Embedded HTTP Server
        final Handler handler = new AuthStaticFileHandler("shrinkwrap", "shrinkwrap");
        final Server httpServer = new Server(HTTP_TEST_PORT);
        httpServer.setHandler(handler);
        try {
            httpServer.start();
            log.info("HTTP Server Started: " + httpServer);
View Full Code Here

        System.clearProperty(MavenSettingsBuilder.ALT_MAVEN_OFFLINE);
    }

    private Server startHttpServer() {
        // Start an Embedded HTTP Server
        final Handler handler = new StaticFileHandler();
        final Server httpServer = new Server(HTTP_TEST_PORT);
        httpServer.setHandler(handler);
        try {
            httpServer.start();
            log.info("HTTP Server Started: " + httpServer);
View Full Code Here

        if (server != null && server.isRunning()) {
            for (Handler handler : contexts.getChildHandlersByClass(ContextHandler.class)) {
                ContextHandler contextHandler = null;               
                if (handler instanceof ContextHandler) {
                    contextHandler = (ContextHandler) handler;
                    Handler jh = contextHandler.getHandler();
                    if (jh instanceof JettyHTTPHandler
                        && contextName.equals(contextHandler.getContextPath())
                        && ((JettyHTTPHandler)jh).getName().equals(smap)) {
                        try {
                            contexts.removeHandler(handler);                           
View Full Code Here

     */
    public synchronized Handler getServant(URL url)  {
        String contextName = HttpUriMapper.getContextName(url.getPath());      
        //final String smap = HttpUriMapper.getResourceBase(url.getPath());
       
        Handler ret = null;
        // After a stop(), the server is null, and therefore this
        // operation should return null.
        if (server != null) {          
            for (Handler handler : server.getChildHandlersByClass(ContextHandler.class)) {
                ContextHandler contextHandler = null;
View Full Code Here

        if (server != null && server.isRunning()) {
            for (Handler handler : contexts.getChildHandlersByClass(ContextHandler.class)) {
                ContextHandler contextHandler = null;               
                if (handler instanceof ContextHandler) {
                    contextHandler = (ContextHandler) handler;
                    Handler jh = contextHandler.getHandler();
                    if (jh instanceof JettyHTTPHandler
                        && contextName.equals(contextHandler.getContextPath())
                        && ((JettyHTTPHandler)jh).getName().equals(smap)) {
                        try {
                            contexts.removeHandler(handler);                           
View Full Code Here

TOP

Related Classes of org.mortbay.jetty.Handler

Copyright © 2018 www.massapicom. 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.