for (int i = 0; i < wsToDeploy.size(); i++) {
currentArchiveFile = (ArchiveFileData) wsToDeploy.get(i);
boolean explodedDir = currentArchiveFile.getFile().isDirectory();
int type = currentArchiveFile.getType();
try {
ArchiveReader archiveReader;
StringWriter errorWriter = new StringWriter();
switch (type) {
case SERVICE:
currentArchiveFile.setClassLoader(explodedDir, axisConfig.getServiceClassLoader());
archiveReader = new ArchiveReader();
String serviceStatus = "";
try {
HashMap wsdlservice = archiveReader.processWSDLs(currentArchiveFile, this);
// AxisService service = archiveReader.generateService(currentArchiveFile.getAbsolutePath());
AxisServiceGroup sericeGroup =
new AxisServiceGroup(axisConfig);
sericeGroup.setServiceGroupClassLoader(currentArchiveFile.getClassLoader());
ArrayList serviceList = archiveReader.processServiceGroup(
currentArchiveFile.getAbsolutePath(),
this,
sericeGroup, explodedDir, wsdlservice, axisConfig);
addServiceGroup(sericeGroup, serviceList);
log.info(Messages.getMessage(
DeploymentErrorMsgs.DEPLOYING_WS, currentArchiveFile.getName()));
} catch (DeploymentException de) {
log.info(Messages.getMessage(DeploymentErrorMsgs.INVALID_SERVICE,
currentArchiveFile.getName(), de.getMessage()));
PrintWriter error_ptintWriter = new PrintWriter(errorWriter);
de.printStackTrace(error_ptintWriter);
serviceStatus = "Error:\n" +
errorWriter.toString();
} catch (AxisFault axisFault) {
log.info(Messages.getMessage(DeploymentErrorMsgs.INVALID_SERVICE,
currentArchiveFile.getName(), axisFault.getMessage()));
PrintWriter error_ptintWriter = new PrintWriter(errorWriter);
axisFault.printStackTrace(error_ptintWriter);
serviceStatus = "Error:\n" +
errorWriter.toString();
} catch (Exception e) {
log.info(Messages.getMessage(DeploymentErrorMsgs.INVALID_SERVICE,
currentArchiveFile.getName(), e.getMessage()));
PrintWriter error_ptintWriter = new PrintWriter(errorWriter);
e.printStackTrace(error_ptintWriter);
serviceStatus = "Error:\n" +
errorWriter.toString();
} finally {
if (serviceStatus.startsWith("Error:")) {
axisConfig.getFaultyServices().put(getAxisServiceName(currentArchiveFile.getName()),
serviceStatus);
}
currentArchiveFile = null;
}
break;
case MODULE:
currentArchiveFile.setClassLoader(explodedDir, axisConfig.getModuleClassLoader());
archiveReader = new ArchiveReader();
String moduleStatus = "";
try {
ModuleDescription metaData = new ModuleDescription();
metaData.setModuleClassLoader(currentArchiveFile.getClassLoader());
metaData.setParent(axisConfig);
archiveReader.readModuleArchive(currentArchiveFile.getAbsolutePath(),
this,
metaData, explodedDir, axisConfig);
addNewModule(metaData);
log.info(Messages.getMessage(DeploymentErrorMsgs.DEPLOYING_MODULE,
metaData.getName().getLocalPart()));