KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > sun > enterprise > webservice > ServiceInvocationHandler


1 /*
2  * The contents of this file are subject to the terms
3  * of the Common Development and Distribution License
4  * (the License). You may not use this file except in
5  * compliance with the License.
6  *
7  * You can obtain a copy of the license at
8  * https://glassfish.dev.java.net/public/CDDLv1.0.html or
9  * glassfish/bootstrap/legal/CDDLv1.0.txt.
10  * See the License for the specific language governing
11  * permissions and limitations under the License.
12  *
13  * When distributing Covered Code, include this CDDL
14  * Header Notice in each file and include the License file
15  * at glassfish/bootstrap/legal/CDDLv1.0.txt.
16  * If applicable, add the following below the CDDL Header,
17  * with the fields enclosed by brackets [] replaced by
18  * you own identifying information:
19  * "Portions Copyrighted [year] [name of copyright owner]"
20  *
21  * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
22  */

23 package com.sun.enterprise.webservice;
24
25 import java.lang.UnsupportedOperationException JavaDoc;
26
27 import java.net.URL JavaDoc;
28
29 import java.util.HashSet JavaDoc;
30 import java.util.Set JavaDoc;
31 import java.util.Map JavaDoc;
32 import java.util.HashMap JavaDoc;
33 import java.util.Iterator JavaDoc;
34 import java.util.List JavaDoc;
35 import java.lang.reflect.Method JavaDoc;
36 import java.lang.reflect.Proxy JavaDoc;
37 import java.lang.reflect.InvocationHandler JavaDoc;
38 import java.lang.reflect.InvocationTargetException JavaDoc;
39
40 import javax.xml.namespace.QName JavaDoc;
41 import javax.xml.rpc.Service JavaDoc;
42 import javax.xml.rpc.handler.HandlerInfo JavaDoc;
43 import javax.xml.rpc.handler.HandlerRegistry JavaDoc;
44 import javax.xml.rpc.Stub JavaDoc;
45 import javax.xml.rpc.Call JavaDoc;
46
47 import com.sun.enterprise.deployment.ServiceReferenceDescriptor;
48 import com.sun.enterprise.deployment.ServiceRefPortInfo;
49 import com.sun.enterprise.deployment.NameValuePairDescriptor;
50 import com.sun.enterprise.deployment.runtime.common.MessageSecurityBindingDescriptor;
51
52 import com.sun.enterprise.security.jauth.ClientAuthConfig;
53 import com.sun.enterprise.webservice.WSSCallbackHandler;
54 import com.sun.enterprise.webservice.MessageLayerClientHandler;
55
56 /**
57  * InvocationHandler used to intercept calls to concrete JAXRPC
58  * Service implementation.
59  *
60  * NOTE : This class makes no distinction between "partial" WSDL and
61  * "full" WSDL. If a service-ref's packaged WSDL is "partial", the
62  * deployer is required to specify a wsdl-override in the runtime info
63  * that points to a final WSDL. In such a case, the behavior for each
64  * method listed in the table in section 4.2.2.7 of the spec is the
65  * same as Full WSDL.
66  *
67  * @author Kenneth Saks
68  */

69 public class ServiceInvocationHandler implements InvocationHandler JavaDoc {
70
71     private ServiceReferenceDescriptor serviceRef;
72
73     // real service instance
74
private Service JavaDoc serviceDelegate;
75
76     // used in full wsdl case for DII methods. Lazily instantiated.
77
private Service JavaDoc configuredServiceDelegate;
78
79     private ClassLoader JavaDoc classLoader;
80
81     private Method JavaDoc getClientManagedPortMethod;
82
83     // location of full wsdl associated with service-ref
84
private URL JavaDoc wsdlLocation;
85
86     private boolean fullWsdl = false;
87     private boolean noWsdl = false;
88
89     private WsUtil wsUtil = new WsUtil();
90
91     // Service method types
92
private static final int CREATE_CALL_NO_ARGS = 1;
93     private static final int CREATE_CALL_PORT = 2;
94     private static final int CREATE_CALL_OPERATION_QNAME = 3;
95     private static final int CREATE_CALL_OPERATION_STRING = 4;
96     private static final int GET_CALLS = 5;
97     private static final int GET_HANDLER_REGISTRY = 6;
98     private static final int GET_PORT_CONTAINER_MANAGED = 7;
99     private static final int GET_PORT_CLIENT_MANAGED = 8;
100     private static final int GET_PORTS = 9;
101     private static final int GET_SERVICE_NAME = 10;
102     private static final int GET_TYPE_MAPPING_REGISTRY = 11;
103     private static final int GET_WSDL_LOCATION = 12;
104     private static final int GENERATED_SERVICE_METHOD = 13;
105
106     private static Map JavaDoc serviceMethodTypes;
107     private static Set JavaDoc fullWsdlIllegalMethods;
108     private static Set JavaDoc noWsdlIllegalMethods;
109
110     static {
111         Init();
112     }
113
114     public ServiceInvocationHandler(ServiceReferenceDescriptor descriptor,
115                                     Service JavaDoc delegate, ClassLoader JavaDoc loader)
116         throws Exception JavaDoc {
117
118         serviceRef = descriptor;
119         serviceDelegate = delegate;
120         classLoader = loader;
121
122         if( serviceRef.hasWsdlFile() ) {
123             wsdlLocation = wsUtil.privilegedGetServiceRefWsdl(serviceRef);
124             fullWsdl = true;
125         } else {
126             noWsdl = true;
127         }
128
129         getClientManagedPortMethod = javax.xml.rpc.Service JavaDoc.class.getMethod
130             ("getPort", new Class JavaDoc[] { QName JavaDoc.class, Class JavaDoc.class } );
131
132     addMessageSecurityHandler(delegate);
133     }
134     
135     public Object JavaDoc invoke(Object JavaDoc proxy, Method JavaDoc method, Object JavaDoc[] args)
136         throws Throwable JavaDoc {
137
138         // NOTE : be careful with "args" parameter. It is null
139
// if method signature has 0 arguments.
140

141         if( method.getDeclaringClass() == java.lang.Object JavaDoc.class ) {
142             return invokeJavaObjectMethod(this, method, args);
143         }
144
145         int methodType = getMethodType(method);
146
147         checkUnsupportedMethods(methodType);
148
149         Object JavaDoc returnValue = null;
150
151         try {
152
153             // Initialize method info for invocation based on arguments.
154
// Some/All of this might be overridden below.
155
Object JavaDoc serviceToInvoke = serviceDelegate;
156             Method JavaDoc methodToInvoke = method;
157             int methodTypeToInvoke = methodType;
158             Object JavaDoc[] argsForInvoke = args;
159
160             switch(methodType) {
161
162             case GET_PORT_CONTAINER_MANAGED :
163                 Class JavaDoc serviceEndpointInterfaceClass = (Class JavaDoc) args[0];
164                 String JavaDoc serviceEndpointInterface =
165                     serviceEndpointInterfaceClass.getName();
166                 ServiceRefPortInfo portInfo =
167                     serviceRef.getPortInfo(serviceEndpointInterface);
168                 
169                 // If we have a port, use it to call getPort(QName, SEI) instead
170
if( (portInfo != null) && portInfo.hasWsdlPort() ) {
171                     methodToInvoke = getClientManagedPortMethod;
172                     methodTypeToInvoke = GET_PORT_CLIENT_MANAGED;
173                     argsForInvoke = new Object JavaDoc[] { portInfo.getWsdlPort(),
174                                                     args[0] };
175                 } else {
176                     // This means the deployer did not resolve the port to
177
// which this SEI is mapped. Just call getPort(SEI)
178
// method on delegate. This is not guaranteed to work.
179
}
180                 break;
181
182             case GET_WSDL_LOCATION :
183                 return wsdlLocation;
184
185             case CREATE_CALL_PORT :
186             case CREATE_CALL_OPERATION_QNAME :
187             case CREATE_CALL_OPERATION_STRING :
188             case GET_CALLS :
189             case GET_PORTS :
190
191                 serviceToInvoke = getConfiguredServiceDelegate();
192                 break;
193
194             } // End switch (methodType)
195

196             returnValue = methodToInvoke.invoke(serviceToInvoke, argsForInvoke);
197             
198             if( returnValue instanceof Stub JavaDoc ) {
199                 Stub JavaDoc stub = (Stub JavaDoc) returnValue;
200                 setStubProperties(stub, methodTypeToInvoke, methodToInvoke,
201                                   argsForInvoke);
202             } else if( returnValue instanceof Call JavaDoc ) {
203                 Call JavaDoc[] calls = new Call JavaDoc[1];
204                 calls[0] = (Call JavaDoc) returnValue;
205                 setCallProperties(calls, methodTypeToInvoke, argsForInvoke);
206             } else if( methodType == GET_CALLS ) {
207                 Call JavaDoc[] calls = (Call JavaDoc[]) returnValue;
208                 setCallProperties(calls, methodTypeToInvoke, argsForInvoke);
209             }
210             
211         } catch(InvocationTargetException JavaDoc ite) {
212             throw ite.getCause();
213         }
214
215     return returnValue;
216     }
217
218     public HandlerInfo JavaDoc getMessageSecurityHandlerInfo(QName JavaDoc port) throws Exception JavaDoc
219     {
220     HandlerInfo JavaDoc rvalue = null;
221
222     MessageSecurityBindingDescriptor binding = null;
223     ServiceRefPortInfo portInfo = serviceRef.getPortInfoByPort(port);
224     if (portInfo != null) {
225         binding = portInfo.getMessageSecurityBinding();
226     }
227
228     ClientAuthConfig config = ClientAuthConfig.getConfig
229         (com.sun.enterprise.security.jauth.AuthConfig.SOAP,
230          binding,WSSCallbackHandler.getInstance());
231
232     if (config != null) {
233
234         // get understood headers from auth module.
235
QName JavaDoc[] headers = config.getMechanisms();
236         
237         Map JavaDoc properties = new HashMap JavaDoc();
238         properties.put(MessageLayerClientHandler.CLIENT_AUTH_CONFIG, config);
239             properties.put(javax.xml.ws.handler.MessageContext.WSDL_SERVICE,
240                 serviceRef.getServiceName());
241
242         rvalue = new HandlerInfo JavaDoc(MessageLayerClientHandler.class,
243                      properties, headers);
244     }
245
246     return rvalue;
247     }
248
249     private boolean addMessageSecurityHandler(Service JavaDoc service) throws Exception JavaDoc
250     {
251     HandlerRegistry JavaDoc registry = service.getHandlerRegistry();
252     Iterator JavaDoc ports = null;
253     try {
254         ports = service.getPorts();
255     } catch (Exception JavaDoc e) {
256         // FIXME: should make sure that the exception was thrown because
257
// the service is not fully defined; but for now just return.
258
ports = null;
259     }
260
261         while(ports != null && ports.hasNext()) {
262
263             QName JavaDoc nextPort = (QName JavaDoc) ports.next();
264
265             List JavaDoc handlerChain = registry.getHandlerChain(nextPort);
266
267         // append security handler to the end of every handler chain
268
// ASSUMPTION 1: that registry.getHandlerChain() never returns null.
269
// ASSUMPTION 2: that handlers from ServiceRef have already been added
270

271         HandlerInfo JavaDoc handlerInfo = getMessageSecurityHandlerInfo(nextPort);
272
273         if (handlerInfo != null) {
274         handlerChain.add(handlerInfo);
275         }
276         }
277
278     return ports == null ? false : true;
279     }
280     
281     private Service JavaDoc getConfiguredServiceDelegate() throws Exception JavaDoc {
282         synchronized(this) {
283             if( configuredServiceDelegate == null ) {
284                 // We need a ConfiguredService to handle these
285
// invocations, since the JAXRPC RI Generated Service impl
286
// does not. Configured service is potentially
287
// a heavy-weight object so we lazily instantiate it to
288
// take advantage of the likelihood that
289
// GeneratedService service-refs won't be used for DII.
290
Service JavaDoc configuredService =
291                     wsUtil.createConfiguredService(serviceRef);
292                 wsUtil.configureHandlerChain(serviceRef, configuredService,
293                          configuredService.getPorts(), classLoader);
294                 configuredServiceDelegate = configuredService;
295         
296         addMessageSecurityHandler(configuredService);
297             }
298         }
299         return configuredServiceDelegate;
300     }
301
302     private int getMethodType(Method JavaDoc method) {
303         Integer JavaDoc methodType = (Integer JavaDoc) serviceMethodTypes.get(method);
304         return (methodType != null) ?
305             methodType.intValue() : GENERATED_SERVICE_METHOD;
306     }
307
308     /**
309      * Convert invocation method to a constant for easier processing.
310      */

311     private static void Init() {
312
313         serviceMethodTypes = new HashMap JavaDoc();
314         fullWsdlIllegalMethods = new HashSet JavaDoc();
315         noWsdlIllegalMethods = new HashSet JavaDoc();
316
317         try {
318
319             Class JavaDoc noParams[] = new Class JavaDoc[0];
320             String JavaDoc createCall = "createCall";
321             Class JavaDoc serviceClass = javax.xml.rpc.Service JavaDoc.class;
322
323             //
324
// Map Service method to method type.
325
//
326

327             Method JavaDoc createCallNoArgs =
328                 serviceClass.getDeclaredMethod(createCall, noParams);
329             serviceMethodTypes.put(createCallNoArgs,
330                                    new Integer JavaDoc(CREATE_CALL_NO_ARGS));
331
332             Method JavaDoc createCallPort =
333                 serviceClass.getDeclaredMethod(createCall,
334                                                new Class JavaDoc[] { QName JavaDoc.class });
335             serviceMethodTypes.put(createCallPort,
336                                    new Integer JavaDoc(CREATE_CALL_PORT));
337
338             Method JavaDoc createCallOperationQName =
339                 serviceClass.getDeclaredMethod
340                 (createCall, new Class JavaDoc[] { QName JavaDoc.class, QName JavaDoc.class });
341             serviceMethodTypes.put(createCallOperationQName,
342                                    new Integer JavaDoc(CREATE_CALL_OPERATION_QNAME));
343
344             Method JavaDoc createCallOperationString =
345                 serviceClass.getDeclaredMethod
346                 (createCall, new Class JavaDoc[] { QName JavaDoc.class, String JavaDoc.class });
347             serviceMethodTypes.put(createCallOperationString,
348                                    new Integer JavaDoc(CREATE_CALL_OPERATION_STRING));
349             
350             Method JavaDoc getCalls = serviceClass.getDeclaredMethod
351                 ("getCalls", new Class JavaDoc[] { QName JavaDoc.class });
352             serviceMethodTypes.put(getCalls, new Integer JavaDoc(GET_CALLS));
353
354             Method JavaDoc getHandlerRegistry = serviceClass.getDeclaredMethod
355                 ("getHandlerRegistry", noParams);
356             serviceMethodTypes.put(getHandlerRegistry,
357                                    new Integer JavaDoc(GET_HANDLER_REGISTRY));
358
359             Method JavaDoc getPortContainerManaged = serviceClass.getDeclaredMethod
360                 ("getPort", new Class JavaDoc[] { Class JavaDoc.class });
361             serviceMethodTypes.put(getPortContainerManaged,
362                                    new Integer JavaDoc(GET_PORT_CONTAINER_MANAGED));
363
364             Method JavaDoc getPortClientManaged = serviceClass.getDeclaredMethod
365                 ("getPort", new Class JavaDoc[] { QName JavaDoc.class, Class JavaDoc.class });
366             serviceMethodTypes.put(getPortClientManaged,
367                                    new Integer JavaDoc(GET_PORT_CLIENT_MANAGED));
368             
369             Method JavaDoc getPorts = serviceClass.getDeclaredMethod
370                 ("getPorts", noParams);
371             serviceMethodTypes.put(getPorts, new Integer JavaDoc(GET_PORTS));
372
373             Method JavaDoc getServiceName = serviceClass.getDeclaredMethod
374                 ("getServiceName", noParams);
375             serviceMethodTypes.put(getServiceName,
376                                    new Integer JavaDoc(GET_SERVICE_NAME));
377
378             Method JavaDoc getTypeMappingRegistry = serviceClass.getDeclaredMethod
379                 ("getTypeMappingRegistry", noParams);
380             serviceMethodTypes.put(getTypeMappingRegistry,
381                                    new Integer JavaDoc(GET_TYPE_MAPPING_REGISTRY));
382
383             Method JavaDoc getWsdlLocation = serviceClass.getDeclaredMethod
384                 ("getWSDLDocumentLocation", noParams);
385             serviceMethodTypes.put(getWsdlLocation,
386                                    new Integer JavaDoc(GET_WSDL_LOCATION));
387         } catch(NoSuchMethodException JavaDoc nsme) {}
388
389         // Implementation of table 4.2.2.7. All "No WSDL" column cells
390
// with value Unspecified throw UnsupportedOperationException
391

392         fullWsdlIllegalMethods.add(new Integer JavaDoc(GET_HANDLER_REGISTRY));
393         fullWsdlIllegalMethods.add(new Integer JavaDoc(GET_TYPE_MAPPING_REGISTRY));
394
395         noWsdlIllegalMethods.add(new Integer JavaDoc(CREATE_CALL_PORT));
396         noWsdlIllegalMethods.add(new Integer JavaDoc(CREATE_CALL_OPERATION_QNAME));
397         noWsdlIllegalMethods.add(new Integer JavaDoc(CREATE_CALL_OPERATION_STRING));
398         noWsdlIllegalMethods.add(new Integer JavaDoc(GET_CALLS));
399         noWsdlIllegalMethods.add(new Integer JavaDoc(GET_HANDLER_REGISTRY));
400         noWsdlIllegalMethods.add(new Integer JavaDoc(GET_PORT_CONTAINER_MANAGED));
401         noWsdlIllegalMethods.add(new Integer JavaDoc(GET_PORT_CLIENT_MANAGED));
402         noWsdlIllegalMethods.add(new Integer JavaDoc(GET_PORTS));
403         noWsdlIllegalMethods.add(new Integer JavaDoc(GET_SERVICE_NAME));
404         noWsdlIllegalMethods.add(new Integer JavaDoc(GET_TYPE_MAPPING_REGISTRY));
405         noWsdlIllegalMethods.add(new Integer JavaDoc(GET_WSDL_LOCATION));
406
407         // This case shouldn't happen since if service-ref has generated
408
// service and no WSDL it won't get past deployment, but it's here
409
// for completeness.
410
noWsdlIllegalMethods.add(new Integer JavaDoc(GENERATED_SERVICE_METHOD));
411     }
412
413     private void checkUnsupportedMethods(int methodType)
414         throws UnsupportedOperationException JavaDoc {
415
416         Set JavaDoc illegalMethods = fullWsdl ?
417             fullWsdlIllegalMethods : noWsdlIllegalMethods;
418
419         if( illegalMethods.contains(new Integer JavaDoc(methodType)) ) {
420             throw new UnsupportedOperationException JavaDoc();
421         }
422
423         return;
424     }
425
426     private void setStubProperties(Stub JavaDoc stub, int methodType, Method JavaDoc method,
427                                    Object JavaDoc[] args) {
428
429         // Port info lookup will be based on SEI or port.
430
QName JavaDoc port = null;
431         String JavaDoc serviceEndpointInterface = null;
432
433         switch(methodType) {
434         case GET_PORT_CONTAINER_MANAGED :
435
436             serviceEndpointInterface = ((Class JavaDoc) args[0]).getName();
437             break;
438
439         case GET_PORT_CLIENT_MANAGED :
440
441             port = (QName JavaDoc) args[0];
442             serviceEndpointInterface = ((Class JavaDoc) args[1]).getName();
443             break;
444
445         case GENERATED_SERVICE_METHOD :
446
447             // java.rmi.Remote get<Name_of_wsdl:port>()
448
String JavaDoc portLocalPart = method.getName().startsWith("get") ?
449                 method.getName().substring(3) : null;
450             if( portLocalPart != null ) {
451                 QName JavaDoc serviceName = serviceRef.getServiceName();
452                 port = new QName JavaDoc(serviceName.getNamespaceURI(), portLocalPart);
453             }
454             serviceEndpointInterface = method.getReturnType().getName();
455
456             break;
457
458         default :
459             return;
460         }
461
462         ServiceRefPortInfo portInfo = null;
463
464         // If port is known, it takes precedence in lookup.
465
if( port != null ) {
466             portInfo = serviceRef.getPortInfoByPort(port);
467         }
468         if( portInfo == null ) {
469             portInfo = serviceRef.getPortInfoBySEI(serviceEndpointInterface);
470         }
471             
472         if( portInfo != null ) {
473             Set JavaDoc properties = portInfo.getStubProperties();
474
475             for(Iterator JavaDoc iter = properties.iterator(); iter.hasNext();) {
476                 NameValuePairDescriptor next = (NameValuePairDescriptor)
477                     iter.next();
478                 if( next.getName().equals
479                     (WsUtil.CLIENT_TRANSPORT_LOG_PROPERTY) ) {
480                     // value is a URL
481
wsUtil.setClientTransportLog(serviceRef, stub,
482                                                  next.getValue());
483                 } else if(next.getName().equals(ServiceEngineUtil.JBI_ENABLED)){
484                     setJBIProperties(stub, portInfo);
485                 } else {
486                     stub._setProperty(next.getName(), next.getValue());
487                 }
488             }
489
490             // If this port has a resolved target endpoint address due to a
491
// port-component-link, set it on stub. However, if the runtime
492
// info has an entry for target endpoint address, that takes
493
// precedence.
494
if( portInfo.hasTargetEndpointAddress() ) {
495                 if(!portInfo.hasStubProperty(Stub.ENDPOINT_ADDRESS_PROPERTY)) {
496                     stub._setProperty(Stub.ENDPOINT_ADDRESS_PROPERTY,
497                                       portInfo.getTargetEndpointAddress());
498                 }
499             }
500         }
501     }
502
503     private void setCallProperties(Call JavaDoc[] calls, int methodType, Object JavaDoc[] args){
504
505         Set JavaDoc callProperties = getPropertiesForCall(methodType, args);
506
507         if( callProperties != null ) {
508             for(int callIndex = 0; callIndex < calls.length; callIndex++) {
509                 setCallProperties(calls[callIndex], callProperties);
510             }
511         }
512     }
513         
514     private Set JavaDoc getPropertiesForCall(int methodType, Object JavaDoc args[]) {
515
516         Set JavaDoc callProperties = null;
517         switch(methodType) {
518
519         case CREATE_CALL_PORT :
520         case CREATE_CALL_OPERATION_QNAME :
521         case CREATE_CALL_OPERATION_STRING :
522         case GET_CALLS :
523
524                 // Each of these methods has port as first argument.
525
QName JavaDoc port = (QName JavaDoc) args[0];
526                 
527                 // Check if call properties are set at the port level.
528
ServiceRefPortInfo portInfo =
529                     serviceRef.getPortInfoByPort(port);
530                 if( portInfo != null ) {
531                     callProperties = portInfo.getCallProperties();
532                 }
533
534                 break;
535
536         case CREATE_CALL_NO_ARGS :
537
538             callProperties = serviceRef.getCallProperties();
539             break;
540
541         }
542         
543         return callProperties;
544     }
545
546     private void setCallProperties(Call JavaDoc call, Set JavaDoc callProperties) {
547         for(Iterator JavaDoc iter = callProperties.iterator(); iter.hasNext();) {
548             NameValuePairDescriptor next = (NameValuePairDescriptor)
549                 iter.next();
550             call.setProperty(next.getName(), next.getValue());
551         }
552     }
553
554     private Object JavaDoc invokeJavaObjectMethod(InvocationHandler JavaDoc handler,
555                                           Method JavaDoc method, Object JavaDoc[] args)
556         throws Throwable JavaDoc {
557
558         Object JavaDoc returnValue = null;
559
560         // Can only be one of :
561
// boolean java.lang.Object.equals(Object)
562
// int java.lang.Object.hashCode()
563
// String java.lang.Object.toString()
564
//
565
// Optimize by comparing as few characters as possible.
566

567         switch( method.getName().charAt(0) ) {
568             case 'e' :
569                 Object JavaDoc other = Proxy.isProxyClass(args[0].getClass()) ?
570                     Proxy.getInvocationHandler(args[0]) : args[0];
571                 returnValue = new Boolean JavaDoc(handler.equals(other));
572                 break;
573             case 'h' :
574                 returnValue = new Integer JavaDoc(handler.hashCode());
575                 break;
576             case 't' :
577                 returnValue = handler.toString();
578                 break;
579             default :
580                 throw new Throwable JavaDoc("Object method " + method.getName() +
581                                     "not found");
582         }
583
584         return returnValue;
585     }
586
587     private void setJBIProperties(Object JavaDoc stubOrCall, ServiceRefPortInfo portInfo) {
588         // Check if the target service is a JBI service, and get its QName
589
QName JavaDoc svcQName = serviceRef.getServiceName();
590         if ( svcQName == null )
591             return;
592                                                                                 
593         if ( stubOrCall instanceof Stub JavaDoc ) {
594             com.sun.xml.rpc.spi.runtime.StubBase stub =
595                     (com.sun.xml.rpc.spi.runtime.StubBase)stubOrCall;
596                                                                                 
597             try {
598                 // This statement is getting executed only
599
//because jbi-enabled property on the stub is set to true
600
ServiceEngineUtil.setJBITransportFactory(portInfo, stub, true);
601             } catch(Throwable JavaDoc e) {
602                 // Do nothing
603
//logger.severe("Exception raised while setting transport " +
604
// "factory to NMR : " + e.getMessage());
605
}
606             return;
607         }
608     }
609 }
610
Popular Tags