OPENJPA-1881. Creating a new "completion" trace message for the enhancement processing.

git-svn-id: https://svn.apache.org/repos/asf/openjpa/trunk@1033480 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Kevin W. Sutter 2010-11-10 14:13:10 +00:00
parent 324ca8e894
commit 5040a436e7
2 changed files with 10 additions and 4 deletions

View File

@ -113,14 +113,14 @@ public class PCClassFileTransformer
if (className == null) {
return null;
}
// prevent re-entrant calls, which can occur if the enhanceing
// prevent re-entrant calls, which can occur if the enhancing
// loader is used to also load OpenJPA libraries; this is to prevent
// recursive enhancement attempts for internal openjpa libraries
if (_transforming)
return null;
_transforming = true;
return transform0(className, redef, bytes);
}
@ -131,7 +131,8 @@ public class PCClassFileTransformer
*/
private byte[] transform0(String className, Class redef, byte[] bytes)
throws IllegalClassFormatException {
byte[] returnBytes = null;
try {
Boolean enhance = needsEnhance(className, redef, bytes);
if (enhance != null && _log.isTraceEnabled())
@ -149,7 +150,8 @@ public class PCClassFileTransformer
if (enhancer.run() == PCEnhancer.ENHANCE_NONE)
return null;
return enhancer.getPCBytecode().toByteArray();
returnBytes = enhancer.getPCBytecode().toByteArray();
return returnBytes;
} catch (Throwable t) {
_log.warn(_loc.get("cft-exception-thrown", className), t);
if (t instanceof RuntimeException)
@ -159,6 +161,9 @@ public class PCClassFileTransformer
throw new GeneralException(t);
} finally {
_transforming = false;
if (returnBytes != null && _log.isTraceEnabled())
_log.trace(_loc.get("runtime-enhance-complete", className,
bytes.length, returnBytes.length));
}
}

View File

@ -25,6 +25,7 @@ bad-field: Missing field for property "{1}" in type "{0}".
reflect-security: Unable to access "{0}" via reflection. Make sure OpenJPA \
has the "suppressAccessChecks" permission.
needs-runtime-enhance: "{0}" requires runtime enhancement: {1}
runtime-enhance-complete: Enhancement for "{0}" completed. Class size: [{1}/{2}]
runtime-enhance-pcclasses: You have enabled runtime enhancement, but have not \
specified the set of persistent classes. OpenJPA must look for metadata \
for every loaded class, which might increase class load times significantly.