Examples of OverloadedException


Examples of org.apache.ace.deployment.provider.OverloadedException

     */
    public List<ArtifactData> getBundleData(String targetId, String version) throws OverloadedException, IllegalArgumentException {
        try {
            int concurrentUsers = m_usageCounter.incrementAndGet();
            if (m_maximumNumberOfUsers != && m_maximumNumberOfUsers < concurrentUsers) {
                throw new OverloadedException("Too many users, maximum allowed = " + m_maximumNumberOfUsers + ", current = " + concurrentUsers,  (concurrentUsers - m_maximumNumberOfUsers) * BACKOFF_TIME_PER_USER);
            }
            return internalGetBundleData(targetId, version);
        } finally {
            m_usageCounter.getAndDecrement();
        }
View Full Code Here

Examples of org.apache.ace.deployment.provider.OverloadedException

    public List<ArtifactData> getBundleData(String targetId, String versionFrom, String versionTo) throws OverloadedException, IllegalArgumentException {
        try {
            int concurrentUsers = m_usageCounter.incrementAndGet();
            if (m_maximumNumberOfUsers != && m_maximumNumberOfUsers < concurrentUsers) {
                throw new OverloadedException("Too many users, maximum allowed = " + m_maximumNumberOfUsers + ", current = " + concurrentUsers,  (concurrentUsers - m_maximumNumberOfUsers) * BACKOFF_TIME_PER_USER);
            }
            List<ArtifactData> dataVersionFrom = internalGetBundleData(targetId, versionFrom);
            List<ArtifactData> dataVersionTo = internalGetBundleData(targetId, versionTo);
   
            Iterator<ArtifactData> it = dataVersionTo.iterator();
View Full Code Here

Examples of org.apache.ace.deployment.provider.OverloadedException

    @SuppressWarnings("unchecked")
    public List<String> getVersions(String targetId) throws OverloadedException, IllegalArgumentException {
        try {
            int concurrentUsers = m_usageCounter.incrementAndGet();
            if (m_maximumNumberOfUsers != && m_maximumNumberOfUsers < concurrentUsers) {
                throw new OverloadedException("Too many users, maximum allowed = " + m_maximumNumberOfUsers + ", current = " + concurrentUsers,  (concurrentUsers - m_maximumNumberOfUsers) * BACKOFF_TIME_PER_USER);
            }
            List<Version> versionList = new ArrayList<Version>();
            File targetDirectory = new File(m_baseDirectory.getAbsolutePath(), targetId);
            if (targetDirectory.isDirectory()) {
                getVersions(targetId, versionList, targetDirectory);
View Full Code Here

Examples of org.apache.ace.deployment.provider.OverloadedException

    public List<ArtifactData> getBundleData(String targetId, String versionFrom, String versionTo) throws OverloadedException, IllegalArgumentException, IOException {
        try {
            int concurrentUsers = m_usageCounter.incrementAndGet();
            if (m_maximumNumberOfUsers != && m_maximumNumberOfUsers < concurrentUsers) {
                throw new OverloadedException("Too many users, maximum allowed = " + m_maximumNumberOfUsers + ", current = " + concurrentUsers,  (concurrentUsers - m_maximumNumberOfUsers) * BACKOFF_TIME_PER_USER);
            }

            try {
                if (versionFrom != null) {
                    Version.parseVersion(versionFrom);
View Full Code Here

Examples of org.apache.ace.deployment.provider.OverloadedException

    @SuppressWarnings("unchecked")
    public List<String> getVersions(String targetId) throws OverloadedException, IllegalArgumentException, IOException {
        try {
            int concurrentUsers = m_usageCounter.incrementAndGet();
            if (m_maximumNumberOfUsers != && m_maximumNumberOfUsers < concurrentUsers) {
                throw new OverloadedException("Too many users, maximum allowed = " + m_maximumNumberOfUsers + ", current = " + concurrentUsers,  (concurrentUsers - m_maximumNumberOfUsers) * BACKOFF_TIME_PER_USER);
            }

            // check if cache is up to date
            if (isCacheUpToDate()) {
                List<String> result = m_cachedVersionLists.get(targetId);
View Full Code Here

Examples of org.apache.ace.deployment.provider.OverloadedException

        HttpServletResponse httpResponse = (HttpServletResponse) response;
        try {
            filterChain.doFilter(request, response);
        }
        catch (OverloadedException oe) {
            OverloadedException overloadedException = (OverloadedException) oe;
            httpResponse.sendError(HttpServletResponse.SC_SERVICE_UNAVAILABLE);
            httpResponse.setHeader(HTTP_RETRY_AFTER, "" + overloadedException.getBackoffTime());
        }
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.