public static AxisService getAnonymousService(AxisConfiguration axisCfg, String serviceKey) throws AxisFault { AxisService service = axisCfg.getService(serviceKey); if (service == null) { synchronized (AnonymousServiceFactory.class) { // double locking, issue found on performance test service = axisCfg.getService(serviceKey); if (service == null) { service = getAxisServiceWithoutCallback(null, axisCfg, serviceKey); } } } return service; } }
/** * Create a new Anonymous Axis service for OUT-IN as default MEP * @param synCfg the Synapse Configuration * @param axisCfg the Axis2 configuration * @param serviceKey key for the service * @return an anonymous service named with the given QoS key */ private static AxisService createAnonymousService(SynapseConfiguration synCfg, AxisConfiguration axisCfg, String serviceKey, boolean setCallback) { try { if (setCallback) { return getAxisServiceWithCallback(synCfg, axisCfg, serviceKey); } else { return getAxisServiceWithoutCallback(synCfg, axisCfg, serviceKey); } } catch (AxisFault e) { handleException( "Error occured while creating an anonymous service for QoS : " + serviceKey, e); } return null; }