RADK Project
Builder-Deployer-Runner ----------------------------------- The EJB, RESTful WebServices, and WebUI code generated by the RADK tool kit are built and deployed in the GlassFish Application server. The EJB module is packaged as simple jar file. The RESTful WebServices and WebUI modules are packaged as war files. Although RADK tool kit is independent of any IDE, it creates all the modules as NetBeans projects. As a result, RADK follows the NetBeans folder structure for building. RADK uses the Apache ant tool, which resides in library folder of GlassFish. Deploying is done using asadmin deploy command of GlassFish. Some of the general files used for building are discussed below. The build-impl.xml created by the RADK acts a build.xml file for the ant. It contains all the necessary processing instructions for ant to do the building task for the generated web application. The project.properties file contains the classpath for the libraries that are referred by the module. The private.properties file contains the classpath for the JEE 5 libraries, which are present in the GlassFish server. The RESTful WebServices module references the EJB jar. The WebUI module references EJB jar and RESTful WebServices war. The building and deploying process is done sequentially for the EJB, RESTful, and WebUI modules respectively. The below code snippet shows the building and deploying process for RESTful WebServies. Similarly, it is done for EJB and WebUI module.
public boolean build() {
try {
System.out.println("started building");
glassFishHome = WebServiceGenerator.replaceBackSlash(Parameters.glassFishServerFolder);
String RESTFolder = WebServiceGenerator.replaceBackSlash(Parameters.restfulWsFolder);
String buildREST = glassFishHome + "\\lib\\ant\\bin\\ant.bat -buildfile \"" + RESTFolder + "\\build.xml\" dist";
invokeCommand(buildREST);
return true;
} catch (Exception e) {
e.printStackTrace();
return false;
}
}
public boolean deploy() {
try {
System.out.println("started deploying");
String deployREST = glassFishHome + "\\bin\\asadmin.bat deploy --user admin" + " " + "\"" + Parameters.restfulWsFolder + "\\dist\\" + Parameters.projectName + "REST.war" + "\"";
invokeCommand(deployREST);
return true;
} catch (Exception ex) {
return false;
}
}
— RADK Project
|