}
time = now();
JaxRpcCodegenFactory jaxrpcFactory =
JaxRpcCodegenFactory.newInstance();
JaxRpcCodegenAdapter jaxrpcAdapter = jaxrpcFactory.getAdapter();
jaxrpcAdapter.run(ejbcCtx);
ejbcCtx.getTiming().jaxrpcGenerationTime += (now() - time);
if (_logger.isLoggable(Level.FINE)) {
_logger.log(Level.FINE, "ejbc.end_jaxrpc_generation",
application.getRegistrationName());
}
// this should not be here but in AppDeployer or such but since
// the archive file is saved at then end of this ejbc process, and
// the servlet swith may require to save the DDs, I decided to put
// it here until we rework the codegen pluggability.
WebServiceDeployer deployer =
new WebServiceDeployer(ejbcCtx.getDeploymentRequest());
deployer.doWebServiceDeployment(ejbcCtx.getDescriptor(),
ejbcCtx.getSrcDir());
// ---- END OF WEB SERVICES ----------------------------------------
// ---- RMIC ALL STUB CLASSES --------------------------------------
Set allStubClasses = new HashSet();
if( generateRmicStubs ) {
// stubs classes for ejbs within this app that need rmic
Set ejbStubClasses = getStubClasses(jcl, ejbHomeInterfaces,
ejbRemoteInterfaces, ejbRemoteDeploymentDescriptors);
// stubs for any J2EE components within the app that are clients
// of remote ejbs but where the target ejbs are not defined within
// the app
Set ejbClientStubClasses =
getEjbClientStubClasses(jcl, application, ejbStubClasses);
allStubClasses.addAll(ejbStubClasses);
allStubClasses.addAll(ejbClientStubClasses);
// Compile and RMIC all Stubs
time = now();
compileAndRmic(classPath, ejbcCtx.getRmicOptions(), allStubClasses,
stubsDir, gnrtrTMP);
ejbcCtx.getTiming().RMICompileTime += (now() - time);
}
// ---- END OF RMIC ALL STUB CLASSES -------------------------------
// Create list of all server files and client files
Vector allClientFiles = new Vector();
// assemble the client files
addGeneratedFiles(allStubClasses, allClientFiles, stubsDir);
if( remote30Files.size() > 0 ) {
Iterator itr = remote30Files.iterator();
if (itr != null) {
for (;itr.hasNext();) {
String file = (String) itr.next();
allClientFiles.add(file.replace(".java", ".class"));
}
}
}
if (jaxrpcAdapter!=null) {
Iterator itr = jaxrpcAdapter.getListOfBinaryFiles();
if (itr!=null) {
for (;itr.hasNext();) {
allClientFiles.add(itr.next());
}
}
}
// client zip entries
ZipItem[] clientStubs = getClientZipEntries(allClientFiles, stubsDir);
_logger.log(Level.FINE, "ejbc.end", application.getRegistrationName());
ejbcCtx.getTiming().totalTime = now() - startTime;
// sets the old thread context classloader back
// this allows the EJB class loader to be garbage collected
if(System.getSecurityManager() == null) {
Thread.currentThread().setContextClassLoader(oContextCL);
} else {
java.security.AccessController.doPrivileged(
new java.security.PrivilegedAction() {
public Object run() {
Thread.currentThread().setContextClassLoader(oContextCL);
return null;
}
}
);
}
/*
*Clean up, releasing the class loader.
*/
jaxrpcAdapter.done();
return clientStubs;
}