You are viewing a plain text version of this content. The canonical link for it is here.
Posted to adffaces-dev@incubator.apache.org by Arjuna Wijeyekoon <ar...@gmail.com> on 2006/09/22 18:18:03 UTC

make UIXComponentBase.__broadcast a protected method

Does anyone mind if I make the following method in
UIXComponentBase protected?
It is a method that component extensions (and components in other packages)
would find very useful.
It is used to deliver a faces event to a method binding listener, as in the
following:

<tr:commandButton actionListener="#{mybean.myActionListener}"/>

  /**
   * Broadcast an event to a MethodBinding.
   */
  final void __broadcast(
    FacesEvent event,
    MethodBinding method) throws AbortProcessingException
  {
    if (method != null)
    {
      try
      {
        FacesContext context = getFacesContext();
        method.invoke(context, new Object[] { event });
      }
      catch (EvaluationException ee)
      {
        Throwable t = ee.getCause();
        // Unwrap AbortProcessingExceptions
        if (t instanceof AbortProcessingException)
          throw ((AbortProcessingException) t);
        throw ee;
      }
    }
  }


thanks
Arjuna

Re: make UIXComponentBase.__broadcast a protected method

Posted by Arjuna Wijeyekoon <ar...@gmail.com>.
http://issues.apache.org/jira/browse/ADFFACES-190

On 9/22/06, Arjuna Wijeyekoon <ar...@gmail.com> wrote:
>
> fine with me. I'll file a jira
>
> On 9/22/06, Adam Winer <aw...@gmail.com> wrote:
> >
> > Hrm, but it's event-specific (takes a FacesEvent, deals
> > with AbortProcessingException) so something like
> > "broadcastToMethodBinding()" works for me.
> >
> > -- Adam
> >
> >
> > On 9/22/06, Arjuna Wijeyekoon < arjuna@gmail.com> wrote:
> > >
> > > protected void callMethodBinding(FacesEvent, MethodBinding) throws
> > > AbortProcessingException
> > > ?
> > >
> > > other names: executeMethodBinding, invokeMethodBinding, invokeMethod
> > >
> > > I think I prefer "invokeMethodBinding".
> > >
> > > On 9/22/06, Adam Winer <aw...@gmail.com> wrote:
> > > >
> > > > +1, though maybe with a different name?
> > > >
> > > > -- Adam
> > > >
> > > >
> > > > On 9/22/06, Arjuna Wijeyekoon <ar...@gmail.com> wrote:
> > > > >
> > > > > Does anyone mind if I make the following method in
> > > > > UIXComponentBase protected?
> > > > > It is a method that component extensions (and components in other
> > > > > packages)
> > > > > would find very useful.
> > > > > It is used to deliver a faces event to a method binding listener,
> > as
> > > in
> > > > > the
> > > > > following:
> > > > >
> > > > > <tr:commandButton actionListener="#{mybean.myActionListener}"/>
> > > > >
> > > > >   /**
> > > > >    * Broadcast an event to a MethodBinding.
> > > > >    */
> > > > >   final void __broadcast(
> > > > >     FacesEvent event,
> > > > >     MethodBinding method) throws AbortProcessingException
> > > > >   {
> > > > >     if (method != null)
> > > > >     {
> > > > >       try
> > > > >       {
> > > > >         FacesContext context = getFacesContext();
> > > > >         method.invoke(context, new Object[] { event });
> > > > >       }
> > > > >       catch (EvaluationException ee)
> > > > >       {
> > > > >         Throwable t = ee.getCause();
> > > > >         // Unwrap AbortProcessingExceptions
> > > > >         if (t instanceof AbortProcessingException)
> > > > >           throw ((AbortProcessingException) t);
> > > > >         throw ee;
> > > > >       }
> > > > >     }
> > > > >   }
> > > > >
> > > > >
> > > > > thanks
> > > > > Arjuna
> > > > >
> > > > >
> > > >
> > > >
> > >
> > >
> >
> >
>

Re: make UIXComponentBase.__broadcast a protected method

Posted by Arjuna Wijeyekoon <ar...@gmail.com>.
fine with me. I'll file a jira

On 9/22/06, Adam Winer <aw...@gmail.com> wrote:
>
> Hrm, but it's event-specific (takes a FacesEvent, deals
> with AbortProcessingException) so something like
> "broadcastToMethodBinding()" works for me.
>
> -- Adam
>
>
> On 9/22/06, Arjuna Wijeyekoon <ar...@gmail.com> wrote:
> >
> > protected void callMethodBinding(FacesEvent, MethodBinding) throws
> > AbortProcessingException
> > ?
> >
> > other names: executeMethodBinding, invokeMethodBinding, invokeMethod
> >
> > I think I prefer "invokeMethodBinding".
> >
> > On 9/22/06, Adam Winer <aw...@gmail.com> wrote:
> > >
> > > +1, though maybe with a different name?
> > >
> > > -- Adam
> > >
> > >
> > > On 9/22/06, Arjuna Wijeyekoon <ar...@gmail.com> wrote:
> > > >
> > > > Does anyone mind if I make the following method in
> > > > UIXComponentBase protected?
> > > > It is a method that component extensions (and components in other
> > > > packages)
> > > > would find very useful.
> > > > It is used to deliver a faces event to a method binding listener, as
> > in
> > > > the
> > > > following:
> > > >
> > > > <tr:commandButton actionListener="#{mybean.myActionListener}"/>
> > > >
> > > >   /**
> > > >    * Broadcast an event to a MethodBinding.
> > > >    */
> > > >   final void __broadcast(
> > > >     FacesEvent event,
> > > >     MethodBinding method) throws AbortProcessingException
> > > >   {
> > > >     if (method != null)
> > > >     {
> > > >       try
> > > >       {
> > > >         FacesContext context = getFacesContext();
> > > >         method.invoke(context, new Object[] { event });
> > > >       }
> > > >       catch (EvaluationException ee)
> > > >       {
> > > >         Throwable t = ee.getCause();
> > > >         // Unwrap AbortProcessingExceptions
> > > >         if (t instanceof AbortProcessingException)
> > > >           throw ((AbortProcessingException) t);
> > > >         throw ee;
> > > >       }
> > > >     }
> > > >   }
> > > >
> > > >
> > > > thanks
> > > > Arjuna
> > > >
> > > >
> > >
> > >
> >
> >
>
>

