Package org.apache.jetspeed.deployment.simpleregistry

Examples of org.apache.jetspeed.deployment.simpleregistry.Entry


        // process decorator by id
        String id = conf.getString("id");
        if (id != null)
        {
            log.info("Found decorator deployment archive " + id);
            Entry entry = new Entry();
            entry.setId(id);
            entry.setAttribute(DEPLOYMENT_OBJECT_PATH_ATTR, event.getDeploymentObject().getPath());
            entry.setAttribute(DEPLOYMENT_CONFIGURATION_ATTR, conf);

            FileSystemHelper sourceObject = null;
            FileSystemHelper deployObject = null;
            try
            {
View Full Code Here


        if ((conf == null) && (event.getPath() != null))
        {
            Iterator registrationsIter = registry.getRegistry().iterator();
            while ((conf == null) && registrationsIter.hasNext())
            {
                Entry entry = (Entry)registrationsIter.next();
                String deploymentObjectPath = (String) entry.getAttribute(DEPLOYMENT_OBJECT_PATH_ATTR);
                if (event.getPath().equals(deploymentObjectPath))
                {
                    conf = (PropertiesConfiguration) entry.getAttribute(DEPLOYMENT_CONFIGURATION_ATTR);
                }
            }
        }
        // silently return if configuration not available, (assumes
        // probably not a decorator)
        if (conf == null)
        {
            return;
        }

        // process decorator by id
        String id = conf.getString("id");
        if (id != null)
        {
            log.info("Found decorator deployment configuration " + id);

            try
            {
                // find and construct decorator deploy path
                String baseDeployPath = getBaseDeployPath(conf);
                String deployPath = baseDeployPath + File.separator + id;
               
                // undeploy decorator
                File deployPathFile = new File(deployPath);
                if (deployPathFile.exists())
                {
                    log.info("Undeploying decorator " + id + " at " + deployPath);
                    DirectoryHelper cleanup = new DirectoryHelper(deployPathFile);
                    cleanup.remove();
                    cleanup.close();
                }
               
                // detect language/country localized decorator components
                final List localeSpecificDeployPathsList = getLocaleSpecificDeployPaths(new File(baseDeployPath));
               
                // undeploy individual locale specific decorator components
                Iterator deployPathsIter = localeSpecificDeployPathsList.iterator();
                while (deployPathsIter.hasNext())
                {
                    File localeDeployPathFile = new File((File) deployPathsIter.next(), id);
                    if (localeDeployPathFile.exists())
                    {
                        log.info("Undeploying decorator " + id + " at " + localeDeployPathFile.getPath());
                        DirectoryHelper cleanup = new DirectoryHelper(localeDeployPathFile);
                        cleanup.remove();
                        cleanup.close();
                        localeDeployPathFile.getParentFile().delete();
                    }
                }
               
                // deregister
                Entry entry = new Entry();
                entry.setId(id);
                registry.deRegister(entry);
                log.info("Deregistering decorator " + id);

                log.info("Decorator " + id + " undeployed and deregistered successfuly.");
            }
View Full Code Here

TOP

Related Classes of org.apache.jetspeed.deployment.simpleregistry.Entry

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.