Examples of ClusterView


Examples of org.apache.sling.discovery.ClusterView

            }

            Announcement topologyAnnouncement = new Announcement(
                    clusterViewService.getSlingId());
            topologyAnnouncement.setServerInfo(serverInfo);
            final ClusterView clusterView = clusterViewService
                    .getClusterView();
            topologyAnnouncement.setLocalCluster(clusterView);
            if (force) {
                logger.debug("ping: sending a resetBackoff");
                topologyAnnouncement.setResetBackoff(true);
View Full Code Here

Examples of org.apache.sling.discovery.ClusterView

            result.setLoop(true);
            return result;
        }
        final String localClusterViewJSON = announcement
                .getString("localClusterView");
        final ClusterView localClusterView = asClusterView(localClusterViewJSON);
        final JSONArray subAnnouncements = announcement
                .getJSONArray("topologyAnnouncements");

        if (announcement.has("inherited")) {
            final Boolean inherited = announcement.getBoolean("inherited");
View Full Code Here

Examples of org.apache.sling.discovery.ClusterView

    private static JSONObject asJSON(final InstanceDescription instanceDescription)
            throws JSONException {
        JSONObject obj = new JSONObject();
        obj.put("slingId", instanceDescription.getSlingId());
        obj.put("isLeader", instanceDescription.isLeader());
        ClusterView cluster = instanceDescription.getClusterView();
        if (cluster != null) {
            obj.put("cluster", cluster.getId());
        }
        JSONObject propertiesObj = new JSONObject();
        Map<String, String> propertiesMap = instanceDescription.getProperties();
        for (Iterator<Entry<String, String>> it = propertiesMap.entrySet()
                .iterator(); it.hasNext();) {
View Full Code Here

Examples of org.apache.sling.discovery.ClusterView

                    // marking as 'loop'
                    replyAnnouncement.setLoop(true);
                    backoffInterval = config.getBackoffStandbyInterval();
                } else {
                    // normal, successful case: replying with the part of the topology which this instance sees
                    final ClusterView clusterView = clusterViewService
                            .getClusterView();
                    replyAnnouncement.setLocalCluster(clusterView);
                    announcementRegistry.addAllExcept(replyAnnouncement, clusterView,
                            new AnnouncementFilter() {
   
View Full Code Here

Examples of org.apache.sling.discovery.ClusterView

    public Set<ClusterView> getClusterViews() {
        Set<ClusterView> result = new HashSet<ClusterView>();
        for (Iterator<InstanceDescription> it = instances.iterator(); it
                .hasNext();) {
            InstanceDescription instance = it.next();
            ClusterView cluster = instance.getClusterView();
            if (cluster != null) {
                result.add(cluster);
            }
        }
        return new HashSet<ClusterView>(result);
View Full Code Here

Examples of org.apache.sling.discovery.ClusterView

        instances.add(myDescription);

        final TopologyEventListener[] registeredServices;
    synchronized ( lock ) {
            registeredServices = this.listeners;
            final ClusterView clusterView = new ClusterView() {

                public InstanceDescription getLeader() {
                    return myDescription;
                }
View Full Code Here

Examples of org.apache.sling.discovery.ClusterView

            this.isLocal = isLocal;
        }

        @Override
        public ClusterView getClusterView() {
            return new ClusterView() {

                @Override
                public InstanceDescription getLeader() {
                    return null;
                }
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.