Package org.apache.jetspeed.deployment

Examples of org.apache.jetspeed.deployment.DeploymentException


            new JetspeedDeploy(event.getPath(), toFile.getAbsolutePath(), stripLoggers);
            event.setStatus(DeploymentStatus.STATUS_OKAY);
        }
        catch (Exception e)
        {
            throw new DeploymentException(e);
        }
    }
View Full Code Here


            pam.startLocalPortletApplication(appName, paDirHelper, createLocalPAClassLoader(targetDir));
            event.setStatus(DeploymentStatus.STATUS_OKAY);
        }
        catch (Exception e)
        {
            throw new DeploymentException(e);
        }
    }
View Full Code Here

            new JetspeedDeploy(event.getPath(), toFile.getAbsolutePath(), stripLoggers);
            event.setStatus(DeploymentStatus.STATUS_OKAY);
        }
        catch (Exception e)
        {
            throw new DeploymentException(e);
        }
    }
View Full Code Here

            pam.startLocalPortletApplication(appName, paDirHelper, createLocalPAClassLoader(targetDir));
            event.setStatus(DeploymentStatus.STATUS_OKAY);
        }
        catch (Exception e)
        {
            throw new DeploymentException(e);
        }
    }
View Full Code Here

        // process decorator by id
        String id = conf.getString("id");
        if (id == null)
        {
            throw new DeploymentException("Unable to deploy decorator, \"id\" attribute not defined in configuration");
        }
       
        log.info("Found decorator deployment archive " + id);

        try
        {
            // construct decorator deploy path
            String baseDeployPath = getBaseDeployPath(conf);
            String deployPath = baseDeployPath + File.separator + id;
            File deployPathFile = new File(deployPath);

            // undeploy decorator if it already exists and is a redeploy or
            // skip deployment if initial deployment
            if (deployPathFile.exists())
            {
                invokeUndeploy(deployPathFile);
            }

            // redeploy/deploy decorator w/o META_INF jar metadata
            log.info("Deploying decorator " + id + " to " + deployPath);
            JarExpander.expand(event.getDeploymentObject().getFile(), deployPathFile);
            File metaInf = new File(deployPathFile, "META-INF");
            if (metaInf.exists())
            {
                DirectoryHelper cleanup = new DirectoryHelper(metaInf);
                cleanup.remove();
                cleanup.close();
            }

            // detect language/country localized decorator components
            final List localeSpecificDeployPathsList = getLocaleSpecificDeployPaths(deployPathFile);

            // deploy individual locale specific decorator components
            Iterator deployPathsIter = localeSpecificDeployPathsList.iterator();
            while (deployPathsIter.hasNext())
            {
                File localeDeployPathFile = (File) deployPathsIter.next();

                // deploy to locale specific location
                File deployToPathFile = new File(baseDeployPath
                                                 + localeDeployPathFile.getPath().substring(deployPath.length())
                                                 + File.separator + id);
                log.info("Deploying locale specific decorator component to " + deployToPathFile.getPath());
                deployToPathFile.mkdirs();

                // deploy decorator components by moving from deployed decorator
                File[] filesToDeploy = localeDeployPathFile.listFiles(new FileFilter()
                {
                    public boolean accept(File pathname)
                    {
                        return !localeSpecificDeployPathsList.contains(pathname);
                    }
                });
                for (int i = 0; (i < filesToDeploy.length); i++)
                {
                    filesToDeploy[i].renameTo(new File(deployToPathFile, filesToDeploy[i].getName()));
                }
            }

            // cleanup locale specific deployment directories
            Iterator cleanupDeployPathsIter = localeSpecificDeployPathsList.iterator();
            while (cleanupDeployPathsIter.hasNext())
            {
                File cleanupLocaleDeployPathFile = (File) cleanupDeployPathsIter.next();
                if (cleanupLocaleDeployPathFile.exists())
                {
                    DirectoryHelper cleanup = new DirectoryHelper(cleanupLocaleDeployPathFile);
                    cleanup.remove();
                    cleanup.close();
                }
            }

            log.info("Decorator " + id + " deployed successfuly.");
            event.setStatus(DeploymentStatus.STATUS_OKAY);
        }
        catch (DeploymentException de)
        {
            throw de;
        }
        catch (Exception e)
        {
            throw new DeploymentException("Error deploying decorator " + id, e);
        }
    }
View Full Code Here

        if (deployPathFile == null || !deployPathFile.exists() ||
            !deployPathFile.isDirectory() || deployPathFile.getParentFile() == null ||
            !deployToDir.equals(deployPathFile.getParentFile().getParent()))
        {
            throw new DeploymentException("Cannot undeploy decorator at " + deployPathFile + ": invalid decorator path");
        }

        String id = deployPathFile.getName();

        try
        {
            // undeploy decorator
            log.info("Undeploying decorator " + id + " at " + deployPathFile.getAbsolutePath());

            // detect language/country localized decorator components
            final List localeSpecificDeployPathsList = getLocaleSpecificDeployPaths(deployPathFile.getParentFile());

            // undeploy individual locale specific decorator components depth first
            for (int i = localeSpecificDeployPathsList.size() - 1; i > -1; i--)
            {
                File localeDeployPathFile = new File((File) localeSpecificDeployPathsList.get(i), id);
                if (localeDeployPathFile.exists())
                {
                    log.info("Undeploying locale specific decorator component at " + localeDeployPathFile.getPath());
                    DirectoryHelper cleanup = new DirectoryHelper(localeDeployPathFile);
                    cleanup.remove();
                    cleanup.close();
                    localeDeployPathFile.getParentFile().delete();
                }
            }

            // now undeploy the decorator root itself
            DirectoryHelper cleanup = new DirectoryHelper(deployPathFile);
            cleanup.remove();
            cleanup.close();

            log.info("Decorator " + id + " undeployed successfuly.");
        }
        catch (Exception e)
        {
            throw new DeploymentException("Error undeploying decorator " + id, e);
        }
    }
