Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: AW: [riena-dev] 264325 - NoSuchMethodException and POJOs

Hi Rieners,

will there be any drawbacks using PojoObservables ? (functionality ? performance ?)

my entity beans already have always PropertyChangeSupport, because I also need this
to use my beans as dynamic facts inside a rule-engine (Drools)

I think Thorstens idea to use PojoObservables only if the bean has no PropertyChangeSupport sounds flexible


ekke

Schenkel, Thorsten schrieb:
Hi,

I also prefer if the ridget will wrap given POJOs internally.
If the bean has no property change support (no method addPropertyChangeListener), the bean will be wrapped in PojoObservable.

Kind regards

Thorsten


-----Ursprüngliche Nachricht-----
Von: riena-dev-bounces@xxxxxxxxxxx [mailto:riena-dev-bounces@xxxxxxxxxxx] Im Auftrag von Drossel, Carsten
Gesendet: Montag, 23. Februar 2009 08:22
An: Riena Developers list
Betreff: AW: [riena-dev] 264325 - NoSuchMethodException and POJOs

Hi Elias,

couldn't we switch to PojoObservables internally? (see https://bugs.eclipse.org/bugs/show_bug.cgi?id=263031 )

Greetings,
Carsten

  
-----Ursprüngliche Nachricht-----
Von: riena-dev-bounces@xxxxxxxxxxx [mailto:riena-dev-
bounces@xxxxxxxxxxx] Im Auftrag von Elias Volanakis
Gesendet: Samstag, 21. Februar 2009 02:50
An: riena-dev@xxxxxxxxxxx
Betreff: [riena-dev] 264325 - NoSuchMethodException and POJOs

Just a quick heads-up:

The 3.5 databinding is more strict and will throw
NoSuchMethodException when using BeanObservables with a POJO (i.e. a
class that does not accept property change listeners). The exception
usually does not cause any harm, however it is written to the log. The
solution is very easy. Use PojoObservables instead:

Exception:

!MESSAGE Could not attach listener to
org.eclipse.riena.example.client.controllers.SharedViewDemoSubModuleCon
troller$TxtBean@1a1a1c6
!STACK 0
java.lang.NoSuchMethodException:
org.eclipse.riena.example.client.controllers.SharedViewDemoSubModuleCon
troller$TxtBean.addPropertyChangeListener(java.beans.PropertyChangeList
ener)
        at java.lang.Class.getMethod(Class.java:1605)
        at
org.eclipse.core.internal.databinding.beans.BeanPropertyListenerSupport
.processListener(BeanPropertyListenerSupport.java:96)
[...]

Problem:

TxtBean bean = new TxtBean();
// TxtBean is actually NOT a bean - its a POJO.
// bindToModel uses BeansObservables.observeValue(bean, "txt")
internaly because it expects a bean
// => exception
labelFacade.bindToModel(bean, "txt");

Solution:

// use this variant of bindToModel together with PojoObservables:
labelFacade.bindToModel(PojoObservables.observeValue(bean, "txt"))

Hope this helps,
Elias.

PS: No need to do anything in the Examples. I'm taking care of this...
_______________________________________________
riena-dev mailing list
riena-dev@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/riena-dev
    
_______________________________________________
riena-dev mailing list
riena-dev@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/riena-dev
_______________________________________________
riena-dev mailing list
riena-dev@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/riena-dev

  


--

ekkehard gentz
software-architect
erp-consultant
max-josefs-platz 30, D-83022 rosenheim, germany
homeoffice (1+1 VoIP): +49 8031 2068 325
mobile (iPhone): +49 151 19424929
mailto:ekkehard@xxxxxxxxxxxxxxxxx
homepage: http://www.gentz-software.de
opensource: http://ekkehard.org
blog (en): http://ekkes-corner.org
blog (de): http://ekkes-ecke.org
skype: ekkes-corner
Steuer-Nr: 156/220/30931 FA Rosenheim, UST-ID: DE189929490


Back to the top