public static void deployModuleServices(AxisModule module,
ConfigurationContext configCtx) throws AxisFault {
try {
AxisConfiguration axisConfig = configCtx.getAxisConfiguration();
ArchiveReader archiveReader = new ArchiveReader();
PhasesInfo phasesInfo = axisConfig.getPhasesInfo();
ClassLoader moduleClassLoader = module.getModuleClassLoader();
ArrayList services = new ArrayList();
InputStream in = moduleClassLoader.getResourceAsStream("aars/aars.list");
if (in != null) {
BufferedReader input;
try {
input = new BufferedReader(new InputStreamReader(in));
String line;
while ((line = input.readLine()) != null) {
services.add(line);
}
input.close();
} catch (IOException ex) {
ex.printStackTrace();
}
}
if (services.size() > 0) {
for (int i = 0; i < services.size(); i++) {
String servicename = (String) services.get(i);
if (servicename == null || "".equals(servicename)) {
continue;
}
InputStream fin = moduleClassLoader.getResourceAsStream("aars/" + servicename);
if (fin == null) {
throw new AxisFault("No service archive found : " + servicename);
}
File inputFile = Utils.createTempFile(servicename,
fin,
(File)axisConfig.getParameterValue(Constants.Configuration.ARTIFACTS_TEMP_DIR));
DeploymentFileData filedata = new DeploymentFileData(inputFile,
DeploymentConstants.TYPE_SERVICE);
filedata.setClassLoader(false,
moduleClassLoader,
(File)axisConfig.getParameterValue(Constants.Configuration.ARTIFACTS_TEMP_DIR));
HashMap wsdlservice = archiveReader.processWSDLs(filedata);
if (wsdlservice != null && wsdlservice.size() > 0) {
Iterator servicesitr = wsdlservice.values().iterator();
while (servicesitr.hasNext()) {
AxisService service = (AxisService) servicesitr.next();
Iterator operations = service.getOperations();
while (operations.hasNext()) {
AxisOperation axisOperation = (AxisOperation) operations.next();
phasesInfo.setOperationPhases(axisOperation);
}
}
}
AxisServiceGroup serviceGroup = new AxisServiceGroup(axisConfig);
serviceGroup.setServiceGroupClassLoader(
filedata.getClassLoader());
ArrayList serviceList = archiveReader.processServiceGroup(
filedata.getAbsolutePath(), filedata,
serviceGroup, false, wsdlservice,
configCtx);
for (int j = 0; j < serviceList.size(); j++) {
AxisService axisService = (AxisService) serviceList.get(j);