You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@tuscany.apache.org by Ron Gavlin <rg...@yahoo.com> on 2006/07/01 00:03:35 UTC

Using EMF Adapters with Tuscany DataObjects

I have some existing code that takes advantage of the EMF-supplied notification features in an EMF/SDO 1.0 DataObject. Specifically, I have wrapper class that wraps a statically generated Customer DataObject. The CustomerWrapper's constructor is listed below. Is there any way to enable EMF notification/adapter support for SDO 2 DataObjects?
 
- Ron
 
public CustomerWrapper(Customer customer)
{
   ((DataObject) customer).eAdapters().add(
      new AdapterImpl()
      {
         public void notifyChanged(Notification notification)
         {
            doInterestingWork();
         };
      });
}
 
protected doInterestingWork()
{
}

---------------------------------------------------------------------
To unsubscribe, e-mail: tuscany-user-unsubscribe@ws.apache.org
For additional commands, e-mail: tuscany-user-help@ws.apache.org


Re: Using EMF Adapters with Tuscany DataObjects

Posted by Frank Budinsky <fr...@ca.ibm.com>.
Ron,

You could easily override eAdapters(), eNotificationRequired(), and 
eNotify() in a subclass (e.g., in ExtensibleDataObjectImpl) to support 
notifying to the adapter list,  but it would probably be a bad idea to use 
EMF features since one of the goals of SDO 2 (Tuscany) is to hide, 
decouple from, and eventually even remove the EMF dependency in the SDO 
implementation. Since SDO has no notification/adapter API, you shouldn't 
rely on that kind of function from the implementation.

Frank

Ron Gavlin <rg...@yahoo.com> wrote on 06/30/2006 06:03:35 PM:

> I have some existing code that takes advantage of the EMF-supplied 
> notification features in an EMF/SDO 1.0 DataObject. Specifically, I 
> have wrapper class that wraps a statically generated Customer 
> DataObject. The CustomerWrapper's constructor is listed below. Is 
> there any way to enable EMF notification/adapter support for SDO 2 
> DataObjects?
> 
> - Ron
> 
> public CustomerWrapper(Customer customer)
> {
>    ((DataObject) customer).eAdapters().add(
>       new AdapterImpl()
>       {
>          public void notifyChanged(Notification notification)
>          {
>             doInterestingWork();
>          };
>       });
> }
> 
> protected doInterestingWork()
> {
> }
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tuscany-user-unsubscribe@ws.apache.org
> For additional commands, e-mail: tuscany-user-help@ws.apache.org
> 


---------------------------------------------------------------------
To unsubscribe, e-mail: tuscany-user-unsubscribe@ws.apache.org
For additional commands, e-mail: tuscany-user-help@ws.apache.org