Java 8 RuntimeMBeanException - top ranked examples from Open Source projects

These code examples were ranked by Codota’s semantic indexing as the best open source examples for Java 8 RuntimeMBeanException class.

This code example shows how to use the following methods:getCause
    try { 
      value = mBeanServer.getAttribute(oname, attName);
    } catch (RuntimeMBeanException e) {
      // UnsupportedOperationExceptions happen in the normal course of business, 
      // so no need to log them as errors all the time. 
      if (e.getCause() instanceof UnsupportedOperationException) {
        if (LOG.isTraceEnabled()) {
          LOG.trace("Getting attribute " + attName + " of " + oname + " threw " + e);
        } 
      } else { 
        LOG.error("getting attribute "+attName+" of "+oname+" threw an exception", e);
      } 
      return; 
    } catch (RuntimeErrorException e) {
      // RuntimeErrorException happens when an unexpected failure occurs in getAttribute 
      // for example https://issues.apache.org/jira/browse/DAEMON-120 
      LOG.debug("getting attribute "+attName+" of "+oname+" threw an exception", e);
      return; 
    } catch (AttributeNotFoundException e) {
      //Ignored the attribute was not found, which should never happen because the bean 
6
CodeRank
Contextual code suggestions in your IDE  Get Codota for Java
This code example shows how to use the following methods:getCause
    try { 
      value = mBeanServer.getAttribute(oname, attName);
    } catch (RuntimeMBeanException e) {
      // UnsupportedOperationExceptions happen in the normal course of business, 
      // so no need to log them as errors all the time. 
      if (e.getCause() instanceof UnsupportedOperationException) {
        LOG.debug("getting attribute "+attName+" of "+oname+" threw an exception", e);
      } else { 
        LOG.error("getting attribute "+attName+" of "+oname+" threw an exception", e);
      } 
      return; 
    } catch (RuntimeErrorException e) {
      // RuntimeErrorException happens when an unexpected failure occurs in getAttribute 
      // for example https://issues.apache.org/jira/browse/DAEMON-120 
      LOG.debug("getting attribute "+attName+" of "+oname+" threw an exception", e);
      return; 
    } catch (AttributeNotFoundException e) {
      //Ignored the attribute was not found, which should never happen because the bean 
      //just told us that it has this attribute, but if this happens just don't output 
      //the attribute. 
5
CodeRank
Contextual code suggestions in your IDE  Get Codota for Java
This code example shows how to use the following methods:getCause
     * 
     * @param e the exception to check 
     * @param perm the missing permission to check for 
     */ 
    private void vetException(RuntimeMBeanException e, Permission perm) {
        Throwable cause = e.getCause();
        if (cause instanceof SecurityException) {
            String msg = cause.getMessage();
            if (msg != null && msg.contains(perm.toString())) {
                // This is the expected exception. 
                return; 
            } 
        } 
 
        fail("Unexpected exception", e);
    } 
 
    /** 
     * Test that the CacheManagerMBean can be accessed if the code base 
     * runs with the same permissions as the {@link #withoutPermsTest} test 
5
CodeRank
Contextual code suggestions in your IDE  Get Codota for Java
This code example shows how to use the following methods:getCause
                        new String[]{"java.lang.String", "boolean"});
            } else { 
                throw exception;
            } 
        } catch (RuntimeMBeanException e) {
            Throwable f = e.getCause();
            if (f instanceof Exception){
                throw (Exception )f;
            } 
            throw e;
        } catch (MBeanException e) {
            Throwable f = e.getCause();
            if (f instanceof Exception){
                throw (Exception )f;
            } 
            throw e;
        } 
    } 
} 
 
4
CodeRank
Contextual code suggestions in your IDE  Get Codota for Java
This code example shows how to use the following methods:
      } 
      catch (InvocationTargetException x)
      { 
         Throwable t = x.getTargetException();
         if (t instanceof RuntimeException)
            throw new RuntimeMBeanException((RuntimeException)t);
         else if (t instanceof Exception) throw new MBeanException((Exception)t);
         throw new RuntimeErrorException((Error)t);
      } 
   } 
 
   /** 
    * Returns the (public) method with the given name and signature on the given class. <br> 
    * Override to return non-public methods, or to map methods to other classes, or to map methods with 
    * different signatures 
    * @see #invoke(String, Class[], Object[]) 
    * @see #invokeMethod 
    */ 
   protected Method findMethod(Class cls, String name, Class[] params) throws NoSuchMethodException
4
CodeRank
Contextual code suggestions in your IDE  Get Codota for Java
This code example shows how to use the following methods:getTargetException
                                return method.invoke(innerObject, args);
                            } catch (InvocationTargetException e) {
                                try { 
                                    throw e.getTargetException();
                                } catch (RuntimeMBeanException e2) {
                                    throw e2.getTargetException();
                                } 
                            } 
                        } 
                    } 
        ); 
        return (T) proxy; 
    } 
 
} 
3
CodeRank
Contextual code suggestions in your IDE  Get Codota for Java
This code example shows how to use the following methods:getTargetException
    public Object invoke(List<String> args) {
        Object result; 
        try { 
            result = proxy.invokeStep(remoteStepId, args);
        } catch (RuntimeMBeanException mbe) {
            RuntimeException targetException = mbe.getTargetException();
            throw targetException;
        } catch (Exception e) {
            throw new ChorusException(e);
        } 
        return result; 
    } 
 
    /** 
     * @return a String id for this step invoker, which should be unique and final 
     */ 
    public String getId() {
        return "RemoteStepInvoker" + System.identityHashCode(this);
    } 
 
3
CodeRank
Contextual code suggestions in your IDE  Get Codota for Java
See Code Examples for Java 8 RuntimeMBeanException Methods: