1
2
3
4
5
6
7
8 package it.imolinfo.jbi4ejb.jbi.xfire;
9
10 import it.imolinfo.jbi4ejb.Logger;
11 import it.imolinfo.jbi4ejb.LoggerFactory;
12
13 import org.codehaus.xfire.handler.LocateBindingHandler;
14 import org.codehaus.xfire.service.Service;
15 import org.codehaus.xfire.soap.SoapTransport;
16 import org.codehaus.xfire.soap.handler.SoapBodyHandler;
17 import org.codehaus.xfire.transport.AbstractTransport;
18 import org.codehaus.xfire.transport.Channel;
19 import org.codehaus.xfire.transport.DefaultEndpoint;
20 import org.codehaus.xfire.wsdl11.WSDL11Transport;
21
22
23
24
25
26
27 public class EjbTransport extends AbstractTransport implements WSDL11Transport, SoapTransport {
28
29
30 public static final String EJB_BINDING = "uri://schemas.imola.it/jbi/wsdl-extensions/ejb/";
31
32 private static final String KNOWN_URI_SCHEME = "ejb://";
33
34 private static final String EJB = "EJB";
35
36
37 private static final Logger LOG
38 = LoggerFactory.getLogger(EjbTransport.class);
39
40
41 private static final String URI_PREFIX = "urn:xfire:transport:ejb:";
42
43
44
45
46 public EjbTransport() {
47 addInHandler(new LocateBindingHandler());
48 addInHandler(new SoapBodyHandler());
49 }
50
51
52
53
54
55
56
57
58 public String getName() {
59 return EJB;
60 }
61
62
63
64
65
66
67
68
69
70
71 public String getServiceURL(Service service) {
72 return KNOWN_URI_SCHEME + service.getName();
73 }
74
75
76
77
78
79
80
81
82
83
84
85
86 protected Channel createNewChannel(String uri) {
87 LOG.debug("Creating new channel for uri: " + uri);
88 EjbChannel c = new EjbChannel(uri, this);
89 c.setEndpoint(new DefaultEndpoint());
90 return c;
91 }
92
93
94
95
96
97
98
99
100
101 protected String getUriPrefix() {
102 return URI_PREFIX;
103 }
104
105
106
107
108
109
110
111
112
113
114 public String[] getSupportedBindings()
115 {
116 return new String[] {EJB_BINDING};
117 }
118
119
120
121
122
123
124
125
126 public String[] getKnownUriSchemes() {
127 return new String[] { KNOWN_URI_SCHEME };
128 }
129
130
131
132
133
134
135
136
137
138
139 public boolean equals(Object o) {
140 return o instanceof EjbTransport;
141 }
142
143 }