commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Christoph Gaffga" <>
Subject Re: [betwixt] Mapping for interface instead of class
Date Wed, 27 Aug 2003 17:08:33 GMT
> Specify the class attribute in the element element.
> (eg <element name="hi" property"hi" class="myinterface"/>
> For more on .betwixt files, see the site docs

Dank u wel. This would help a lot in many cases. But there is one problem
When I want to write the EJB using "beanWriter.write(myRemoteBean)" it wont
work, because I can't pass a class parameter (eg
beanWriter.write(myRemoteBean, "myInterface") )

My Idea is to extend betwixt, so that for all beans B that have
java.lang.reflect.Proxy.isProxyClass(B.getClass) == true
betwixt uses the interface, the proxy was created of:
Class I = C.getClass().getInterfaces()[0]
for finding the dot-betwixt-mapping-file.

Does this sound reasonable? Can anybody give me a starting point for
implementing this?


> On Wed, 2003-08-27 at 16:08, Christoph Gaffga wrote:
> > > Creating beans from that will however still not work.
> > > If you have Interface I and class A and B implementing I, betwixt
> > > figure out which class it was, unless we are actually putting the
> > > getClass().getName() into the xml now (please forgive me not looking
> > > the code to check this), for the objects the be correctly recreated
> > > xml..
> >
> > Yes, I understand this problem with reading beans. But my problem ist
> > writing EJB to XML. Because in this context I only know the Interface
> > class (stub) is generated automatically). So, what I'm looking for is
> > something like an I.betwixt-file to customize the output.
> > Any Ideas?

View raw message