Package org.apache.openejb.client

Examples of org.apache.openejb.client.ClusterMetaData


            res.setFailure(e);
            sendErrorResponse("Cannot read ClusterRequest", e, res, out);
            throw (IOException) new IOException().initCause(e);
        }

        ClusterMetaData currentClusterMetaData = data.current();

        if (req.getClusterMetaDataVersion() < currentClusterMetaData.getVersion()){
            if (logger.isDebugEnabled()) {
                URI[] locations = currentClusterMetaData.getLocations();
                if (locations.length < 10) {
                    logger.debug("Sending client updated cluster locations: [" + Join.join(", ", locations) + "]");
                } else {
                    logger.debug("Sending client updated cluster locations: " + locations.length + " locations total");
                }
View Full Code Here


        private ClusterMetaData current;
        private ReadWriteLock sync = new ReentrantReadWriteLock();
        private final java.util.Set set = new LinkedHashSet();

        public Data() {
            this.current = new ClusterMetaData(0);
        }
View Full Code Here

        }

        public boolean add(URI o) {
            Lock lock = sync.writeLock();
            lock.lock();
            ClusterMetaData nextVersion = null;
            try {
                if (set.add(o)) {
                    nextVersion = newClusterMetaData(set, current);
                    return true;
                } else {
View Full Code Here

        }

        public boolean remove(Object o) {
            Lock lock = sync.writeLock();
            lock.lock();
            ClusterMetaData nextVersion = null;
            try {
                if (set.remove(o)) {
                    nextVersion = newClusterMetaData(set, current);
                    return true;
                } else {
View Full Code Here

        }

        private static ClusterMetaData newClusterMetaData(Set set, ClusterMetaData current) {
            URI[] locations = new URI[set.size()];
            set.toArray(locations);
            return new ClusterMetaData(System.currentTimeMillis(), locations);
        }
View Full Code Here

TOP

Related Classes of org.apache.openejb.client.ClusterMetaData

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.