public static void deployModuleServices(AxisModule module,
ConfigurationContext configCtx) throws AxisFault {
try {
AxisConfiguration axisConfig = configCtx.getAxisConfiguration();
ArchiveReader archiveReader = new ArchiveReader();
PhasesInfo phasesInfo = axisConfig.getPhasesInfo();
final ClassLoader moduleClassLoader = module.getModuleClassLoader();
ArrayList services = new ArrayList();
final InputStream in = (InputStream)org.apache.axis2.java.security.AccessController
.doPrivileged(new PrivilegedAction() {
public Object run() {
return moduleClassLoader
.getResourceAsStream("aars/aars.list");
}
});
if (in != null) {
BufferedReader input;
try {
input = new BufferedReader(
(InputStreamReader)org.apache.axis2.java.security.AccessController
.doPrivileged(new PrivilegedAction() {
public Object run() {
return new InputStreamReader(in);
}
}));
String line;
while ((line = input.readLine()) != null) {
line = line.trim();
if (line.length() > 0 && line.charAt(0) != '#') {
services.add(line);
}
}
input.close();
} catch (IOException ex) {
ex.printStackTrace();
}
}
if (services.size() > 0) {
for (Object service1 : services) {
final String servicename = (String)service1;
if (servicename == null || "".equals(servicename)) {
continue;
}
InputStream fin = (InputStream)org.apache.axis2.java.security.AccessController
.doPrivileged(new PrivilegedAction() {
public Object run() {
return 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);
filedata.setClassLoader(false,
moduleClassLoader,
(File)axisConfig.getParameterValue(Constants.Configuration.ARTIFACTS_TEMP_DIR),
axisConfig.isChildFirstClassLoading());
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 (Object aServiceList : serviceList) {
AxisService axisService = (AxisService)aServiceList;
Parameter moduleService = new Parameter();