View Full Code Here

                return configuration;
            }
        }
        catch (Exception e1)
        {
            throw new DeploymentException("Error reading decorator.properties from " + event.getPath(), e1);
        }
        finally
        {
            if (stream != null)
            {
View Full Code Here

        // process decorator by id
        String id = conf.getString("id");
        if (id == null)
        {
            throw new DeploymentException("Unable to deploy decorator, \"id\" attribute not defined in configuration");
        }
       
        log.info("Found decorator deployment archive " + id);

        try
        {
            // construct decorator deploy path
            String baseDeployPath = getBaseDeployPath(conf);
            String deployPath = baseDeployPath + File.separator + id;
            File deployPathFile = new File(deployPath);

            // undeploy decorator if it already exists and is a redeploy or
            // skip deployment if initial deployment
            if (deployPathFile.exists())
            {
                invokeUndeploy(deployPathFile);
            }

            // redeploy/deploy decorator w/o META_INF jar metadata
            log.info("Deploying decorator " + id + " to " + deployPath);
            JarExpander.expand(event.getDeploymentObject().getFile(), deployPathFile);
            File metaInf = new File(deployPathFile, "META-INF");
            if (metaInf.exists())
            {
                DirectoryHelper cleanup = new DirectoryHelper(metaInf);
                cleanup.remove();
                cleanup.close();
            }

            // detect language/country localized decorator components
            final List localeSpecificDeployPathsList = getLocaleSpecificDeployPaths(deployPathFile);

            // deploy individual locale specific decorator components
            Iterator deployPathsIter = localeSpecificDeployPathsList.iterator();
            while (deployPathsIter.hasNext())
            {
                File localeDeployPathFile = (File) deployPathsIter.next();

                // deploy to locale specific location
                File deployToPathFile = new File(baseDeployPath
                                                 + localeDeployPathFile.getPath().substring(deployPath.length())
                                                 + File.separator + id);
                log.info("Deploying locale specific decorator component to " + deployToPathFile.getPath());
                deployToPathFile.mkdirs();

                // deploy decorator components by moving from deployed decorator
                File[] filesToDeploy = localeDeployPathFile.listFiles(new FileFilter()
                {
                    public boolean accept(File pathname)
                    {
                        return !localeSpecificDeployPathsList.contains(pathname);
                    }
                });
                for (int i = 0; (i < filesToDeploy.length); i++)
                {
                    filesToDeploy[i].renameTo(new File(deployToPathFile, filesToDeploy[i].getName()));
                }
            }

            // cleanup locale specific deployment directories
            Iterator cleanupDeployPathsIter = localeSpecificDeployPathsList.iterator();
            while (cleanupDeployPathsIter.hasNext())
            {
                File cleanupLocaleDeployPathFile = (File) cleanupDeployPathsIter.next();
                if (cleanupLocaleDeployPathFile.exists())
                {
                    DirectoryHelper cleanup = new DirectoryHelper(cleanupLocaleDeployPathFile);
                    cleanup.remove();
                    cleanup.close();
                }
            }

            log.info("Decorator " + id + " deployed successfuly.");
            event.setStatus(DeploymentStatus.STATUS_OKAY);
        }
        catch (DeploymentException de)
        {
            throw de;
        }
        catch (Exception e)
        {
            throw new DeploymentException("Error deploying decorator " + id, e);
        }
    }
View Full Code Here

        if (deployPathFile == null || !deployPathFile.exists() ||
            !deployPathFile.isDirectory() || deployPathFile.getParentFile() == null ||
            !deployToDir.equals(deployPathFile.getParentFile().getParent()))
        {
            throw new DeploymentException("Cannot undeploy decorator at " + deployPathFile + ": invalid decorator path");
        }

        String id = deployPathFile.getName();

        try
        {
            // undeploy decorator
            log.info("Undeploying decorator " + id + " at " + deployPathFile.getAbsolutePath());

            // detect language/country localized decorator components
            final List localeSpecificDeployPathsList = getLocaleSpecificDeployPaths(deployPathFile.getParentFile());

            // undeploy individual locale specific decorator components depth first
            for (int i = localeSpecificDeployPathsList.size() - 1; i > -1; i--)
            {
                File localeDeployPathFile = new File((File) localeSpecificDeployPathsList.get(i), id);
                if (localeDeployPathFile.exists())
                {
                    log.info("Undeploying locale specific decorator component at " + localeDeployPathFile.getPath());
                    DirectoryHelper cleanup = new DirectoryHelper(localeDeployPathFile);
                    cleanup.remove();
                    cleanup.close();
                    localeDeployPathFile.getParentFile().delete();
                }
            }

            // now undeploy the decorator root itself
            DirectoryHelper cleanup = new DirectoryHelper(deployPathFile);
            cleanup.remove();
            cleanup.close();

            log.info("Decorator " + id + " undeployed successfuly.");
        }
        catch (Exception e)
        {
            throw new DeploymentException("Error undeploying decorator " + id, e);
        }
    }
View Full Code Here

                return configuration;
            }
        }
        catch (Exception e1)
        {
            throw new DeploymentException("Error reading decorator.properties from " + event.getPath(), e1);
        }
        finally
        {
            if (stream != null)
            {
View Full Code Here

TOP

Related Classes of org.apache.jetspeed.deployment.DeploymentException

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.