Re: make UIXComponentBase.__broadcast a protected method

Posted by Adam Winer <aw...@gmail.com>.
Hrm, but it's event-specific (takes a FacesEvent, deals
with AbortProcessingException) so something like
"broadcastToMethodBinding()" works for me.

-- Adam


On 9/22/06, Arjuna Wijeyekoon <ar...@gmail.com> wrote:
>
> protected void callMethodBinding(FacesEvent, MethodBinding) throws
> AbortProcessingException
> ?
>
> other names: executeMethodBinding, invokeMethodBinding, invokeMethod
>
> I think I prefer "invokeMethodBinding".
>
> On 9/22/06, Adam Winer <aw...@gmail.com> wrote:
> >
> > +1, though maybe with a different name?
> >
> > -- Adam
> >
> >
> > On 9/22/06, Arjuna Wijeyekoon <ar...@gmail.com> wrote:
> > >
> > > Does anyone mind if I make the following method in
> > > UIXComponentBase protected?
> > > It is a method that component extensions (and components in other
> > > packages)
> > > would find very useful.
> > > It is used to deliver a faces event to a method binding listener, as
> in
> > > the
> > > following:
> > >
> > > <tr:commandButton actionListener="#{mybean.myActionListener}"/>
> > >
> > >   /**
> > >    * Broadcast an event to a MethodBinding.
> > >    */
> > >   final void __broadcast(
> > >     FacesEvent event,
> > >     MethodBinding method) throws AbortProcessingException
> > >   {
> > >     if (method != null)
> > >     {
> > >       try
> > >       {
> > >         FacesContext context = getFacesContext();
> > >         method.invoke(context, new Object[] { event });
> > >       }
> > >       catch (EvaluationException ee)
> > >       {
> > >         Throwable t = ee.getCause();
> > >         // Unwrap AbortProcessingExceptions
> > >         if (t instanceof AbortProcessingException)
> > >           throw ((AbortProcessingException) t);
> > >         throw ee;
> > >       }
> > >     }
> > >   }
> > >
> > >
> > > thanks
> > > Arjuna
> > >
> > >
> >
> >
>
>

Re: make UIXComponentBase.__broadcast a protected method

Posted by Arjuna Wijeyekoon <ar...@gmail.com>.
protected void callMethodBinding(FacesEvent, MethodBinding) throws
AbortProcessingException
?

other names: executeMethodBinding, invokeMethodBinding, invokeMethod

I think I prefer "invokeMethodBinding".

On 9/22/06, Adam Winer <aw...@gmail.com> wrote:
>
> +1, though maybe with a different name?
>
> -- Adam
>
>
> On 9/22/06, Arjuna Wijeyekoon <ar...@gmail.com> wrote:
> >
> > Does anyone mind if I make the following method in
> > UIXComponentBase protected?
> > It is a method that component extensions (and components in other
> > packages)
> > would find very useful.
> > It is used to deliver a faces event to a method binding listener, as in
> > the
> > following:
> >
> > <tr:commandButton actionListener="#{mybean.myActionListener}"/>
> >
> >   /**
> >    * Broadcast an event to a MethodBinding.
> >    */
> >   final void __broadcast(
> >     FacesEvent event,
> >     MethodBinding method) throws AbortProcessingException
> >   {
> >     if (method != null)
> >     {
> >       try
> >       {
> >         FacesContext context = getFacesContext();
> >         method.invoke(context, new Object[] { event });
> >       }
> >       catch (EvaluationException ee)
> >       {
> >         Throwable t = ee.getCause();
> >         // Unwrap AbortProcessingExceptions
> >         if (t instanceof AbortProcessingException)
> >           throw ((AbortProcessingException) t);
> >         throw ee;
> >       }
> >     }
> >   }
> >
> >
> > thanks
> > Arjuna
> >
> >
>
>

Re: make UIXComponentBase.__broadcast a protected method

Posted by Adam Winer <aw...@gmail.com>.
+1, though maybe with a different name?

-- Adam


On 9/22/06, Arjuna Wijeyekoon <ar...@gmail.com> wrote:
>
> Does anyone mind if I make the following method in
> UIXComponentBase protected?
> It is a method that component extensions (and components in other
> packages)
> would find very useful.
> It is used to deliver a faces event to a method binding listener, as in
> the
> following:
>
> <tr:commandButton actionListener="#{mybean.myActionListener}"/>
>
>   /**
>    * Broadcast an event to a MethodBinding.
>    */
>   final void __broadcast(
>     FacesEvent event,
>     MethodBinding method) throws AbortProcessingException
>   {
>     if (method != null)
>     {
>       try
>       {
>         FacesContext context = getFacesContext();
>         method.invoke(context, new Object[] { event });
>       }
>       catch (EvaluationException ee)
>       {
>         Throwable t = ee.getCause();
>         // Unwrap AbortProcessingExceptions
>         if (t instanceof AbortProcessingException)
>           throw ((AbortProcessingException) t);
>         throw ee;
>       }
>     }
>   }
>
>
> thanks
> Arjuna
>
>