IBM WebSphere Application ServerTM
Release 7

com.ibm.websphere.grid.spi
Class SPI

java.lang.Object
  extended by com.ibm.websphere.grid.spi.SPI
All Implemented Interfaces:
java.lang.Comparable
Direct Known Subclasses:
LifeCycle, SubJobCollector, WSGridNotificationSPI

public abstract class SPI
extends java.lang.Object
implements java.lang.Comparable


Constructor Summary
SPI()
           
 
Method Summary
 int compareTo(java.lang.Object o)
           Compares this SPI instance to another.
 int getInvocationOrder()
          Returns invocation order of this SPI instance.
abstract  java.lang.String getName()
          Returns the name of this SPI instance.
 void setInvocationOrder(int n)
           Called by job scheduler SPI initialization to set invocation order for this SPI instance.
 java.lang.String toString()
          Returns string form of this SPI instance.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

SPI

public SPI()
Method Detail

getName

public abstract java.lang.String getName()
Returns the name of this SPI instance. Should return a unique identifier.


setInvocationOrder

public void setInvocationOrder(int n)

Called by job scheduler SPI initialization to set invocation order for this SPI instance. The order is given by the numeric qualifier from the xd.spi.properties file for the given SPI type - e.g.

    # spi.WSGridNotificationSPI.1=com.abc.NotifySPI_A
    # spi.WSGridNotificationSPI.2=com.abc.NotifySPI_B 
 
Which results in the invocation order being NotifySPI_A, then NotifySPI_B. Note that each SPI instance of the same logical type should have a unique invocation ordinal value. This is not enforced. SPIs of the same type with the same invocation order will be invoked in an unpredictable order.

Parameters:
specifies - the invocation ordinal value.

getInvocationOrder

public int getInvocationOrder()
Returns invocation order of this SPI instance.

Returns:
ordinal integer value of invocation order of this SPI instance.

toString

public java.lang.String toString()
Returns string form of this SPI instance.

Overrides:
toString in class java.lang.Object
Returns:
string form of this SPI instance, in the form:
 {logical-name}:{invocation-order}
 

compareTo

public int compareTo(java.lang.Object o)

Compares this SPI instance to another. Comparisons are numeric, based on invocation order.

Specified by:
compareTo in interface java.lang.Comparable
Parameters:
SPI - instance to compare with this SPI instance.
Returns:
comparison result as follows:
  • -1 - indicates this SPI invocation order is less than specified SPI invocation order.
  • 0 - indicates this SPI invocation order is equal to the specified SPI invocation order.
  • 1 - indicates this SPI invocation order is greater than specified SPI invocation order.

IBM WebSphere Application ServerTM
Release 7