Package net.sf.ehcache.config

Examples of net.sf.ehcache.config.InvalidConfigurationException


    String userid = request.getParameter("userid");
    String password = request.getParameter("password");
    String contextUserid = WebContext.getWebSCContextCredentials().getUserId();
    String contextPassword = WebContext.getWebSCContextCredentials().getPassword();
    if (contextUserid == null || contextPassword == null) {
      throw new InvalidConfigurationException("system configuration has no credentials");
    }
    if (userid == null || password == null) {
      throw new LoginException("not authorized");
    }
    if (userid.equals(contextUserid) == false) {
View Full Code Here


  public void setResponder(IResponder resp) {
    super.setResponder(resp);
    ListenerConfiguration listenerConfig = resp.getListenerConfig();
    RemoteNodeConfiguration remoteNodeConfig = listenerConfig.getRemoteNodeConfiguration();
    if (remoteNodeConfig == null) {
      throw new InvalidConfigurationException("remote host configuration is missing for responder="
          + resp.getListenerConfig().getName());
    }
    this.remoteHost = remoteNodeConfig.getHost();
    this.remotePort = remoteNodeConfig.getPort();
    try {
View Full Code Here

    /**
     * {@inheritDoc}
     */
    public void setAttributeExtractors(Map<String, AttributeExtractor> extractors) {
        if (!extractors.isEmpty()) {
            throw new InvalidConfigurationException("Search attributes not supported by this store type: " + getClass().getName());
        }
    }
View Full Code Here

            terracottaClientConfiguration.freezeConfig();
        }
        if (isRejoinEnabled()) {
            TerracottaRuntimeType type = TerracottaClusteredInstanceHelper.getInstance().getTerracottaRuntimeTypeOrNull();
            if (type == null) {
                throw new InvalidConfigurationException(
                        "Terracotta Rejoin is enabled but can't determine Terracotta Runtime. You are probably missing Terracotta jar(s).");
            }
            if (type != TerracottaRuntimeType.EnterpriseExpress && type != TerracottaRuntimeType.Express) {
                throw new InvalidConfigurationException("Rejoin cannot be used in Terracotta DSO mode.");
            }
            Thread rejoinThread = new Thread(rejoinWorker, "Rejoin Worker Thread [cacheManager: " + cacheManager.getName() + "]");
            rejoinThread.setDaemon(true);
            rejoinThread.start();
        }
View Full Code Here

        String trimmed = expression.trim();

        String[] tokens = trimmed.split("\\.");

        if (tokens.length == 0) {
            throw new InvalidConfigurationException("Invalid attribute expression: " + trimmed);
        }

        String startToken = tokens[0];

        if (startToken.equalsIgnoreCase(ELEMENT)) {
            start = StartType.ELEMENT;
        } else if (startToken.equalsIgnoreCase(KEY)) {
            start = StartType.KEY;
        } else if (startToken.equalsIgnoreCase(VALUE)) {
            start = StartType.VALUE;
        } else {
            throw new InvalidConfigurationException("Expression must start with either \"" + ELEMENT + "\", \"" + KEY + "\" or \"" + VALUE
                    + "\": " + trimmed);
        }

        this.parts = parseExpression(tokens, trimmed);
        this.expression = trimmed;
View Full Code Here

        return parts;
    }

    private static void verifyToken(String token, String expression) {
        if (token.length() == 0) {
            throw new InvalidConfigurationException("Empty element in expression: " + expression);
        }

        for (int i = 0; i < token.length(); i++) {
            char c = token.charAt(i);
            if (i == 0) {
                if (!Character.isJavaIdentifierStart(c)) {
                    throw new InvalidConfigurationException("Invalid element (" + token + ") in expression: " + expression);
                }
            } else {
                if (!Character.isJavaIdentifierPart(c)) {
                    throw new InvalidConfigurationException("Invalid element (" + token + ") in expression: " + expression);
                }
            }
        }
    }
View Full Code Here

     * {@inheritDoc}
     */
    @Override
    public void setNodeCoherent(boolean coherent) {
        if (!coherent) {
            throw new InvalidConfigurationException("a transactional cache cannot be incoherent");
        }
        underlyingStore.setNodeCoherent(coherent);
    }
View Full Code Here

            final Store store;
            if (isTerracottaClustered()) {
                final Consistency consistency = getCacheConfiguration().getTerracottaConfiguration().getConsistency();
                final boolean coherent = getCacheConfiguration().getTerracottaConfiguration().isCoherent();
                if (getCacheConfiguration().isOverflowToOffHeap()) {
                    throw new InvalidConfigurationException(
                            "Terracotta clustered caches with local overflow to offheap are not supported yet."
                                    + " You can fix this by disabling overflow to offheap for clustered caches.");
                }
                if (getCacheConfiguration().getTerracottaConfiguration().isSynchronousWrites() && consistency == Consistency.EVENTUAL) {
                    throw new InvalidConfigurationException(
                            "Terracotta clustered caches with eventual consistency and synchronous writes are not supported yet."
                                    + " You can fix this by either making the cache in 'strong' consistency mode "
                                    + "(<terracotta consistency=\"strong\"/>) or turning off synchronous writes.");
                }
                if (getCacheConfiguration().getTransactionalMode().isTransactional() && consistency == Consistency.EVENTUAL) {
                    throw new InvalidConfigurationException("Consistency should be " + Consistency.STRONG
                            + " when cache is configured with transactions enabled. "
                            + "You can fix this by either making the cache in 'strong' consistency mode "
                            + "(<terracotta consistency=\"strong\"/>) or turning off transactions.");
                }
                if (getCacheConfiguration().getTransactionalMode().isTransactional()
                        && !getCacheConfiguration().getTransactionalMode().equals(CacheConfiguration.TransactionalMode.XA_STRICT)
                        && getCacheConfiguration().getTerracottaConfiguration().isNonstopEnabled()) {
                    LOG.warn("Cache: " + configuration.getName() + " configured both NonStop and transactional non xa_strict."
                            + " NonStop features won't work for this cache!");
                }
                if ((coherent && consistency == Consistency.EVENTUAL) || (!coherent && consistency == Consistency.STRONG)) {
                    throw new InvalidConfigurationException("Coherent and consistency attribute values are conflicting. "
                            + "Please remove the coherent attribute as its deprecated.");
                }
                int maxConcurrency = Integer.getInteger(EHCACHE_CLUSTERREDSTORE_MAX_CONCURRENCY_PROP,
                        DEFAULT_EHCACHE_CLUSTERREDSTORE_MAX_CONCURRENCY);
                if (getCacheConfiguration().getTerracottaConfiguration().getConcurrency() > maxConcurrency) {
                    throw new InvalidConfigurationException("Maximum supported concurrency for Terracotta clustered caches is "
                            + maxConcurrency + ". Please reconfigure cache '" + getName() + "' with concurrency value <= " + maxConcurrency
                            + " or use system property '" + EHCACHE_CLUSTERREDSTORE_MAX_CONCURRENCY_PROP + "' to override the default");
                }
                if (getCacheConfiguration().getMaxElementsOnDisk() == 0) {
                    LOG.warn("Performance may degrade and server disks could run out of space!\nThe distributed cache {} does not have " +
View Full Code Here

            }
        }

        if (invalid) {
            String errorMessage = "Errors:" + error.toString();
            throw new InvalidConfigurationException(errorMessage);
        }
    }
View Full Code Here

TOP

Related Classes of net.sf.ehcache.config.InvalidConfigurationException

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.