coherence-community / oracle-bedrock

Oracle Bedrock
Other
55 stars 31 forks source link

Provide the ability to serialize unserializable results returned by dynamic proxies of remote instances #130

Closed brianoliver closed 10 years ago

brianoliver commented 10 years ago

When making a call to a dynamically generated proxy, if the return value is an unserializable map/set/list (ie: collection), the result will fai lto be returned. However in some circumstances it's possible that we could create and return a serializable version, eg: if the return type is a Map but the implementation is not serializable, we could create and return a serializable Map. This would then allow non-serializable return values to be returned.

eg: When calling NamedCache.entrySet(), the returned entries may not be serializable.

Ideally we need to provide the RemoteMethodInvocation class with a mechanism to intercept and transform the results of method invocations into something that is serializable. While we can attempt to do this generically (ie: if it's an unserializable Map, put all of the entries into a new serializable Map), often this is not enough as the Map.Entries themselves may not be serializable.

Consequently we need to offer a custom mechanism that will allow specific proxy implementations (like those of NameCache), to be customized so that return results may work as expected.

To achieve this we should; a). move the RemoteMethodInvocation class into the com.oracle.tools.runtime.concurrent.callable package b). introduce the notion of a RemoteMethodInvocation.Interceptor (that of which is optional), which can be provided to RemoteMethodInvocation instances for intercepting and transforming arguments, results and exceptions.

This would provide implementors the ability to intercept the complete context of the invocation, including the result. Additionally it would allow exceptions to be thrown if the result can't be transformed.

brianoliver commented 8 years ago

This issue was imported from JIRA ORACLETOOLS-130

brianoliver commented 10 years ago

Reported by @brianoliver

brianoliver commented 10 years ago

Marked as fixed by @brianoliver on Monday, July 7th 2014, 11:56:36 am