Hi Wolfgang, Jonathan and I have checked in support for controls in wsm earlier today. These checkins are based on the assumption that we'd slightly change the annotation processing: first we run apt to generate artifacts for controls and an annotated class file for the jws-file. Then we use reflection to build the object model from the generated class file. The major benefits of this are: - simplifies code base, code maintenance and changes because we have only one "object model generator", i.e. the reflection processor. - simplifies the integration of controls with wsm
Thanks for your code. I've had a look at it and have a question: Why do you differentiate between annotated and non-annotated methods? Could we just use one collection of all methods instead? Cheers, -michael -----Original Message----- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Sent: Wednesday, October 13, 2004 7:58 PM To: Beehive Developers Cc: Jonathan Colwell; Michael Merz Subject: Re: @SecurityIdentity, @SecurityRoles Hi Michael, > I would like to suggest the > processor generate a warning in case there are any annotations such as > @WebMethod in the implementation bean and the bean refers to an endpoint > interface. It doesn't take that much time so let me implement this later. > If there is an endpoint interface, the > implementation bean is *not* required to have @WebMethod annotations. > [The methods in the endpoint interface isn't required to have @WebMethod > annotations either.] So there shouldn't be an exception in this case. I've implemented the way you said. ( I attached a patch and test cases for this. plz throw away the last files I sent you, Michael) The original WebServiceTYPEMetadata had only <Collection>WebServiceMETHODMetadata collection variable (named methods) which are always published by Web Service. In case the object model is for the service implementation bean, it contains only methods annotated with @WebMethod. In case the object model is for the service endpoint interface, it contains all methods no matter they are annotated with @WebMethod or not. So when comparing the methods' signature of the service implementation bean and one of the endpoint interface , the processor has to have the service implementation bean's methods which are not annotated with @WebMethod also. Otherwise, the processor is required to scan the service implementation bean class to retrieve methods with reflection again. It costs much. Thus, I refactored WebServiceTYPEMetadata for the service implementation bean to hold non-annotated methods as well in a new added Collection variable named nonAnnotatedMethods. ( The variable name, nonAnnotatedMethods, is not right, though. It should be hiddenMethods or something like that. Anyways, I go with nonAnnotatedMethods for now. ) Unfortunately, one problem raised by APT. Although I implemented WsmAnnotationProcessor to throw an exception when the inconsistency is found while constructing an object model of the endpoint interface, APT ( com.sun.tools.apt.Main().compile(...) ) never throws the exception up to the caller and even the return-value of the compile method is always zero (which means the compiling succeeded). What APT does is just catch the exception and print the error message to System.err and always return zero. So the caller of APT cannot tell the annotation processing succeeded or not programmatically. There're two ways to avoid this problem. The first one is intercepting the System.err to figure out whether an exception had been thrown. ( this is obviously silly though ) The second one is ,for example, adding a new static variable which holds the result status of the processing in WsmAnnotationProcessor and the caller retrieves the variable to check whether the processing succeeded or not. What do you guys think ?? Wolfgang. ps) The drt/tests/org/apache/beehive/wsm/jsr181/processor/apt/WsmAnnotationProce ssorEndpointInterface2Test.java test case in new_files.tar.gz always fails. This relates to what I said above.
