TRAP/J 2.2 User Manual

Important Note: TRAP/J does not support adaptation of final, static, native, and main.

Writing Delegates

  1. Follow the instructions in the "Adding Adaptability to Your Application" page to enable adaptability in your application.
  2. Create a new class somewhere within the package structure of your application.
  3. 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
    {
       ...
    }
  4. Implement the methods given in the interface.
    Note: Ensure that your delegate method has the exact signature of the original method.
  5. Compile the delegate.

  6. Your delegate is now ready to be used with your application.
« Adding Adaptability to your Application Table of Contents
TRAP/J Home
Using the Local Composer to Adapt Applications »