beehive-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Jonathan Colwell" <jcolw...@bea.com>
Subject RE: endpoint interface
Date Mon, 27 Sep 2004 15:50:46 GMT
Hi Wolfgang,

If no endpointInterface is specified, things behave as they were and the
rest of the annotations will be loaded from the implemetation as usual.

You have a point about the spec not really specifying whether the String
specifying the endpoint interface should refer to a source file or a
class file.  Perhaps we should attempt to use either, so if someone puts
@WebService(endpointInterface = "WebServiceInterface.java") we try to
load the source and if a class name is used we try to find a matching
source file and if that fails, just load the class and use reflection to
create the object model.  I have no idea if this is the right solution
but it would allow us to be more flexible if we find out what value this
annotation is really looking for.

I haven't looked over the code you sent but will try to do that later
today.

Thanks again for jumping in.

cheers,

Jonathan


-----Original Message-----
From: wolfgang127us@yahoo.co.jp [mailto:wolfgang127us@yahoo.co.jp] 
Sent: Sunday, September 26, 2004 11:55 AM
To: Jonathan Colwell
Cc: Michael Merz
Subject: Re: endpoint interface

Hello Jonathan and Michael.

> From what I understand from the spec, the implementation file, in this

> case, the actual .jws would now only have that single 
> @WebService(endpointInterface = "WebServiceInterface.java") annotation

> and the rest would be found in the target file.

What I understood from the JSR-181 is that...
[1] If the Service Implementation Bean does NOT specify
@WebService.endpointInterface, The processor(WsmAnnotationProcessor)
will generate a Service Endpoint Interface (source file and class file)
and load annotations from the original bean or the generated class file
(or source file).

[2] If the Service Implementation Bean DOES specify
@WebService.endpointInterface, The processor will load annotations from
the endpointInterface.

There're some parts that I still cannot understand.
Jonathan, you wrote @WebService(endpointInterface =
"WebServiceInterface.java"), but does the endpointInterface really take
the name of the java source file as its value ?
I guess the class name is better to find the target interface, but gotta
load annotations using reflection.
Anyways, the JSR-181 doesn't mention that it should be whether the name
of a java source file or a class name so I don't know...

In [1] above, I said 
> If the Service Implementation Bean does NOT specify 
> @WebService.endpointInterface, The processor(WsmAnnotationProcessor) 
> will generate a Service Endpoint Interface
but what kinda name (java interface name) will the generated service
endpoint interface have then ? 
Even though the JSR-181 says "The generated service endpoint interface
is given an implementation-defined name", what does the
implementation-defined name mean ?
Does it mean that ,for example, the annotated Foo.jws(public class Foo)
is processed, the name of the generated endpoint interface will be Foo
as well but java class will be changed to java interface (public
interface Foo) ?
It's weird, thus my current processor will add "Interface" to the Foo as
a suffix.

What I've updated for WsmAnnotationProcessor is to read the jws and
generate the source file of the endpoint interface and compile.

For example, Foo.jws(in svn) is processed, then the following
interface(FooInterface.java) will be generated and compiled.
[FooInterface.java]-----------------------------------------------------
--
import javax.jws.Oneway;
import javax.jws.WebMethod;
import javax.jws.WebParam;
import javax.jws.WebResult;
import javax.jws.WebService;

@WebService (
    name="Abacus",
    targetNamespace="http://www.superflaco.com/AnnotationTest" ) public
interface FooInterface {

    @WebMethod
    @Oneway
    public void goHome ( @WebParam ( name="when") long in0 );

    @WebMethod (
        operationName="GoLoco",
        action="LocoAction" )
    @WebResult
    public boolean getNutty ( @WebParam int in0 , @WebParam (
name="detail") String in1 );

}
-------------------------------------------------------
Since the processor uses APT, I couldn't get the name of method
arguments. 
Thus, they will be in0, in1...
I've made JavaDoc 1.5 version(I implemented the Doclet class) to read a
jws file. 
It even can retrieve the name of method arguments and perfectly worked
but somehow I don't like to use JavaDoc.

Please point out if I'm doing wrong.

wolfgang

ps)
Loading annotations is not that hard, so I wanna finish the part of the
generating source files first.





Mime
View raw message