jdk-24/jdk/test/javax/management/eventService/MyFetchingEventForwarder.java
Shanliang Jiang cf105cf085 5108776: Add reliable event handling to the JMX API
6218920: API bug - impossible to delete last MBeanServerForwarder on a connector

Reviewed-by: emcmanus
2008-07-31 15:31:13 +02:00

54 lines
1.1 KiB
Java

/*
* MyList.java
*
* Created on Oct 23, 2007, 2:45:57 PM
*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
/**
*
* @author sjiang
*/
import java.io.IOException;
import java.util.ArrayList;
import javax.management.event.FetchingEventForwarder;
public class MyFetchingEventForwarder extends FetchingEventForwarder {
public MyFetchingEventForwarder() {
super(1000);
shared = this;
setList(myList);
}
public void setAgain() {
setList(myList);
}
public void setClientId(String clientId) throws IOException {
used = true;
super.setClientId(clientId);
}
public boolean isUsed() {
return used;
}
private class MyList<TargetedNotification>
extends ArrayList<TargetedNotification> {
public boolean add(TargetedNotification e) {
used = true;
return super.add(e);
}
}
public MyList myList = new MyList();
public static MyFetchingEventForwarder shared;
private boolean used = false;
}