Re: Managing components deployed on severalhosts

"Guijarro, Julio" <[email protected]> Tue, 25 Jul 2006 20:18:31 +0100
Newsgroups gmane.comp.java.smartfrog.devel
Message-ID <[email protected]>
Hi Olivier,

The right exception to throw there is SmartFrogContextException. 

In your case, because the exception is generated inside a component
class, you could use:
throw new SmartFrogContextException(yourMessage, throwable,
primWhere_this is_thrown)

other alternatives:
throw new SmartFrogContextException(yourMessage)

or

throw new SmartFrogContextException(yourMessage, throwable)

or 


from
package org.smartfrog.sfcore.common;


You could also create your own special exception, if you need to, by
extending SmartFrogRuntimeException.

> -----Original Message-----
> From: smartfrog-developer-bounces-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org
[mailto:smartfrog-
> developer-bounces-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org] On Behalf Of Olivier Pernet
> Sent: 24 July 2006 16:53
> To: Smartfrog-developer-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org
> Subject: Re: [Smartfrog-developer] Managing components deployed on
> severalhosts
> 
> On 7/19/06, Goldsack, Patrick <[email protected]> wrote:
> [...]
> > As for notification of attribute change - the way we implement that
in
> > our own applications is to overwrite the sfReplaceAttribute and/or
> > sfAddAttribute method and hook our logic on there, or to poll the
> > attributes on a regular basis, depending on what we want.
Overwriting
> > the method means that we can reject the  update if we want, whereas
with
> > a simple notification of change this would be too late.
> 
> I'm trying to implement that right now, and the Javadoc doesn't make
> it very clear what you should do to reject an update. 
Again it depends of the semantics of your component. You don't need to
throw any exception if you don't want to.

> And the
> exception thrown is a SmartFrogRuntimeException, not a
> SmartFrogException, so I'm not too sure about just throwing an
> instance of this.
> How do you do that usually ? Do you have to allow modifications before
> deployment, so that the Prim can be initialized ?


It depends on what you are trying to do. Most of the sfAddAttribute()
calls are just to add extra info to the runtime but it you throw an
exception then the components will probably terminate. You should only
check/filter for your particular cases, the others should be passed to
super....

> 
> Cheers,
> --
> Olivier Pernet
> Summer Student - CERN Openlab
> 
> We are the knights who say
> echo '16i[q]sa[ln0=aln100%Pln100/snlbx]sbA0D4D465452snlbxq'|dc
> 
>
------------------------------------------------------------------------
-
> Take Surveys. Earn Cash. Influence the Future of IT
> Join SourceForge.net's Techsay panel and you'll get the chance to
share
> your
> opinions on IT & business topics through brief surveys -- and earn
cash
>
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDE
V
> _______________________________________________
> Smartfrog-developer mailing list
> Smartfrog-developer-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org
> https://lists.sourceforge.net/lists

-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys -- and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV