01: /**
02: * JOnAS : Java(TM) OpenSource Application Server
03: * Copyright (C) 2005 Bull S.A.
04: * Contact: jonas-team@objectweb.org
05: *
06: * This library is free software; you can redistribute it and/or
07: * modify it under the terms of the GNU Lesser General Public
08: * License as published by the Free Software Foundation; either
09: * 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 7560 2005-10-21 13:50:04Z sauthieg $
23: * --------------------------------------------------------------------------
24: */package org.objectweb.jonas_ws.wsgen.generator.ews.wsdltoj2ee.writer;
25:
26: import javax.wsdl.Binding;
27:
28: import org.apache.axis.wsdl.gen.Generator;
29: import org.apache.axis.wsdl.symbolTable.BindingEntry;
30: import org.apache.axis.wsdl.symbolTable.PortTypeEntry;
31: import org.apache.axis.wsdl.symbolTable.SymbolTable;
32: import org.apache.ws.ews.mapper.J2eeBindingWriter;
33: import org.apache.ws.ews.mapper.J2eeEmitter;
34:
35: /**
36: * Extends EWS J2eeBindingWriter to generate port interface only when needed.
37: * @author Guillaume Sauthier
38: */
39: public class JOnASEWSBindingWriter extends J2eeBindingWriter implements
40: Generator {
41:
42: /**
43: * @param emitter J2eeEmitter
44: * @param binding wsdl:binding containing port-interface infos
45: * @param st Entry table
46: */
47: public JOnASEWSBindingWriter(J2eeEmitter emitter, Binding binding,
48: SymbolTable st) {
49: super (emitter, binding, st);
50: }
51:
52: /**
53: * @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)
54: */
55: protected Generator getJavaInterfaceWriter(J2eeEmitter emitter,
56: PortTypeEntry ptEntry, BindingEntry bEntry, SymbolTable st) {
57: ClassLoader cl = ((org.objectweb.jonas_ws.wsgen.generator.ews.wsdltoj2ee.emitter.JOnASWSEmitter) emitter)
58: .getClassLoader();
59: try {
60: cl.loadClass(ptEntry.getName());
61: } catch (ClassNotFoundException cnfe) {
62: // class not available, generate it
63: return super .getJavaInterfaceWriter(emitter, ptEntry,
64: bEntry, symbolTable);
65: }
66: return null;
67: }
68:
69: /**
70: * @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)
71: */
72: protected Generator getJavaImplWriter(J2eeEmitter arg0,
73: BindingEntry arg1, SymbolTable arg2) {
74: return null;
75: }
76:
77: /**
78: * @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)
79: */
80: protected Generator getJavaSkelWriter(J2eeEmitter arg0,
81: BindingEntry arg1, SymbolTable arg2) {
82: return null;
83: }
84: }
|