Package org.mortbay.jetty

Examples of org.mortbay.jetty.Handler


        return context;
    }

    private void checkIfContextIsFree(String path)
    {
      Handler handler = _server.getHandler();
    if (handler instanceof ContextHandler)
    {
      ContextHandler ctx = (ContextHandler) handler;
      if (ctx.getContextPath().equals(path))
            throw new RuntimeException("another context already bound to path " + path);
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

    protected static WebAppContext findWAC(ServletContext context) {
        if (context instanceof ContextHandler.SContext) {
            ContextHandler.SContext sContext = (ContextHandler.SContext) context;
            ContextHandler contextHandler = sContext.getContextHandler();
            Handler handler = contextHandler.getHandler();
            if (handler instanceof ServletHandler) {
                ServletHandler servletHandler = (ServletHandler) handler;
                Server server = servletHandler.getServer();
                Handler serverHandler = server.getHandler();
                if (serverHandler instanceof HandlerCollection) {
                    HandlerCollection hc = (HandlerCollection) serverHandler;
                    for (Handler h : hc.getHandlers()) {
                        if (h instanceof WebAppContext) {
                            WebAppContext wac = (WebAppContext) h;
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 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

        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

        server.start();
        return server;
    }
  
    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

        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

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.