com.ibm.websphere.wpf
Interface PartitionManager


public interface PartitionManager

The PartitionManager interface provides the runtime support to create, remove, add, diable or remove a partition as the application developer requries. An instance is bound to the jndi space of a Partition Statless Session Bean. It allows partitions to be dynamically added and removed once the server is up and running.


Field Summary
static int FAULT_GRACEFUL
          The FAULT_GRACEFUL return value reflects that JVM is ok and this fault impacts this partition only.
static int FAULT_PANIC
          The FAULT_GRACEFUL return value reflects that JVM is compromized and should be dropped in total.
static java.lang.String JNDI_NAME
          This is the jndi name to find this instance in a partition handler EJB.
 
Method Summary
 void addPartition(PartitionDefinition name)
          This dynamically adds a new partition to the application with the specified name.
 PartitionDefinition createPartitionDefinition(java.lang.String partitionName)
          This returns a partition definition with standard/default class.
 PartitionDefinition createPartitionDefinition(java.lang.String partitionName, java.lang.String partitionClass, PartitionScope scope)
          This returns a partition definition with standard/default class.
 PartitionDefinition createPartitionDefinition(java.lang.String partitionName, java.lang.String partitionClass, PartitionScope scope, java.util.Map attrMap)
          This returns a partition definition with standard/default class.
 void disablePartition(java.lang.String name)
          This dynamically disables a partition.
 java.lang.String getApplicationName()
          This returns the application name used when installing the partitioned J2EE application.
 java.lang.String[] getPartitions()
          This returns all the current partitions registered with an application.
 void removePartition(java.lang.String name)
          This dynamically removes a partition from the application.
 void reportPartitionFault(java.lang.String partitionName, int severity)
          This can be called to report a fault with the operation of an active partition.
 void reportTransactionComplete(java.lang.String partitionName, long responseTime_ms)
          This should be called to inform the runtime when a transaction/operation completes on this partition.
 void reportTransactionFailed(java.lang.String partitionName)
          This should be called to inform the runtime when a transaction/operation fails on this partition.
 void setHttpPartitionManager(com.ibm.websphere.http.wpf.interfaces.HttpPartitionManagerInterface manager)
          This indicates to WPF that this application uses HTTP Partitioning.
 

Field Detail

JNDI_NAME

static final java.lang.String JNDI_NAME
This is the jndi name to find this instance in a partition handler EJB. It is only present on these EJBs, not all EJBs in a partitioned application.

See Also:
Constant Field Values

FAULT_GRACEFUL

static final int FAULT_GRACEFUL
The FAULT_GRACEFUL return value reflects that JVM is ok and this fault impacts this partition only. Use of this API value is reserved at this time. See the reportPartitionFault() API.

See Also:
Constant Field Values

FAULT_PANIC

static final int FAULT_PANIC
The FAULT_GRACEFUL return value reflects that JVM is compromized and should be dropped in total. Use of this API value is reserved at this time. See the reportPartitionFault() API.

See Also:
Constant Field Values
Method Detail

addPartition

void addPartition(PartitionDefinition name)
This dynamically adds a new partition to the application with the specified name. Calling this method adds the partition to all cluster members, there is no need to call it on each member individually.

Parameters:
name - The new partition name.
Throws:
java.lang.IllegalStateException - If the calling application has no partition handler bean

removePartition

void removePartition(java.lang.String name)
                     throws UnknownPartitionException
This dynamically removes a partition from the application. Calling this method removes the partition on all cluster members, there is no need to call it on each member individually.

Parameters:
name - The partition to remove.
Throws:
java.lang.IllegalStateException - If the calling application has no partition handler bean
UnknownPartitionException - If this partition doesn't exist.

disablePartition

void disablePartition(java.lang.String name)
                      throws UnknownPartitionException
This dynamically disables a partition. Calling this method disables the partition on the current cluster members. This can also be accomplished via the wpfadmin command.

When the method is invoked, the partition will either enter a deactivated state or activate immediately on another cluster member capable of hosting the partition. The partition would be deactivated depending on the current policy settings, but by default activated on another cluster member if one is available. If partition is not automatically reactivated, wpfadmin can be used to enable the member once the administrator can review the logs and determine any action that should be done prior to reenabling the partition.

