WebSphere Extended Deployment, Version 6.0.x     Operating Systems: AIX, HP-UX, Linux, Solaris, Windows

通知インターフェース

このサーブレット API には、HttpPartitionNotification インターフェースを使用して区画コールバック (区画イベントに関するもの) を受け取るためのメソッドがあります。 通知インターフェースは、次のようになっています。
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 プログラミング・インターフェース

Reference topic    

Terms of Use | Feedback Last updated: Mar 20, 2006 12:35:11 PM EST
http://publib.boulder.ibm.com/infocenter/wxdinfo/v6r0/index.jsp?topic=?topic=/com.ibm.websphere.xd.doc/info/WPF51/rwpfNotificationInterface.html

© Copyright IBM 2005, 2006. All Rights Reserved.
This information center is powered by Eclipse technology. (http://www.eclipse.org)