log.info(Messages.getMessage(DeploymentErrorMsgs.DEPLOYING_POJO,
className,
deploymentFileData.getFile().getAbsolutePath()));
JamServiceFactory factory = JamServiceFactory.getInstance();
JamServiceParams jamServiceParams = factory.createServiceParams();
jamServiceParams.addClassLoader(classLoader);
jamServiceParams.includeClass(className);
JamService service = factory.createService(jamServiceParams);
JamClassIterator jClassIter = service.getClasses();
while (jClassIter.hasNext()) {
JClass jclass = (JClass) jClassIter.next();
if (jclass.getQualifiedName().equals(className)) {
/**
* Schema genertaion done in two stage 1. Load all the methods and
* create type for methods parameters (if the parameters are Bean
* then it will create Complex types for those , and if the
* parameters are simple type which decribe in SimpleTypeTable
* nothing will happen) 2. In the next stage for all the methods
* messages and port types will be creteated
*/
JAnnotation annotation =
jclass.getAnnotation(AnnotationConstants.WEB_SERVICE);
if (annotation != null) {
// try to see whether JAX-WS jars in the class path , if so use them
// to process annotated pojo else use annogen to process the pojo class
AxisService axisService;
axisService =
createAxisService(classLoader,
className,
deploymentFileData.getFile().toURL());
configCtx.getAxisConfiguration().addService(axisService);
} else {
AxisService axisService =
createAxisServiceUsingAnnogen(className,
classLoader,
deploymentFileData.getFile().toURL());
configCtx.getAxisConfiguration().addService(axisService);
}
}
}
}
} else if ("jar".equals(extension)) {
ArrayList classList;
FileInputStream fin = null;
ZipInputStream zin = null;
try {
fin = new FileInputStream(deploymentFileData.getAbsolutePath());
zin = new ZipInputStream(fin);
ZipEntry entry;
classList = new ArrayList();
while ((entry = zin.getNextEntry()) != null) {
String name = entry.getName();
if (name.endsWith(".class")) {
classList.add(name);
}
}
zin.close();
fin.close();
} catch (Exception e) {
log.debug(Messages.getMessage(DeploymentErrorMsgs.DEPLOYING_EXCEPTION,e.getMessage()),e);
throw new DeploymentException(e);
} finally {
if (zin != null) {
zin.close();
}
if (fin != null) {
fin.close();
}
}
ArrayList axisServiceList = new ArrayList();
for (int i = 0; i < classList.size(); i++) {
String className = (String) classList.get(i);
ArrayList urls = new ArrayList();
urls.add(deploymentFileData.getFile().toURL());
urls.add(configCtx.getAxisConfiguration().getRepository());
String webLocation = DeploymentEngine.getWebLocationString();
if (webLocation != null) {
urls.add(new File(webLocation).toURL());
}
ClassLoader classLoader = Utils.createClassLoader(
urls,
configCtx.getAxisConfiguration().getSystemClassLoader(),
true,
(File) configCtx.getAxisConfiguration().
getParameterValue(Constants.Configuration.ARTIFACTS_TEMP_DIR));
Thread.currentThread().setContextClassLoader(classLoader);
className = className.replaceAll(".class", "");
className = className.replaceAll("/", ".");
JamServiceFactory factory = JamServiceFactory.getInstance();
JamServiceParams jamServiceParams = factory.createServiceParams();
jamServiceParams.addClassLoader(classLoader);
jamServiceParams.includeClass(className);
JamService service = factory.createService(jamServiceParams);
JamClassIterator jClassIter = service.getClasses();
while (jClassIter.hasNext()) {
JClass jclass = (JClass) jClassIter.next();
if (jclass.getQualifiedName().equals(className)) {
/**