Examples of HealthCheckFilter


Examples of org.apache.sling.hc.util.HealthCheckFilter

     */
    @Override
    public List<HealthCheckExecutionResult> execute(final String... tags) {
        logger.debug("Starting executing checks for {}", tags == null ? "*" : tags);

        final HealthCheckFilter filter = new HealthCheckFilter(this.bundleContext);
        try {
            final ServiceReference[] healthCheckReferences = filter.getTaggedHealthCheckServiceReferences(tags);

            return this.execute(healthCheckReferences);
        } finally {
            filter.dispose();
        }
    }
View Full Code Here

Examples of org.apache.sling.hc.util.HealthCheckFilter

    protected final void activate(final ComponentContext componentContext) {
        this.bundleContext = componentContext.getBundleContext();
        this.bundleContext.addServiceListener(this);

        int count = 0;
        HealthCheckFilter healthCheckFilter = new HealthCheckFilter(bundleContext);
        final ServiceReference[] healthCheckReferences = healthCheckFilter.getTaggedHealthCheckServiceReferences(new String[0]);
        for (ServiceReference serviceReference : healthCheckReferences) {
            HealthCheckMetadata healthCheckMetadata = new HealthCheckMetadata(serviceReference);
            if (isAsync(healthCheckMetadata)) {
                if (scheduleHealthCheck(healthCheckMetadata)) {
                    count++;
View Full Code Here

Examples of org.apache.sling.hc.util.HealthCheckFilter

        testServices.add(new TestHealthCheck("foo"));
        testServices.add(new TestHealthCheck("bar"));
        testServices.add(new TestHealthCheck("foo", "bar"));
        testServices.add(new TestHealthCheck("other", "thing"));
        testServices.add(new TestHealthCheck());
        filter = new HealthCheckFilter(bundleContext);
    }
View Full Code Here

Examples of org.apache.sling.hc.util.HealthCheckFilter

        // test check is hcRef
        compositeHealthCheck.setReferenceToThis(hcRef);
        compositeHealthCheck.setFilterTags(filterTags);

        compositeHealthCheck.setHealthCheckFilter(new HealthCheckFilter(null) { // not using @Spy because varargs matcher does not work with spies

            @Override
            public ServiceReference[] getTaggedHealthCheckServiceReferences(String... tags) {
                ServiceReference[] result = new ServiceReference[] {};
                if (tags.length > 0) {
View Full Code Here

Examples of org.apache.sling.hc.util.HealthCheckFilter

        // test check is hcRef1
        compositeHealthCheck.setReferenceToThis(hcRef1);
        compositeHealthCheck.setFilterTags(filterTags);

        compositeHealthCheck.setHealthCheckFilter(new HealthCheckFilter(null) {

            @Override
            public ServiceReference[] getTaggedHealthCheckServiceReferences(String... tags) { // not using @Spy because varargs matcher does not work with spies
                ServiceReference[] result = new ServiceReference[] {};
                if (tags.length > 0) {
View Full Code Here

Examples of org.apache.sling.hc.util.HealthCheckFilter

    private final BundleContext bundleContext;
       
    TestBridgeContext(BundleContext bundleContext, String [] tags) {
        this.bundleContext = bundleContext;
        this.tags = tags;
        this.filter = new HealthCheckFilter(bundleContext);
    }
View Full Code Here

Examples of org.apache.sling.hc.util.HealthCheckFilter

    private HealthCheckFilter healthCheckFilter;
   
    @Activate
    protected void activate(final ComponentContext ctx) {
        bundleContext = ctx.getBundleContext();
        healthCheckFilter = new HealthCheckFilter(bundleContext);
        referenceToThis = getReferenceByPid(PropertiesUtil.toString(ctx.getProperties().get(Constants.SERVICE_PID), "-1"));

        filterTags = PropertiesUtil.toStringArray(ctx.getProperties().get(PROP_FILTER_TAGS), new String[] {});
        log.debug("Activated, will select HealthCheck having tags {}", Arrays.asList(filterTags));
    }
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.