Author |
Message |
04/08/2009 22:10:42
|
unnutz
master
Joined: 12/18/2008 02:56:28
Messages: 69
Offline
|
Hi.
What approach could you suggest when implementing distributed master-worker application based on MasterWorker TIM and built over the Spring IoC?
Application uses WorkManager API. What if exact Work instance needed access to some local bean?
The only way I see is storing ApplicationContext somewhere in static property of some class and when Work object materialized on VM get access to ApplicationContext through this. But it is not very clear and would not be too readable as there could be a lot of different Work subclasses.
Thanks :)
|
|
|
04/09/2009 00:45:54
|
sergiob
jedi
Joined: 08/06/2007 06:24:12
Messages: 118
Offline
|
unnutz wrote:
The only way I see is storing ApplicationContext somewhere in static property of some class and when Work object materialized on VM get access to ApplicationContext through this.
AFAIK, this is currently the only viable solution: some kind of static lookup.
You may also mark the injected field as transient, tell Terracotta not to share it among cluster nodes and then use Terracotta onLoad materialization for setting it in remote nodes, but that shouldn't differ that much from the first solution.
I was thinking of adding dependency injection facilities for materializing transient fields in distributed objects, but this is just a thought right now.
Cheers,
Sergio B.
|
Sergio Bossa - Terracotta Forge Team |
|
|
04/09/2009 00:50:59
|
unnutz
master
Joined: 12/18/2008 02:56:28
Messages: 69
Offline
|
sergiob wrote:
I was thinking of adding dependency injection facilities for materializing transient fields in distributed objects, but this is just a thought right now.
Mmm. Could you share your thoughts on this? How it can be implemented? APIs or whatever. I wish I could help and contribute into the code.
Thanks a lot.
Sincerely,
Artyom.
|
|
|
07/22/2011 01:38:25
|
gyan10
ophanim
Joined: 06/28/2011 23:15:25
Messages: 701
Offline
|
This is very old thread.Please respond if issue is still not resolved.
Thanks
|
Gyan Awasthi
Terracotta -A Software AG company |
|
|
|