I thought of apt being run at build time. The build process would generate a class file and an object model file; both artifacts are required to to successfully deploy the web service. Version/date checking would not be necessary. We can add error checking to see if the versions match -- or, since both are generated at the same time, assume that they do. Note that neither the class file nor the object model file are supposed to be tampered with; they're generated files. At deploy-time, the object model would be deserialized, class or source files would not be required for that purpose anymore. In other words, we would never generate an object model at runtime, but at build time. The class file and the object model file are both integral part of the web service artifact(s); both get deployed as part of deploying the web service.
Cheers, -michael -----Original Message----- From: Jonathan Colwell Sent: Monday, December 13, 2004 9:58 AM To: Beehive Developers Subject: RE: [WSM] About Beehive-120 in Jira. Guten Tag Wolfgang, I'm a bit reluctant to insert things into the JWS source since if we had APT doing that, we could just have APT add @WebParam annotations for every parameter. The way I understood Michael describe it, and he is welcome to correct me if I am wrong, is that APT could produce a compiled class file and a file containing the serialized WSM object model. Then, when the reflection WSM annotation processor runs, it can see if a serialized OM is available and not older than the class file. If that is the case, the processor can just load that up using ObjectInputStream instead of reflecting against the class itself. This way there is no re-parsing of the source, param names are retained and we don't mess around with either the JWS source or the resulting class. If we run into situations where the serialized OM gets out of sync with the class, some checks could be made to see if the serialized data matches that of a newly created WSM OM made from reflection against the class. Does that sound reasonable? -jc -----Original Message----- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Sent: Monday, December 13, 2004 9:24 AM To: Beehive Developers Subject: Re: [WSM] About Beehive-120 in Jira. Hi Jonathan, How about this way ? Get the param names from jws and put a hidden constant pool ( class variable ) holding the names into the jws and makes APT compile it. After the compilation, replaces the modified code with the original one. Here's the example. -------- original jws -------------------------- @WebService public class MyWS { @WebMethod public void WhatIsYourAge(int age){...} @WebMethod public void Add(int myAge, int yourAge){...} } -------- modified jws -------------------------- @WebService public class MyWS { public static Map<String,String> _HIDDEN_CONSTANT_POOL_ = new HashMap<String,String>(); static{ _HIDDEN_CONSTANT_POOL_.add("WhatIsYourAge0","age"); _HIDDEN_CONSTANT_POOL_.add("Add0","myAge,yourAge"); } @WebMethod public void WhatIsYourAge(int age){...} } We have to be careful that the name of the class variable doesn't be doubled in the original code, but this way is really simple and easy. ( Of course, we must think how to match the name of the key in the pool and a method in the jws. ) Thanks in advance. Wolfgang
