1 23 24 29 package com.sun.appserv.management.helper; 30 31 import java.util.Map ; 32 33 import javax.management.Notification ; 34 35 import com.sun.appserv.management.base.NotificationService; 36 37 40 public final class NotificationServiceHelper 41 { 42 final NotificationService mProxy; 43 final Object mBufferID; 44 long mNextSequenceNumber; 45 46 public 47 NotificationServiceHelper( 48 final NotificationService proxy, 49 final Object bufferID ) 50 { 51 mProxy = proxy; 52 mBufferID = bufferID; 53 54 mNextSequenceNumber = 0; 55 } 56 57 58 public NotificationService 59 get() 60 { 61 return( mProxy ); 62 } 63 64 67 public Notification [] 68 getNotifications() 69 { 70 final Map <String ,Object > result = 71 mProxy.getBufferNotifications( mBufferID, mNextSequenceNumber); 72 73 final Long nextSequenceNumber = (Long ) 74 result.get( mProxy.NEXT_SEQUENCE_NUMBER_KEY ); 75 mNextSequenceNumber = nextSequenceNumber.longValue(); 76 77 final Notification [] notifs = 78 (Notification [])result.get( mProxy.NOTIFICATIONS_KEY ); 79 80 return( notifs ); 81 } 82 } 83 84 85 | Popular Tags |