[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: ExternalDatabase.objectForName()
Falko Braeutigam wrote:
> I see. Try the following: get the long value of the ObjectID of the proxy:
>
> long id = proxy.remoteID().value();
>
> and send this long id down the cable. On the other computer you build a new
> proxy from the ObjectID value via:
>
> ExternalDatabase db = ... ;
> long id = ... ;
> <your_type> proxy = (...)new OzoneProxy( new ObjectID( id ), database );
>
> This newly created proxy can be used just like any other proxy. No explicite
> mapping is needed.
>
> This of course is totally unportable but should do exactly what you need ;)
>
> Falko
Yep - that seems to work.
One question, though - obviously I can't garantee to the recipient of the id that the
referenced object will still be there when they receive the event (if they were
particularly unlucky, it might be referring to an entirely new object, but I don't think
this will ever occur in practice, and in any case, I have a few counter-measures up my
sleeve...)
How would I test that the newly constructed proxy is valid? Or, put another way, what
exception will get thrown if I try and use it and it is invalid?
Thanks,
Martin