下面列出了怎么用javax.management.NotificationBroadcasterSupport的API类实例代码及写法,或者点击链接到github查看源代码。
static boolean isDefinitelyImmutableInfo(Class<?> implClass) {
if (!NotificationBroadcaster.class.isAssignableFrom(implClass))
return true;
synchronized (definitelyImmutable) {
Boolean immutable = definitelyImmutable.get(implClass);
if (immutable == null) {
final Class<NotificationBroadcasterSupport> nbs =
NotificationBroadcasterSupport.class;
if (nbs.isAssignableFrom(implClass)) {
try {
Method m = implClass.getMethod("getNotificationInfo");
immutable = (m.getDeclaringClass() == nbs);
} catch (Exception e) {
// Too bad, we'll say no for now.
return false;
}
} else
immutable = false;
definitelyImmutable.put(implClass, immutable);
}
return immutable;
}
}
/**
* Controls the way the CommunicatorServer service is deserialized.
*/
private void readObject(ObjectInputStream stream)
throws IOException, ClassNotFoundException {
// Call the default deserialization of the object.
//
stream.defaultReadObject();
// Call the specific initialization for the CommunicatorServer service.
// This is for transient structures to be initialized to specific
// default values.
//
stateLock = new Object();
state = OFFLINE;
stopRequested = false;
servedClientCount = 0;
clientHandlerVector = new Vector<>();
mainThread = null;
notifCount = 0;
notifInfos = null;
notifBroadcaster = new NotificationBroadcasterSupport();
dbgTag = makeDebugTag();
}
static boolean isDefinitelyImmutableInfo(Class<?> implClass) {
if (!NotificationBroadcaster.class.isAssignableFrom(implClass))
return true;
synchronized (definitelyImmutable) {
Boolean immutable = definitelyImmutable.get(implClass);
if (immutable == null) {
final Class<NotificationBroadcasterSupport> nbs =
NotificationBroadcasterSupport.class;
if (nbs.isAssignableFrom(implClass)) {
try {
Method m = implClass.getMethod("getNotificationInfo");
immutable = (m.getDeclaringClass() == nbs);
} catch (Exception e) {
// Too bad, we'll say no for now.
return false;
}
} else
immutable = false;
definitelyImmutable.put(implClass, immutable);
}
return immutable;
}
}
/**
* Controls the way the CommunicatorServer service is deserialized.
*/
private void readObject(ObjectInputStream stream)
throws IOException, ClassNotFoundException {
// Call the default deserialization of the object.
//
stream.defaultReadObject();
// Call the specific initialization for the CommunicatorServer service.
// This is for transient structures to be initialized to specific
// default values.
//
stateLock = new Object();
state = OFFLINE;
stopRequested = false;
servedClientCount = 0;
clientHandlerVector = new Vector<>();
mainThread = null;
notifCount = 0;
notifInfos = null;
notifBroadcaster = new NotificationBroadcasterSupport();
dbgTag = makeDebugTag();
}
static boolean isDefinitelyImmutableInfo(Class<?> implClass) {
if (!NotificationBroadcaster.class.isAssignableFrom(implClass))
return true;
synchronized (definitelyImmutable) {
Boolean immutable = definitelyImmutable.get(implClass);
if (immutable == null) {
final Class<NotificationBroadcasterSupport> nbs =
NotificationBroadcasterSupport.class;
if (nbs.isAssignableFrom(implClass)) {
try {
Method m = implClass.getMethod("getNotificationInfo");
immutable = (m.getDeclaringClass() == nbs);
} catch (Exception e) {
// Too bad, we'll say no for now.
return false;
}
} else
immutable = false;
definitelyImmutable.put(implClass, immutable);
}
return immutable;
}
}
/**
* Controls the way the CommunicatorServer service is deserialized.
*/
private void readObject(ObjectInputStream stream)
throws IOException, ClassNotFoundException {
// Call the default deserialization of the object.
//
stream.defaultReadObject();
// Call the specific initialization for the CommunicatorServer service.
// This is for transient structures to be initialized to specific
// default values.
//
stateLock = new Object();
state = OFFLINE;
stopRequested = false;
servedClientCount = 0;
clientHandlerVector = new Vector<>();
mainThread = null;
notifCount = 0;
notifInfos = null;
notifBroadcaster = new NotificationBroadcasterSupport();
dbgTag = makeDebugTag();
}
static boolean isDefinitelyImmutableInfo(Class<?> implClass) {
if (!NotificationBroadcaster.class.isAssignableFrom(implClass))
return true;
synchronized (definitelyImmutable) {
Boolean immutable = definitelyImmutable.get(implClass);
if (immutable == null) {
final Class<NotificationBroadcasterSupport> nbs =
NotificationBroadcasterSupport.class;
if (nbs.isAssignableFrom(implClass)) {
try {
Method m = implClass.getMethod("getNotificationInfo");
immutable = (m.getDeclaringClass() == nbs);
} catch (Exception e) {
// Too bad, we'll say no for now.
return false;
}
} else
immutable = false;
definitelyImmutable.put(implClass, immutable);
}
return immutable;
}
}
/**
* Controls the way the CommunicatorServer service is deserialized.
*/
private void readObject(ObjectInputStream stream)
throws IOException, ClassNotFoundException {
// Call the default deserialization of the object.
//
stream.defaultReadObject();
// Call the specific initialization for the CommunicatorServer service.
// This is for transient structures to be initialized to specific
// default values.
//
stateLock = new Object();
state = OFFLINE;
stopRequested = false;
servedClientCount = 0;
clientHandlerVector = new Vector<>();
mainThread = null;
notifCount = 0;
notifInfos = null;
notifBroadcaster = new NotificationBroadcasterSupport();
dbgTag = makeDebugTag();
}
static boolean isDefinitelyImmutableInfo(Class<?> implClass) {
if (!NotificationBroadcaster.class.isAssignableFrom(implClass))
return true;
synchronized (definitelyImmutable) {
Boolean immutable = definitelyImmutable.get(implClass);
if (immutable == null) {
final Class<NotificationBroadcasterSupport> nbs =
NotificationBroadcasterSupport.class;
if (nbs.isAssignableFrom(implClass)) {
try {
Method m = implClass.getMethod("getNotificationInfo");
immutable = (m.getDeclaringClass() == nbs);
} catch (Exception e) {
// Too bad, we'll say no for now.
return false;
}
} else
immutable = false;
definitelyImmutable.put(implClass, immutable);
}
return immutable;
}
}
/**
* Controls the way the CommunicatorServer service is deserialized.
*/
private void readObject(ObjectInputStream stream)
throws IOException, ClassNotFoundException {
// Call the default deserialization of the object.
//
stream.defaultReadObject();
// Call the specific initialization for the CommunicatorServer service.
// This is for transient structures to be initialized to specific
// default values.
//
stateLock = new Object();
state = OFFLINE;
stopRequested = false;
servedClientCount = 0;
clientHandlerVector = new Vector<>();
mainThread = null;
notifCount = 0;
notifInfos = null;
notifBroadcaster = new NotificationBroadcasterSupport();
dbgTag = makeDebugTag();
}
static boolean isDefinitelyImmutableInfo(Class<?> implClass) {
if (!NotificationBroadcaster.class.isAssignableFrom(implClass))
return true;
synchronized (definitelyImmutable) {
Boolean immutable = definitelyImmutable.get(implClass);
if (immutable == null) {
final Class<NotificationBroadcasterSupport> nbs =
NotificationBroadcasterSupport.class;
if (nbs.isAssignableFrom(implClass)) {
try {
Method m = implClass.getMethod("getNotificationInfo");
immutable = (m.getDeclaringClass() == nbs);
} catch (Exception e) {
// Too bad, we'll say no for now.
return false;
}
} else
immutable = false;
definitelyImmutable.put(implClass, immutable);
}
return immutable;
}
}
/**
* Controls the way the CommunicatorServer service is deserialized.
*/
private void readObject(ObjectInputStream stream)
throws IOException, ClassNotFoundException {
// Call the default deserialization of the object.
//
stream.defaultReadObject();
// Call the specific initialization for the CommunicatorServer service.
// This is for transient structures to be initialized to specific
// default values.
//
stateLock = new Object();
state = OFFLINE;
stopRequested = false;
servedClientCount = 0;
clientHandlerVector = new Vector<>();
mainThread = null;
notifCount = 0;
notifInfos = null;
notifBroadcaster = new NotificationBroadcasterSupport();
dbgTag = makeDebugTag();
}
static boolean isDefinitelyImmutableInfo(Class<?> implClass) {
if (!NotificationBroadcaster.class.isAssignableFrom(implClass))
return true;
synchronized (definitelyImmutable) {
Boolean immutable = definitelyImmutable.get(implClass);
if (immutable == null) {
final Class<NotificationBroadcasterSupport> nbs =
NotificationBroadcasterSupport.class;
if (nbs.isAssignableFrom(implClass)) {
try {
Method m = implClass.getMethod("getNotificationInfo");
immutable = (m.getDeclaringClass() == nbs);
} catch (Exception e) {
// Too bad, we'll say no for now.
return false;
}
} else
immutable = false;
definitelyImmutable.put(implClass, immutable);
}
return immutable;
}
}
/**
* Controls the way the CommunicatorServer service is deserialized.
*/
private void readObject(ObjectInputStream stream)
throws IOException, ClassNotFoundException {
// Call the default deserialization of the object.
//
stream.defaultReadObject();
// Call the specific initialization for the CommunicatorServer service.
// This is for transient structures to be initialized to specific
// default values.
//
stateLock = new Object();
state = OFFLINE;
stopRequested = false;
servedClientCount = 0;
clientHandlerVector = new Vector<>();
mainThread = null;
notifCount = 0;
notifInfos = null;
notifBroadcaster = new NotificationBroadcasterSupport();
dbgTag = makeDebugTag();
}
static boolean isDefinitelyImmutableInfo(Class<?> implClass) {
if (!NotificationBroadcaster.class.isAssignableFrom(implClass))
return true;
synchronized (definitelyImmutable) {
Boolean immutable = definitelyImmutable.get(implClass);
if (immutable == null) {
final Class<NotificationBroadcasterSupport> nbs =
NotificationBroadcasterSupport.class;
if (nbs.isAssignableFrom(implClass)) {
try {
Method m = implClass.getMethod("getNotificationInfo");
immutable = (m.getDeclaringClass() == nbs);
} catch (Exception e) {
// Too bad, we'll say no for now.
return false;
}
} else
immutable = false;
definitelyImmutable.put(implClass, immutable);
}
return immutable;
}
}
static boolean isDefinitelyImmutableInfo(Class<?> implClass) {
if (!NotificationBroadcaster.class.isAssignableFrom(implClass))
return true;
synchronized (definitelyImmutable) {
Boolean immutable = definitelyImmutable.get(implClass);
if (immutable == null) {
final Class<NotificationBroadcasterSupport> nbs =
NotificationBroadcasterSupport.class;
if (nbs.isAssignableFrom(implClass)) {
try {
Method m = implClass.getMethod("getNotificationInfo");
immutable = (m.getDeclaringClass() == nbs);
} catch (Exception e) {
// Too bad, we'll say no for now.
return false;
}
} else
immutable = false;
definitelyImmutable.put(implClass, immutable);
}
return immutable;
}
}
/**
* Controls the way the CommunicatorServer service is deserialized.
*/
private void readObject(ObjectInputStream stream)
throws IOException, ClassNotFoundException {
// Call the default deserialization of the object.
//
stream.defaultReadObject();
// Call the specific initialization for the CommunicatorServer service.
// This is for transient structures to be initialized to specific
// default values.
//
stateLock = new Object();
state = OFFLINE;
stopRequested = false;
servedClientCount = 0;
clientHandlerVector = new Vector<>();
mainThread = null;
notifCount = 0;
notifInfos = null;
notifBroadcaster = new NotificationBroadcasterSupport();
dbgTag = makeDebugTag();
}
static boolean isDefinitelyImmutableInfo(Class<?> implClass) {
if (!NotificationBroadcaster.class.isAssignableFrom(implClass))
return true;
synchronized (definitelyImmutable) {
Boolean immutable = definitelyImmutable.get(implClass);
if (immutable == null) {
final Class<NotificationBroadcasterSupport> nbs =
NotificationBroadcasterSupport.class;
if (nbs.isAssignableFrom(implClass)) {
try {
Method m = implClass.getMethod("getNotificationInfo");
immutable = (m.getDeclaringClass() == nbs);
} catch (Exception e) {
// Too bad, we'll say no for now.
return false;
}
} else
immutable = false;
definitelyImmutable.put(implClass, immutable);
}
return immutable;
}
}
/**
* Controls the way the CommunicatorServer service is deserialized.
*/
private void readObject(ObjectInputStream stream)
throws IOException, ClassNotFoundException {
// Call the default deserialization of the object.
//
stream.defaultReadObject();
// Call the specific initialization for the CommunicatorServer service.
// This is for transient structures to be initialized to specific
// default values.
//
stateLock = new Object();
state = OFFLINE;
stopRequested = false;
servedClientCount = 0;
clientHandlerVector = new Vector<>();
mainThread = null;
notifCount = 0;
notifInfos = null;
notifBroadcaster = new NotificationBroadcasterSupport();
dbgTag = makeDebugTag();
}
static boolean isDefinitelyImmutableInfo(Class<?> implClass) {
if (!NotificationBroadcaster.class.isAssignableFrom(implClass))
return true;
synchronized (definitelyImmutable) {
Boolean immutable = definitelyImmutable.get(implClass);
if (immutable == null) {
final Class<NotificationBroadcasterSupport> nbs =
NotificationBroadcasterSupport.class;
if (nbs.isAssignableFrom(implClass)) {
try {
Method m = implClass.getMethod("getNotificationInfo");
immutable = (m.getDeclaringClass() == nbs);
} catch (Exception e) {
// Too bad, we'll say no for now.
return false;
}
} else
immutable = false;
definitelyImmutable.put(implClass, immutable);
}
return immutable;
}
}
/**
* Controls the way the CommunicatorServer service is deserialized.
*/
private void readObject(ObjectInputStream stream)
throws IOException, ClassNotFoundException {
// Call the default deserialization of the object.
//
stream.defaultReadObject();
// Call the specific initialization for the CommunicatorServer service.
// This is for transient structures to be initialized to specific
// default values.
//
stateLock = new Object();
state = OFFLINE;
stopRequested = false;
servedClientCount = 0;
clientHandlerVector = new Vector<>();
mainThread = null;
notifCount = 0;
notifInfos = null;
notifBroadcaster = new NotificationBroadcasterSupport();
dbgTag = makeDebugTag();
}
static boolean isDefinitelyImmutableInfo(Class<?> implClass) {
if (!NotificationBroadcaster.class.isAssignableFrom(implClass))
return true;
synchronized (definitelyImmutable) {
Boolean immutable = definitelyImmutable.get(implClass);
if (immutable == null) {
final Class<NotificationBroadcasterSupport> nbs =
NotificationBroadcasterSupport.class;
if (nbs.isAssignableFrom(implClass)) {
try {
Method m = implClass.getMethod("getNotificationInfo");
immutable = (m.getDeclaringClass() == nbs);
} catch (Exception e) {
// Too bad, we'll say no for now.
return false;
}
} else
immutable = false;
definitelyImmutable.put(implClass, immutable);
}
return immutable;
}
}
/**
* Controls the way the CommunicatorServer service is deserialized.
*/
private void readObject(ObjectInputStream stream)
throws IOException, ClassNotFoundException {
// Call the default deserialization of the object.
//
stream.defaultReadObject();
// Call the specific initialization for the CommunicatorServer service.
// This is for transient structures to be initialized to specific
// default values.
//
stateLock = new Object();
state = OFFLINE;
stopRequested = false;
servedClientCount = 0;
clientHandlerVector = new Vector<>();
mainThread = null;
notifCount = 0;
notifInfos = null;
notifBroadcaster = new NotificationBroadcasterSupport();
dbgTag = makeDebugTag();
}
static boolean isDefinitelyImmutableInfo(Class<?> implClass) {
if (!NotificationBroadcaster.class.isAssignableFrom(implClass))
return true;
synchronized (definitelyImmutable) {
Boolean immutable = definitelyImmutable.get(implClass);
if (immutable == null) {
final Class<NotificationBroadcasterSupport> nbs =
NotificationBroadcasterSupport.class;
if (nbs.isAssignableFrom(implClass)) {
try {
Method m = implClass.getMethod("getNotificationInfo");
immutable = (m.getDeclaringClass() == nbs);
} catch (Exception e) {
// Too bad, we'll say no for now.
return false;
}
} else
immutable = false;
definitelyImmutable.put(implClass, immutable);
}
return immutable;
}
}
/**
* Controls the way the CommunicatorServer service is deserialized.
*/
private void readObject(ObjectInputStream stream)
throws IOException, ClassNotFoundException {
// Call the default deserialization of the object.
//
stream.defaultReadObject();
// Call the specific initialization for the CommunicatorServer service.
// This is for transient structures to be initialized to specific
// default values.
//
stateLock = new Object();
state = OFFLINE;
stopRequested = false;
servedClientCount = 0;
clientHandlerVector = new Vector<>();
mainThread = null;
notifCount = 0;
notifInfos = null;
notifBroadcaster = new NotificationBroadcasterSupport();
dbgTag = makeDebugTag();
}
static boolean isDefinitelyImmutableInfo(Class<?> implClass) {
if (!NotificationBroadcaster.class.isAssignableFrom(implClass))
return true;
synchronized (definitelyImmutable) {
Boolean immutable = definitelyImmutable.get(implClass);
if (immutable == null) {
final Class<NotificationBroadcasterSupport> nbs =
NotificationBroadcasterSupport.class;
if (nbs.isAssignableFrom(implClass)) {
try {
Method m = implClass.getMethod("getNotificationInfo");
immutable = (m.getDeclaringClass() == nbs);
} catch (Exception e) {
// Too bad, we'll say no for now.
return false;
}
} else
immutable = false;
definitelyImmutable.put(implClass, immutable);
}
return immutable;
}
}
/**
* Controls the way the CommunicatorServer service is deserialized.
*/
private void readObject(ObjectInputStream stream)
throws IOException, ClassNotFoundException {
// Call the default deserialization of the object.
//
stream.defaultReadObject();
// Call the specific initialization for the CommunicatorServer service.
// This is for transient structures to be initialized to specific
// default values.
//
stateLock = new Object();
state = OFFLINE;
stopRequested = false;
servedClientCount = 0;
clientHandlerVector = new Vector<>();
mainThread = null;
notifCount = 0;
notifInfos = null;
notifBroadcaster = new NotificationBroadcasterSupport();
dbgTag = makeDebugTag();
}
static boolean isDefinitelyImmutableInfo(Class<?> implClass) {
if (!NotificationBroadcaster.class.isAssignableFrom(implClass))
return true;
synchronized (definitelyImmutable) {
Boolean immutable = definitelyImmutable.get(implClass);
if (immutable == null) {
final Class<NotificationBroadcasterSupport> nbs =
NotificationBroadcasterSupport.class;
if (nbs.isAssignableFrom(implClass)) {
try {
Method m = implClass.getMethod("getNotificationInfo");
immutable = (m.getDeclaringClass() == nbs);
} catch (Exception e) {
// Too bad, we'll say no for now.
return false;
}
} else
immutable = false;
definitelyImmutable.put(implClass, immutable);
}
return immutable;
}
}
/**
* Controls the way the CommunicatorServer service is deserialized.
*/
private void readObject(ObjectInputStream stream)
throws IOException, ClassNotFoundException {
// Call the default deserialization of the object.
//
stream.defaultReadObject();
// Call the specific initialization for the CommunicatorServer service.
// This is for transient structures to be initialized to specific
// default values.
//
stateLock = new Object();
state = OFFLINE;
stopRequested = false;
servedClientCount = 0;
clientHandlerVector = new Vector<>();
mainThread = null;
notifCount = 0;
notifInfos = null;
notifBroadcaster = new NotificationBroadcasterSupport();
dbgTag = makeDebugTag();
}
/**
* Create a new StandardWrapper component with the default basic Valve.
*/
public StandardWrapper() {
super();
swValve=new StandardWrapperValve();
pipeline.setBasic(swValve);
broadcaster = new NotificationBroadcasterSupport();
}