partitionUnloadEvent(...) is not called as the application will call this method and can clean as much as is possible prior to the ivocation.

Parameters:
name - The partition to disable.
Throws:
java.lang.IllegalStateException - If the calling application has no partition handler bean
UnknownPartitionException - If this partition doesn't exist.

getPartitions

java.lang.String[] getPartitions()
This returns all the current partitions registered with an application.

Returns:
An array of Strings listing all partition names.
Throws:
java.lang.IllegalStateException - If the calling application is not partitioned.

getApplicationName

java.lang.String getApplicationName()
This returns the application name used when installing the partitioned J2EE application.

Returns:
String.

reportPartitionFault

void reportPartitionFault(java.lang.String partitionName,
                          int severity)
This can be called to report a fault with the operation of an active partition. The severity allows wpf to determine what action to take. This API is reserved by IBM at this time. At this time, the disablePartition(String) API should be used to handle error conditions.

Parameters:
partitionName - The source partition detecting the fault.
severity - This needs to be one of FAULT_* report codes.
Throws:
java.lang.IllegalStateException - If the calling application has no partition handler bean

reportTransactionComplete

void reportTransactionComplete(java.lang.String partitionName,
                               long responseTime_ms)
This should be called to inform the runtime when a transaction/operation completes on this partition. This is used to populate the WPF performance monitoring infrastrucutre. Each time this is called, the transaction will be counted and the response time will be noted.

Parameters:
partitionName - the name of the partition.
responseTime_ms - the response time for the transaction.
Throws:
java.lang.IllegalStateException - If the calling application has no partition handler bean

reportTransactionFailed

void reportTransactionFailed(java.lang.String partitionName)
This should be called to inform the runtime when a transaction/operation fails on this partition. This is used to populate the WPF performance monitoring infrastrucutre. Each time this is called, the failed transaction will be counted.

Parameters:
partitionName -

createPartitionDefinition

PartitionDefinition createPartitionDefinition(java.lang.String partitionName)
                                              throws java.lang.IllegalArgumentException
This returns a partition definition with standard/default class. This doesn't create a 'real' partition, it returns a PartitionDefinition object for the use of the application. The partition has cluster scope.

Parameters:
partitionName -
Returns:
A PartitionDefinition representing a cluster scoped partition.
Throws:
java.lang.IllegalArgumentException - If the partition name is null.

createPartitionDefinition

PartitionDefinition createPartitionDefinition(java.lang.String partitionName,
                                              java.lang.String partitionClass,
                                              PartitionScope scope)
                                              throws java.lang.IllegalArgumentException
This returns a partition definition with standard/default class. This doesn't create a 'real' partition, it returns a PartitionDefinition object for the use of the application.

Parameters:
partitionName - The name of the partition.
partitionClass - The desired classification for it.
scope - Whether this partition is node or cluster scoped.
Returns:
A PartitionDefinition representing a cluster or scoped partition.
Throws:
java.lang.IllegalArgumentException - If any parameters are null.
See Also:
PartitionScope

createPartitionDefinition

PartitionDefinition createPartitionDefinition(java.lang.String partitionName,
                                              java.lang.String partitionClass,
                                              PartitionScope scope,
                                              java.util.Map attrMap)
                                              throws java.lang.IllegalArgumentException
This returns a partition definition with standard/default class. This doesn't create a 'real' partition, it returns a PartitionDefinition object for the use of the application.

Parameters:
partitionName - The name of the partition.
partitionClass - The desired classification for it.
scope - Whether this partition is node or cluster scoped.
Map - of attributes (String key and value) pairs users can use associate for policy management.
Returns:
A PartitionDefinition representing a cluster or scoped partition.
Throws:
java.lang.IllegalArgumentException - If any parameters are null.
See Also:
PartitionScope

setHttpPartitionManager

void setHttpPartitionManager(com.ibm.websphere.http.wpf.interfaces.HttpPartitionManagerInterface manager)
This indicates to WPF that this application uses HTTP Partitioning.

Parameters:
manager - is the HttpPartitionManager instance.