[Logo] Terracotta Discussion Forums (LEGACY READ-ONLY ARCHIVE)
  [Search] Search   [Recent Topics] Recent Topics   [Members]  Member Listing   [Groups] Back to home page 
[Register] Register / 
[Login] Login 
[Expert]
MasterWorker TIM and Spring  XML
Forum Index -> Terracotta for Spring
Author Message
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 :)
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
[Yahoo!]
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.
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
 
Forum Index -> Terracotta for Spring
Go to:   
Powered by JForum 2.1.7 © JForum Team