1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16 package org.apache.geronimo.ews.ws4j2ee.toWs.dd.jonas;
17
18 import org.apache.geronimo.ews.ws4j2ee.context.J2EEWebServiceContext;
19 import org.apache.geronimo.ews.ws4j2ee.toWs.AbstractWriter;
20 import org.apache.geronimo.ews.ws4j2ee.toWs.GenerationConstants;
21 import org.apache.geronimo.ews.ws4j2ee.toWs.GenerationFault;
22
23 /***
24 * @author sauthieg
25 */
26 public class JOnASDDWriter extends AbstractWriter {
27 public JOnASDDWriter(J2EEWebServiceContext j2eewscontext) throws GenerationFault {
28 super(j2eewscontext, j2eewscontext.getMiscInfo().getOutPutPath() +
29 "/ejb/META-INF/JonAs.xml");
30 }
31
32 public void writeCode() throws GenerationFault {
33 String ejbname = j2eewscontext.getWSDLContext().getTargetPortType().getName().toLowerCase();
34 int index = ejbname.lastIndexOf(".");
35 if (index > 0) {
36 ejbname = ejbname.substring(index + 1);
37 }
38 out.write("<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n");
39 out.write("<jonas-ejb-jar xmlns=\"http://www.objectweb.org/jonas/ns\"\n");
40 out.write(" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"\n");
41 out.write(" xsi:schemaLocation=\"http://www.objectweb.org/jonas/ns\"\n");
42 out.write(" http://www.objectweb.org/jonas/ns/jonas-ejb-jar_4_0.xsd\">\n");
43 out.write(" <jonas-session>\n");
44 out.write(" <ejb-name>" + j2eewscontext.getMiscInfo().getJ2eeComponetLink() + "</ejb-name>\n");
45 String implStyle = j2eewscontext.getMiscInfo().getImplStyle();
46 if (GenerationConstants.USE_LOCAL_AND_REMOTE.equals(implStyle)
47 || GenerationConstants.USE_REMOTE.equals(implStyle)) {
48 out.write(" <jndi-name>" + j2eewscontext.getMiscInfo().getJ2eeComponetLink() + "</jndi-name>\n");
49 }
50 if (GenerationConstants.USE_LOCAL_AND_REMOTE.equals(implStyle)
51 || GenerationConstants.USE_LOCAL.equals(implStyle)) {
52
53
54 }
55 out.write(" </jonas-session>\n");
56 out.write("</jonas-ejb-jar>\n");
57 }
58 }