J2ee Deployment Diagram
|
|
In this section you will learn how to navigate in your J2ee Deployment Diagram and set up configuration.
Please note that you can create a J2ee deployment diagram from scratch or use a wizard from a class diagram.
If you want to set up a deployment diagram manually, you have to make sure you set the right stereotypes to the components.
|
-
A component with the ear stereotype represents an Application.
-
A component with the war stereotype represents a Web Module.
-
A component with the jar stereotype represents an Ejb Module.
-
A component with the servlet stereotype represents a list of servlets.
-
A component with the bean stereotype represents a list of ejb.
|
This section covers the following elements:
-
|
1. Run Xdoclet from a class diagram
We need now to generate Beans interfaces using XDoclet.
From the Class Diagram you can:
-
Create an associated deployment diagram. This allows you to generate
a deployment diagram from a Class Diagram.
-
Choose deployment diagram...This allows you to associate this
Class Diagram with an existing Deployment Diagram.
-
Run XDoclet. This allows you to run XDoclet and create the Java
classes needed for your application.
|
|
2. Deployment diagram creation wizard
We would like to create an associated deployment diagram for our class diagram.
Open the class diagram editor popup menu->J2ee Profile->Create associated deployment diagram.
|
|
2.1 Server selection
Select the server name by using the drop down arrow.
Server configuration is explained in .
Select JBoss application server.
|
|
2.2. Enterprise deployment ARchive (EAR) definition
You can create an application which includes web and ejb modules.
|
|
2.3. Web ARchive (WAR) definition
You can choose to use web modules.
You can either use one module containing all the servlets which are
presently located on the diagram or define modules manually.
|
|
2.4. Ejb modules definition
This page works in the same way as the web module definition page.
|
|
Click on the finish button and wait for the end of the Progress Information.
|
|
The deployment diagram should look like the following image.
|
|
3. Customization of the created diagram
Select the servlet stereotype component in the diagram editor.
|
|
Open the servlet component properties popup menu->properties
|
|
Enter the content tab, which is specific to servlet components.
We can change the servlet list held by this component.
|
|
Select the web module component inside the JBoss node and click on it.
Open the web module popup menu->properties
|
|
Select the web module component inside the JBoss node and click on it.
Open the web module popup menu->properties
|
|
Enter the War content tab, which is specific to war components.
Select the Ant war task and select the content of the war file that will be generated at
deployment.
|
|
Select the MyApp component inside the JBoss node and click on it.
|
|
Open the MyApp component popup menu->properties
|
|
Enter the Ear content tab, which is specific to ear components.
In the left pane we can see all the modules which are used inside this application.
|
|
4. Starting Jboss server
By selecting the JBoss node we can:
- Start the server
- Debug the server
- Stop the server
We can start the Jboss server from the deployment diagram editor popup menu.
Open the diagram editor popup menu->J2ee Profile->Start
|
|
The console view shows the start of Jboss.
|
|
5. Deploying modules/application
On each module and application we can manage the deployment of the component by the mean of its context menu.
Select the MyApp component inside the JBoss node and click on it.
The menu group contains three items.
- Deploy (or redeploy if it is not the first time deployed)
- Undeploy
- Deploy to (to choose or change the deployment location).
Open the popup menu->J2ee Profile->Deploy to...
|
|
Select Jboss 3.2.2RC4 and click on the OK button.
This section has been set up in .
|
|
Wait for the end of the progress monitor.
|
|
|