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 파티션 기능에서 지원하는 인터페이스와 매우 유사하지만 몇 가지 차이점이 있습니다. 가장 큰 차이점은 이 응용프로그램에서 사용할 요청 표현식을 수집할 때 HTTP 파티션 기능에서 사용하는 getExpressions() 메소드의 포함 여부입니다. Servlet은 알림을 수신하기 위해, 예를 들어 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); }이 예에서는 Servlet의 destroy() 메소드에서 HttpPartitionManager.deregisterNotfication() 메소드를 사용하는 경우도 보여줍니다. 정확성을 위해 등록된 모든 알림을 등록 취소해야 합니다.
Related concepts
HTTP 프로그래밍 인터페이스