felix-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Richard S. Hall" <he...@ungoverned.org>
Subject Re: [iPOJO] Question about bind changes in runtime
Date Sat, 19 Jan 2013 22:55:15 GMT
On 1/19/13 13:04 , fabiolf wrote:
> Good afternoon everybody!
>
> I have a question about how iPOJO works on the Dynamic Reconfiguration
> field. I've been working with iPOJO mainly in the scenario of changing a
> bind in a component instance dependency when the provider is not available
> anymore. So, when it is not available we can be sure it is not servicing any
> requests.
>
> However, there is another scenario with iPOJO that the bind can be changed
> when a provider can be possible servicing requests; if I provide a
> comparator that ranks the providers, if a new higher in the rank provider is
> available, iPOJO changes the bind automatically, right?

If you've set the binding policy for that dependency to be 
"dynamic-priority", then yes. Otherwise, no.

> In that case, what
> is the behavior? iPOJO waits for the request to be processed? If yes, how
> does it do it? Or it just changes the bind without worrying much about
> possible servicing requests?

I don't know for sure if there is some specific mechanism in iPOJO to 
detect this case and do something special, but ordinarily iPOJO uses a 
service caching mechanism for threads that enter an iPOJO managed 
instance. This ensures that once a thread enters a component instance 
method, it will see the same service instances it uses until the thread 
ultimately exits the instance method.

So, in short, I don't think there would ever be a case where iPOJO would 
switch services in mid-stream on a thread, since it was explicitly 
designed to avoid doing so and thus relieve the component developer from 
worrying about that concurrency issues.

-> richard

>
> Thanks,
> Fabio
>
>
>
> --
> View this message in context: http://apache-felix.18485.n6.nabble.com/iPOJO-Question-about-bind-changes-in-runtime-tp5001457.html
> Sent from the Apache Felix - Users mailing list archive at Nabble.com.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@felix.apache.org
> For additional commands, e-mail: users-help@felix.apache.org
>


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@felix.apache.org
For additional commands, e-mail: users-help@felix.apache.org


Mime
View raw message