當前位置: 首頁>>代碼示例>>Java>>正文


Java InstanceNotFoundException類代碼示例

本文整理匯總了Java中javax.management.InstanceNotFoundException的典型用法代碼示例。如果您正苦於以下問題:Java InstanceNotFoundException類的具體用法?Java InstanceNotFoundException怎麽用?Java InstanceNotFoundException使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


InstanceNotFoundException類屬於javax.management包,在下文中一共展示了InstanceNotFoundException類的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: invoke

import javax.management.InstanceNotFoundException; //導入依賴的package包/類
public Object invoke(ObjectName name, String operationName,
                     Object params[], String signature[])
        throws InstanceNotFoundException, MBeanException,
               ReflectionException {

    name = nonDefaultDomain(name);

    DynamicMBean instance = getMBean(name);
    checkMBeanPermission(instance, operationName, name, "invoke");
    try {
        return instance.invoke(operationName, params, signature);
    } catch (Throwable t) {
        rethrowMaybeMBeanException(t);
        throw new AssertionError();
    }
}
 
開發者ID:AdoptOpenJDK,項目名稱:openjdk-jdk10,代碼行數:17,代碼來源:DefaultMBeanServerInterceptor.java

示例2: addListenerWithSubject

import javax.management.InstanceNotFoundException; //導入依賴的package包/類
private Integer addListenerWithSubject(ObjectName name,
                                       MarshalledObject<NotificationFilter> filter,
                                       Subject delegationSubject,
                                       boolean reconnect)
    throws InstanceNotFoundException, IOException {

    final boolean debug = logger.debugOn();
    if (debug)
        logger.debug("addListenerWithSubject",
                "(ObjectName,MarshalledObject,Subject)");

    final ObjectName[] names = new ObjectName[] {name};
    final MarshalledObject<NotificationFilter>[] filters =
            Util.cast(new MarshalledObject<?>[] {filter});
    final Subject[] delegationSubjects = new Subject[] {
        delegationSubject
    };

    final Integer[] listenerIDs =
            addListenersWithSubjects(names,filters,delegationSubjects,
            reconnect);

    if (debug) logger.debug("addListenerWithSubject","listenerID="
            + listenerIDs[0]);
    return listenerIDs[0];
}
 
開發者ID:lambdalab-mirror,項目名稱:jdk8u-jdk,代碼行數:27,代碼來源:RMIConnector.java

示例3: isInstanceOf

import javax.management.InstanceNotFoundException; //導入依賴的package包/類
public boolean isInstanceOf(ObjectName name,
        String className)
        throws InstanceNotFoundException,
        IOException {
    if (logger.debugOn())
        logger.debug("isInstanceOf", "name=" + name +
                ", className=" + className);

    final ClassLoader old = pushDefaultClassLoader();
    try {
        return connection.isInstanceOf(name,
                className,
                delegationSubject);
    } catch (IOException ioe) {
        communicatorAdmin.gotIOException(ioe);

        return connection.isInstanceOf(name,
                className,
                delegationSubject);
    } finally {
        popDefaultClassLoader(old);
    }
}
 
開發者ID:lambdalab-mirror,項目名稱:jdk8u-jdk,代碼行數:24,代碼來源:RMIConnector.java

示例4: addNotificationListener

import javax.management.InstanceNotFoundException; //導入依賴的package包/類
public void addNotificationListener(ObjectName name,
        NotificationListener listener,
        NotificationFilter filter,
        Object handback)
        throws InstanceNotFoundException,
        IOException {

    final boolean debug = logger.debugOn();

    if (debug)
        logger.debug("addNotificationListener" +
                "(ObjectName,NotificationListener,"+
                "NotificationFilter,Object)",
                "name=" + name
                + ", listener=" + listener
                + ", filter=" + filter
                + ", handback=" + handback);

    final Integer listenerID =
            addListenerWithSubject(name,
            new MarshalledObject<NotificationFilter>(filter),
            delegationSubject,true);
    rmiNotifClient.addNotificationListener(listenerID, name, listener,
            filter, handback,
            delegationSubject);
}
 
開發者ID:AdoptOpenJDK,項目名稱:openjdk-jdk10,代碼行數:27,代碼來源:RMIConnector.java

示例5: getListener

