Java Code Examples for org.apache.axis2.engine.AxisConfiguration#getServices()

The following examples show how to use org.apache.axis2.engine.AxisConfiguration#getServices() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: DBUtils.java    From micro-integrator with Apache License 2.0 6 votes vote down vote up
/**
 * This method returns the available data services names.
 *
 * @param axisConfiguration Axis configuration
 * @return names of available data services
 * @throws AxisFault
 */
public static String[] getAvailableDS(AxisConfiguration axisConfiguration) throws AxisFault {
    List<String> serviceList = new ArrayList<>();
    Map<String, AxisService> map = axisConfiguration.getServices();
    Set<String> set = map.keySet();
    for (String serviceName : set) {
        AxisService axisService = axisConfiguration.getService(serviceName);
        Parameter parameter = axisService.getParameter(DBConstants.AXIS2_SERVICE_TYPE);
        if (parameter != null) {
            if (DBConstants.DB_SERVICE_TYPE.equals(parameter.getValue().toString())) {
                serviceList.add(serviceName);
            }
        }
    }
    return serviceList.toArray(new String[serviceList.size()]);
}
 
Example 2
Source File: DBUtils.java    From micro-integrator with Apache License 2.0 5 votes vote down vote up
/**
 * This method verifies whether there's an existing data service for the given name.
 *
 * @param axisConfiguration Axis configuration
 * @param dataService       Data service
 * @return Boolean (Is available)
 * @throws AxisFault
 */
public static boolean isAvailableDS(AxisConfiguration axisConfiguration, String dataService) throws AxisFault {
    Map<String, AxisService> map = axisConfiguration.getServices();
    AxisService axisService = map.get(dataService);
    if (axisService != null) {
        Parameter parameter = axisService.getParameter(DBConstants.AXIS2_SERVICE_TYPE);
        if (parameter != null) {
            if (DBConstants.DB_SERVICE_TYPE.equals(parameter.getValue().toString())) {
                return true;
            }
        }
    }
    return false;
}
 
Example 3
Source File: TargetServiceObserver.java    From carbon-commons with Apache License 2.0 5 votes vote down vote up
public void init(AxisConfiguration axisConfig) {
    this.axisConfiguration = axisConfig;
    // There may be services deployed already
    // We need to send Hello messages for such services
    // Services deployed later will be picked up by the serviceUpdate event
    Map<String, AxisService> services = axisConfig.getServices();
    for (AxisService service : services.values()) {
        sendHello(service);
    }
}