public interface HttpPartitionNotification { /* * Fetch the vector of partition strings from the web module. */ public Vector getPartitions(); /* * Fetch the array of expressions from the web module. */ public HttpPartitionExpression[] getExpressions(); /* * Queries the web module to determine if the specified partition is still alive. */ public boolean isPartitionAlive(String partitionName); /* * Indicates that this partition has been loaded by WPF. */ public boolean loadEvent(String partitionName); /* * Indicates that this partition has been loaded by WPF. */ public void unloadEvent(String partitionName); }WebSphere Application Server 区画化機能でサポートされているインターフェースとよく似ていますが、 わずかな違いもいくつかあります。 特に、getExpressions() メソッドが含まれている点が異なります。 HTTP 区画化機能では、この機能を使用して、アプリケーションで使用される要求表現を収集します。 サーブレットでは、init() メソッドなどで HttpPartitionManager.registerNotfication() メソッドを呼び出すことにより、 そのサーブレット自体または他のクラスを登録して通知を受け取ることができます。
public void init() throws ServletException { System.out.println(className+": Registering notification "); httpPartitionManager.registerNotification(appName, this); } public void destroy() { System.out.println(className+": Deregistering notification "); httpPartitionManager.deregisterNotification(appName, this); }この例では、サーブレットの destroy() メソッドで HttpPartitionManager.deregisterNotfication() メソッド も使用しています。正確を期すため、登録済みの通知はすべて、登録解除する必要があります。
Related concepts
HTTP プログラミング・インターフェース