本文整理汇总了Java中javax.management.MBeanServerDelegate类的典型用法代码示例。如果您正苦于以下问题:Java MBeanServerDelegate类的具体用法?Java MBeanServerDelegate怎么用?Java MBeanServerDelegate使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
MBeanServerDelegate类属于javax.management包,在下文中一共展示了MBeanServerDelegate类的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: DefaultMBeanServerInterceptor
import javax.management.MBeanServerDelegate; //导入依赖的package包/类
/**
* Creates a DefaultMBeanServerInterceptor with the specified
* repository instance.
* <p>Do not forget to call <code>initialize(outer,delegate)</code>
* before using this object.
* @param outer A pointer to the MBeanServer object that must be
* passed to the MBeans when invoking their
* {@link javax.management.MBeanRegistration} interface.
* @param delegate A pointer to the MBeanServerDelegate associated
* with the new MBeanServer. The new MBeanServer must register
* this MBean in its MBean repository.
* @param instantiator The MBeanInstantiator that will be used to
* instantiate MBeans and take care of class loading issues.
* @param repository The repository to use for this MBeanServer.
*/
public DefaultMBeanServerInterceptor(MBeanServer outer,
MBeanServerDelegate delegate,
MBeanInstantiator instantiator,
Repository repository) {
if (outer == null) throw new
IllegalArgumentException("outer MBeanServer cannot be null");
if (delegate == null) throw new
IllegalArgumentException("MBeanServerDelegate cannot be null");
if (instantiator == null) throw new
IllegalArgumentException("MBeanInstantiator cannot be null");
if (repository == null) throw new
IllegalArgumentException("Repository cannot be null");
this.server = outer;
this.delegate = delegate;
this.instantiator = instantiator;
this.repository = repository;
this.domain = repository.getDefaultDomain();
}
示例2: sendNotification
import javax.management.MBeanServerDelegate; //导入依赖的package包/类
/**
* Sends an MBeanServerNotifications with the specified type for the
* MBean with the specified ObjectName
*/
private void sendNotification(String NotifType, ObjectName name) {
// ------------------------------
// ------------------------------
// ---------------------
// Create notification
// ---------------------
MBeanServerNotification notif = new MBeanServerNotification(
NotifType,MBeanServerDelegate.DELEGATE_NAME,0,name);
if (MBEANSERVER_LOGGER.isLoggable(Level.FINER)) {
MBEANSERVER_LOGGER.logp(Level.FINER,
DefaultMBeanServerInterceptor.class.getName(),
"sendNotification", NotifType + " " + name);
}
delegate.sendNotification(notif);
}
示例3: destroyListeners
import javax.management.MBeanServerDelegate; //导入依赖的package包/类
private void destroyListeners() {
checkNoLocks();
logger.debug("destroyListeners", "starts");
try {
removeNotificationListener(MBeanServerDelegate.DELEGATE_NAME,
creationListener);
} catch (Exception e) {
logger.warning("remove listener from MBeanServer delegate", e);
}
Set<ObjectName> names = queryNames(null, broadcasterQuery);
for (final ObjectName name : names) {
if (logger.debugOn())
logger.debug("destroyListeners",
"remove listener from " + name);
removeBufferListener(name);
}
logger.debug("destroyListeners", "ends");
}
示例4: removeListenerForMBeanRemovedNotif
import javax.management.MBeanServerDelegate; //导入依赖的package包/类
protected void removeListenerForMBeanRemovedNotif(Integer id)
throws IOException, InstanceNotFoundException,
ListenerNotFoundException {
try {
connection.removeNotificationListeners(
MBeanServerDelegate.DELEGATE_NAME,
new Integer[] {id},
null);
} catch (IOException ioe) {
communicatorAdmin.gotIOException(ioe);
connection.removeNotificationListeners(
MBeanServerDelegate.DELEGATE_NAME,
new Integer[] {id},
null);
}
}
示例5: main
import javax.management.MBeanServerDelegate; //导入依赖的package包/类
public static void main(String[] args) throws Exception {
System.out.println(
"Test that <MBeanServerDelegate.DELEGATE_NAME> equals " +
"<new ObjectName(\"JMImplementation:type=MBeanServerDelegate\")>");
final ObjectName delegateName =
new ObjectName("JMImplementation:type=MBeanServerDelegate");
if (!delegateName.equals(MBeanServerDelegate.DELEGATE_NAME))
throw new AssertionError("Unexpected value: " +
"MBeanServerDelegate.DELEGATE_NAME = " +
MBeanServerDelegate.DELEGATE_NAME);
System.out.println("MBeanServerDelegate.DELEGATE_NAME = " +
"new ObjectName(\"" + delegateName + "\")");
System.out.println("Test that <ObjectName.WILDCARD> " +
"equals <new ObjectName(\"*:*\")>");
final ObjectName wildcardName = new ObjectName("*:*");
if (!wildcardName.equals(ObjectName.WILDCARD))
throw new AssertionError("Unexpected value: " +
"ObjectName.WILDCARD = " +
ObjectName.WILDCARD);
System.out.println("ObjectName.WILDCARD = " +
"new ObjectName(\"" + wildcardName + "\")");
System.out.println("Test passes: constants were initialized properly");
}
示例6: sendNotification
import javax.management.MBeanServerDelegate; //导入依赖的package包/类
/**
* Sends an MBeanServerNotifications with the specified type for the
* MBean with the specified ObjectName
*/
private void sendNotification(String NotifType, ObjectName name) {
// ------------------------------
// ------------------------------
// ---------------------
// Create notification
// ---------------------
MBeanServerNotification notif = new MBeanServerNotification(
NotifType,MBeanServerDelegate.DELEGATE_NAME,0,name);
if (MBEANSERVER_LOGGER.isLoggable(Level.TRACE)) {
MBEANSERVER_LOGGER.log(Level.TRACE, NotifType + " " + name);
}
delegate.sendNotification(notif);
}