KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > objectweb > jonas_ws > wsgen > generator > ews > wsdltoj2ee > writer > JOnASEWSBindingWriter


1 /**
2  * JOnAS : Java(TM) OpenSource Application Server
3  * Copyright (C) 2005 Bull S.A.
4  * Contact: jonas-team@objectweb.org
5  *
6  * This library is free software; you can redistribute it and/or
7  * modify it under the terms of the GNU Lesser General Public
8  * License as published by the Free Software Foundation; either
9  * version 2.1 of the License, or any later version.
10  *
11  * This library is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14  * Lesser General Public License for more details.
15  *
16  * You should have received a copy of the GNU Lesser General Public
17  * License along with this library; if not, write to the Free Software
18  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
19  * USA
20  *
21  * --------------------------------------------------------------------------
22  * $Id: JOnASEWSBindingWriter.java,v 1.2 2005/05/27 15:01:22 sauthieg Exp $
23  * --------------------------------------------------------------------------
24  */

25 package org.objectweb.jonas_ws.wsgen.generator.ews.wsdltoj2ee.writer;
26
27 import javax.wsdl.Binding;
28
29 import org.apache.axis.wsdl.gen.Generator;
30 import org.apache.axis.wsdl.symbolTable.BindingEntry;
31 import org.apache.axis.wsdl.symbolTable.PortTypeEntry;
32 import org.apache.axis.wsdl.symbolTable.SymbolTable;
33 import org.apache.axis.wsdl.toJava.JavaInterfaceWriter;
34 import org.apache.geronimo.ews.jaxrpcmapping.J2eeBindingWriter;
35 import org.apache.geronimo.ews.jaxrpcmapping.J2eeEmitter;
36
37
38 /**
39  * Extends EWS J2eeBindingWriter to generate port interface only when needed.
40  * @author Guillaume Sauthier
41  */

42 public class JOnASEWSBindingWriter extends J2eeBindingWriter implements Generator {
43
44     /**
45      * @param emitter J2eeEmitter
46      * @param binding wsdl:binding containing port-interface infos
47      * @param st Entry table
48      */

49     public JOnASEWSBindingWriter(J2eeEmitter emitter, Binding binding, SymbolTable st) {
50         super(emitter, binding, st);
51     }
52
53     /**
54      * @see org.apache.geronimo.ews.jaxrpcmapping.J2eeBindingWriter#getJavaInterfaceWriter(org.apache.geronimo.ews.jaxrpcmapping.J2eeEmitter, org.apache.axis.wsdl.symbolTable.PortTypeEntry, org.apache.axis.wsdl.symbolTable.BindingEntry, org.apache.axis.wsdl.symbolTable.SymbolTable)
55      */

56     protected Generator getJavaInterfaceWriter(J2eeEmitter emitter, PortTypeEntry ptEntry, BindingEntry bEntry, SymbolTable st) {
57         ClassLoader JavaDoc cl = ((org.objectweb.jonas_ws.wsgen.generator.ews.wsdltoj2ee.emitter.JOnASWSEmitter) emitter).getClassLoader();
58         try {
59             cl.loadClass(ptEntry.getName());
60         } catch (ClassNotFoundException JavaDoc cnfe) {
61             // class not available, generate it
62
return super.getJavaInterfaceWriter(emitter, ptEntry, bEntry, symbolTable);
63         }
64         return null;
65     }
66
67     /**
68      * @see org.apache.geronimo.ews.jaxrpcmapping.J2eeBindingWriter#getJavaImplWriter(org.apache.geronimo.ews.jaxrpcmapping.J2eeEmitter, org.apache.axis.wsdl.symbolTable.BindingEntry, org.apache.axis.wsdl.symbolTable.SymbolTable)
69      */

70     protected Generator getJavaImplWriter(J2eeEmitter arg0, BindingEntry arg1,
71             SymbolTable arg2) {
72         return null;
73     }
74
75     /**
76      * @see org.apache.geronimo.ews.jaxrpcmapping.J2eeBindingWriter#getJavaSkelWriter(org.apache.geronimo.ews.jaxrpcmapping.J2eeEmitter, org.apache.axis.wsdl.symbolTable.BindingEntry, org.apache.axis.wsdl.symbolTable.SymbolTable)
77      */

78     protected Generator getJavaSkelWriter(J2eeEmitter arg0, BindingEntry arg1,
79             SymbolTable arg2) {
80         return null;
81     }
82 }
83
Popular Tags