Package org.apache.sling.discovery

Examples of org.apache.sling.discovery.InstanceFilter


      }
        final TopologyView tv = this.currentView;
        @SuppressWarnings("unchecked")
        Set<InstanceDescription> instances = ( tv == null ? (Set<InstanceDescription>)Collections.EMPTY_SET :

                tv.findInstances(new InstanceFilter() {

                    public boolean accept(InstanceDescription instance) {
                        String slingId = instance.getSlingId();
                      if (logger.isDebugEnabled()) {
                          logger.debug("renderProperties/picks: slingId={}", slingId);
View Full Code Here


     * find a particular instance in the topology
     */
    private InstanceDescription findInstance(final TopologyView view,
            final String slingId) {
        Set<InstanceDescription> foundInstances = view
                .findInstances(new InstanceFilter() {

                    public boolean accept(InstanceDescription instance) {
                        return instance.getSlingId().equals(slingId);
                    }
                });
View Full Code Here

        final DefaultInstanceDescriptionImpl id = TopologyTestHelper
                .createAndAddInstanceDescription(newView, newView
                        .getClusterViews().iterator().next());
        TopologyTestHelper.createAndAddInstanceDescription(newView, newView
                .getClusterViews().iterator().next());
        assertEquals(4, newView.findInstances(new InstanceFilter() {

            public boolean accept(InstanceDescription instance) {
                return true;
            }
        }).size());
        assertEquals(1, newView.findInstances(new InstanceFilter() {

            public boolean accept(InstanceDescription instance) {
                return instance.getSlingId().equals(id.getSlingId());
            }
        }).size());
        assertEquals(1, newView.findInstances(new InstanceFilter() {

            public boolean accept(InstanceDescription instance) {
                return instance.isLeader();
            }
        }).size());
        assertEquals(1, newView.findInstances(new InstanceFilter() {
            boolean first = true;

            public boolean accept(InstanceDescription instance) {
                if (!first) {
                    return false;
View Full Code Here

TOP

Related Classes of org.apache.sling.discovery.InstanceFilter

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.