Package org.jboss.ejb.client

Examples of org.jboss.ejb.client.NodeAffinity


            List<Address> addresses = this.cache.getAdvancedCache().getDistributionManager().locate(key);
            if (!addresses.contains(this.cache.getCacheManager().getAddress())) {
                // Otherwise choose random node from hash targets
                Map.Entry<String, ?> entry = this.registry.getRemoteEntry(addresses.get(random.nextInt(addresses.size())));
                if (entry != null) {
                    return new NodeAffinity(entry.getKey());
                }
            }
        }
        return new NodeAffinity(this.registry.getLocalEntry().getKey());
    }
View Full Code Here


            List<Address> addresses = this.cache.getAdvancedCache().getDistributionManager().locate(key);
            if (!addresses.contains(this.cache.getCacheManager().getAddress())) {
                // Otherwise choose random node from hash targets
                Map.Entry<String, ?> entry = this.registry.getRemoteEntry(addresses.get(random.nextInt(addresses.size())));
                if (entry != null) {
                    return new NodeAffinity(entry.getKey());
                }
            }
        }
        return new NodeAffinity(this.registry.getLocalEntry().getKey());
    }
View Full Code Here

        return this.identifierFactory.createIdentifier();
    }

    @Override
    public Affinity getStrictAffinity() {
        return new NodeAffinity(this.environment.getNodeName());
    }
View Full Code Here

        return this.identifierFactory.createIdentifier();
    }

    @Override
    public Affinity getStrictAffinity() {
        return new NodeAffinity(this.environment.getNodeName());
    }
View Full Code Here

        this.entries.clear();
    }

    @Override
    public Affinity getStrictAffinity() {
        return new NodeAffinity(this.environment.getNodeName());
    }
View Full Code Here

        }
    }

    @Override
    public Affinity getStrictAffinity() {
        return this.beanCache.getCacheConfiguration().clustering().cacheMode().isClustered() ? new ClusterAffinity(this.registry.getGroup().getName()) : new NodeAffinity(this.registry.getLocalEntry().getKey());
    }
View Full Code Here

        return this.beanCache.getCacheConfiguration().clustering().cacheMode().isClustered() ? new ClusterAffinity(this.registry.getGroup().getName()) : new NodeAffinity(this.registry.getLocalEntry().getKey());
    }

    @Override
    public Affinity getWeakAffinity(I id) {
        return this.beanCache.getCacheConfiguration().clustering().cacheMode().isClustered() ? new NodeAffinity(this.registry.getEntry(this.locatePrimaryOwner(id)).getKey()) : Affinity.NONE;
    }
View Full Code Here

        this.environment = environment;
    }

    @Override
    public Affinity getStrictAffinity() {
        return new NodeAffinity(this.environment.getNodeName());
    }
View Full Code Here

        this.environment = environment;
    }

    @Override
    public Affinity getStrictAffinity() {
        return new NodeAffinity(this.environment.getNodeName());
    }
View Full Code Here

            List<Address> addresses = this.cache.getAdvancedCache().getDistributionManager().locate(key);
            if (!addresses.contains(this.cache.getCacheManager().getAddress())) {
                // Otherwise choose random node from hash targets
                Map.Entry<String, ?> entry = this.registry.getRemoteEntry(addresses.get(random.nextInt(addresses.size())));
                if (entry != null) {
                    return new NodeAffinity(entry.getKey());
                }
            }
        }
        return new NodeAffinity(this.registry.getLocalEntry().getKey());
    }
View Full Code Here

TOP

Related Classes of org.jboss.ejb.client.NodeAffinity

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.