KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > mule > providers > service > ConnectorServiceDescriptor


1 /*
2  * $Id: ConnectorServiceDescriptor.java 4259 2006-12-14 03:12:07Z aperepel $
3  * --------------------------------------------------------------------------------------
4  * Copyright (c) MuleSource, Inc. All rights reserved. http://www.mulesource.com
5  *
6  * The software in this package is published under the terms of the MuleSource MPL
7  * license, a copy of which has been included with this distribution in the
8  * LICENSE.txt file.
9  */

10
11 package org.mule.providers.service;
12
13 import org.apache.commons.lang.StringUtils;
14 import org.apache.commons.logging.Log;
15 import org.apache.commons.logging.LogFactory;
16 import org.mule.config.MuleProperties;
17 import org.mule.config.i18n.Message;
18 import org.mule.config.i18n.Messages;
19 import org.mule.impl.MuleSessionHandler;
20 import org.mule.impl.endpoint.EndpointBuilder;
21 import org.mule.impl.endpoint.UrlEndpointBuilder;
22 import org.mule.providers.NullPayload;
23 import org.mule.umo.UMOComponent;
24 import org.mule.umo.UMOException;
25 import org.mule.umo.UMOTransactionConfig;
26 import org.mule.umo.UMOTransactionFactory;
27 import org.mule.umo.endpoint.UMOEndpoint;
28 import org.mule.umo.provider.UMOConnector;
29 import org.mule.umo.provider.UMOMessageAdapter;
30 import org.mule.umo.provider.UMOMessageDispatcherFactory;
31 import org.mule.umo.provider.UMOMessageReceiver;
32 import org.mule.umo.provider.UMOSessionHandler;
33 import org.mule.umo.provider.UMOStreamMessageAdapter;
34 import org.mule.umo.transformer.UMOTransformer;
35 import org.mule.util.ClassUtils;
36 import org.mule.util.ObjectFactory;
37
38 import java.io.InputStream JavaDoc;
39 import java.io.OutputStream JavaDoc;
40 import java.util.Properties JavaDoc;
41
42 /**
43  * <code>ConnectorServiceDescriptor</code> describes the necessery information for
44  * creating a connector from a service descriptor. A service descriptor should be
45  * located at META-INF/services/org/mule/providers/<protocol> where protocol is the
46  * protocol of the connector to be created The service descriptor is on the form ok
47  * key value pairs and supports the following properties <b>connector</b>=org.mule.umo.providers.AbstractServiceEnabledConnector -
48  * The connector class <b>conector.factory</b>=org.mule.util.ObjectFactory - A
49  * connector factory class to use, this is used instead of the 'connector' property
50  * if set <b>dispatcher.factory</b>=org.mule.umo.providers.UMOMessageDispatcherFactory -
51  * tHe dispatcher factory class to use <b>message.adapter</b>=org.mule.umo.providers.UMOMessageAdapter -
52  * The message adater class to use <b>message.receiver</b>=org.mule.umo.providers.UMOMessageReceiver -
53  * The message receiver class to use <b>service.error</b>= This should only be set
54  * if the connector described cannot be created directly from this descriptor. In the
55  * case of Jms this would be set as the JmsConnector also needs Jndi information.
56  * <b>inbound.transformer</b>=org.mule.umo.UMOTransformer - The default inbound
57  * transformer to use by endpoints if no other is set <b>outbound.transformer</b>=org.mule.umo.UMOTransformer -
58  * The default outbound transformer to use by endpoints if no other is set Any other
59  * properties set in the descriptor are made available using the getParams() method
60  * on this discriptor.
61  *
62  * @author <a HREF="mailto:ross.mason@symphonysoft.com">Ross Mason</a>
63  * @version $Revision: 4259 $
64  */

