A partitioned stateless session bean (PSSB) is a stateless session bean
that implements the PartitionHandlerLocal interface, and utilizes the PartitionManager
to create partitions from the partitioning facility's (WPF) framework. The
runtime characteristics are the same as a normal stateless session bean from
a runtime perspective.
The special features of this bean type include the following:
- While the application starts in the enterprise beans container, the bean
is analyzed, and if this bean is a PSSB the PartitionHandlerLocal interface
methods are called. The interface implementation methods can use the PartitionManager
API to submit requests to the HA manager coordinator to create and activate
partitions based upon the current policy.
- During the activation of methods from the client to the server implementation
of the PSSB, each client method invocation is intercepted and processed to
determine which partition this method should be driven against on the server
infrastructure. For example, assume a PSSB named TestBean is being
demonstrated, and this bean has a remote interface method called ping(String
partition). When the client executes the TestBean.ping(partition) method,
the TestBean_PartitionKey.ping(partition) (a class the programmer
will create) will process all the method attributes and return a single string
to advise the WLM subsystem which partition endpoint the method should be
directed towards.
- The PSSB has several methods to handle the state changes that the partition
instances might encounter during normal activities. For example, there is
a PartitionLoadEvent(String) and PartitionUnLoadEvent(String) method
that will be executed if the administrator uses a JMX or wpfadmin command
to move a partition endpoint from server to another server. In this case,
if a Partition P001 is associated with application server appsvr1, and users
execute a wpfadmin move operation that changes the P001 partition from appsvr1
to appsvrN in the cluster, these bean callback methods are invoked. The PSSB
on appsvr1 would receive a deactivate callback from the HA manager, and in
turn the partitioning facility's runtime would call the PartitionUnLoadEvent(String) method.
After this method successfully completes, the HA manager on appsvrN drives
an activation related callback method, and the partitioning facility's runtime
runs a PartitionLoadEvent(String) on the PSSB.
In summary, a PSSB is a typical session bean that implements and calls
methods from the partitioning facility's framework. These methods are similar
in many ways to existing EJB callback method handling but have functions that
are related to partitioning rather than normal EJB callback methods.