"adrian(a)jboss.org" wrote :
| 2) The other is as I mention above. Use the ScopeKey as the builder class
| and retrieve a more optimizated key for internal use within the MDR.
|
| e.g. something like:
|
| | public class ScopeKey
| | {
| | ...
| |
| | Object getOptimzedKey() {} // Key for use at runtime
| | }
| |
|
| In fact (1) and (2) are just variations on the same theme, with (2) potentially
| being more optimal.
|
I'm trying to do (2) as follows.
| public class ScopeKey
| {
| ...
|
| /**
| * The returned ScopeKey is immutable and optimized for use at runtime.
| * @return Optimized immutable ScopeKey
| */
| public ScopeKey getOptimizedKey()
| {
| return new UnmodifiableScopeKey(this);
| }
|
| }
|
Where UnmodifiableScopeKey is similar to the code that I previously posted.
There is a dependency between UnmodifiableScopeKey + ScopeKey that needs to be manually
maintained but maybe I could test for that in a UnmodifiableScopeKey unit test.
UnmodifiableScopeKey extends ScopeKey and overides all of the public ScopeKey methods.
The (work in progress) UnmodifiableScopeKey source is here
http://pastebin.com/m5d484e25
Does UnmodifiableScopeKey work for everyone? I assume this will work as the
optimizedKey.
View the original post :
http://www.jboss.org/index.html?module=bb&op=viewtopic&p=4249231#...
Reply to the post :
http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&a...