import javax.management.InstanceNotFoundException; //導入依賴的package包/類
private NotificationListener getListener(ObjectName listener)
    throws ListenerNotFoundException {
    // ----------------
    // Get listener object
    // ----------------
    DynamicMBean instance;
    try {
        instance = getMBean(listener);
    } catch (InstanceNotFoundException e) {
        throw EnvHelp.initCause(
                      new ListenerNotFoundException(e.getMessage()), e);
    }

    Object resource = getResource(instance);
    if (!(resource instanceof NotificationListener)) {
        final RuntimeException exc =
            new IllegalArgumentException(listener.getCanonicalName());
        final String msg =
            "MBean " + listener.getCanonicalName() + " does not " +
            "implement " + NotificationListener.class.getName();
        throw new RuntimeOperationsException(exc, msg);
    }
    return (NotificationListener) resource;
}
 
開發者ID:lambdalab-mirror,項目名稱:jdk8u-jdk,代碼行數:25,代碼來源:DefaultMBeanServerInterceptor.java

示例6: getMBeanInfo

import javax.management.InstanceNotFoundException; //導入依賴的package包/類
public MBeanInfo getMBeanInfo(ObjectName name)
throws InstanceNotFoundException,
        IntrospectionException,
        ReflectionException,
        IOException {

    if (logger.debugOn()) logger.debug("getMBeanInfo", "name=" + name);
    final ClassLoader old = pushDefaultClassLoader();
    try {
        return connection.getMBeanInfo(name, delegationSubject);
    } catch (IOException ioe) {
        communicatorAdmin.gotIOException(ioe);

        return connection.getMBeanInfo(name, delegationSubject);
    } finally {
        popDefaultClassLoader(old);
    }
}
 
開發者ID:lambdalab-mirror,項目名稱:jdk8u-jdk,代碼行數:19,代碼來源:RMIConnector.java

示例7: isInstanceOf

import javax.management.InstanceNotFoundException; //導入依賴的package包/類
private static boolean isInstanceOf(final MBeanServer mbs,
                                    final ObjectName name,
                                    final String className) {
    PrivilegedExceptionAction<Boolean> act =
        new PrivilegedExceptionAction<Boolean>() {
            public Boolean run() throws InstanceNotFoundException {
                return mbs.isInstanceOf(name, className);
            }
        };
    try {
        return AccessController.doPrivileged(act);
    } catch (Exception e) {
        logger.fine("isInstanceOf", "failed: " + e);
        logger.debug("isInstanceOf", e);
        return false;
    }
}
 
開發者ID:lambdalab-mirror,項目名稱:jdk8u-jdk,代碼行數:18,代碼來源:ArrayNotificationBuffer.java

示例8: getClassLoader

import javax.management.InstanceNotFoundException; //導入依賴的package包/類
/**
 * <p>Return the named {@link java.lang.ClassLoader}.
 * @param loaderName The ObjectName of the ClassLoader.
 * @return The named ClassLoader.
 * @exception InstanceNotFoundException if the named ClassLoader
 * is not found.
 */
public ClassLoader getClassLoader(ObjectName loaderName)
        throws InstanceNotFoundException {

    if (loaderName == null) {
        checkMBeanPermission((String) null, null, null, "getClassLoader");
        return server.getClass().getClassLoader();
    }

    DynamicMBean instance = getMBean(loaderName);
    checkMBeanPermission(instance, null, loaderName, "getClassLoader");

    Object resource = getResource(instance);

    /* Check if the given MBean is a ClassLoader */
    if (!(resource instanceof ClassLoader))
        throw new InstanceNotFoundException(loaderName.toString() +
                                            " is not a classloader");

    return (ClassLoader) resource;
}
 
開發者ID:AdoptOpenJDK,項目名稱:openjdk-jdk10,代碼行數:28,代碼來源:DefaultMBeanServerInterceptor.java

示例9: getMBean

import javax.management.InstanceNotFoundException; //導入依賴的package包/類
/**
 * Gets a specific MBean controlled by the DefaultMBeanServerInterceptor.
 * The name must have a non-default domain.
 */
private DynamicMBean getMBean(ObjectName name)
    throws InstanceNotFoundException {

    if (name == null) {
        throw new RuntimeOperationsException(new
            IllegalArgumentException("Object name cannot be null"),
                           "Exception occurred trying to get an MBean");
    }
    DynamicMBean obj = repository.retrieve(name);
    if (obj == null) {
        if (MBEANSERVER_LOGGER.isLoggable(Level.FINER)) {
            MBEANSERVER_LOGGER.logp(Level.FINER,
                    DefaultMBeanServerInterceptor.class.getName(),
                    "getMBean", name + " : Found no object");
        }
        throw new InstanceNotFoundException(name.toString());
    }
    return obj;
}
 
