Before you begin
The partition stateless session bean (PSSB) is the central
element of a partitioning facility application. It allows the application
server to query the application at startup to determine which partitions
the application requires. It is also used by the application server
to inform the application when a partition is activated or deactivated.
Activated means the HA manager has assigned a partition to this cluster
member (See the section on HA manager policies to see how the HA manager
assigns partitions to a cluster member).
About this task
For this activity we will add a PSSB to the enterprise bean
module created in the previous section.
Procedure
- In WSAD Version 5.1, right click on the enterprise bean
project and click New. This brings up the
New window that allows you to make an Enterprise bean.
- Click EJB in the left frame of the window and then
click on Enterprise Bean on the right. Click on Next.
- Select the EJB module you want to host your PSSB and click Next.
The module selected should already be the correct one since
that is what you clicked on to get to these dialogs.
- Create the session bean. When completed, click Next.
- Select session bean in the radio check boxes.
- Provide a bean name.
- Provide a path source folder information.
- Provide default packaging information.
- Define the local interface and local home interface for
the PSSB.
- Click on the Class... button beside the local
home interface.
- Scroll down and select the PartitionHandlerLocalHome interface.
You can see the package name com.ibm.websphere.wpf from
the wpf.jar file we added to the build path previously. This
dialog only shows interfaces that are usable as local home interfaces.
- Click OK.
- Click on the Class... button beside the local
interface.
- Scroll down and select the PartitionHandlerLocalHome interface.
- Click OK.
- Click on Finish. The PSSB is now
created and included in your enterprise bean module. Next, we need
to add the methods from the PartitionHandler to the implementation
bean for the enterprise bean. There is no built-in mechanism for doing
this easily, but there is a trick we can use to get WSAD to add the
methods very easily.
- Find the bean you just added in your project and double
click on pssb_name (whatever you called your PSSB).
- Change the pssb_name to also implement the PartitionHandlerLocal interface
and click Save.
- Right click on the class name in the outline and generate
the missing methods on the interfaces, by selecting Source > Override
/ Implement methods.
- In the resulting Override / Implement methods window, deselect
the checkbox for the EJBLocalObject and click OK.
This adds the methods from the local interface in one easy
step.
- Remove the PartitionHandlerLocal interface from
the pssb_name and click Save.
Results
Your PSSB is now ready for customization.