Coverage Report - org.mule.providers.soap.xfire.XFireConnector
 
Classes in this File Line Coverage Branch Coverage Complexity
XFireConnector
67%
117/175
61%
40/66
1.925
 
 1  
 /*
 2  
  * $Id: XFireConnector.java 10164 2007-12-28 11:32:14Z marie.rizzo $
 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 CPAL v1.0
 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.soap.xfire;
 12  
 
 13  
 import org.mule.MuleManager;
 14  
 import org.mule.impl.MuleDescriptor;
 15  
 import org.mule.impl.endpoint.MuleEndpoint;
 16  
 import org.mule.impl.internal.notifications.ManagerNotification;
 17  
 import org.mule.impl.internal.notifications.ManagerNotificationListener;
 18  
 import org.mule.impl.internal.notifications.NotificationException;
 19  
 import org.mule.impl.model.ModelHelper;
 20  
 import org.mule.providers.AbstractConnector;
 21  
 import org.mule.providers.http.HttpConnector;
 22  
 import org.mule.providers.http.HttpConstants;
 23  
 import org.mule.providers.soap.MethodFixInterceptor;
 24  
 import org.mule.providers.soap.xfire.i18n.XFireMessages;
 25  
 import org.mule.umo.UMOComponent;
 26  
 import org.mule.umo.UMOException;
 27  
 import org.mule.umo.endpoint.UMOEndpoint;
 28  
 import org.mule.umo.endpoint.UMOEndpointURI;
 29  
 import org.mule.umo.lifecycle.InitialisationException;
 30  
 import org.mule.umo.manager.UMOServerNotification;
 31  
 import org.mule.umo.provider.UMOMessageReceiver;
 32  
 import org.mule.util.ClassUtils;
 33  
 import org.mule.util.StringUtils;
 34  
 import org.mule.util.SystemUtils;
 35  
 
 36  
 import java.util.List;
 37  
 import java.util.Map;
 38  
 
 39  
 import org.codehaus.xfire.DefaultXFire;
 40  
 import org.codehaus.xfire.XFire;
 41  
 import org.codehaus.xfire.aegis.AegisBindingProvider;
 42  
 import org.codehaus.xfire.aegis.type.TypeMappingRegistry;
 43  
 import org.codehaus.xfire.annotations.AnnotationServiceFactory;
 44  
 import org.codehaus.xfire.annotations.WebAnnotations;
 45  
 import org.codehaus.xfire.service.Service;
 46  
 import org.codehaus.xfire.service.ServiceFactory;
 47  
 import org.codehaus.xfire.service.binding.BindingProvider;
 48  
 import org.codehaus.xfire.service.binding.ObjectServiceFactory;
 49  
 import org.codehaus.xfire.soap.SoapConstants;
 50  
 import org.codehaus.xfire.wsdl11.builder.WSDLBuilderFactory;
 51  
 
 52  
 /**
 53  
  * Configures Xfire to provide STaX-based Web Servies support to Mule.
 54  
  */
 55  
 public class XFireConnector extends AbstractConnector
 56  
     implements ManagerNotificationListener
 57  
 {
 58  
     public static final String XFIRE_SERVICE_COMPONENT_NAME = "_xfireServiceComponent";
 59  
     public static final String DEFAULT_MULE_NAMESPACE_URI = "http://www.muleumo.org";
 60  
     public static final String XFIRE_PROPERTY = "xfire";
 61  
     public static final String XFIRE_TRANSPORT = "transportClass";
 62  
 
 63  
     public static final String CLASSNAME_ANNOTATIONS = "org.codehaus.xfire.annotations.jsr181.Jsr181WebAnnotations";
 64  
     private static final String DEFAULT_BINDING_PROVIDER_CLASS = "org.codehaus.xfire.aegis.AegisBindingProvider";
 65  
     private static final String DEFAULT_TYPE_MAPPING_REGISTRY_CLASS = "org.codehaus.xfire.aegis.type.DefaultTypeMappingRegistry";
 66  
 
 67  
     protected MuleDescriptor xfireDescriptor;
 68  
 
 69  
     private XFire xfire;
 70  
 
 71  
     private ServiceFactory serviceFactory;
 72  
 
 73  66
     private boolean enableJSR181Annotations = false;
 74  
 
 75  66
     private List clientServices = null;
 76  66
     private List clientInHandlers = null;
 77  66
     private List clientOutHandlers = null;
 78  66
     private String clientTransport = null;
 79  
 
 80  66
     private String bindingProvider = null;
 81  66
     private String typeMappingRegistry = null;
 82  66
     private String serviceTransport = null;
 83  66
     private List serverInHandlers = null;
 84  66
     private List serverOutHandlers = null;
 85  
     
 86  66
     private Map extraProperties = null;
 87  
 
 88  
     public XFireConnector()
 89  
     {
 90  66
         super();
 91  66
         registerProtocols();
 92  66
     }
 93  
 
 94  
     protected void registerProtocols()
 95  
     {
 96  60
         registerSupportedProtocol("http");
 97  60
         registerSupportedProtocol("https");
 98  60
         registerSupportedProtocol("jms");
 99  60
         registerSupportedProtocol("vm");
 100  60
         registerSupportedProtocol("servlet");
 101  60
     }
 102  
 
 103  
     public String getProtocol()
 104  
     {
 105  900
         return "xfire";
 106  
     }
 107  
 
 108  
     protected void doInitialise() throws InitialisationException
 109  
     {
 110  
 
 111  
         try
 112  
         {
 113  66
             MuleManager.getInstance().registerListener(this);
 114  
         }
 115  0
         catch (NotificationException e)
 116  
         {
 117  0
             throw new InitialisationException(e, this);
 118  66
         }
 119  
 
 120  66
         if (xfire == null)
 121  
         {
 122  66
             xfire = new DefaultXFire();
 123  
         }
 124  
 
 125  66
         if (clientServices != null)
 126  
         {
 127  2
             ObjectServiceFactory factory = new ObjectServiceFactory();
 128  2
             configureBindingProvider(factory);
 129  
 
 130  4
             for (int i = 0; i < clientServices.size(); i++)
 131  
             {
 132  
                 try
 133  
                 {
 134  2
                     Class clazz = ClassUtils.loadClass(clientServices.get(i).toString(), this.getClass());
 135  2
                     Service service = factory.create(clazz);
 136  2
                     xfire.getServiceRegistry().register(service);
 137  
                 }
 138  0
                 catch (ClassNotFoundException e)
 139  
                 {
 140  0
                     throw new InitialisationException(
 141  
                         XFireMessages.couldNotInitAnnotationProcessor(clientServices.get(i)), e, this);
 142  2
                 }
 143  
             }
 144  
         }
 145  
 
 146  66
         if (serviceFactory == null)
 147  
         {
 148  66
             if (enableJSR181Annotations)
 149  
             {
 150  
                 // are we running under Java 5 (at least)?
 151  0
                 if (!SystemUtils.isJavaVersionAtLeast(150))
 152  
                 {
 153  0
                     throw new InitialisationException(
 154  
                         XFireMessages.annotationsRequireJava5(), this);
 155  
                 }
 156  
                 try
 157  
                 {
 158  0
                     WebAnnotations wa = (WebAnnotations)ClassUtils.instanciateClass(
 159  
                         CLASSNAME_ANNOTATIONS, null, this.getClass());
 160  0
                     serviceFactory = new AnnotationServiceFactory(wa, xfire.getTransportManager());
 161  0
                     configureBindingProvider((ObjectServiceFactory)serviceFactory);
 162  
                 }
 163  0
                 catch (Exception ex)
 164  
                 {
 165  0
                     throw new InitialisationException(
 166  
                         XFireMessages.couldNotInitAnnotationProcessor(CLASSNAME_ANNOTATIONS), ex, this);
 167  0
                 }
 168  
             }
 169  
             else
 170  
             {
 171  66
                 serviceFactory = new MuleObjectServiceFactory(xfire.getTransportManager());
 172  66
                 configureBindingProvider((ObjectServiceFactory)serviceFactory);
 173  
             }
 174  
         }
 175  
 
 176  66
         if (serviceFactory instanceof ObjectServiceFactory)
 177  
         {
 178  66
             ObjectServiceFactory osf = (ObjectServiceFactory)serviceFactory;
 179  66
             if (osf.getTransportManager() == null)
 180  
             {
 181  0
                 osf.setTransportManager(xfire.getTransportManager());
 182  
             }
 183  
 
 184  
         }
 185  66
     }
 186  
 
 187  
     protected void configureBindingProvider(ObjectServiceFactory factory) throws InitialisationException
 188  
     {
 189  68
         if (StringUtils.isBlank(bindingProvider))
 190  
         {
 191  66
             bindingProvider = DEFAULT_BINDING_PROVIDER_CLASS;
 192  
         }
 193  
 
 194  68
         if (StringUtils.isBlank(typeMappingRegistry))
 195  
         {
 196  66
             typeMappingRegistry = DEFAULT_TYPE_MAPPING_REGISTRY_CLASS;
 197  
         }
 198  
 
 199  
         try
 200  
         {
 201  68
             Class clazz = ClassUtils.loadClass(bindingProvider, this.getClass());
 202  68
             BindingProvider provider = (BindingProvider)ClassUtils.instanciateClass(clazz, new Object[] {} );
 203  
 
 204  
             // Create the argument of TypeMappingRegistry ONLY if the binding 
 205  
             // provider is aegis and the type mapping registry is not the default
 206  68
             if (bindingProvider.equals(DEFAULT_BINDING_PROVIDER_CLASS) && !typeMappingRegistry.equals(DEFAULT_TYPE_MAPPING_REGISTRY_CLASS))
 207  
             {
 208  0
                 Class registryClazz = ClassUtils.loadClass(typeMappingRegistry, this.getClass());
 209  
 
 210  
                 // No constructor arguments for the mapping registry
 211  
                 //
 212  
                 // Note that if we had to create the DefaultTypeMappingRegistry here
 213  
                 // we would need to pass in a boolean argument of true to the
 214  
                 // constructor. Currently, it appears that all other registries
 215  
                 // can be created with zero argument constructors
 216  0
                 TypeMappingRegistry registry = (TypeMappingRegistry)ClassUtils.instanciateClass(registryClazz, new Object[] { } );
 217  0
                 ((AegisBindingProvider)provider).setTypeMappingRegistry(registry);
 218  
             }
 219  
 
 220  68
             factory.setBindingProvider(provider);
 221  
 
 222  68
             String wsdlBuilderFactoryClass = null;
 223  
 
 224  
             // Special handling for MessageBindingProvider
 225  68
             if (bindingProvider.equals("org.codehaus.xfire.service.binding.MessageBindingProvider"))
 226  
             {
 227  0
                 factory.setStyle(SoapConstants.STYLE_MESSAGE);
 228  
             }
 229  
 
 230  
             // See MULE-1871
 231  
 //            // Special handling for XmlBeansBindingProvider
 232  
 //            if (bindingProvider.equals("org.codehaus.xfire.service.binding.MessageBindingProvider"))
 233  
 //            {
 234  
 //                factory.setStyle(SoapConstants.STYLE_DOCUMENT);
 235  
 //                wsdlBuilderFactoryClass = "org.codehaus.xfire.xmlbeans.XmlBeansWSDLBuilderFactory";
 236  
 //            }
 237  
 
 238  
             // If required, create the WSDL builder factory (only XML beans needs
 239  
             // this)
 240  68
             if (wsdlBuilderFactoryClass != null)
 241  
             {
 242  0
                 Class wsdlBuilderFactoryClazz = ClassUtils.loadClass(wsdlBuilderFactoryClass, this.getClass());
 243  0
                 WSDLBuilderFactory wsdlBuilderFactory = (WSDLBuilderFactory)ClassUtils.instanciateClass(wsdlBuilderFactoryClazz, new Object[] { } );
 244  0
                 factory.setWsdlBuilderFactory(wsdlBuilderFactory);
 245  
             }
 246  
         }
 247  0
         catch (Exception ex)
 248  
         {
 249  0
             throw new InitialisationException(
 250  
                 XFireMessages.unableToInitBindingProvider(bindingProvider), ex, this);
 251  68
         }
 252  
 
 253  68
     }
 254  
 
 255  
     protected void doDispose()
 256  
     {
 257  
         // template method
 258  66
     }
 259  
 
 260  
     protected void doConnect() throws Exception
 261  
     {
 262  
         // template method
 263  52
     }
 264  
 
 265  
     protected void doDisconnect() throws Exception
 266  
     {
 267  
         // template method
 268  52
     }
 269  
 
 270  
     protected void doStart() throws UMOException
 271  
     {
 272  
         // template method
 273  52
     }
 274  
 
 275  
     protected void doStop() throws UMOException
 276  
     {
 277  
         // template method
 278  52
     }
 279  
 
 280  
     public XFire getXfire()
 281  
     {
 282  220
         return xfire;
 283  
     }
 284  
 
 285  
     public void setXfire(XFire xfire)
 286  
     {
 287  0
         this.xfire = xfire;
 288  0
     }
 289  
 
 290  
     protected void registerReceiverWithMuleService(UMOMessageReceiver receiver, UMOEndpointURI ep)
 291  
         throws UMOException
 292  
     {
 293  
         // If this is the first receiver we need to create the Axis service
 294  
         // component
 295  
         // this will be registered with Mule when the Connector starts
 296  84
         if (xfireDescriptor == null)
 297  
         {
 298  
             // See if the xfire descriptor has already been added. This allows
 299  
             // developers to override the default configuration, say to increase
 300  
             // the threadpool
 301  44
             xfireDescriptor = (MuleDescriptor)MuleManager.getInstance().lookupModel(ModelHelper.SYSTEM_MODEL).getDescriptor(
 302  
                 XFIRE_SERVICE_COMPONENT_NAME + getName());
 303  44
             if (xfireDescriptor == null)
 304  
             {
 305  44
                 xfireDescriptor = createxfireDescriptor();
 306  
             }
 307  
             else
 308  
             {
 309  
                 // Lets unregister the 'template' instance, configure it and
 310  
                 // then register
 311  
                 // again later
 312  0
                 MuleManager.getInstance().lookupModel(ModelHelper.SYSTEM_MODEL).unregisterComponent(xfireDescriptor);
 313  
             }
 314  
             // if the axis server hasn't been set, set it now. The Axis server
 315  
             // may be set externally
 316  44
             if (xfireDescriptor.getProperties().get(XFIRE_PROPERTY) == null)
 317  
             {
 318  44
                 xfireDescriptor.getProperties().put(XFIRE_PROPERTY, xfire);
 319  
             }
 320  44
             if (serviceTransport != null
 321  
                 && xfireDescriptor.getProperties().get(XFIRE_TRANSPORT) == null)
 322  
             {
 323  0
                 xfireDescriptor.getProperties().put(XFIRE_TRANSPORT, serviceTransport);
 324  
             }
 325  44
             xfireDescriptor.setContainerManaged(false);
 326  
         }
 327  84
         String serviceName = receiver.getComponent().getDescriptor().getName();
 328  
 
 329  
         // No determine if the endpointUri requires a new connector to be
 330  
         // registed in the case of http we only need to register the new
 331  
         // endpointUri if the port is different
 332  84
         String endpoint = receiver.getEndpointURI().getAddress();
 333  84
         String scheme = ep.getScheme().toLowerCase();
 334  
 
 335  
 
 336  84
         boolean sync = receiver.getEndpoint().isSynchronous();
 337  
 
 338  
         // If we are using sockets then we need to set the endpoint name appropiately
 339  
         // and if using http/https
 340  
         // we need to default to POST and set the Content-Type
 341  84
         if (scheme.equals("http") || scheme.equals("https") || scheme.equals("ssl")
 342  
             || scheme.equals("tcp") || scheme.equals("servlet"))
 343  
         {
 344  84
             endpoint += "/" + serviceName;
 345  84
             receiver.getEndpoint().getProperties().put(HttpConnector.HTTP_METHOD_PROPERTY, "POST");
 346  84
             receiver.getEndpoint().getProperties().put(HttpConstants.HEADER_CONTENT_TYPE,
 347  
                 "text/xml");
 348  
 
 349  
             // Default to using synchronous for socket based protocols unless the
 350  
             // synchronous property has been set explicitly
 351  84
             if (!receiver.getEndpoint().isSynchronousSet())
 352  
             {
 353  74
                 sync = true;
 354  
             }
 355  
         }
 356  
        
 357  
 
 358  84
         UMOEndpoint serviceEndpoint = new MuleEndpoint(endpoint, true);
 359  84
         serviceEndpoint.setSynchronous(sync);
 360  84
         serviceEndpoint.setName(ep.getScheme() + ":" + serviceName);
 361  
 
 362  
         // Set the transformers on the endpoint too
 363  84
         serviceEndpoint.setTransformer(receiver.getEndpoint().getTransformer());
 364  84
         receiver.getEndpoint().setTransformer(null);
 365  
 
 366  84
         serviceEndpoint.setResponseTransformer(receiver.getEndpoint().getResponseTransformer());
 367  84
         receiver.getEndpoint().setResponseTransformer(null);
 368  
 
 369  
         // set the filter on the axis endpoint on the real receiver endpoint
 370  84
         serviceEndpoint.setFilter(receiver.getEndpoint().getFilter());
 371  
         // Remove the Axis filter now
 372  84
         receiver.getEndpoint().setFilter(null);
 373  
 
 374  
         // set the Security filter on the axis endpoint on the real receiver
 375  
         // endpoint
 376  84
         serviceEndpoint.setSecurityFilter(receiver.getEndpoint().getSecurityFilter());
 377  
         // Remove the Axis Receiver Security filter now
 378  84
         receiver.getEndpoint().setSecurityFilter(null);
 379  84
         xfireDescriptor.getInboundRouter().addEndpoint(serviceEndpoint);
 380  84
     }
 381  
 
 382  
     protected MuleDescriptor createxfireDescriptor()
 383  
     {
 384  44
         MuleDescriptor xfireDescriptor = (MuleDescriptor)MuleManager.getInstance().lookupModel(ModelHelper.SYSTEM_MODEL)
 385  
             .getDescriptor(XFIRE_SERVICE_COMPONENT_NAME + getName());
 386  44
         if (xfireDescriptor == null)
 387  
         {
 388  44
             xfireDescriptor = new MuleDescriptor(XFIRE_SERVICE_COMPONENT_NAME + getName());
 389  46
             xfireDescriptor.setImplementation(XFireServiceComponent.class.getName());
 390  
         }
 391  44
         return xfireDescriptor;
 392  
     }
 393  
 
 394  
     public ServiceFactory getServiceFactory()
 395  
     {
 396  86
         return serviceFactory;
 397  
     }
 398  
 
 399  
     public void setServiceFactory(ServiceFactory serviceFactory)
 400  
     {
 401  0
         this.serviceFactory = serviceFactory;
 402  0
     }
 403  
 
 404  
     /**
 405  
      * The method determines the key used to store the receiver against.
 406  
      *
 407  
      * @param component the component for which the endpoint is being registered
 408  
      * @param endpoint the endpoint being registered for the component
 409  
      * @return the key to store the newly created receiver against. In this case it
 410  
      *         is the component name, which is equivilent to the Axis service name.
 411  
      */
 412  
     protected Object getReceiverKey(UMOComponent component, UMOEndpoint endpoint)
 413  
     {
 414  426
         if (endpoint.getEndpointURI().getPort() == -1)
 415  
         {
 416  20
             return component.getDescriptor().getName();
 417  
         }
 418  
         else
 419  
         {
 420  406
             return endpoint.getEndpointURI().getAddress() + "/"
 421  
                    + component.getDescriptor().getName();
 422  
         }
 423  
     }
 424  
 
 425  
     public boolean isEnableJSR181Annotations()
 426  
     {
 427  86
         return enableJSR181Annotations;
 428  
     }
 429  
 
 430  
     public void setEnableJSR181Annotations(boolean enableJSR181Annotations)
 431  
     {
 432  0
         this.enableJSR181Annotations = enableJSR181Annotations;
 433  0
     }
 434  
 
 435  
     public List getClientServices()
 436  
     {
 437  0
         return clientServices;
 438  
     }
 439  
 
 440  
     public void setClientServices(List clientServices)
 441  
     {
 442  2
         this.clientServices = clientServices;
 443  2
     }
 444  
 
 445  
     public List getClientInHandlers()
 446  
     {
 447  38
         return clientInHandlers;
 448  
     }
 449  
 
 450  
     public void setClientInHandlers(List handlers)
 451  
     {
 452  0
         clientInHandlers = handlers;
 453  0
     }
 454  
 
 455  
     public List getClientOutHandlers()
 456  
     {
 457  38
         return clientOutHandlers;
 458  
     }
 459  
 
 460  
     public void setClientOutHandlers(List handlers)
 461  
     {
 462  0
         clientOutHandlers = handlers;
 463  0
     }
 464  
 
 465  
     public String getClientTransport()
 466  
     {
 467  32
         return clientTransport;
 468  
     }
 469  
 
 470  
     public void setClientTransport(String transportClass)
 471  
     {
 472  0
         clientTransport = transportClass;
 473  0
     }
 474  
 
 475  
     public String getServiceTransport()
 476  
     {
 477  0
         return serviceTransport;
 478  
     }
 479  
 
 480  
     public void setServiceTransport(String transportClass)
 481  
     {
 482  0
         serviceTransport = transportClass;
 483  0
     }
 484  
 
 485  
     public String getBindingProvider()
 486  
     {
 487  0
         return bindingProvider;
 488  
     }
 489  
 
 490  
     public void setBindingProvider(String bindingProvider)
 491  
     {
 492  0
         this.bindingProvider = bindingProvider;
 493  0
     }
 494  
 
 495  
     public String getTypeMappingRegistry()
 496  
     {
 497  0
         return typeMappingRegistry;
 498  
     }
 499  
 
 500  
     public void setTypeMappingRegistry(String typeMappingRegistry)
 501  
     {
 502  0
         this.typeMappingRegistry = typeMappingRegistry;
 503  0
     }
 504  
 
 505  
     public void onNotification(UMOServerNotification event)
 506  
     {
 507  682
         if (event.getAction() == ManagerNotification.MANAGER_STARTED_MODELS)
 508  
         {
 509  
             // We need to register the xfire service component once the model
 510  
             // starts because
 511  
             // when the model starts listeners on components are started, thus
 512  
             // all listener
 513  
             // need to be registered for this connector before the xfire service
 514  
             // component is registered. The implication of this is that to add a
 515  
             // new service and a
 516  
             // different http port the model needs to be restarted before the
 517  
             // listener is available
 518  44
             if (!MuleManager.getInstance().lookupModel(ModelHelper.SYSTEM_MODEL).isComponentRegistered(
 519  
                 XFIRE_SERVICE_COMPONENT_NAME + getName()))
 520  
             {
 521  
                 try
 522  
                 {
 523  
                     // Descriptor might be null if no inbound endpoints have
 524  
                     // been register for the xfire connector
 525  44
                     if (xfireDescriptor == null)
 526  
                     {
 527  0
                         xfireDescriptor = createxfireDescriptor();
 528  
                     }
 529  44
                     xfireDescriptor.addInterceptor(new MethodFixInterceptor());
 530  
 
 531  44
                     if (xfireDescriptor.getProperties().get("xfire") == null)
 532  
                     {
 533  0
                         xfireDescriptor.getProperties().put("xfire", xfire);
 534  
                     }
 535  44
                     MuleManager.getInstance().lookupModel(ModelHelper.SYSTEM_MODEL).registerComponent(xfireDescriptor);
 536  
                 }
 537  0
                 catch (UMOException e)
 538  
                 {
 539  0
                     handleException(e);
 540  44
                 }
 541  
             }
 542  
         }
 543  682
     }
 544  
 
 545  
     public List getServerInHandlers()
 546  
     {
 547  118
         return serverInHandlers;
 548  
     }
 549  
 
 550  
     public void setServerInHandlers(List serverInHandlers)
 551  
     {
 552  0
         this.serverInHandlers = serverInHandlers;
 553  0
     }
 554  
 
 555  
     public List getServerOutHandlers()
 556  
     {
 557  32
         return serverOutHandlers;
 558  
     }
 559  
 
 560  
     public void setServerOutHandlers(List serverOutHandlers)
 561  
     {
 562  0
         this.serverOutHandlers = serverOutHandlers;
 563  0
     }
 564  
 
 565  
     public Map getExtraProperties()
 566  
     {
 567  38
         return extraProperties;
 568  
     }
 569  
 
 570  
     public void setExtraProperties(Map extraProperties)
 571  
     {
 572  0
             if (this.extraProperties != null)
 573  
             {        
 574  0
                     this.extraProperties.putAll(extraProperties);
 575  
             }
 576  
             else
 577  
             {
 578  0
                     this.extraProperties = extraProperties;        
 579  
             }
 580  0
     }
 581  
 }