1<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> 2<!--NewPage--> 3<HTML> 4<HEAD> 5<!-- Generated by javadoc (build 1.5.0) on Thu May 15 17:17:33 EDT 2008 --> 6<TITLE> 7ClassEnhancer (Oracle - Berkeley DB Java API) 8</TITLE> 9 10<META NAME="keywords" CONTENT="com.sleepycat.persist.model.ClassEnhancer class"> 11 12<LINK REL ="stylesheet" TYPE="text/css" HREF="/style.css" TITLE="Style"> 13 14<SCRIPT type="text/javascript"> 15function windowTitle() 16{ 17 parent.document.title="ClassEnhancer (Oracle - Berkeley DB Java API)"; 18} 19</SCRIPT> 20<NOSCRIPT> 21</NOSCRIPT> 22 23</HEAD> 24 25<BODY BGCOLOR="white" onload="windowTitle();"> 26 27 28<!-- ========= START OF TOP NAVBAR ======= --> 29<A NAME="navbar_top"><!-- --></A> 30<A HREF="#skip-navbar_top" title="Skip navigation links"></A> 31<TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY=""> 32<TR> 33<TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> 34<A NAME="navbar_top_firstrow"><!-- --></A> 35<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY=""> 36 <TR ALIGN="center" VALIGN="top"> 37 <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="/overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A> </TD> 38 <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A> </TD> 39 <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> <FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT> </TD> 40 <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="class-use/ClassEnhancer.html"><FONT CLASS="NavBarFont1"><B>Use</B></FONT></A> </TD> 41 <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A> </TD> 42 <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="/deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A> </TD> 43 <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="/index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A> </TD> 44 <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="/help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A> </TD> 45 </TR> 46</TABLE> 47</TD> 48<TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM> 49<b>Berkeley DB</b><br><font size="-1"> version 4.7.25</font></EM> 50</TD> 51</TR> 52 53<TR> 54<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> 55 <A HREF="/com/sleepycat/persist/model/AnnotationModel.html" title="class in com.sleepycat.persist.model"><B>PREV CLASS</B></A> 56 <A HREF="/com/sleepycat/persist/model/ClassMetadata.html" title="class in com.sleepycat.persist.model"><B>NEXT CLASS</B></A></FONT></TD> 57<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> 58 <A HREF="/index.html?com/sleepycat/persist/model/ClassEnhancer.html" target="_top"><B>FRAMES</B></A> 59 <A HREF="ClassEnhancer.html" target="_top"><B>NO FRAMES</B></A> 60 <SCRIPT type="text/javascript"> 61 <!-- 62 if(window==top) { 63 document.writeln('<A HREF="/allclasses-noframe.html"><B>All Classes</B></A>'); 64 } 65 //--> 66</SCRIPT> 67<NOSCRIPT> 68 <A HREF="/allclasses-noframe.html"><B>All Classes</B></A> 69</NOSCRIPT> 70 71 72</FONT></TD> 73</TR> 74<TR> 75<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2"> 76 SUMMARY: NESTED | FIELD | <A HREF="#constructor_summary">CONSTR</A> | <A HREF="#method_summary">METHOD</A></FONT></TD> 77<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2"> 78DETAIL: FIELD | <A HREF="#constructor_detail">CONSTR</A> | <A HREF="#method_detail">METHOD</A></FONT></TD> 79</TR> 80</TABLE> 81<A NAME="skip-navbar_top"></A> 82<!-- ========= END OF TOP NAVBAR ========= --> 83 84<HR> 85<!-- ======== START OF CLASS DATA ======== --> 86<H2> 87<FONT SIZE="-1"> 88com.sleepycat.persist.model</FONT> 89<BR> 90Class ClassEnhancer</H2> 91<PRE> 92<A HREF="http://java.sun.com/j2se/1.5.0/docs/api/java/lang/Object.html" title="class or interface in java.lang">java.lang.Object</A> 93 <IMG SRC="/resources/inherit.gif" ALT="extended by "><B>com.sleepycat.persist.model.ClassEnhancer</B> 94</PRE> 95<DL> 96<DT><B>All Implemented Interfaces:</B> <DD><A HREF="http://java.sun.com/j2se/1.5.0/docs/api/java/lang/instrument/ClassFileTransformer.html" title="class or interface in java.lang.instrument">ClassFileTransformer</A></DD> 97</DL> 98<HR> 99<DL> 100<DT><PRE>public class <B>ClassEnhancer</B><DT>extends <A HREF="http://java.sun.com/j2se/1.5.0/docs/api/java/lang/Object.html" title="class or interface in java.lang">Object</A><DT>implements <A HREF="http://java.sun.com/j2se/1.5.0/docs/api/java/lang/instrument/ClassFileTransformer.html" title="class or interface in java.lang.instrument">ClassFileTransformer</A></DL> 101</PRE> 102 103<P> 104Enhances the bytecode of persistent classes to provide efficient access to 105 fields and constructors, and to avoid special security policy settings for 106 accessing non-public members. Classes are enhanced if they are annotated 107 with <A HREF="/com/sleepycat/persist/model/Entity.html" title="annotation in com.sleepycat.persist.model"><CODE>Entity</CODE></A> or <A HREF="/com/sleepycat/persist/model/Persistent.html" title="annotation in com.sleepycat.persist.model"><CODE>Persistent</CODE></A>. 108 109 <p><code>ClassEnhancer</code> objects are thread-safe. Multiple threads may 110 safely call the methods of a shared <code>ClassEnhancer</code> object.</p> 111 112 <p>As described in the <a 113 href="/package-summary.html#bytecode">package summary</a>, bytecode 114 enhancement may be used either at runtime or offline (at build time).</p> 115 116 <p>To use enhancement offline, this class may be used as a <A HREF="/com/sleepycat/persist/model/ClassEnhancer.html#main(java.lang.String[])"><CODE>main 117 program</CODE></A>. 118 </p> 119 120 <p>For enhancement at runtime, this class provides the low level support 121 needed to transform class bytes during class loading. To configure runtime 122 enhancement you may use one of the following approaches:</p> 123 <ol> 124 <li>For Java 1.5, the <code>je-<version>.jar</code> file may be used as an instrumentation 125 agent as follows: 126 <pre class="code">java -javaagent:lib/je-<version>.jar=enhance:packageNames ...</pre> 127 <code>packageNames</code> is a comma separated list of packages containing 128 persistent classes. Sub-packages of these packages are also searched. If 129 <code>packageNames</code> is omitted then all packages known to the current 130 classloader are searched. 131 <p>The "-v" option may be included in the comma separated list to print the 132 name of each class that is enhanced.</p></li> 133 <br> 134 <li>The <A HREF="/com/sleepycat/persist/model/ClassEnhancer.html#enhance(java.lang.String, byte[])"><CODE>enhance(java.lang.String, byte[])</CODE></A> method may be called to implement a class loader 135 that performs enhancement. Using this approach, it is the developer's 136 responsibility to implement and configure the class loader.</li> 137 </ol> 138<P> 139 140<P> 141<HR> 142 143<P> 144 145<!-- ======== CONSTRUCTOR SUMMARY ======== --> 146 147<A NAME="constructor_summary"><!-- --></A> 148<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> 149<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"> 150<TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2"> 151<B>Constructor Summary</B></FONT></TH> 152</TR> 153<TR BGCOLOR="white" CLASS="TableRowColor"> 154<TD><CODE><B><A HREF="/com/sleepycat/persist/model/ClassEnhancer.html#ClassEnhancer()">ClassEnhancer</A></B>()</CODE> 155 156<BR> 157 Creates a class enhancer that searches all packages.</TD> 158</TR> 159<TR BGCOLOR="white" CLASS="TableRowColor"> 160<TD><CODE><B><A HREF="/com/sleepycat/persist/model/ClassEnhancer.html#ClassEnhancer(java.util.Set)">ClassEnhancer</A></B>(<A HREF="http://java.sun.com/j2se/1.5.0/docs/api/java/util/Set.html" title="class or interface in java.util">Set</A><<A HREF="http://java.sun.com/j2se/1.5.0/docs/api/java/lang/String.html" title="class or interface in java.lang">String</A>> packageNames)</CODE> 161 162<BR> 163 Creates a class enhancer that searches a given set of packages.</TD> 164</TR> 165</TABLE> 166 167<!-- ========== METHOD SUMMARY =========== --> 168 169<A NAME="method_summary"><!-- --></A> 170<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> 171<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"> 172<TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2"> 173<B>Method Summary</B></FONT></TH> 174</TR> 175<TR BGCOLOR="white" CLASS="TableRowColor"> 176<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> 177<CODE> byte[]</CODE></FONT></TD> 178<TD><CODE><B><A HREF="/com/sleepycat/persist/model/ClassEnhancer.html#enhance(java.lang.String, byte[])">enhance</A></B>(<A HREF="http://java.sun.com/j2se/1.5.0/docs/api/java/lang/String.html" title="class or interface in java.lang">String</A> className, 179 byte[] classBytes)</CODE> 180 181<BR> 182 Enhances the given class bytes if the class is annotated with <A HREF="/com/sleepycat/persist/model/Entity.html" title="annotation in com.sleepycat.persist.model"><CODE>Entity</CODE></A> or <A HREF="/com/sleepycat/persist/model/Persistent.html" title="annotation in com.sleepycat.persist.model"><CODE>Persistent</CODE></A>.</TD> 183</TR> 184<TR BGCOLOR="white" CLASS="TableRowColor"> 185<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> 186<CODE> boolean</CODE></FONT></TD> 187<TD><CODE><B><A HREF="/com/sleepycat/persist/model/ClassEnhancer.html#getVerbose()">getVerbose</A></B>()</CODE> 188 189<BR> 190 Gets verbose mode.</TD> 191</TR> 192<TR BGCOLOR="white" CLASS="TableRowColor"> 193<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> 194<CODE>static void</CODE></FONT></TD> 195<TD><CODE><B><A HREF="/com/sleepycat/persist/model/ClassEnhancer.html#main(java.lang.String[])">main</A></B>(<A HREF="http://java.sun.com/j2se/1.5.0/docs/api/java/lang/String.html" title="class or interface in java.lang">String</A>[] args)</CODE> 196 197<BR> 198 Enhances classes in the directories specified.</TD> 199</TR> 200<TR BGCOLOR="white" CLASS="TableRowColor"> 201<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> 202<CODE>static void</CODE></FONT></TD> 203<TD><CODE><B><A HREF="/com/sleepycat/persist/model/ClassEnhancer.html#premain(java.lang.String, java.lang.instrument.Instrumentation)">premain</A></B>(<A HREF="http://java.sun.com/j2se/1.5.0/docs/api/java/lang/String.html" title="class or interface in java.lang">String</A> args, 204 <A HREF="http://java.sun.com/j2se/1.5.0/docs/api/java/lang/instrument/Instrumentation.html" title="class or interface in java.lang.instrument">Instrumentation</A> inst)</CODE> 205 206<BR> 207 Enhances classes as specified by a JVM -javaagent argument.</TD> 208</TR> 209<TR BGCOLOR="white" CLASS="TableRowColor"> 210<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> 211<CODE> void</CODE></FONT></TD> 212<TD><CODE><B><A HREF="/com/sleepycat/persist/model/ClassEnhancer.html#setVerbose(boolean)">setVerbose</A></B>(boolean verbose)</CODE> 213 214<BR> 215 Sets verbose mode.</TD> 216</TR> 217<TR BGCOLOR="white" CLASS="TableRowColor"> 218<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> 219<CODE> byte[]</CODE></FONT></TD> 220<TD><CODE><B><A HREF="/com/sleepycat/persist/model/ClassEnhancer.html#transform(java.lang.ClassLoader, java.lang.String, java.lang.Class, java.security.ProtectionDomain, byte[])">transform</A></B>(<A HREF="http://java.sun.com/j2se/1.5.0/docs/api/java/lang/ClassLoader.html" title="class or interface in java.lang">ClassLoader</A> loader, 221 <A HREF="http://java.sun.com/j2se/1.5.0/docs/api/java/lang/String.html" title="class or interface in java.lang">String</A> className, 222 <A HREF="http://java.sun.com/j2se/1.5.0/docs/api/java/lang/Class.html" title="class or interface in java.lang">Class</A><?> classBeingRedefined, 223 <A HREF="http://java.sun.com/j2se/1.5.0/docs/api/java/security/ProtectionDomain.html" title="class or interface in java.security">ProtectionDomain</A> protectionDomain, 224 byte[] classfileBuffer)</CODE> 225 226<BR> 227 </TD> 228</TR> 229</TABLE> 230 <A NAME="methods_inherited_from_class_java.lang.Object"><!-- --></A> 231<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> 232<TR BGCOLOR="#EEEEFF" CLASS="TableSubHeadingColor"> 233<TH ALIGN="left"><B>Methods inherited from class java.lang.<A HREF="http://java.sun.com/j2se/1.5.0/docs/api/java/lang/Object.html" title="class or interface in java.lang">Object</A></B></TH> 234</TR> 235<TR BGCOLOR="white" CLASS="TableRowColor"> 236<TD><CODE><A HREF="http://java.sun.com/j2se/1.5.0/docs/api/java/lang/Object.html#clone()" title="class or interface in java.lang">clone</A>, <A HREF="http://java.sun.com/j2se/1.5.0/docs/api/java/lang/Object.html#equals(java.lang.Object)" title="class or interface in java.lang">equals</A>, <A HREF="http://java.sun.com/j2se/1.5.0/docs/api/java/lang/Object.html#finalize()" title="class or interface in java.lang">finalize</A>, <A HREF="http://java.sun.com/j2se/1.5.0/docs/api/java/lang/Object.html#getClass()" title="class or interface in java.lang">getClass</A>, <A HREF="http://java.sun.com/j2se/1.5.0/docs/api/java/lang/Object.html#hashCode()" title="class or interface in java.lang">hashCode</A>, <A HREF="http://java.sun.com/j2se/1.5.0/docs/api/java/lang/Object.html#notify()" title="class or interface in java.lang">notify</A>, <A HREF="http://java.sun.com/j2se/1.5.0/docs/api/java/lang/Object.html#notifyAll()" title="class or interface in java.lang">notifyAll</A>, <A HREF="http://java.sun.com/j2se/1.5.0/docs/api/java/lang/Object.html#toString()" title="class or interface in java.lang">toString</A>, <A HREF="http://java.sun.com/j2se/1.5.0/docs/api/java/lang/Object.html#wait()" title="class or interface in java.lang">wait</A>, <A HREF="http://java.sun.com/j2se/1.5.0/docs/api/java/lang/Object.html#wait(long)" title="class or interface in java.lang">wait</A>, <A HREF="http://java.sun.com/j2se/1.5.0/docs/api/java/lang/Object.html#wait(long, int)" title="class or interface in java.lang">wait</A></CODE></TD> 237</TR> 238</TABLE> 239 240<P> 241 242<!-- ========= CONSTRUCTOR DETAIL ======== --> 243 244<A NAME="constructor_detail"><!-- --></A> 245<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> 246<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"> 247<TH ALIGN="left" COLSPAN="1"><FONT SIZE="+2"> 248<B>Constructor Detail</B></FONT></TH> 249</TR> 250</TABLE> 251 252<A NAME="ClassEnhancer()"><!-- --></A><H3> 253ClassEnhancer</H3> 254<PRE> 255public <B>ClassEnhancer</B>()</PRE> 256<DL> 257<DD>Creates a class enhancer that searches all packages. 258<P> 259</DL> 260<HR> 261 262<A NAME="ClassEnhancer(java.util.Set)"><!-- --></A><H3> 263ClassEnhancer</H3> 264<PRE> 265public <B>ClassEnhancer</B>(<A HREF="http://java.sun.com/j2se/1.5.0/docs/api/java/util/Set.html" title="class or interface in java.util">Set</A><<A HREF="http://java.sun.com/j2se/1.5.0/docs/api/java/lang/String.html" title="class or interface in java.lang">String</A>> packageNames)</PRE> 266<DL> 267<DD>Creates a class enhancer that searches a given set of packages. 268<P> 269<DL> 270<DT><B>Parameters:</B><DD><CODE>packageNames</CODE> - a set of packages to search for persistent 271 classes. Sub-packages of these packages are also searched. If empty or 272 null, all packages known to the current classloader are searched.</DL> 273</DL> 274 275<!-- ============ METHOD DETAIL ========== --> 276 277<A NAME="method_detail"><!-- --></A> 278<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> 279<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"> 280<TH ALIGN="left" COLSPAN="1"><FONT SIZE="+2"> 281<B>Method Detail</B></FONT></TH> 282</TR> 283</TABLE> 284 285<A NAME="main(java.lang.String[])"><!-- --></A><H3> 286main</H3> 287<PRE> 288public static void <B>main</B>(<A HREF="http://java.sun.com/j2se/1.5.0/docs/api/java/lang/String.html" title="class or interface in java.lang">String</A>[] args) 289 throws <A HREF="http://java.sun.com/j2se/1.5.0/docs/api/java/lang/Exception.html" title="class or interface in java.lang">Exception</A></PRE> 290<DL> 291<DD>Enhances classes in the directories specified. The class files are 292 replaced when they are enhanced, without changing the file modification 293 date. For example: 294 295 <pre class="code">java -cp je-<version>.jar com.sleepycat.persist.model.ClassEnhancer /classes</pre> 296 297 <p>The "-v" argument may be specified to print the name of each class 298 file that is enhanced. The total number of class files enhanced will 299 always be printed.</p> 300<P> 301<DD><DL> 302</DL> 303</DD> 304<DD><DL> 305<DT><B>Parameters:</B><DD><CODE>args</CODE> - one or more directories containing classes to be enhanced. 306 Subdirectories of these directories will also be searched. Optionally, 307 -v may be included to print the name of every class file enhanced. 308<DT><B>Throws:</B> 309<DD><CODE><A HREF="http://java.sun.com/j2se/1.5.0/docs/api/java/lang/Exception.html" title="class or interface in java.lang">Exception</A></CODE></DL> 310</DD> 311</DL> 312<HR> 313 314<A NAME="premain(java.lang.String, java.lang.instrument.Instrumentation)"><!-- --></A><H3> 315premain</H3> 316<PRE> 317public static void <B>premain</B>(<A HREF="http://java.sun.com/j2se/1.5.0/docs/api/java/lang/String.html" title="class or interface in java.lang">String</A> args, 318 <A HREF="http://java.sun.com/j2se/1.5.0/docs/api/java/lang/instrument/Instrumentation.html" title="class or interface in java.lang.instrument">Instrumentation</A> inst)</PRE> 319<DL> 320<DD>Enhances classes as specified by a JVM -javaagent argument. 321<P> 322<DD><DL> 323</DL> 324</DD> 325<DD><DL> 326<DT><B>See Also:</B><DD><A HREF="http://java.sun.com/j2se/1.5.0/docs/api/java/lang/instrument/package-summary.html"><CODE>java.lang.instrument</CODE></A></DL> 327</DD> 328</DL> 329<HR> 330 331<A NAME="setVerbose(boolean)"><!-- --></A><H3> 332setVerbose</H3> 333<PRE> 334public void <B>setVerbose</B>(boolean verbose)</PRE> 335<DL> 336<DD>Sets verbose mode. 337 338 <p>True may be specified to print the name of each class file that is 339 enhanced. This property is false by default.</p> 340<P> 341<DD><DL> 342</DL> 343</DD> 344<DD><DL> 345</DL> 346</DD> 347</DL> 348<HR> 349 350<A NAME="getVerbose()"><!-- --></A><H3> 351getVerbose</H3> 352<PRE> 353public boolean <B>getVerbose</B>()</PRE> 354<DL> 355<DD>Gets verbose mode. 356<P> 357<DD><DL> 358</DL> 359</DD> 360<DD><DL> 361<DT><B>See Also:</B><DD><A HREF="/com/sleepycat/persist/model/ClassEnhancer.html#setVerbose(boolean)"><CODE>setVerbose(boolean)</CODE></A></DL> 362</DD> 363</DL> 364<HR> 365 366<A NAME="transform(java.lang.ClassLoader, java.lang.String, java.lang.Class, java.security.ProtectionDomain, byte[])"><!-- --></A><H3> 367transform</H3> 368<PRE> 369public byte[] <B>transform</B>(<A HREF="http://java.sun.com/j2se/1.5.0/docs/api/java/lang/ClassLoader.html" title="class or interface in java.lang">ClassLoader</A> loader, 370 <A HREF="http://java.sun.com/j2se/1.5.0/docs/api/java/lang/String.html" title="class or interface in java.lang">String</A> className, 371 <A HREF="http://java.sun.com/j2se/1.5.0/docs/api/java/lang/Class.html" title="class or interface in java.lang">Class</A><?> classBeingRedefined, 372 <A HREF="http://java.sun.com/j2se/1.5.0/docs/api/java/security/ProtectionDomain.html" title="class or interface in java.security">ProtectionDomain</A> protectionDomain, 373 byte[] classfileBuffer)</PRE> 374<DL> 375<DD><DL> 376<DT><B>Specified by:</B><DD><CODE><A HREF="http://java.sun.com/j2se/1.5.0/docs/api/java/lang/instrument/ClassFileTransformer.html#transform(java.lang.ClassLoader, java.lang.String, java.lang.Class, java.security.ProtectionDomain, byte[])" title="class or interface in java.lang.instrument">transform</A></CODE> in interface <CODE><A HREF="http://java.sun.com/j2se/1.5.0/docs/api/java/lang/instrument/ClassFileTransformer.html" title="class or interface in java.lang.instrument">ClassFileTransformer</A></CODE></DL> 377</DD> 378<DD><DL> 379</DL> 380</DD> 381</DL> 382<HR> 383 384<A NAME="enhance(java.lang.String, byte[])"><!-- --></A><H3> 385enhance</H3> 386<PRE> 387public byte[] <B>enhance</B>(<A HREF="http://java.sun.com/j2se/1.5.0/docs/api/java/lang/String.html" title="class or interface in java.lang">String</A> className, 388 byte[] classBytes)</PRE> 389<DL> 390<DD>Enhances the given class bytes if the class is annotated with <A HREF="/com/sleepycat/persist/model/Entity.html" title="annotation in com.sleepycat.persist.model"><CODE>Entity</CODE></A> or <A HREF="/com/sleepycat/persist/model/Persistent.html" title="annotation in com.sleepycat.persist.model"><CODE>Persistent</CODE></A>. 391<P> 392<DD><DL> 393</DL> 394</DD> 395<DD><DL> 396<DT><B>Parameters:</B><DD><CODE>className</CODE> - the class name in binary format; for example, 397 "my.package.MyClass$Name", or null if no filtering by class name 398 should be performed.<DD><CODE>classBytes</CODE> - are the class file bytes to be enhanced. 399<DT><B>Returns:</B><DD>the enhanced bytes, or null if no enhancement was performed.</DL> 400</DD> 401</DL> 402<!-- ========= END OF CLASS DATA ========= --> 403<HR> 404 405 406<!-- ======= START OF BOTTOM NAVBAR ====== --> 407<A NAME="navbar_bottom"><!-- --></A> 408<A HREF="#skip-navbar_bottom" title="Skip navigation links"></A> 409<TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY=""> 410<TR> 411<TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> 412<A NAME="navbar_bottom_firstrow"><!-- --></A> 413<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY=""> 414 <TR ALIGN="center" VALIGN="top"> 415 <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="/overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A> </TD> 416 <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A> </TD> 417 <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> <FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT> </TD> 418 <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="class-use/ClassEnhancer.html"><FONT CLASS="NavBarFont1"><B>Use</B></FONT></A> </TD> 419 <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A> </TD> 420 <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="/deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A> </TD> 421 <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="/index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A> </TD> 422 <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="/help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A> </TD> 423 </TR> 424</TABLE> 425</TD> 426<TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM> 427<b>Berkeley DB</b><br><font size="-1"> version 4.7.25</font></EM> 428</TD> 429</TR> 430 431<TR> 432<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> 433 <A HREF="/com/sleepycat/persist/model/AnnotationModel.html" title="class in com.sleepycat.persist.model"><B>PREV CLASS</B></A> 434 <A HREF="/com/sleepycat/persist/model/ClassMetadata.html" title="class in com.sleepycat.persist.model"><B>NEXT CLASS</B></A></FONT></TD> 435<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> 436 <A HREF="/index.html?com/sleepycat/persist/model/ClassEnhancer.html" target="_top"><B>FRAMES</B></A> 437 <A HREF="ClassEnhancer.html" target="_top"><B>NO FRAMES</B></A> 438 <SCRIPT type="text/javascript"> 439 <!-- 440 if(window==top) { 441 document.writeln('<A HREF="/allclasses-noframe.html"><B>All Classes</B></A>'); 442 } 443 //--> 444</SCRIPT> 445<NOSCRIPT> 446 <A HREF="/allclasses-noframe.html"><B>All Classes</B></A> 447</NOSCRIPT> 448 449 450</FONT></TD> 451</TR> 452<TR> 453<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2"> 454 SUMMARY: NESTED | FIELD | <A HREF="#constructor_summary">CONSTR</A> | <A HREF="#method_summary">METHOD</A></FONT></TD> 455<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2"> 456DETAIL: FIELD | <A HREF="#constructor_detail">CONSTR</A> | <A HREF="#method_detail">METHOD</A></FONT></TD> 457</TR> 458</TABLE> 459<A NAME="skip-navbar_bottom"></A> 460<!-- ======== END OF BOTTOM NAVBAR ======= --> 461 462<HR> 463<font size=1>Copyright (c) 1996,2008 Oracle. All rights reserved.</font> 464</BODY> 465</HTML> 466