Methods Summary |
---|
public static void | addNotificationListenerObjectName(java.lang.Exception e)
if (e instanceof InstanceNotFoundException)
throw (InstanceNotFoundException)e;
else if (e instanceof RuntimeException)
throw (RuntimeException)e;
else if (e instanceof NotSerializableException)
throw wrappedSerializationException(e);
else
throw wrappingIoException(e);
|
public static void | addNotificationListeners(java.lang.Exception e)
addNotificationListenerObjectName(e);
|
public static void | createMBean(java.lang.Exception e)
if (e instanceof ReflectionException)
throw (ReflectionException)e;
else if (e instanceof InstanceAlreadyExistsException)
throw (InstanceAlreadyExistsException)e;
else if (e instanceof MBeanRegistrationException)
throw (MBeanRegistrationException)e;
else if (e instanceof MBeanException)
throw (MBeanException)e;
else if (e instanceof NotCompliantMBeanException)
throw (NotCompliantMBeanException)e;
else if (e instanceof RuntimeException)
throw (RuntimeException)e;
else if (e instanceof NotSerializableException)
throw wrappedSerializationException(e);
else
throw wrappingIoException(e);
|
public static void | createMBeanLoader(java.lang.Exception e)
if (e instanceof ReflectionException)
throw (ReflectionException)e;
else if (e instanceof InstanceAlreadyExistsException)
throw (InstanceAlreadyExistsException)e;
else if (e instanceof MBeanRegistrationException)
throw (MBeanRegistrationException)e;
else if (e instanceof MBeanException)
throw (MBeanException)e;
else if (e instanceof NotCompliantMBeanException)
throw (NotCompliantMBeanException)e;
else if (e instanceof InstanceNotFoundException)
throw (InstanceNotFoundException)e;
else if (e instanceof RuntimeException)
throw (RuntimeException)e;
else if (e instanceof NotSerializableException)
throw wrappedSerializationException(e);
else
throw wrappingIoException(e);
|
public static void | createMBeanLoaderParams(java.lang.Exception e)
createMBeanLoader(e); //throws exact same set of exceptions.
|
public static void | createMBeanParams(java.lang.Exception e)
createMBean(e); //throws exact same set of exceptions.
|
public static void | getAttribute(java.lang.Exception e)
if (e instanceof MBeanException)
throw (MBeanException)e;
else if (e instanceof AttributeNotFoundException)
throw (AttributeNotFoundException)e;
else if (e instanceof InstanceNotFoundException)
throw (InstanceNotFoundException)e;
else if (e instanceof ReflectionException)
throw (ReflectionException)e;
else if (e instanceof RuntimeException)
throw (RuntimeException)e;
else if (e instanceof NotSerializableException)
throw wrappedSerializationException(e);
else //has to be this, otherwise a ClassCastException results.
throw wrappingIoException(e);
|
public static void | getAttributes(java.lang.Exception e)
if (e instanceof InstanceNotFoundException)
throw (InstanceNotFoundException)e;
else if (e instanceof ReflectionException)
throw (ReflectionException)e;
else if (e instanceof RuntimeException)
throw (RuntimeException)e;
else if (e instanceof NotSerializableException)
throw wrappedSerializationException(e);
else
throw wrappingIoException(e);
|
public static void | getDefaultDomain(java.lang.Exception e)
getIOException(e); //throws exact same set of exceptions
|
public static void | getDomains(java.lang.Exception e)
getIOException(e); // throws exact same set of exceptions
|
private static void | getIOException(java.lang.Exception e)
throw wrappingIoException(e); // has to be this, otherwise ClassCastException results
|
public static void | getMBeanCount(java.lang.Exception e)
getIOException(e); // throws exact same set of exceptions
|
public static void | getMBeanInfo(java.lang.Exception e)
if (e instanceof InstanceNotFoundException)
throw (InstanceNotFoundException)e;
else if (e instanceof IntrospectionException)
throw (IntrospectionException)e;
else if (e instanceof ReflectionException)
throw (ReflectionException)e;
else if (e instanceof RuntimeException)
throw (RuntimeException)e;
else if (e instanceof NotSerializableException)
throw wrappedSerializationException(e);
else
throw wrappingIoException(e);
|
public static void | getObjectInstance(java.lang.Exception e)
if (e instanceof InstanceNotFoundException)
throw (InstanceNotFoundException)e;
else if (e instanceof RuntimeException)
throw (RuntimeException)e;
else if (e instanceof NotSerializableException)
throw wrappedSerializationException(e);
else
throw wrappingIoException(e);
|
public static void | invoke(java.lang.Exception e)
if (e instanceof InstanceNotFoundException)
throw (InstanceNotFoundException)e;
else if (e instanceof MBeanException)
throw (MBeanException)e;
else if (e instanceof ReflectionException)
throw (ReflectionException)e;
else if (e instanceof RuntimeException)
throw (RuntimeException)e;
else if (e instanceof NotSerializableException)
throw wrappedSerializationException(e);
else //CCE Results?
throw wrappingIoException(e);
|
public static void | isInstanceOf(java.lang.Exception e)
if (e instanceof InstanceNotFoundException)
throw (InstanceNotFoundException)e;
else if (e instanceof RuntimeException)
throw (RuntimeException)e;
else if (e instanceof NotSerializableException)
throw wrappedSerializationException(e);
else
throw wrappingIoException(e);
|
public static void | isRegistered(java.lang.Exception e)
getIOException(e); // throws exact same set of exceptions
|
public static void | queryMBeans(java.lang.Exception e)
if (e instanceof NotSerializableException)
throw wrappedSerializationException(e);
getIOException(e); // throws exact same set of exceptions
|
public static void | queryNames(java.lang.Exception e)
if (e instanceof NotSerializableException)
throw wrappedSerializationException(e);
getIOException(e); // throws exact same set of exceptions
|
public static void | removeNotificationListener(java.lang.Exception e)
if (e instanceof InstanceNotFoundException)
throw (InstanceNotFoundException)e;
else if (e instanceof ListenerNotFoundException)
throw (ListenerNotFoundException)e;
else if (e instanceof RuntimeException)
throw (RuntimeException)e;
else if (e instanceof NotSerializableException)
throw wrappedSerializationException(e);
else
throw wrappingIoException(e);
|
public static void | removeNotificationListenerFilterHandback(java.lang.Exception e)
removeNotificationListener(e);
|
public static void | removeNotificationListenerObjectName(java.lang.Exception e)
removeNotificationListener(e);
|
public static void | removeNotificationListenerObjectNameFilterHandback(java.lang.Exception e)
removeNotificationListener(e);
|
public static void | setAttribute(java.lang.Exception e)
if (e instanceof AttributeNotFoundException)
throw (AttributeNotFoundException)e;
else if (e instanceof InstanceNotFoundException)
throw (InstanceNotFoundException)e;
else if (e instanceof InvalidAttributeValueException)
throw (InvalidAttributeValueException)e;
else if (e instanceof MBeanException)
throw (MBeanException)e;
else if (e instanceof RuntimeException)
throw (RuntimeException)e;
else if (e instanceof NotSerializableException)
throw wrappedSerializationException(e);
else
throw wrappingIoException(e);
|
public static void | setAttributes(java.lang.Exception e)
if (e instanceof InstanceNotFoundException)
throw (InstanceNotFoundException)e;
else if (e instanceof ReflectionException)
throw (ReflectionException)e;
else if (e instanceof RuntimeException)
throw (RuntimeException)e;
else if (e instanceof NotSerializableException)
throw wrappedSerializationException(e);
else
throw wrappingIoException(e);
|
public static void | unregisterMBean(java.lang.Exception e)
if (e instanceof InstanceNotFoundException)
throw (InstanceNotFoundException)e;
else if (e instanceof MBeanRegistrationException)
throw (MBeanRegistrationException)e;
else if (e instanceof RuntimeException)
throw (RuntimeException)e;
else if (e instanceof NotSerializableException)
throw wrappedSerializationException(e);
else
throw wrappingIoException(e);
|
private static java.lang.RuntimeException | wrappedSerializationException(java.lang.Exception e)A method to create a {@link java.io.NotSerializableException} if that
is what gets thrown by the server. It may happen that the server while
invoking a specific MBeanServerConnection method throws a NotSerializableException
especially if an MBean attribute is not serialiable, invocation result of
invoke method is not serializable etc. There is an argument around what to
do in this case because {@link java.io.IOException} is kind of reserved
for any communication problems and {@link java.io.NotSerializableException}
extends {@link java.io.IOException} :). This means that I can't throw only
IOException. Hence this method.
final String dm = e.getMessage();
final Throwable cause = e.getCause();
final StackTraceElement[] st = e.getStackTrace();
final RuntimeException re = new RuntimeException(dm);
if (cause != null) {
re.initCause(cause);
}
if (st != null) {
re.setStackTrace(st);
}
return ( re );
|
private static java.io.IOException | wrappingIoException(java.lang.Throwable t)The method which acts as a "catch-all". In the distributed environment, it
is obvious that a large set of exceptions is thrown under various circumstances.
The ultimate exception on which this implementation falls back is {@link
java.io.IOException}. This method receives such an exception, that is
not any of those thrown by MBeanServerConnection's methods, and
carefully arranges its stack and initial cause. The returned instance of
IOException has these properties:
Its stack is intact. (if not null)
The actual exception becomes the init cause. (if not null, which is the case)
if (t instanceof RedirectException) return (RedirectException) t;
final String dm = t.getMessage();
final Throwable cause = t.getCause();
final StackTraceElement[] st = t.getStackTrace();
final IOException ioe = new IOException (dm);
if (cause != null) {
ioe.initCause(cause);
}
if (st != null) {
ioe.setStackTrace(st);
}
return ( ioe );
|