Re: Small code donation
"Sasa Bojanic" <[email protected]> Wed, 14 Sep 2005 10:07:21 +0200
| Newsgroups | gmane.comp.java.enhydra.shark |
|---|---|
| Message-ID | <003601c5b903$5684a060$1200a8c0@bobrock> |
Hi, thanks a lot! We currently have no time to test it, but from your explanations I see this could be very useful. Maybe in the future (with your permission) we'll include it in shark project. Regards, Sasa. ----- Original Message ----- From: "David Delbecq" <[email protected]> To: <[email protected]> Sent: Thursday, September 08, 2005 12:34 PM Subject: [shark] Small code donation > Hello, > > Am sending this small code as i think it might be useful to shark-CORBA. > > It's a simple code generator which explore the shark client CORBA interfaces > and creates wrappers around each of them (as long as they can be reached by > a trail of calls coming from the initial. The wrappers are created using > the decorator design pattern. They automatically unwrap parameters if needed > and wrap results. > The added functionnality for decorator is to catch null values on returns. > CORBA does not support nulls so instead of sending nulls, the sun corba layer > sends a BAD_PARAM exception with a 201 minor code (see > http://java.sun.com/j2se/1.4.2/docs/guide/idl/jidlExceptions.html#minorcodemeanings) > > This will help developers using the shark client api as in current implementation, > catching manually all those exceptions because the shark engine sends lots of > null when dealing with description process (process description, activity description) or > auditEvents (the activity() might be null, resulting in one of those exceptions client-side) > > To execute, ensure all shark libs are in classpath and run org.enhydra.shark.wrapper.tool.WrapperMaker > > First argument must be configuration properties file (provided) and second is destination path for generated .java > > Using the wrappers after is easy, replace > SharkInterface interface= SharkInterfaceHelper.narrow(ncRef.resolve(path)); > by > SharkInterface interface= new SharkInterfaceWrapper(SharkInterfaceHelper.narrow(ncRef.resolve(path))); > > After use as usual, all returned interfaces from call will be wrapper where needed. > Then you don't have to worry anymore about this null return values throwing exceptions. > > I think generation of wrappers could be included in the shark build process. > > Regards. > -- > David Delbecq > Royal Meteorological Institute of Belgium > > - > Is there life after /sbin/halt -p? > -------------------------------------------------------------------------------- > > -- > You receive this message as a subscriber of the [email protected] mailing list. > To unsubscribe: mailto:[email protected] > For general help: mailto:[email protected]?subject=help > ObjectWeb mailing lists service home page: http://www.objectweb.org/wws >
message-footer.txt
(text/plain, 271 B)
-- You receive this message as a subscriber of the [email protected] mailing list. To unsubscribe: mailto:[email protected] For general help: mailto:[email protected]?subject=help ObjectWeb mailing lists service home page: http://www.objectweb.org/wws