Ricardo:

I agree with you suggestion.  We have several cases where we are throwing a
RuntimeException in order to bypass the interface restrictions.  If a
ContextException is defined - I would like to see this extends
CascadingException.

Cheers, Steve.


> -----Original Message-----
> From: Ricardo Rocha [mailto:[EMAIL PROTECTED]]
> Sent: Monday, 09 April, 2001 07:16
> To: [EMAIL PROTECTED]
> Subject: Throwing exceptions during contextualization
>
>
> A component implementing Contextualizable may need to assert some
> condition(s) on its context and throw an exception if such condition(s)
> are not met:
>
>   public class MyComponent implements Contextualizable {
>     . . .
>     public void contextualize(Context context) throws ContextException {
>         this.requiredComponent = context.get("required");
>         if (this.required == null) {
>          throw new ContextException("Required component missing
> in context");
>         }
>     }
>     . . .
>   }
>
> What do you think of creating a new ContextException and have the
> contextualize(Context) method throw it?
>
> Regards,
>
> Ricardo
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to