Package com.sun.enterprise.config

Examples of com.sun.enterprise.config.ConfigException


  // Add a new element returning its index in the list with a boolean flag
  public int addHttpListener(HttpListener value, boolean overwrite)
      throws ConfigException{
    HttpListener old = getHttpListenerById(value.getId());
    if(old != null) {
      throw new ConfigException(StringManager.getManager(HttpService.class).getString("cannotAddDuplicate""HttpListener"));
    }
    return this.addValue(HTTP_LISTENER, value, overwrite);
  }
View Full Code Here


  // Add a new element returning its index in the list with a boolean flag
  public int addVirtualServer(VirtualServer value, boolean overwrite)
      throws ConfigException{
    VirtualServer old = getVirtualServerById(value.getId());
    if(old != null) {
      throw new ConfigException(StringManager.getManager(HttpService.class).getString("cannotAddDuplicate""VirtualServer"));
    }
    return this.addValue(VIRTUAL_SERVER, value, overwrite);
  }
View Full Code Here

  // Add a new element returning its index in the list with a boolean flag
  public int addElementProperty(ElementProperty value, boolean overwrite)
      throws ConfigException{
    ElementProperty old = getElementPropertyByName(value.getName());
    if(old != null) {
      throw new ConfigException(StringManager.getManager(HttpService.class).getString("cannotAddDuplicate""ElementProperty"));
    }
    return this.addValue(ELEMENT_PROPERTY, value, overwrite);
  }
View Full Code Here

  // Add a new element returning its index in the list with a boolean flag
  public int addElementProperty(ElementProperty value, boolean overwrite)
      throws ConfigException{
    ElementProperty old = getElementPropertyByName(value.getName());
    if(old != null) {
      throw new ConfigException(StringManager.getManager(EjbTimerService.class).getString("cannotAddDuplicate""ElementProperty"));
    }
    return this.addValue(ELEMENT_PROPERTY, value, overwrite);
  }
View Full Code Here

                 if (server == null)
                     server = ServerHelper.getServerByName(
                              configContext, serverName);
             } catch (ConfigException e) {
                 //no server instance either.
                 if (server == null) throw new ConfigException(
                   _localStrMgr.getString(SYNC_NO_MATCHING_SERVER, serverName));
             }
         }
       
        _logger.log(Level.INFO,
View Full Code Here

                //referencing its config
                String configName = ServerHelper.getConfigForServer(configContext,
                    target.getName()).getName();
                if (!ConfigAPIHelper.isConfigurationReferencedByServerOnly(configContext,
                    configName, target.getName())) {
                        throw new ConfigException(localStrings.getString(
                            "configurationHasMultipleRefs", target.getName(), configName,
                            ConfigAPIHelper.getConfigurationReferenceesAsString(
                                configContext, configName)));  
                }                                             
            } else if (target.getType() == TargetType.CLUSTER) {
                //If we are operating on a cluster, ensure that the cluster is the only entity
                //referencing its config
                String configName = ClusterHelper.getConfigForCluster(configContext,
                    target.getName()).getName();
                if (!ConfigAPIHelper.isConfigurationReferencedByClusterOnly(configContext,
                    configName, target.getName())) {
                        throw new ConfigException(localStrings.getString(
                            "configurationHasMultipleRefs", target.getName(), configName,
                            ConfigAPIHelper.getConfigurationReferenceesAsString(
                                configContext, configName)));
                }    
            }
View Full Code Here

                //Delete the resource reference only if the resource is referenced
                //by the target server only
                if (!ServerHelper.serverReferencesResource(getConfigContext()
                    tgtName, resRef)) {
                    throw new ConfigException(localStrings.getString("serverResourceRefDoesNotExist",
                        tgtName, resRef));
                } else if (ResourceHelper.isResourceReferencedByServerOnly(getConfigContext(),
                    resRef, tgtName)) {
                    getResourceReferenceHelper().deleteResourceReference(tgtName, resRef);
                } else {
                    throw new ConfigException(localStrings.getString("resourceHasMultipleRefs",
                        tgtName, resRef, ResourceHelper.getResourceReferenceesAsString(
                            getConfigContext(), resRef)));
                }
            } else if (target.getType() == TargetType.CLUSTER) {               
                //Delete the resource reference only if the resource is referenced
                //by the target cluster only
                 if (!ClusterHelper.clusterReferencesResource(getConfigContext(),
                    tgtName, resRef)) {
                    throw new ConfigException(localStrings.getString("clusterResourceRefDoesNotExist",
                        tgtName, resRef));
                 } else if (ResourceHelper.isResourceReferencedByClusterOnly(getConfigContext(),
                    resRef, tgtName)) {
                    getResourceReferenceHelper().deleteResourceReference(tgtName, resRef);    
                 } else {
                    throw new ConfigException(localStrings.getString("resourceHasMultipleRefs",
                        tgtName, resRef, ResourceHelper.getResourceReferenceesAsString(
                            getConfigContext(), resRef)));                    
                 }
            }
            //As a sanity check ensure that the resource has no references; otherwise
            //it cannot be deleted from the domain
            if (ResourceHelper.isResourceReferenced(getConfigContext(), resRef)) {
                throw new ConfigException(localStrings.getString("resourceIsReferenced",
                    resRef, ResourceHelper.getResourceReferenceesAsString(
                        getConfigContext(), resRef)));
            }
/*        }
        catch (javax.management.MalformedObjectNameException mone) {}
View Full Code Here

    public void addClusteringSupportUsingProfile(final String profile) throws ConfigException {
        final ConfigContext acc    = MBeanRegistryFactory.getAdminContext().getAdminConfigContext();
        if (ServerHelper.isClusterAdminSupported(acc)) {
            final String msg = localStrings.getString("domain.supports.cluster");
            throw new ConfigException(msg);
        }
        try {
            final Config defaultConfig = getTemplateConfig(profile);
            addConfig(acc, defaultConfig);
            addClusterSupportElements(acc);
            configurAdminServer(acc);
            createMissingFolders(acc, defaultConfig.getName());           
           
        } catch(final Exception e) {
            throw new ConfigException(e);
        }
    }
View Full Code Here

        final String type = getResourceType(referenceName);    
        //Check to see whether we are creating or deleting a system resource
        //reference.
        if (!allowSystemRefs) {
            if (ResourceHelper.isSystemResource(getConfigContext(), referenceName)) {
                throw new ConfigException(_strMgr.getString("systemResourceRefNotAllowed",
                    referenceName));
            }
        }
        return type;
    }
View Full Code Here

        String referenceName) throws ConfigException
    {       
        ResourceRef ref = cluster.getResourceRefByRef(referenceName);
        if (ref != null) {
            //Resource ref already exists in cluster        
            throw new ConfigException(_strMgr.getString("clusterResourceRefAlreadyExists",
                referenceName, cluster.getName()));    
        }
        ref = new ResourceRef();
        ref.setEnabled(enabled);
        ref.setRef(referenceName);
View Full Code Here

TOP

Related Classes of com.sun.enterprise.config.ConfigException

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.