Package org.mortbay.jetty

Examples of org.mortbay.jetty.Handler


        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

            try
            {
                if (dispatch==REQUEST && isProtectedTarget(target))
                    throw new HttpException(HttpServletResponse.SC_NOT_FOUND);
               
                Handler handler = getHandler();
                if (handler!=null)
                    handler.handle(target, request, response, dispatch);
            }
            catch(HttpException e)
            {
                Log.debug(e);
                response.sendError(e.getStatus(), e.getReason());
View Full Code Here

                    // explicitly-defined virtual hosts, most specific
                    list=hosts.get(host);
                    for (int j=0; j<LazyList.size(list); j++)
                    {
                        Handler handler = (Handler)LazyList.get(list,j);
                        handler.handle(target,request, response, dispatch);
                        if (base_request.isHandled())
                            return;
                    }

                    // wildcard for one level of names
                    list=hosts.get("*."+host.substring(host.indexOf(".")+1));
                    for (int j=0; j<LazyList.size(list); j++)
                    {
                        Handler handler = (Handler)LazyList.get(list,j);
                        handler.handle(target,request, response, dispatch);
                        if (base_request.isHandled())
                            return;
                    }

                    // no virtualhosts defined for the context, least specific
                    // will handle any request that does not match to a specific virtual host above                   
                    list=hosts.get("*");
                    for (int j=0; j<LazyList.size(list); j++)
                    {
                        Handler handler = (Handler)LazyList.get(list,j);
                        handler.handle(target,request, response, dispatch);
                        if (base_request.isHandled())
                            return;
                    }
                }
                else
                {
                    for (int j=0; j<LazyList.size(list); j++)
                    {
                        Handler handler = (Handler)LazyList.get(list,j);
                        handler.handle(target,request, response, dispatch);
                        if (base_request.isHandled())
                            return;
                    }
                }
      }
View Full Code Here

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

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

        context.setConnectorNames(new String[] {connector.getName()});

        if (handlerNames != null) {
            String[] handlerNameArray = handlerNames.split(",");
            for (String handlerName : handlerNameArray) {
                Handler handler = getHandler(handlerName);
                context.addHandler(handler);
            }
        }
       
        ServletHolder holder = new ServletHolder();
View Full Code Here

       
        super.doStop();
    }
  
    private Handler getHandler(String handlerName) {
        Handler handler = null;
        if (handlerName != null) {
            handler = getCamelContext().getRegistry().lookup(handlerName, Handler.class);
            ObjectHelper.notNull(handler, handlerName);
            if (LOG.isDebugEnabled()) {
                LOG.debug("Using context handler: " + handlerName);
View Full Code Here

      final int gameserverPort) {
    org.mortbay.jetty.Server server = new org.mortbay.jetty.Server(webserverPort);

    final long time = (new Date()).getTime();
   
    Handler handler = new AbstractHandler()  {
     
        public void handle(String target, HttpServletRequest request,
            HttpServletResponse response, int dispatch)
            throws IOException, ServletException   {
         
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

        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.