Examples of WebApplicationsHolder


Examples of org.wso2.carbon.server.WebApplicationsHolder

    private WarCappMetadata getWebappMetadata(String fileName) {
        // metadata instance to return
        WarCappMetadata warCappMetadata = null;

        // get the webapp holder instance from config context
        WebApplicationsHolder holder = (WebApplicationsHolder) getConfigContext().
                        getProperty(CarbonConstants.WEB_APPLICATIONS_HOLDER);

        // first search in the started webapps
        String state = STARTED;
        WebApplication webApplication = holder.getStartedWebapps().get(fileName);

        // if it is null, try searching stopped webapps
        if (webApplication == null) {
            state = STOPPED;
            webApplication = holder.getStoppedWebapps().get(fileName);
        }

        // if it is still null, try searching faulty webapps
        if (webApplication == null) {
            state = FAULTY;
            webApplication = holder.getFaultyWebapps().get(fileName);
        }

        // if we could find a web app for the given file name, create the Metadata instance
        if (webApplication != null) {
            warCappMetadata = new WarCappMetadata();
View Full Code Here

Examples of org.wso2.carbon.server.WebApplicationsHolder

     *
     * @param webappFileName
     * @return
     */
    public WebappMetadata getStartedWebapp(String webappFileName) {
        WebApplicationsHolder holder = getWebappsHolder();
        WebApplication webApplication = holder.getStartedWebapps().get(webappFileName);
        WebappMetadata webappMetadata = null;
        if (webApplication != null) {
            webappMetadata = getWebapp(webApplication);
            webappMetadata.setStarted(true);
        }
View Full Code Here

Examples of org.wso2.carbon.server.WebApplicationsHolder

     *
     * @param webappFileName
     * @return
     */
    public WebappMetadata getStoppedWebapp(String webappFileName) {
        WebApplicationsHolder holder = getWebappsHolder();
        WebApplication webApplication = holder.getStoppedWebapps().get(webappFileName);
        WebappMetadata webappMetadata = null;
        if (webApplication != null) {
            webappMetadata = getWebapp(webApplication);
            webappMetadata.setStarted(false);
        }
View Full Code Here

Examples of org.wso2.carbon.server.WebApplicationsHolder

                                                       int pageNumber) throws AxisFault {
        return getPagedWebapps(pageNumber, getFaultyWebapps(webappSearchString));
    }

    private WebappsWrapper getPagedWebapps(int pageNumber, List<WebappMetadata> webapps) {
        WebApplicationsHolder webappsHolder = getWebappsHolder();
        WebappsWrapper webappsWrapper = getWebappsWrapper(webappsHolder, webapps);
        try {
            webappsWrapper.setHostName(NetworkUtils.getLocalHostname());
        } catch (SocketException e) {
            log.error("Error occurred while getting local hostname", e);
View Full Code Here

Examples of org.wso2.carbon.server.WebApplicationsHolder

        }
        return webapps;
    }

    private List<WebappMetadata> getFaultyWebapps(String webappsSearchString) {
        WebApplicationsHolder webappsHolder = getWebappsHolder();
        if (webappsHolder == null) {
            return null;
        }
        List<WebappMetadata> webapps = new ArrayList<WebappMetadata>();
        for (WebApplication webapp : webappsHolder.getFaultyWebapps().values()) {
            if (!doesWebappSatisfySearchString(webapp, webappsSearchString)) {
                continue;
            }
            WebappMetadata webappMetadata = new WebappMetadata();
            webappMetadata.setContext(webapp.getContextName());
View Full Code Here

Examples of org.wso2.carbon.server.WebApplicationsHolder

     *
     * @param webappFileNames The file names of the webapps to be stopped
     * @throws AxisFault If an error occurs while undeploying
     */
    public void stopWebapps(String[] webappFileNames) throws AxisFault {
        WebApplicationsHolder webappsHolder = getWebappsHolder();
        Map<String, WebApplication> startedWebapps = webappsHolder.getStartedWebapps();
        for (String webappFileName : webappFileNames) {
            try {
                WebApplication webApplication = startedWebapps.get(webappFileName);
                webappsHolder.stopWebapp(webApplication);
            } catch (CarbonException e) {
                handleException("Error occurred while undeploying webapps", e);
            }
        }
    }
View Full Code Here

Examples of org.wso2.carbon.server.WebApplicationsHolder

     *
     * @param webappFileNames The file names of the webapps to be restarted
     * @throws org.apache.axis2.AxisFault If a deployment error occurs
     */
    public void startWebapps(String[] webappFileNames) throws AxisFault {
        WebApplicationsHolder webappsHolder = getWebappsHolder();
        Map<String, WebApplication> stoppedWebapps = webappsHolder.getStoppedWebapps();
        Deployer webappDeployer =
                ((DeploymentEngine) getAxisConfig().getConfigurator()).getDeployer(WebappsConstants
                        .WEBAPP_DEPLOYMENT_FOLDER, WebappsConstants.WEBAPP_EXTENSION);
        for (String webappFileName : webappFileNames) {
            WebApplication webapp = stoppedWebapps.get(webappFileName);
View Full Code Here

Examples of org.wso2.carbon.server.WebApplicationsHolder

        try {
            boolean started = webapp.start();
            if (started) {
                String webappFileName = webapp.getWebappFile().getName();
                stoppedWebapps.remove(webappFileName);
                WebApplicationsHolder webappsHolder = getWebappsHolder();
                Map<String, WebApplication> startedWebapps = webappsHolder.getStartedWebapps();
                startedWebapps.put(webappFileName, webapp);
            }
        } catch (CarbonException e) {
            String msg = "Cannot start webapp " + webapp;
            log.error(msg, e);
View Full Code Here

Examples of org.wso2.carbon.server.WebApplicationsHolder

        String tenantDomain = carbonContext.getTenantDomain();
        String webContextPrefix = (tenantDomain != null) ?
                                  "/" + MultitenantConstants.TENANT_AWARE_URL_PREFIX +
                                  "/" + tenantDomain + "/" + WebappsConstants.WEBAPP_PREFIX + "/" :
                                  "";
        WebApplicationsHolder webappsHolder = new WebApplicationsHolder(new File(webappsDir));
        configCtx.setProperty(CarbonConstants.WEB_APPLICATIONS_HOLDER, webappsHolder);
        tomcatWebappDeployer = new TomcatGenericWebappsDeployer(webContextPrefix,
                                                                tenantId,
                                                                tenantDomain,
                                                                webappsHolder);
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.