Hi,

I don't actually use DynamicProxies (I do use them elsewhere, just not in in
OJB), so I can't be much more help - but... The whole point of proxies is
that you *shouldn't* get to the real class. You should always talk to the
proxy, and the proxy talks to the real object. If you nead to expose
functionality, you should put it on the interface...

OJB doesn't do anything particularly wild or crazy with Proxies, so any
documentation on them should give you some idea :
http://java.sun.com/j2se/1.3/docs/guide/reflection/proxy.html

If you absolutely *must* get at the object, I think you can do it via
ProxyHelper
org.apache.ojb.broker.util.ProxyHelper  - it has two relevant methods
getRealObject and getRealObjectIfMaterialized.

I reiterate, though, it's not a good idea.

Cheers,

Charles.

>-----Original Message-----
>From: Joerg Lensing [mailto:[EMAIL PROTECTED]
>Sent: 10 September 2003 17:13
>To: OJB Users List
>Subject: Re: proxy question
>
>
>Joerg Lensing wrote:
>
>> hi charles,
>> ok, but how can I know do i get the real class? (instanceof doesn't 
>> work.. don't know why9
>>
>> e.g.     if (pPartnerPO instanceof PersonIF)   --> returns 
>"true", but 
>> should be false!! 
>
>sorry: should be
>       if (partnerIF instanceof PersonIF) {
>
>joerg
>
>
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: [EMAIL PROTECTED]
>For additional commands, e-mail: [EMAIL PROTECTED]
>


This email and any attachments are strictly confidential and are intended
solely for the addressee. If you are not the intended recipient you must
not disclose, forward, copy or take any action in reliance on this message
or its attachments. If you have received this email in error please notify
the sender as soon as possible and delete it from your computer systems.
Any views or opinions presented are solely those of the author and do not
necessarily reflect those of HPD Software Limited or its affiliates.

 At present the integrity of email across the internet cannot be guaranteed
and messages sent via this medium are potentially at risk.  All liability
is excluded to the extent permitted by law for any claims arising as a re-
sult of the use of this medium to transmit information by or to 
HPD Software Limited or its affiliates.



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

Reply via email to