Examples of DiscoveryServiceFilter


Examples of org.wso2.carbon.discovery.search.DiscoveryServiceFilter

     * @return an array of TargetService instances matching the probe or null
     * @throws Exception if an error occurs while accessing the registry
     */
    public static TargetService[] findServices(Probe probe) throws Exception {       
        ServiceManager serviceManager = new ServiceManager(getRegistry());
        DiscoveryServiceFilter filter = new DiscoveryServiceFilter(probe);

        // Check whether the inactive services should be skipped when searching
        AxisConfiguration axisConfig;
        String tenantDomain = SuperTenantCarbonContext.getCurrentContext().getTenantDomain(true);
        ConfigurationContext mainCfgCtx = ConfigHolder.getInstance().getServerConfigurationContext();
        if (tenantDomain != null) {
            axisConfig = TenantAxisUtils.getTenantAxisConfiguration(tenantDomain, mainCfgCtx);
        } else {
            axisConfig = mainCfgCtx.getAxisConfiguration();
        }
       
        Parameter parameter = axisConfig.getParameter(DiscoveryConstants.SKIP_INACTIVE_SERVICES);
        if (parameter != null && "true".equals(parameter.getValue())) {
            filter.setSkipInactiveServices(true);
        }

        Service[] services = serviceManager.findServices(filter);
        if (services != null && services.length > 0) {
            TargetService[] targetServices = new TargetService[services.length];
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.