65
66 public class ConnectorServiceDescriptor
67 {
68     /**
69      * logger used by this class
70      */

71     protected static Log logger = LogFactory.getLog(ConnectorServiceDescriptor.class);
72
73     private String JavaDoc protocol;
74     private String JavaDoc serviceLocation;
75     private String JavaDoc serviceError;
76     private String JavaDoc serviceFinder;
77     private String JavaDoc connector;
78     private String JavaDoc connectorFactory;
79     private String JavaDoc dispatcherFactory;
80     private String JavaDoc transactionFactory;
81     private String JavaDoc messageAdapter;
82     private String JavaDoc streamMessageAdapter;
83     private String JavaDoc messageReceiver;
84     private String JavaDoc transactedMessageReceiver;
85     private String JavaDoc endpointBuilder;
86     private String JavaDoc sessionHandler;
87     private String JavaDoc defaultInboundTransformer;
88     private String JavaDoc defaultOutboundTransformer;
89     private String JavaDoc defaultResponseTransformer;
90     private Properties properties;
91
92     private UMOTransformer inboundTransformer;
93     private UMOTransformer outboundTransformer;
94     private UMOTransformer responseTransformer;
95     // private EndpointBuilder endpointBuilderImpl;
96
private ConnectorServiceFinder connectorServiceFinder;
97
98     public ConnectorServiceDescriptor(String JavaDoc protocol, String JavaDoc serviceLocation, Properties props)
99     {
100         this.protocol = protocol;
101         this.serviceLocation = serviceLocation;
102         this.properties = props;
103
104         serviceError = removeProperty(MuleProperties.CONNECTOR_SERVICE_ERROR);
105         connector = removeProperty(MuleProperties.CONNECTOR_CLASS);
106         connectorFactory = removeProperty(MuleProperties.CONNECTOR_FACTORY);
107         dispatcherFactory = removeProperty(MuleProperties.CONNECTOR_DISPATCHER_FACTORY);
108         transactionFactory = removeProperty(MuleProperties.CONNECTOR_DISPATCHER_FACTORY);
109         messageReceiver = removeProperty(MuleProperties.CONNECTOR_MESSAGE_RECEIVER_CLASS);
110         transactedMessageReceiver = removeProperty(MuleProperties.CONNECTOR_TRANSACTED_MESSAGE_RECEIVER_CLASS);
111         messageAdapter = removeProperty(MuleProperties.CONNECTOR_MESSAGE_ADAPTER);
112         streamMessageAdapter = removeProperty(MuleProperties.CONNECTOR_STREAM_MESSAGE_ADAPTER);
113         defaultInboundTransformer = removeProperty(MuleProperties.CONNECTOR_INBOUND_TRANSFORMER);
114         defaultOutboundTransformer = removeProperty(MuleProperties.CONNECTOR_OUTBOUND_TRANSFORMER);
115         defaultResponseTransformer = removeProperty(MuleProperties.CONNECTOR_RESPONSE_TRANSFORMER);
116         endpointBuilder = removeProperty(MuleProperties.CONNECTOR_ENDPOINT_BUILDER);
117         serviceFinder = removeProperty(MuleProperties.CONNECTOR_SERVICE_FINDER);
118         sessionHandler = removeProperty(MuleProperties.CONNECTOR_SESSION_HANDLER);
119     }
120
121     void setOverrides(Properties props)
122     {
123         if (props == null || props.size() == 0)
124         {
125             return;
126         }
127         serviceError = props.getProperty(MuleProperties.CONNECTOR_SERVICE_ERROR, serviceError);
128         connector = props.getProperty(MuleProperties.CONNECTOR_CLASS, connector);
129         connectorFactory = props.getProperty(MuleProperties.CONNECTOR_FACTORY, connectorFactory);
130         dispatcherFactory = props.getProperty(MuleProperties.CONNECTOR_DISPATCHER_FACTORY, dispatcherFactory);
131         messageReceiver = props.getProperty(MuleProperties.CONNECTOR_MESSAGE_RECEIVER_CLASS, messageReceiver);
132         transactedMessageReceiver = props.getProperty(
133             MuleProperties.CONNECTOR_TRANSACTED_MESSAGE_RECEIVER_CLASS, transactedMessageReceiver);
134         messageAdapter = props.getProperty(MuleProperties.CONNECTOR_MESSAGE_ADAPTER, messageAdapter);
135
136         String JavaDoc temp = props.getProperty(MuleProperties.CONNECTOR_INBOUND_TRANSFORMER);
137         if (temp != null)
138         {
139             defaultInboundTransformer = temp;
140             inboundTransformer = null;
141         }
142
143         temp = props.getProperty(MuleProperties.CONNECTOR_OUTBOUND_TRANSFORMER);
144         if (temp != null)
145         {
146             defaultOutboundTransformer = temp;
147             outboundTransformer = null;
148         }
149
150         temp = props.getProperty(MuleProperties.CONNECTOR_RESPONSE_TRANSFORMER);
151         if (temp != null)
152         {
153             defaultResponseTransformer = temp;
154             responseTransformer = null;
155         }
156
157         temp = props.getProperty(MuleProperties.CONNECTOR_ENDPOINT_BUILDER);
158         if (temp != null)
159         {
160             endpointBuilder = temp;
161         }
162
163         temp = props.getProperty(MuleProperties.CONNECTOR_SERVICE_FINDER);
164         if (temp != null)
165         {
166             serviceFinder = temp;
167             connectorServiceFinder = null;
168         }
169     }
170
171     private String JavaDoc removeProperty(String JavaDoc name)
172     {
173         String JavaDoc temp = (String JavaDoc)properties.remove(name);
174         if (StringUtils.isEmpty(StringUtils.trim(temp)))
175         {
176             return null;
177         }
178         else
179         {
180             return temp;
181         }
182     }
183
184     public String JavaDoc getProtocol()
185     {
186         return protocol;
187     }
188
189     public String JavaDoc getServiceLocation()
190     {
191         return serviceLocation;
192     }
193
194     public String JavaDoc getServiceError()
195     {
196         return serviceError;
197     }
198
199     public String JavaDoc getConnector()
200     {
201         return connector;
202     }
203
204     public String JavaDoc getConnectorFactory()
205     {
206         return connectorFactory;
207     }
208
209     public String JavaDoc getDispatcherFactory()
210     {
211         return dispatcherFactory;
212     }
213
214     public String JavaDoc getMessageReceiver()
215     {
216         return messageReceiver;
217     }
218
219     public String JavaDoc getTransactedMessageReceiver()
220     {
221         return transactedMessageReceiver;
222     }
223
224     public String JavaDoc getDefaultInboundTransformer()
225     {
226         return defaultInboundTransformer;
227     }
228
229     public String JavaDoc getDefaultOutboundTransformer()
230     {
231         return defaultOutboundTransformer;
232     }
233
234     public String JavaDoc getMessageAdapter()
235     {
236         return messageAdapter;
237     }
238
239     public Properties getProperties()
240     {
241         return properties;
242     }
243
244     public String JavaDoc getEndpointBuilder()
245     {
246         return endpointBuilder;
247     }
248
249     public String JavaDoc getServiceFinder()
250     {
251         return serviceFinder;
252     }
253
254     public String JavaDoc getStreamMessageAdapter()
255     {
256         return streamMessageAdapter;
257     }
258
259     public String JavaDoc getTransactionFactory()
260     {
261         return transactionFactory;
262     }
263
264     public ConnectorServiceFinder getConnectorServiceFinder()
265     {
266         return connectorServiceFinder;
267     }
268
269     public String JavaDoc getSessionHandler()
270     {
271         return sessionHandler;
272     }
273
274     public ConnectorServiceFinder createServiceFinder() throws ConnectorServiceException
275     {
276         if (serviceFinder == null)
277         {
278             return null;
279         }
280         if (connectorServiceFinder == null)
281         {
282             try
283             {
284                 connectorServiceFinder = (ConnectorServiceFinder)ClassUtils.instanciateClass(serviceFinder,
285                     ClassUtils.NO_ARGS);
286             }
287             catch (Exception JavaDoc e)
288             {
289                 throw new ConnectorServiceException(new Message(Messages.CANT_INSTANCIATE_FINDER_X,
290                     serviceFinder), e);
291             }
292         }
293         return connectorServiceFinder;
294     }
295
296     public String JavaDoc getDefaultResponseTransformer()
297     {
298         return defaultResponseTransformer;
299     }
300
301     public UMOMessageAdapter createMessageAdapter(Object JavaDoc message) throws ConnectorServiceException
302     {
303         return createMessageAdapter(message, messageAdapter);
304     }
305
306     public UMOStreamMessageAdapter createStreamMessageAdapter(InputStream JavaDoc in, OutputStream JavaDoc out)
307         throws ConnectorServiceException
308     {
309         if (getStreamMessageAdapter() == null)
310         {
311             // streamMessageAdapter = StreamMessageAdapter.class.getName();
312
if (logger.isDebugEnabled())
313             {
314                 logger.debug("No stream.message.adapter set in service description, defaulting to: "
315                              + streamMessageAdapter);
316             }
317             // If the stream.message.adapter is not set streaming should not be used
318
throw new ConnectorServiceException(new Message(Messages.X_NOT_SET_IN_SERVICE_X,
319                 "stream.message.adapter", getProtocol() + " service descriptor"));
320         }
321         try
322         {
323             if (out == null)
324             {
325                 return (UMOStreamMessageAdapter)ClassUtils.instanciateClass(streamMessageAdapter,
326                     new Object JavaDoc[]{in});
327             }
328             else
329             {
330                 return (UMOStreamMessageAdapter)ClassUtils.instanciateClass(streamMessageAdapter,
331                     new Object JavaDoc[]{in, out});
332             }
333         }
334         catch (Exception JavaDoc e)
335         {
336             throw new ConnectorServiceException(new Message(Messages.FAILED_TO_CREATE_X_WITH_X,
337                 "Message Adapter", streamMessageAdapter), e);
338         }
339     }
340
341     protected UMOMessageAdapter createMessageAdapter(Object JavaDoc message, String JavaDoc clazz)
342         throws ConnectorServiceException
343     {
344         if (message == null)
345         {
346             message = new NullPayload();
347         }
348         if (messageAdapter != null)
349         {
350             try
351             {
352                 return (UMOMessageAdapter)ClassUtils.instanciateClass(clazz, new Object JavaDoc[]{message});
353             }
354             catch (Exception JavaDoc e)
355             {
356                 throw new ConnectorServiceException(new Message(Messages.FAILED_TO_CREATE_X_WITH_X,
357                     "Message Adapter", clazz), e);
358             }
359         }
360         else
361         {
362             throw new ConnectorServiceException(new Message(Messages.X_NOT_SET_IN_SERVICE_X,
363                 "Message Adapter", getProtocol()));
364         }
365     }
366
367     public UMOSessionHandler createSessionHandler() throws ConnectorServiceException
368     {
369         if (getSessionHandler() == null)
370         {
371             sessionHandler = MuleSessionHandler.class.getName();
372             if (logger.isDebugEnabled())
373             {
374                 logger.debug("No session.handler set in service description, defaulting to: "
375                              + sessionHandler);
376             }
377         }
378         try
379         {
380             return (UMOSessionHandler)ClassUtils.instanciateClass(getSessionHandler(), ClassUtils.NO_ARGS,
381                 getClass());
382         }
383         catch (Throwable JavaDoc e)
384         {
385             throw new ConnectorServiceException(new Message(Messages.FAILED_TO_CREATE_X_WITH_X,
386                 "SessionHandler", sessionHandler), e);
387         }
388     }
389
390     public UMOMessageReceiver createMessageReceiver(UMOConnector connector,
391                                                     UMOComponent component,
392                                                     UMOEndpoint endpoint) throws UMOException
393     {
394
395         return createMessageReceiver(connector, component, endpoint, null);
396     }
397
398     public UMOMessageReceiver
399
400     createMessageReceiver(UMOConnector connector, UMOComponent component, UMOEndpoint endpoint, Object JavaDoc[] args)
401         throws UMOException
402     {
403         String JavaDoc receiverClass = messageReceiver;
404
405         if (endpoint.getTransactionConfig() != null
406             && endpoint.getTransactionConfig().getAction() != UMOTransactionConfig.ACTION_NONE)
407         {
408             if (transactedMessageReceiver != null)
409             {
410                 receiverClass = transactedMessageReceiver;
411             }
412         }
413
414         if (receiverClass != null)
415         {
416             Object JavaDoc[] newArgs = null;
417             if (args != null && args.length != 0)
418             {
419                 newArgs = new Object JavaDoc[3 + args.length];
420             }
421             else
422             {
423                 newArgs = new Object JavaDoc[3];
424             }
425             newArgs[0] = connector;
426             newArgs[1] = component;
427             newArgs[2] = endpoint;
428             if (args != null && args.length != 0)
429             {
430                 System.arraycopy(args, 0, newArgs, 3, newArgs.length - 3);
431             }
432
433             try
434             {
435                 return (UMOMessageReceiver)ClassUtils.instanciateClass(receiverClass, newArgs);
436             }
437             catch (Exception JavaDoc e)
438             {
439                 throw new ConnectorServiceException(new Message(Messages.FAILED_TO_CREATE_X_WITH_X,
440                     "Message Receiver", getProtocol()), e);
441             }
442
443         }
444         else
445         {
446             throw new ConnectorServiceException(new Message(Messages.X_NOT_SET_IN_SERVICE_X,
447                 "Message Receiver", getProtocol()));
448         }
449     }
450
451     public UMOMessageDispatcherFactory createDispatcherFactory() throws ConnectorServiceException
452     {
453         if (dispatcherFactory != null)
454         {
455             try
456             {
457                 return (UMOMessageDispatcherFactory)ClassUtils.instanciateClass(dispatcherFactory,
458                     ClassUtils.NO_ARGS);
459             }
460             catch (Exception JavaDoc e)
461             {
462                 throw new ConnectorServiceException(new Message(Messages.FAILED_TO_CREATE_X_WITH_X,
463                     "Message Dispatcher Factory", dispatcherFactory), e);
464             }
465         }
466         else
467         {
468             throw new ConnectorServiceException(new Message(Messages.X_NOT_SET_IN_SERVICE_X,
469                 "Message Dispatcher Factory", getProtocol()));
470         }
471     }
472
473     public UMOTransactionFactory createTransactionFactory() throws ConnectorServiceException
474     {
475         if (transactionFactory != null)
476         {
477             try
478             {
479                 return (UMOTransactionFactory)ClassUtils.instanciateClass(transactionFactory,
480                     ClassUtils.NO_ARGS);
481             }
482             catch (Exception JavaDoc e)
483             {
484                 throw new ConnectorServiceException(new Message(Messages.FAILED_TO_CREATE_X_WITH_X,
485                     "Transaction Factory", transactionFactory), e);
486             }
487         }
488         else
489         {
490             return null;
491         }
492     }
493
494     public UMOConnector createConnector(String JavaDoc protocol) throws ConnectorServiceException
495     {
496
497         UMOConnector connector;
498         // Make sure we can create the endpoint/connector using this service
499
// method
500
if (getServiceError() != null)
501         {
502             throw new ConnectorServiceException(Message.createStaticMessage(getServiceError()));
503         }
504         // if there is a factory, use it
505
try
506         {
507             if (getConnectorFactory() != null)
508             {
509                 ObjectFactory factory = (ObjectFactory)ClassUtils.loadClass(getConnectorFactory(),
510                     ConnectorFactory.class).newInstance();
511                 connector = (UMOConnector)factory.create();
512             }
513             else
514             {
515                 if (getConnector() != null)
516                 {
517                     connector = (UMOConnector)ClassUtils.loadClass(getConnector(), ConnectorFactory.class)
518                         .newInstance();
519                 }
520                 else
521                 {
522                     throw new ConnectorServiceException(new Message(Messages.X_NOT_SET_IN_SERVICE_X,
523                         "Connector", getProtocol()));
524                 }
525             }
526         }
527         catch (ConnectorServiceException e)
528         {
529             throw e;
530         }
531         catch (Exception JavaDoc e)
532         {
533             throw new ConnectorServiceException(new Message(Messages.FAILED_TO_CREATE_X_WITH_X, "Connector",
534                 getConnector()), e);
535
536         }
537
538         if (connector.getName() == null)
539         {
540             connector.setName("_" + protocol + "Connector#" + connector.hashCode());
541         }
542         return connector;
543     }
544
545     public UMOTransformer createInboundTransformer() throws ConnectorFactoryException
546     {
547         if (inboundTransformer != null)
548         {
549             return inboundTransformer;
550         }
551         if (getDefaultInboundTransformer() != null)
552         {
553             logger.info("Loading default inbound transformer: " + getDefaultInboundTransformer());
554             try
555             {
556                 inboundTransformer = (UMOTransformer)ClassUtils.instanciateClass(
557                     getDefaultInboundTransformer(), ClassUtils.NO_ARGS);
558                 return inboundTransformer;
559             }
560             catch (Exception JavaDoc e)
561             {
562                 throw new ConnectorFactoryException(new Message(Messages.FAILED_LOAD_X_TRANSFORMER_X,
563                     "inbound", getDefaultInboundTransformer()), e);
564             }
565         }
566         return null;
567     }
568
569     public UMOTransformer createOutboundTransformer() throws ConnectorFactoryException
570     {
571         if (outboundTransformer != null)
572         {
573             return outboundTransformer;
574         }
575         if (getDefaultOutboundTransformer() != null)
576         {
577             logger.info("Loading default outbound transformer: " + getDefaultOutboundTransformer());
578             try
579             {
580                 outboundTransformer = (UMOTransformer)ClassUtils.instanciateClass(
581                     getDefaultOutboundTransformer(), ClassUtils.NO_ARGS);
582                 return outboundTransformer;
583             }
584             catch (Exception JavaDoc e)
585             {
586                 throw new ConnectorFactoryException(new Message(Messages.FAILED_LOAD_X_TRANSFORMER_X,
587                     "outbound", getDefaultOutboundTransformer()), e);
588             }
589         }
590         return null;
591     }
592
593     public UMOTransformer createResponseTransformer() throws ConnectorFactoryException
594     {
595         if (responseTransformer != null)
596         {
597             return responseTransformer;
598         }
599         if (getDefaultResponseTransformer() != null)
600         {
601             logger.info("Loading default response transformer: " + getDefaultResponseTransformer());
602             try
603             {
604                 responseTransformer = (UMOTransformer)ClassUtils.instanciateClass(
605                     getDefaultResponseTransformer(), ClassUtils.NO_ARGS);
606                 return responseTransformer;
607             }
608             catch (Exception JavaDoc e)
609             {
610                 throw new ConnectorFactoryException(new Message(Messages.FAILED_LOAD_X_TRANSFORMER_X,
611                     "response", getDefaultResponseTransformer()), e);
612             }
613         }
614         return null;
615     }
616
617     public EndpointBuilder createEndpointBuilder() throws ConnectorFactoryException
618     {
619         if (endpointBuilder == null)
620         {
621             logger.debug("Endpoint resolver not set, Loading default resolver: "
622                          + UrlEndpointBuilder.class.getName());
623             return new UrlEndpointBuilder();
624         }
625         else
626         {
627             logger.debug("Loading endpointUri resolver: " + getEndpointBuilder());
628             try
629             {
630                 return (EndpointBuilder)ClassUtils.instanciateClass(getEndpointBuilder(), ClassUtils.NO_ARGS);
631             }
632             catch (Exception JavaDoc e)
633             {
634                 throw new ConnectorFactoryException(new Message(Messages.FAILED_LOAD_X,
635                     "Endpoint Builder: " + getEndpointBuilder()), e);
636             }
637         }
638     }
639
640     public boolean equals(Object JavaDoc o)
641     {
642         if (this == o)
643         {
644             return true;
645         }
646         if (!(o instanceof ConnectorServiceDescriptor))
647         {
648             return false;
649         }
650
651         final ConnectorServiceDescriptor connectorServiceDescriptor = (ConnectorServiceDescriptor)o;
652
653         if (connector != null
654                         ? !connector.equals(connectorServiceDescriptor.connector)
655                         : connectorServiceDescriptor.connector != null)
656         {
657             return false;
658         }
659         if (connectorFactory != null
660                         ? !connectorFactory.equals(connectorServiceDescriptor.connectorFactory)
661                         : connectorServiceDescriptor.connectorFactory != null)
662         {
663             return false;
664         }
665         if (defaultInboundTransformer != null
666                         ? !defaultInboundTransformer.equals(connectorServiceDescriptor.defaultInboundTransformer)
667                         : connectorServiceDescriptor.defaultInboundTransformer != null)
668         {
669             return false;
670         }
671         if (defaultOutboundTransformer != null
672                         ? !defaultOutboundTransformer.equals(connectorServiceDescriptor.defaultOutboundTransformer)
673                         : connectorServiceDescriptor.defaultOutboundTransformer != null)
674         {
675             return false;
676         }
677         if (defaultResponseTransformer != null
678                         ? !defaultResponseTransformer.equals(connectorServiceDescriptor.defaultResponseTransformer)
679                         : connectorServiceDescriptor.defaultResponseTransformer != null)
680         {
681             return false;
682         }
683         if (dispatcherFactory != null
684                         ? !dispatcherFactory.equals(connectorServiceDescriptor.dispatcherFactory)
685                         : connectorServiceDescriptor.dispatcherFactory != null)
686         {
687             return false;
688         }
689         if (endpointBuilder != null
690                         ? !endpointBuilder.equals(connectorServiceDescriptor.endpointBuilder)
691                         : connectorServiceDescriptor.endpointBuilder != null)
692         {
693             return false;
694         }
695         if (messageAdapter != null
696                         ? !messageAdapter.equals(connectorServiceDescriptor.messageAdapter)
697                         : connectorServiceDescriptor.messageAdapter != null)
698         {
699             return false;
700         }
701         if (messageReceiver != null
702                         ? !messageReceiver.equals(connectorServiceDescriptor.messageReceiver)
703                         : connectorServiceDescriptor.messageReceiver != null)
704         {
705             return false;
706         }
707         if (properties != null
708                         ? !properties.equals(connectorServiceDescriptor.properties)
709                         : connectorServiceDescriptor.properties != null)
710         {
711             return false;
712         }
713         if (protocol != null
714                         ? !protocol.equals(connectorServiceDescriptor.protocol)
715                         : connectorServiceDescriptor.protocol != null)
716         {
717             return false;
718         }
719         if (serviceError != null
720                         ? !serviceError.equals(connectorServiceDescriptor.serviceError)
721                         : connectorServiceDescriptor.serviceError != null)
722         {
723             return false;
724         }
725         if (serviceFinder != null
726                         ? !serviceFinder.equals(connectorServiceDescriptor.serviceFinder)
727                         : connectorServiceDescriptor.serviceFinder != null)
728         {
729             return false;
730         }
731         if (serviceLocation != null
732                         ? !serviceLocation.equals(connectorServiceDescriptor.serviceLocation)
733                         : connectorServiceDescriptor.serviceLocation != null)
734         {
735             return false;
736         }
737         if (sessionHandler != null
738                         ? !sessionHandler.equals(connectorServiceDescriptor.sessionHandler)
739                         : connectorServiceDescriptor.sessionHandler != null)
740         {
741             return false;
742         }
743         if (streamMessageAdapter != null
744                         ? !streamMessageAdapter.equals(connectorServiceDescriptor.streamMessageAdapter)
745                         : connectorServiceDescriptor.streamMessageAdapter != null)
746         {
747             return false;
748         }
749         if (transactedMessageReceiver != null
750                         ? !transactedMessageReceiver.equals(connectorServiceDescriptor.transactedMessageReceiver)
751                         : connectorServiceDescriptor.transactedMessageReceiver != null)
752         {
753             return false;
754         }
755         if (transactionFactory != null
756                         ? !transactionFactory.equals(connectorServiceDescriptor.transactionFactory)
757                         : connectorServiceDescriptor.transactionFactory != null)
758         {
759             return false;
760         }
761
762         return true;
763     }
764
765     public int hashCode()
766     {
767         int result = (protocol != null ? protocol.hashCode() : 0);
768         result = 29 * result + (serviceLocation != null ? serviceLocation.hashCode() : 0);
769         result = 29 * result + (serviceError != null ? serviceError.hashCode() : 0);
770         result = 29 * result + (serviceFinder != null ? serviceFinder.hashCode() : 0);
771         result = 29 * result + (connector != null ? connector.hashCode() : 0);
772         result = 29 * result + (connectorFactory != null ? connectorFactory.hashCode() : 0);
773         result = 29 * result + (dispatcherFactory != null ? dispatcherFactory.hashCode() : 0);
774         result = 29 * result + (transactionFactory != null ? transactionFactory.hashCode() : 0);
775         result = 29 * result + (messageAdapter != null ? messageAdapter.hashCode() : 0);
776         result = 29 * result + (streamMessageAdapter != null ? streamMessageAdapter.hashCode() : 0);
777         result = 29 * result + (messageReceiver != null ? messageReceiver.hashCode() : 0);
778         result = 29 * result + (transactedMessageReceiver != null ? transactedMessageReceiver.hashCode() : 0);
779         result = 29 * result + (endpointBuilder != null ? endpointBuilder.hashCode() : 0);
780         result = 29 * result + (sessionHandler != null ? sessionHandler.hashCode() : 0);
781         result = 29 * result + (defaultInboundTransformer != null ? defaultInboundTransformer.hashCode() : 0);
782         result = 29 * result
783                  + (defaultOutboundTransformer != null ? defaultOutboundTransformer.hashCode() : 0);
784         result = 29 * result
785                  + (defaultResponseTransformer != null ? defaultResponseTransformer.hashCode() : 0);
786         return 29 * result + (properties != null ? properties.hashCode() : 0);
787     }
788
789 }
790
Popular Tags