TRAP/J 2.2 User Manual
Important Note: TRAP/J does not support adaptation of final
, static
, native
, and main
.
Writing Delegates
- Follow the instructions in the "Adding Adaptability to Your Application"
page to enable adaptability in your application.
- Create a new class somewhere within the package structure of your application.
- Implement the proper interface in your new class. This interface will be of the form:
<MethodName>_TRAPJInterface
Example:
Original Code -
public void originalMethod(...)
{
...
}
Delegate -
public class DelegateClass implements OriginalMethod_TRAPJInterface
{
...
}
- Implement the methods given in the interface.
Note: Ensure that your delegate method has the exact signature of the original method.
- Compile the delegate.
- Your delegate is now ready to be used with your application.