Creating Necessary Resources in Production

 < Day Day Up > 

The wlw-manifest.xml file has tags to specify the resources that need to be created. Listing 15.1 shows the wlw-manifest file created for the Process application from Chapter 11, "Working with Workflows."

Listing 15.1. The wlw-manifest.xml File
 <?xml version="1.0" encoding="UTF-8"?> <con:wlw-manifest xmlns:con="http://www.bea.com/2003/03/wlw/config/">   <con:project name="RoomServiceAppWeb">    <con:async-request-queue>RoomServiceAppWeb.queue.AsyncDispatcher    </con:async-request-queue>    <con:async-request-error-queue>RoomServiceAppWeb.queue.AsyncDispatcher_error    </con:async-request-error-queue>    <con:top-level-component class-name="processes.process" component-type="JPD">      <con:conversation-state-table table-name="JPD_CEAPPWEB_PROCESSES_PROCESS"/>        <con:external-callbacks/>         </con:top-level-component>    </con:project> </con:wlw-manifest> 

Database Tables

Database tables are used to store conversational state. For each <con:conversation-state-table> element, a corresponding table must be created. Listing 15.2 is an example of the SQL statement for creating the table specified in the wlw-manifest.xml file from Listing 15.1.

Listing 15.2. SQL for PointBase
 CREATE TABLE JPD_CEAPPWEB_PROCESSES_PROCESS ( CG_ID varchar(768) not null, LAST_ACCESS_TIME bigint, CG_DATA BLOB(4M), CONSTRAINT PK_JPD_CEAPPWEB_PROCESSES_PROCESS_ID  PRIMARY KEY(CG_ID) 

CG_ID stores the conversation ID generated by the server, and CG_DATA stores all the information used during this conversation.

JMS Queues

Java Messaging Service (JMS) queues are used for asynchronous Web services and processes. For each <con:async-request-queue> and <con:async-request-error-queue> element, corresponding queues must be created. These JMS queues are always in pairs. The association is made by using the ErrorDestination attribute in the <con:async-request-queue> JMS queue. To create these queues using the Administration Console, follow these steps

  1. Start the Administration Console using the URL http://< IP address of the admin server >:< port of the server >/console (for example, http://127.0.0.1:7001/console ). Supply the administrator username and password.

  2. In the pane on the left, navigate to Services, JMS, Servers, Server-Name , Destinations. Figure 15.2 shows Destinations selected for cgJMSServer.

    Figure 15.2. Selecting the Destinations folder.

    graphics/15fig02.jpg

  3. On the right, click the Configure a New JMS Queue link, as shown in Figure 15.3.

    Figure 15.3. Creating a new JMS queue.

    graphics/15fig03.jpg

  4. Enter any logical name for the JMS queue name, and enter the Java Naming and Directory Interface (JNDI) name specified in the <con:async-request-queue> tag (see Figure 15.4). The JNDI name is used to send or receive messages from the queue. Make sure you create a second queue for the error destination, using the value in the <con:async-request-error-queue> tag as the JNDI name.

    Figure 15.4. Specifying the JMS queue name and JNDI name.

    graphics/15fig04.jpg

  5. Click the Create button to create the queue, as shown in Figure 15.5.

    Figure 15.5. Creating the JMS queue.

    graphics/15fig05.jpg

  6. In the pane on the left, click the JMS queue created for the <con:async-request-queue> element. In this example, you click the RoomServiceAppWeb.queue.AsyncDispatcher queue created in the previous step.

  7. Click the Redelivery tab and use the Error Destination drop-down list to select the corresponding error delivery queue, as shown in Figure 15.6. RoomServiceAppWeb.queue.AsyncDispatcher_error is the error delivery queue created as specified in the wlw-manifest.xml file you saw earlier in Listing 15.1.

    Figure 15.6. Setting the ErrorDestination attribute.

    graphics/15fig06.jpg

  8. Click Apply, as shown in Figure 15.7.

    Figure 15.7. Applying the changes.

    graphics/15fig07.jpg

Security Role Restrictions for Controls

Security role restrictions are placed on controls that can receive external callbacks. Listing 15.3 shows an example of the elements that specify this information for the Process application used as an example earlier.

Listing 15.3. An Example of <con:external-callbacks/>
 <con:top-level-component class-name="processes.process"                                      component-type="JPD"> <con:external-callbacks/>   <con:security-roles>      <con:role-name>Managers</con:role-name>   </con:security-roles> </con:top-level-component> 

To define a new security policy, you use the Administration Console. Right-click the name of the Web application under Deployments, Web Application Modules, and choose Define Security Policy.

In the Policy Condition drop-down list, select the Caller Is Granted the Role condition and click Add (see Figure 15.8). This opens a dialog box where you can supply the role name defined in the wlw-manifest.xml file. You can also use the other conditions in this list, depending on your needs.

Figure 15.8. Selecting the condition to add to the security policy.

graphics/15fig08.gif

 < Day Day Up > 


BEA WebLogic Workshop 8.1 Kick Start
BEA WebLogic Workshop 8.1 Kick Start: Simplifying Java Web Applications and J2EE
ISBN: 0672326221
EAN: 2147483647
Year: 2004
Pages: 138

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net