Package org.apache.catalina

Examples of org.apache.catalina.Context


            ctxs.add(context);
        }

        List sessionList = new ArrayList();
        for (Iterator it = ctxs.iterator(); it.hasNext();) {
            Context ctx = (Context) it.next();
            if (ctx != null && ctx.getManager() != null && (!searchInfo.isApply() || searchInfo.isUseSearch())) {
                Session[] sessions = ctx.getManager().findSessions();
                for (int i = 0; i < sessions.length; i++) {
                    Session session = sessions[i];
                    ApplicationSession appSession = ApplicationUtils.getApplicationSession(
                            session, calcSize, searchInfo.isUseAttr());
                    if (appSession != null && matchSession(appSession, searchInfo)) {
                        if (ctx.getName() != null) {
                            appSession.setApplicationName(ctx.getName().length() > 0 ? ctx.getName() : "/");
                        }
                        sessionList.add(appSession);
                    }
                }
            }
View Full Code Here


        if (getContainerWrapper().getResourceResolver().supportsPrivateResources()) {
            for (Iterator it = getContainerWrapper().getTomcatContainer().findContexts().iterator(); it.hasNext();) {
                //
                // make sure we skip ROOT application
                //
                Context appContext = (Context) it.next();

                allContextsAvailable = allContextsAvailable && appContext.getAvailable();

                List applicationResources = getContainerWrapper().getResourceResolver().getApplicationResources(appContext);

                for (Iterator it2 = applicationResources.iterator(); it2.hasNext();) {

                    ApplicationResource appResource = (ApplicationResource) it2.next();

                    DataSourceInfo dsi = appResource.getDataSourceInfo();
                    if (dsi != null && dsi.getBusyScore() > tomcatTestReport.getDatasourceUsageScore()) {
                        tomcatTestReport.setContextName(appContext.getName());
                        tomcatTestReport.setDatasourceUsageScore(dsi.getBusyScore());
                        tomcatTestReport.setDataSourceName(appResource.getName());
                    }
                }
            }
View Full Code Here

*/
public abstract class ContextHandlerController extends TomcatContainerController {

    protected ModelAndView handleRequestInternal(HttpServletRequest request, HttpServletResponse response) throws Exception {
        String contextName = ServletRequestUtils.getStringParameter(request, "webapp", null);
        Context context = null;
        if (contextName != null) {
            contextName = getContainerWrapper().getTomcatContainer().formatContextName(contextName);
            context = getContainerWrapper().getTomcatContainer().findContext(contextName);
        }

View Full Code Here

        // this will help us to associate threads with applications.
        //
        List contexts = getContainerWrapper().getTomcatContainer().findContexts();
        Map classLoaderMap = new TreeMap();
        for (int i = 0; i < contexts.size(); i++) {
            Context context = (Context) contexts.get(i);
            if (context.getLoader() != null && context.getLoader().getClassLoader() != null) {
                classLoaderMap.put(toUID(context.getLoader().getClassLoader()), context.getName());
            }
        }

        return new ModelAndView(getViewName(), "threads", enumerateThreads(classLoaderMap));
    }
View Full Code Here

        List apps = getContainerWrapper().getTomcatContainer().findContexts();
        List applications = new ArrayList(apps.size());
        boolean showResources = getContainerWrapper().getResourceResolver().supportsPrivateResources();
        for (int i = 0; i < apps.size(); i++) {
            Context appContext = (Context) apps.get(i);
            //
            // check if this is not the ROOT webapp
            //
            if (appContext.getName() != null) {
                applications.add(ApplicationUtils.getApplication(appContext, getContainerWrapper().getResourceResolver(), calcSize));
            }
        }
        if (! applications.isEmpty() && ! showResources) {
            request.setAttribute("no_resources", Boolean.TRUE);
View Full Code Here

* @author Vlad Ilyushchenko
*/
public class ReloadContextController extends NoSelfContextHandlerController {

    protected void executeAction(String contextName) throws Exception {
        Context context = getContainerWrapper().getTomcatContainer().findContext(contextName);
        if (context != null) {
            context.reload();
        }
    }
View Full Code Here

                            //
                            // let Tomcat know that the file is there
                            //
                            getContainerWrapper().getTomcatContainer().installWar(contextName, new URL("jar:file:" + destWar.getAbsolutePath() + "!/"));

                            Context ctx = getContainerWrapper().getTomcatContainer().findContext(contextName);
                            if (ctx == null) {
                                errMsg = getMessageSourceAccessor().getMessage("probe.src.deploy.war.notinstalled", new Object[]{visibleContextName});
                            } else {
                                request.setAttribute("success", Boolean.TRUE);
                                if (discard) {
                                    getContainerWrapper().getTomcatContainer().discardWorkDir(ctx);
                                }
                                if (compile) {
                                    Summary summary = new Summary();
                                    summary.setName(ctx.getName());
                                    getContainerWrapper().getTomcatContainer().listContextJsps(ctx, summary, true);
                                    request.getSession(true).setAttribute(DisplayJspController.SUMMARY_ATTRIBUTE, summary);
                                    request.setAttribute("compileSuccess", Boolean.TRUE);
                                }
                            }
View Full Code Here

        Container[] containers = host.findChildren();
        return Arrays.asList(containers);
    }

    public void stop(String name) throws Exception {
        Context ctx = findContext(name);
        if (ctx != null) {
            ((Lifecycle) ctx).stop();
        }
    }
View Full Code Here

            ((Lifecycle) ctx).stop();
        }
    }

    public void start(String name) throws Exception {
        Context ctx = findContext(name);
        if (ctx != null) {
            ((Lifecycle) ctx).start();
        }
    }
View Full Code Here

        Container[] containers = host.findChildren();
        return Arrays.asList(containers);
    }

    public void stop(String name) throws Exception {
        Context ctx = findContext(name);
        if (ctx != null) {
            ((Lifecycle) ctx).stop();
        }
    }
View Full Code Here

TOP

Related Classes of org.apache.catalina.Context

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.