This is way too cool,

Thanks 

-D


Mario Ivankovits wrote:
> 
> Hi!
>>>>> Like a scheduler within the webapp? this way i can have orchestra to
>>>>> keep
>>>>> EntityManager round to do 
>>>>> lazy loading of a huge object.
>>>>>   
>>>>>         
>>>> No, many of Orchestra's data-structures are kept in the session scope 
>>>> which is not available during a non http request.
>>>>       
> After thinking about again it I realized that I wrote nonsense here.
> In fact Orchestra WILL work in non servlet environments .... for 
> example, we startup a compatible environment for our junit tests.
> 
> And it sould be simple - it is all about the FrameworkAdapter.
> I've copied our mock class over to the core and now there is a 
> org.apache.myfaces.orchestra.frameworkAdapter.local.LocalFrameworkAdapter 
> class which should help you to solve the problem.
> 
> Use it with something like this:
> 
>         LocalFrameworkAdapter frameworkAdapter = new 
> LocalFrameworkAdapter();
>         frameworkAdapter.setApplicationContext(applicationContext); // 
> <= the Spring application context you have to gather from somewhere
>         FrameworkAdapter.setInstance(frameworkAdapter);
> 
> Notice, FrameworkAdapter.setInstance is thread bound, so you'll have to 
> do this for each thread going to use Orchestra.
> If you use a fresh frameworkAdapter per run or share it over multiple 
> runs is up to you, depending if you have conversations running longer 
> than one sheduler task, however, the LocalFrameworkAdapter is not thread 
> safe. If you need such a feature, just copy over the 
> LocalFrameworkAdapter and synchronized the maps, however (2), the entity 
> manager itself is not thread safe.
> 
> I don't know how your sheduler works, but you also could configure this 
> FrameworkAdapter as prototype in Spring and get the ApplicationContext 
> injected ... automatically.
> 
> 
> Ciao,
> Mario
> 
> 
> 

-- 
View this message in context: 
http://www.nabble.com/-Orchestra--Does-Orchestra-work-with-non-web-client--tf4410349.html#a12608390
Sent from the My Faces - Dev mailing list archive at Nabble.com.

Reply via email to