if (hasBeforeMarshalCallback) {
try {
Method beforeMarshal = null;
if (PrivilegedAccessHelper.shouldUsePrivilegedAccess()){
try{
beforeMarshal = (Method)AccessController.doPrivileged(new PrivilegedGetMethod(domainClass, "beforeMarshal", params, false));
}catch (PrivilegedActionException ex){
if (ex.getCause() instanceof NoSuchMethodException){
throw (NoSuchMethodException) ex.getCause();
}
throw (RuntimeException)ex.getCause();
}
}else{
beforeMarshal = PrivilegedAccessHelper.getMethod(domainClass, "beforeMarshal", params, false);
}
setBeforeMarshalCallback(beforeMarshal);
} catch (NoSuchMethodException nsmex) {}
}
if (hasAfterMarshalCallback) {
try {
Method afterMarshal = null;
if (PrivilegedAccessHelper.shouldUsePrivilegedAccess()){
try{
afterMarshal = (Method)AccessController.doPrivileged(new PrivilegedGetMethod(domainClass, "afterMarshal", params, false));
}catch (PrivilegedActionException ex){
if (ex.getCause() instanceof NoSuchMethodException){
throw (NoSuchMethodException) ex.getCause();
}
throw (RuntimeException)ex.getCause();