Package org.apache.jetspeed.components.portletregistry

Examples of org.apache.jetspeed.components.portletregistry.RegistryException


        {
            // ignore errors during portal shutdown
        }
        if  (pa != null && pa.getApplicationType() != paType)
        {
            throw new RegistryException("Cannot stop portlet application "+contextName+": as Application Types don't match: " + pa.getApplicationType() + " != " + paType);
        }
        DescriptorChangeMonitor monitor = this.monitor;
        if ( monitor != null )
        {
            monitor.remove(contextName);
View Full Code Here


           
            if (pa != null)
            {
                if (portletFactory.isPortletApplicationRegistered(pa))
                {
                    throw new RegistryException("Portlet Application " + paName + " still running");
                }

                unregisterPortletApplication(pa, true);
                try
                {
View Full Code Here

    if ((contextName.length() >= prefixLength)
      && contextName.substring(0, prefixLength).equalsIgnoreCase(LOCAL_PA_PREFIX))
    {
      if (!local)
      {
        throw new RegistryException("Prefix \"" + LOCAL_PA_PREFIX
          + "\" is reserved for Local Portlet Applications only.");
      }
    }
    else if (local)
    {
      throw new RegistryException("Prefix \"" + LOCAL_PA_PREFIX
        + "\" is required for Local Portlet Applications.");
    }
  }
View Full Code Here

    catch (Exception e)
    {
      String msg = "Failed to load portlet application for "
        + paWar.getPortletApplicationName();
      log.error(msg, e);
      throw new RegistryException(msg);
    }

    // register the portlet application
    try
    {
      registry.registerPortletApplication(pa);
      registered = true;
      log.info("Registered the portlet application " + paName);

      // add to search engine result
      this.updateSearchEngine(false, pa);
     
      // and add to the current node info
      nodeManager.addNode(new Long(pa.getId().toString()), pa.getName());
           
            // grant default permissions to portlet application
      grantDefaultPermissions(paName);
           
            if ( autoCreateRoles && roleManager != null && pa.getWebApplicationDefinition().getSecurityRoles() != null )
            {
                try
                {
                    Iterator rolesIter = pa.getWebApplicationDefinition().getSecurityRoles().iterator();
                    SecurityRole sr;
                    while ( rolesIter.hasNext() )
                    {
                        sr = (SecurityRole)rolesIter.next();
                        if ( !roleManager.roleExists(sr.getRoleName()) )
                        {
                            roleManager.addRole(sr.getRoleName());
                            log.info("AutoCreated role: "+sr.getRoleName()+" from portlet application "+paName+" its web definition");
                        }
                    }
                }
                catch (SecurityException sex)
                {
                    log.warn("Failed to autoCreate roles for portlet application " + paName+": "+sex.getMessage(), sex);
                }
            }

      return pa;
    }
    catch (Exception e)
    {
      String msg = "Failed to register portlet application, " + paName;
      log.error(msg, e);

      if (registered)
      {
        try
        {
          unregisterPortletApplication(pa, (paType == MutablePortletApplication.LOCAL));
        }
        catch (Exception re)
        {
          log.error("Failed to rollback registration of portlet application" + paName, re);
        }
      }

      throw new RegistryException(msg, e);
    }
  }
View Full Code Here

                String msg = "Invalid PA WAR for " + contextName;
                log.error(msg, e);
                if ( paClassLoader == null )
                {
                    // nothing to be done about it anymore: this pa is beyond repair :(
                    throw new RegistryException(e);
                }
                register = false;
            }

      MutablePortletApplication pa = registry.getPortletApplication(contextName);

            if (pa != null)
            {
                if ( pa.getApplicationType() != paType )
                {
                    throw new RegistryException("Cannot start portlet application "+contextName+": as Application Types don't match: " + pa.getApplicationType() + " != " + paType);
                }
                DescriptorChangeMonitor changeMonitor = this.monitor;
                if (!monitored && changeMonitor != null)
                {
                    changeMonitor.remove(contextName);
View Full Code Here

        {
            // ignore errors during portal shutdown
        }
        if  (pa != null && pa.getApplicationType() != paType)
        {
            throw new RegistryException("Cannot stop portlet application "+contextName+": as Application Types don't match: " + pa.getApplicationType() + " != " + paType);
        }
        DescriptorChangeMonitor monitor = this.monitor;
        if ( monitor != null )
        {
            monitor.remove(contextName);
View Full Code Here

          }
          catch (PortletEntityNotDeletedException e)
          {
            String msg = "Failed to delete Portlet Entity " + entity.getId();
            log.error(msg, e);
            throw new RegistryException(msg, e);
          }
        }

        entityAccess.removeFromCache(entity);
        windowAccess.removeWindows(entity);
View Full Code Here

                    log.error(msg, e);
                }
                if ( paClassLoader == null )
                {
                    // nothing to be done about it anymore: this pa is beyond repair :(
                    throw new RegistryException(e);
                }
                //register = false;
            }
           
            MutablePortletApplication regPA = registry.getPortletApplication(contextName);
            MutablePortletApplication newPA = paWar.createPortletApp(false);
            if (regPA == null)
            {
                System.out.println("**** New portlet app found - registration required..." + contextName);
                regPA = registerPortletApplication(paWar, null, paType, paClassLoader, silent);
            }
            else
            {
                String regVersion = getVersion(regPA);
                String newVersion = getVersion(newPA);
                System.out.print("Reg version is " + regVersion);
                System.out.print(", New version is " + newVersion);
                if (newVersion.compareTo(regVersion) > 0)
                {
                    System.out.println(" - **** New Version is greater: registration required... " + contextName);
                    regPA = registerPortletApplication(paWar, regPA, paType, paClassLoader, silent);                   
                }
                else
                {
                    System.out.println(" - New Version is NOT greater: registration not required ... " + contextName);                   
                }
            }
            if (portletFactory.isPortletApplicationRegistered(regPA))
            {
                portletFactory.unregisterPortletApplication(regPA);
            }
            portletFactory.registerPortletApplication(regPA, paClassLoader);
        }
        catch (Exception e)
        {
            String msg = "Error starting portlet application " + contextName;           
            if (!silent || log.isDebugEnabled())
            {
                log.error(msg, e);
            }
            throw new RegistryException(msg, e);
        }
    }
View Full Code Here

    protected void retryStartPortletApplication(String contextName, String contextPath, FileSystemHelper warStruct, ClassLoader paClassLoader, int paType) throws RegistryException
    {
        // Retry to start application according to configuration. Note
        // that this method is not declared transactional to allow clean
        // retries within a single transaction.
        RegistryException tryStartException = null;
        for (int i = 0; (i < maxRetriedStarts+1); i++)
        {
            try
            {
                // try to start portlet application
View Full Code Here

           
            if (pa != null)
            {
                if (portletFactory.isPortletApplicationRegistered(pa))
                {
                    throw new RegistryException("Portlet Application " + paName + " still running");
                }

                unregisterPortletApplication(pa, true);
                try
                {
View Full Code Here

TOP

Related Classes of org.apache.jetspeed.components.portletregistry.RegistryException

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.