-
@Retention(RUNTIME) @Target(FIELD) public static @interface CodeRootDelegate.Driver
Mark a field referencing an interface implementation to be wrapped by an interface proxy, and used to drive updates of the root. Any call to the proxy will cause a root update on the calling thread, prior to calling through to the interface implementation.By default, polling for messages will be done in a background thread between calls to the interface - code may execute outside of calls to the interface. Updates may also be forced on the background thread if the interface has not been called in some time.
The field must refer to the desired implementation after delegate instantiation - the easiest way is to initialize the field with the right value. The field value will be wrapped in a proxy, which will be set as the new field value during code attachment. This way the implementation of the interface may be freely changed, while the reference passed to external code remains constant.
The field type must be that of the desired interface rather than its implementation.