You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@felix.apache.org by Todor Boev <t....@prosyst.bg> on 2008/10/27 13:44:18 UTC

IPojo - ServiceUnavailableException?

Hello,
What does iPojo do if an active component (one running a thread) tries 
to access a service dependency that is not currently available? Does it 
cause the call to the dependency to throw something like 
ServiceUnavailableException? I.e. are the dependencies proxied or are 
they the raw service objects?
Cheers,
Todor

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


Re: IPojo - ServiceUnavailableException?

Posted by "Richard S. Hall" <he...@ungoverned.org>.

Clement Escoffier wrote:
> Exactly, 
>
> A temporal dependency will never be 'null' (except if the onTimeout policy
> is 'null' of course). By default, an exception will be thrown (once the
> timeout is reached).
>   

Temporal dependencies will also never be null if you set the timeout to 
be infinite, but if the service never comes back, then you won't make 
much progress. :-)

-> richard

> 'Regular' (i.e. non temporal) optional dependency cannot be 'null' too. By
> default a nullable object (or a default-implementation object) is injected
> when the field accesses to an unavailable service. 
>
> Regards,
>
> Clement
>
>
> -----Original Message-----
> From: Todor Boev [mailto:t.boev@prosyst.bg] 
> Sent: lundi 27 octobre 2008 16:40
> To: users@felix.apache.org
> Subject: Re: IPojo - ServiceUnavailableException?
>
> Clement Escoffier wrote:
>   
>> When a thread try to use a temporal dependency...
>>
>>   
>>     
> You mean a thread simply uses the reference stored in the respective 
> component field to make a call to the dependency object? I.e. I can 
> count on  temporal dependencies to never be null.  I.e. you do proxy the 
> temporal dependencies (not that it matters how exactly this is 
> implemented :)
>
> Cheers,
> Todor
>
> ---------------------------------------------------------------------
> 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
>
>   

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


RE: IPojo - ServiceUnavailableException?

Posted by Clement Escoffier <cl...@gmail.com>.
Exactly, 

A temporal dependency will never be 'null' (except if the onTimeout policy
is 'null' of course). By default, an exception will be thrown (once the
timeout is reached).

'Regular' (i.e. non temporal) optional dependency cannot be 'null' too. By
default a nullable object (or a default-implementation object) is injected
when the field accesses to an unavailable service. 

Regards,

Clement


-----Original Message-----
From: Todor Boev [mailto:t.boev@prosyst.bg] 
Sent: lundi 27 octobre 2008 16:40
To: users@felix.apache.org
Subject: Re: IPojo - ServiceUnavailableException?

Clement Escoffier wrote:
> When a thread try to use a temporal dependency...
>
>   
You mean a thread simply uses the reference stored in the respective 
component field to make a call to the dependency object? I.e. I can 
count on  temporal dependencies to never be null.  I.e. you do proxy the 
temporal dependencies (not that it matters how exactly this is 
implemented :)

Cheers,
Todor

---------------------------------------------------------------------
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


Re: IPojo - ServiceUnavailableException?

Posted by Todor Boev <t....@prosyst.bg>.
Clement Escoffier wrote:
> When a thread try to use a temporal dependency...
>
>   
You mean a thread simply uses the reference stored in the respective 
component field to make a call to the dependency object? I.e. I can 
count on  temporal dependencies to never be null.  I.e. you do proxy the 
temporal dependencies (not that it matters how exactly this is 
implemented :)

Cheers,
Todor

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


RE: IPojo - ServiceUnavailableException?

Posted by Clement Escoffier <cl...@gmail.com>.
Hi,

First, iPOJO instances are either valid or invalid. Basically, an invalid
instance is an instance requiring a non-available service. An invalid
instance should stops the created threads avoiding those kind of access
(thanks to the lifecycle callbacks). if despite this, a thread tries to
access to a unavailable service, iPOJO fire a warning and 'null' is
returned. 

However, temporal dependencies have a different behavior. When a thread try
to use a temporal dependency on an unavailable service, the thread waits (is
stopped) until a timeout (the default is 3s, but can be configured). If the
timeout is reached (and the service stills unavailable), the temporal
dependency executes a 'onTimeout' action. By default, it throws a
RuntimeException (equivalent to the ServiceUnavailableException). However,
others policies are also available:
- injecting a Nullable object
- inject a default-implementation object
- injection an empty array (only for aggregate dependency)
- injection 'null' 

To answer to the second question: iPOJO instances have a direct access on
service objects.

Regards,

Clement

-----Original Message-----
From: Todor Boev [mailto:t.boev@prosyst.bg] 
Sent: lundi 27 octobre 2008 13:44
To: users@felix.apache.org
Subject: IPojo - ServiceUnavailableException?

Hello,
What does iPojo do if an active component (one running a thread) tries 
to access a service dependency that is not currently available? Does it 
cause the call to the dependency to throw something like 
ServiceUnavailableException? I.e. are the dependencies proxied or are 
they the raw service objects?
Cheers,
Todor

---------------------------------------------------------------------
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