use of javax.management.ReflectionException in project wildfly-core by wildfly.
the class PluggableMBeanServerImpl method createMBean.
@Override
public ObjectInstance createMBean(String className, ObjectName name, Object[] params, String[] signature) throws ReflectionException, InstanceAlreadyExistsException, MBeanException, NotCompliantMBeanException {
params = nullAsEmpty(params);
signature = nullAsEmpty(signature);
Throwable error = null;
MBeanServerPlugin delegate = null;
final boolean readOnly = false;
try {
delegate = findDelegateForNewObject(name);
authorizeMBeanOperation(delegate, name, CREATE_MBEAN, null, JmxAction.Impact.WRITE);
return checkNotAReservedDomainRegistrationIfObjectNameWasChanged(name, delegate.createMBean(className, name, params, signature), delegate);
} catch (Exception e) {
error = e;
if (e instanceof ReflectionException)
throw (ReflectionException) e;
if (e instanceof InstanceAlreadyExistsException)
throw (InstanceAlreadyExistsException) e;
if (e instanceof MBeanException)
throw (MBeanException) e;
if (e instanceof NotCompliantMBeanException)
throw (NotCompliantMBeanException) e;
throw makeRuntimeException(e);
} finally {
if (shouldAuditLog(delegate, readOnly)) {
new MBeanServerAuditLogRecordFormatter(this, error, readOnly).createMBean(className, name, params, signature);
}
}
}
use of javax.management.ReflectionException in project wildfly-core by wildfly.
the class PluggableMBeanServerImpl method getMBeanInfo.
private MBeanInfo getMBeanInfo(ObjectName name, boolean logAndAuthorize, boolean nullIfNotFound) throws InstanceNotFoundException, IntrospectionException, ReflectionException {
Throwable error = null;
MBeanServerPlugin delegate = null;
final boolean readOnly = true;
try {
delegate = findDelegate(name);
if (logAndAuthorize) {
authorizeMBeanOperation(delegate, name, GET_MBEAN_INFO, null, JmxAction.Impact.READ_ONLY);
}
return delegate.getMBeanInfo(name);
} catch (Exception e) {
if (nullIfNotFound) {
return null;
}
error = e;
if (e instanceof InstanceNotFoundException)
throw (InstanceNotFoundException) e;
if (e instanceof IntrospectionException)
throw (IntrospectionException) e;
if (e instanceof ReflectionException)
throw (ReflectionException) e;
throw makeRuntimeException(e);
} finally {
if (logAndAuthorize && shouldAuditLog(delegate, readOnly)) {
new MBeanServerAuditLogRecordFormatter(this, error, readOnly).getMBeanInfo(name);
}
}
}
use of javax.management.ReflectionException in project wildfly-core by wildfly.
the class PluggableMBeanServerImpl method instantiate.
@Override
public Object instantiate(String className, Object[] params, String[] signature) throws ReflectionException, MBeanException {
params = nullAsEmpty(params);
signature = nullAsEmpty(signature);
Throwable error = null;
MBeanServerPlugin delegate = rootMBeanServer;
final boolean readOnly = false;
try {
// Special authorization
authorizeClassloadingOperation(delegate, INSTANTIATE);
return delegate.instantiate(className, params, signature);
} catch (Exception e) {
error = e;
if (e instanceof ReflectionException)
throw (ReflectionException) e;
if (e instanceof MBeanException)
throw (MBeanException) e;
throw makeRuntimeException(e);
} finally {
if (shouldAuditLog(delegate, readOnly)) {
new MBeanServerAuditLogRecordFormatter(this, error, readOnly).instantiate(className, params, signature);
}
}
}
use of javax.management.ReflectionException in project wildfly-core by wildfly.
the class PluggableMBeanServerImpl method deserialize.
@Override
@Deprecated
public ObjectInputStream deserialize(String className, ObjectName loaderName, byte[] data) throws OperationsException, ReflectionException {
Throwable error = null;
MBeanServerPlugin delegate = rootMBeanServer;
final boolean readOnly = true;
try {
// Special authorization
authorizeClassloadingOperation(delegate, loaderName, DESERIALIZE);
return delegate.deserialize(className, loaderName, data);
} catch (Exception e) {
error = e;
if (e instanceof OperationsException)
throw (OperationsException) e;
if (e instanceof ReflectionException)
throw (ReflectionException) e;
throw makeRuntimeException(e);
} finally {
if (shouldAuditLog(delegate, readOnly)) {
new MBeanServerAuditLogRecordFormatter(this, error, readOnly).deserialize(className, loaderName, data);
}
}
}
use of javax.management.ReflectionException in project wildfly-core by wildfly.
the class PluggableMBeanServerImpl method instantiate.
@Override
public Object instantiate(String className, ObjectName loaderName) throws ReflectionException, MBeanException, InstanceNotFoundException {
Throwable error = null;
MBeanServerPlugin delegate = rootMBeanServer;
final boolean readOnly = false;
try {
// Special authorization
authorizeClassloadingOperation(delegate, INSTANTIATE);
return delegate.instantiate(className, loaderName);
} catch (Exception e) {
error = e;
if (e instanceof ReflectionException)
throw (ReflectionException) e;
if (e instanceof MBeanException)
throw (MBeanException) e;
if (e instanceof InstanceNotFoundException)
throw (InstanceNotFoundException) e;
throw makeRuntimeException(e);
} finally {
if (shouldAuditLog(delegate, readOnly)) {
new MBeanServerAuditLogRecordFormatter(this, error, readOnly).instantiate(className, loaderName);
}
}
}
Aggregations