開發者ID:SunburstApps,項目名稱:OpenJSharp,代碼行數:24,代碼來源:DefaultMBeanServerInterceptor.java

示例10: getAttributes

import javax.management.InstanceNotFoundException; //導入依賴的package包/類
@Override
public AttributeList getAttributes(ObjectName name, String[] attributes)
    throws InstanceNotFoundException, ReflectionException {
  AttributeList results = new AttributeList();
  for (String attribute : attributes) {
    try {
      Object value = getAttribute(name, attribute);
      Attribute att = new Attribute(attribute, value);
      results.add(att);
    } catch (Exception e) {
      throw new GemFireSecurityException("error getting value of " + attribute + " from " + name,
          e);
    }
  }
  return results;
}
 
開發者ID:ampool,項目名稱:monarch,代碼行數:17,代碼來源:MBeanServerWrapper.java

示例11: setAttribute

import javax.management.InstanceNotFoundException; //導入依賴的package包/類
public void setAttribute(ObjectName name,
        Attribute attribute)
        throws InstanceNotFoundException,
        AttributeNotFoundException,
        InvalidAttributeValueException,
        MBeanException,
        ReflectionException,
        IOException {

    if (logger.debugOn()) logger.debug("setAttribute",
            "name=" + name + ", attribute name="
            + attribute.getName());

    final MarshalledObject<Attribute> sAttribute =
            new MarshalledObject<Attribute>(attribute);
    final ClassLoader old = pushDefaultClassLoader();
    try {
        connection.setAttribute(name, sAttribute, delegationSubject);
    } catch (IOException ioe) {
        communicatorAdmin.gotIOException(ioe);

        connection.setAttribute(name, sAttribute, delegationSubject);
    } finally {
        popDefaultClassLoader(old);
    }
}
 
開發者ID:lambdalab-mirror,項目名稱:jdk8u-jdk,代碼行數:27,代碼來源:RMIConnector.java

示例12: createMBean

import javax.management.InstanceNotFoundException; //導入依賴的package包/類
public ObjectInstance createMBean(
        String className, ObjectName name, ObjectName loaderName)
throws ReflectionException, InstanceAlreadyExistsException,
        MBeanRegistrationException, MBeanException,
        NotCompliantMBeanException, InstanceNotFoundException {
    return createMBean(className, name, loaderName, null, null);
}
 
開發者ID:lambdalab-mirror,項目名稱:jdk8u-jdk,代碼行數:8,代碼來源:OldMBeanServerTest.java

示例13: removeNotificationListener

import javax.management.InstanceNotFoundException; //導入依賴的package包/類
public void removeNotificationListener(ObjectName name,
                                       NotificationListener listener,
                                       NotificationFilter filter,
                                       Object handback)
        throws InstanceNotFoundException, ListenerNotFoundException {
    removeNotificationListener(name, listener, filter, handback, false);
}
 
開發者ID:lambdalab-mirror,項目名稱:jdk8u-jdk,代碼行數:8,代碼來源:DefaultMBeanServerInterceptor.java

示例14: destroyModule

import javax.management.InstanceNotFoundException; //導入依賴的package包/類
@Override
public void destroyModule(final ObjectName objectName)
        throws InstanceNotFoundException {
    if(objectName != null){
        conf4 = null;
    }
}
 
開發者ID:hashsdn,項目名稱:hashsdn-controller,代碼行數:8,代碼來源:TestingConfigTransactionController.java

示例15: addNotificationListener

import javax.management.InstanceNotFoundException; //導入依賴的package包/類
@Override
public synchronized void addNotificationListener(ObjectName name, ObjectName listener,
		NotificationFilter filter, Object handback)
		throws InstanceNotFoundException {
	mbs.addNotificationListener(name, listener, filter, handback);
	Listener1 l = new Listener1(name, listener, filter, handback);
	listeners.add(l);
	listeners1.add(l);
}
 
開發者ID:kefik,項目名稱:Pogamut3,代碼行數:10,代碼來源:PogamutMBeanServer.java


注:本文中的javax.management.InstanceNotFoundException類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。