*/
private void generateAndRecordEARFacadeContents(
final DeploymentContext dc,
final String appClientGroupList) throws IOException {
final ClientArtifactsManager clientArtifactsManager = ClientArtifactsManager.get(dc);
final Manifest manifest = new Manifest();
Attributes mainAttrs = manifest.getMainAttributes();
mainAttrs.put(Attributes.Name.MANIFEST_VERSION, "1.0");
mainAttrs.put(Attributes.Name.MAIN_CLASS, GLASSFISH_APPCLIENT_GROUP_FACADE_CLASS_NAME);
mainAttrs.put(GLASSFISH_APPCLIENT_GROUP, appClientGroupList);
//Now manifest is ready to be written.
final File manifestFile = File.createTempFile("groupMF", ".MF");
final OutputStream manifestOutputStream = new BufferedOutputStream(new FileOutputStream(manifestFile)); //facadeArchive.putNextEntry(JarFile.MANIFEST_NAME);
try {
manifest.write(manifestOutputStream);
} finally {
manifestOutputStream.close();
}
clientArtifactsManager.add(manifestFile, JarFile.MANIFEST_NAME, true /* isTemp */);
writeMainClass(clientArtifactsManager);
/*
* If the EAR contains a permissions file we need to make sure it's added
* to the group-level generated facade JAR.
*/
final File permissionsFile = getPermissionsFile();
if (permissionsFile.canRead()) {
clientArtifactsManager.add(permissionsFile, PERMISSIONS_XML_PATH, false /* isTemp */);
}
/*
* Higher-level code will copy the files generated here plus other deployers'
* artifacts - such as generated stubs - into the generated client JAR