coherence-community / oracle-bedrock

Oracle Bedrock
Other
55 stars 31 forks source link

Introduce the ability to inject RemoteChannels into RemoteCallables and RemoteRunnables #381

Closed brianoliver closed 7 years ago

brianoliver commented 7 years ago

As a developer often I'd like the ability to access and use the underlying RemoteChannel that is initiating the execution of a RemoteCallable or RemoteRunnable, say to asynchronously send back other callables/runnables or emit events.

Instead of changing the RemoteCallable / RemoteRunnable interfaces or introducing new RemoteChannel aware interfaces, we should simply allow implementations to annotate fields and methods requiring a RemoteChannel to be injected using the @RemoteChannel.Inject annotation, prior to execution.

For example: Permit the following

@RemoteChannel.Inject
public/private RemoteChannel channel;   // this should be injected prior to execution

and

@RemoteChannel.Inject
public/private void setRemoteChannel(RemoteChannel channel) { ... }