Coverage Report - org.mule.config.MuleConfiguration
 
Classes in this File Line Coverage Branch Coverage Complexity
MuleConfiguration
41%
66/162
23%
6/26
1.368
MuleConfiguration$1
0%
0/11
0%
0/6
1.368
 
 1  
 /*
 2  
  * $Id: MuleConfiguration.java 10415 2008-01-21 10:46:37Z dirk.olmes $
 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.config;
 12  
 
 13  
 import org.mule.MuleManager;
 14  
 import org.mule.MuleRuntimeException;
 15  
 import org.mule.config.i18n.CoreMessages;
 16  
 import org.mule.providers.ConnectionStrategy;
 17  
 import org.mule.providers.SingleAttemptConnectionStrategy;
 18  
 import org.mule.umo.manager.DefaultWorkListener;
 19  
 import org.mule.util.FileUtils;
 20  
 import org.mule.util.StringUtils;
 21  
 import org.mule.util.queue.EventFilePersistenceStrategy;
 22  
 import org.mule.util.queue.QueuePersistenceStrategy;
 23  
 
 24  
 import java.io.File;
 25  
 import java.io.IOException;
 26  
 import java.io.InputStream;
 27  
 import java.net.URL;
 28  
 import java.security.AccessController;
 29  
 import java.security.PrivilegedAction;
 30  
 import java.util.Enumeration;
 31  
 import java.util.jar.Attributes;
 32  
 import java.util.jar.Manifest;
 33  
 
 34  
 import javax.resource.spi.work.WorkListener;
 35  
 
 36  
 import org.apache.commons.beanutils.BeanUtils;
 37  
 import org.apache.commons.logging.Log;
 38  
 import org.apache.commons.logging.LogFactory;
 39  
 
 40  
 /**
 41  
  * <code>MuleConfiguration</code> holds the runtime configuration specific to the
 42  
  * <code>MuleManager</code>. Once the <code>MuleManager</code> has been
 43  
  * initialised this class is immutable.
 44  
  */
 45  
 public class MuleConfiguration
 46  
 {
 47  
     private static final String DEFAULT_LOG_DIRECTORY = "logs";
 48  
 
 49  
     /**
 50  
      * logger used by this class
 51  
      */
 52  2296
     protected transient Log logger = LogFactory.getLog(getClass());
 53  
 
 54  
     /**
 55  
      * The default serverUrl used to receive incoming requests from clients
 56  
      */
 57  
     public static final String DEFAULT_SERVER_URL = "tcp://localhost:60504";
 58  
 
 59  
     /**
 60  
      * Specifies that the transformer properties should be obtained from the Mule
 61  
      * Manager properties
 62  
      */
 63  
     public static final String USE_MANAGER_PROPERTIES = "org.mule.useManagerProperties";
 64  
 
 65  
     /**
 66  
      * Specifies whether mule should process messages sysnchonously, i.e. that a
 67  
      * mule-model can only processone message at a time, or asynchonously. The
 68  
      * default value is 'false'.
 69  
      */
 70  
     public static final String SYNCHRONOUS_PROPERTY = "synchronous";
 71  
 
 72  
     public static final String DEFAULT_ENCODING = "UTF-8";
 73  
     /**
 74  
      * Default encoding used in OS running Mule
 75  
      */
 76  2
     public static final String DEFAULT_OS_ENCODING = System.getProperty("file.encoding");
 77  
 
 78  
     // /**
 79  
     // * Determines the default inboundProvider that Mule uses to communicate
 80  
     // between MuelUMO's when an
 81  
     // * inboundProvider is not specified on a mule.
 82  
     // * If this value is not specifed, Mule will create a default VM connection
 83  
     // * called 'muleVMInboundProvider' which will use a VMConnector.
 84  
     // */
 85  
     // public static final String DEFAULT_INBOUND_PROVIDER_PROPERTY =
 86  
     // "defaultInboundProvider";
 87  
     //
 88  
     // /**
 89  
     // * Determines the default outboundProvider that Mule uses to communicate
 90  
     // between MuelUMO's when an
 91  
     // * outboundProvider is not specified on a mule.
 92  
     // * If this value is not specifed, Mule will create a default VM connection
 93  
     // * called 'muleVMOutbound' which will use a VMConnector.
 94  
     // */
 95  
     // public static final String DEFAULT_OUTBOUND_PROVIDER_PROPERTY =
 96  
     // "defaultOutboundProvider";
 97  
 
 98  
     /**
 99  
      * Default value for SYNCHRONOUS_PROPERTY
 100  
      */
 101  
     public static final boolean DEFAULT_SYNCHRONOUS = false;
 102  
 
 103  
     /**
 104  
      * Default value for MAX_OUTSTANDING_MESSAGES_PROPERTY
 105  
      */
 106  
     public static final int DEFAULT_MAX_OUTSTANDING_MESSAGES = 1000;
 107  
 
 108  
     public static final int DEFAULT_TIMEOUT = 10000;
 109  
 
 110  
     public static final int DEFAULT_TRANSACTION_TIMEOUT = 30000;
 111  
 
 112  
     public static final String DEFAULT_SYSTEM_MODEL_TYPE = "seda";
 113  
 
 114  
     /**
 115  
      * Where Mule stores any runtime files to disk
 116  
      */
 117  
     public static final String DEFAULT_WORKING_DIRECTORY = "./.mule";
 118  
 
 119  
     /**
 120  
      * The default queueStore directory for persistence
 121  
      */
 122  
     public static final String DEFAULT_QUEUE_STORE = "queuestore";
 123  
 
 124  
     /**
 125  
      * holds the value for SYNCHRONOUS
 126  
      */
 127  2296
     private boolean synchronous = DEFAULT_SYNCHRONOUS;
 128  
 
 129  
     /**
 130  
      * The type of model used for the internal system model where system created
 131  
      * services are registered
 132  
      */
 133  2296
     private String systemModelType = DEFAULT_SYSTEM_MODEL_TYPE;
 134  
 
 135  
     /**
 136  
      * Whether Mule should fire message events for every message sent and received
 137  
      */
 138  2296
     private boolean enableMessageEvents = false;
 139  
 
 140  
     /**
 141  
      * Name of the model to use. If blank the first model will be used
 142  
      */
 143  2296
     private String model = null;
 144  
 
 145  2296
     private String encoding = DEFAULT_ENCODING;
 146  
 
 147  2296
     private String osEncoding = DEFAULT_OS_ENCODING;
 148  
 
 149  2296
     private PoolingProfile poolingProfile = new PoolingProfile();
 150  
 
 151  
     /**
 152  
      * configuration for the threadpool used by message dispatchers
 153  
      */
 154  2296
     private ThreadingProfile messageDispatcherThreadingProfile = null;
 155  
 
 156  
     /**
 157  
      * configuration for the threadpool used by message receivers
 158  
      */
 159  2296
     private ThreadingProfile messageReceiverThreadingProfile = null;
 160  
 
 161  
     /**
 162  
      * configuration for the threadpool used by component pooling in mule
 163  
      */
 164  2296
     private ThreadingProfile componentPoolThreadingProfile = null;
 165  
 
 166  2296
     private QueueProfile queueProfile = new QueueProfile(DEFAULT_MAX_OUTSTANDING_MESSAGES, false);
 167  
 
 168  2296
     private QueuePersistenceStrategy persistenceStrategy = new EventFilePersistenceStrategy();
 169  
 
 170  
     /**
 171  
      * When running sychonously, return events can be received over transports that
 172  
      * support ack or replyTo This property determines how long to wait for a receive
 173  
      */
 174  2296
     private int synchronousEventTimeout = DEFAULT_TIMEOUT;
 175  
 
 176  
     /**
 177  
      * The default transaction timeout value used if no specific transaction time out
 178  
      * has been set on the transaction config
 179  
      */
 180  2296
     private int transactionTimeout = DEFAULT_TRANSACTION_TIMEOUT;
 181  
 
 182  
     /**
 183  
      * Determines whether when running synchronously, return events are received
 184  
      * before returning the call. i.e. in jms wait for a replyTo. Vm queues do this
 185  
      * automatically
 186  
      */
 187  2296
     private boolean remoteSync = false;
 188  
 
 189  
     /**
 190  
      * Determines whether internal vm queues are persistent. If they are, if the
 191  
      * server dies unexpectedly it can resume it's current state and continue
 192  
      * processing
 193  
      */
 194  2296
     private boolean recoverableMode = false;
 195  
     /**
 196  
      * A helper thread pool configuration that is used for all other thread pool
 197  
      * configurations
 198  
      */
 199  2296
     private ThreadingProfile defaultThreadingProfile = new ThreadingProfile();
 200  
 
 201  
     /**
 202  
      * Where mule will store any runtime files to disk
 203  
      */
 204  
     private String workingDirectory;
 205  
 
 206  
     /**
 207  
      * The configuration resources used to configure the MuleManager instance
 208  
      */
 209  2296
     private String[] configResources = new String[]{};
 210  
 
 211  
     /**
 212  
      * This is the url used by the server itself to receive incomming requests. This
 213  
      * enables clients such as the Mule Client to marshal remote requests to a
 214  
      * MuleManager instance. The default value is tcp://localhost:61616
 215  
      */
 216  2296
     private String serverUrl = DEFAULT_SERVER_URL;
 217  
 
 218  
     /**
 219  
      * The Mule Jar manifest object
 220  
      */
 221  2296
     private Manifest manifest = null;
 222  
 
 223  
     /**
 224  
      * Whether the server instance is running in client mode, which means that some
 225  
      * services will not be started
 226  
      */
 227  2296
     private boolean clientMode = false;
 228  
 
 229  
     /**
 230  
      * Whether the server is embedded by another framework and certain stand-alone
 231  
      * features
 232  
      */
 233  2296
     private boolean embedded = false;
 234  
 
 235  
     /**
 236  
      * The model type to use for component invocations
 237  
      */
 238  2296
     private String modelType = "default";
 239  
 
 240  
     /**
 241  
      * The default connection Strategy used for a connector when one hasn't been
 242  
      * defined for the connector
 243  
      */
 244  2296
     private ConnectionStrategy connectionStrategy = new SingleAttemptConnectionStrategy();
 245  
 
 246  2296
     private WorkListener workListener = new DefaultWorkListener();
 247  
 
 248  
     public MuleConfiguration()
 249  
     {
 250  2296
         super();
 251  2296
         setWorkingDirectory(DEFAULT_WORKING_DIRECTORY);
 252  2296
     }
 253  
 
 254  
     /**
 255  
      * @return true if the model is running synchronously or false otherwise
 256  
      */
 257  
     public boolean isSynchronous()
 258  
     {
 259  0
         return synchronous;
 260  
     }
 261  
 
 262  
     public void setSynchronous(boolean synchronous)
 263  
     {
 264  66
         this.synchronous = synchronous;
 265  66
     }
 266  
 
 267  
     public String getModel()
 268  
     {
 269  0
         return model;
 270  
     }
 271  
 
 272  
     public void setModel(String model)
 273  
     {
 274  0
         this.model = model;
 275  0
     }
 276  
 
 277  
     public ThreadingProfile getMessageDispatcherThreadingProfile()
 278  
     {
 279  778
         return getThreadingProfile(messageDispatcherThreadingProfile);
 280  
     }
 281  
 
 282  
     public void setMessageDispatcherThreadingProfile(ThreadingProfile messageDispatcherThreadingProfile)
 283  
     {
 284  0
         this.messageDispatcherThreadingProfile = messageDispatcherThreadingProfile;
 285  0
     }
 286  
 
 287  
     public ThreadingProfile getMessageReceiverThreadingProfile()
 288  
     {
 289  778
         return getThreadingProfile(messageReceiverThreadingProfile);
 290  
     }
 291  
 
 292  
     public void setMessageReceiverThreadingProfile(ThreadingProfile messageReceiverThreadingProfile)
 293  
     {
 294  0
         this.messageReceiverThreadingProfile = messageReceiverThreadingProfile;
 295  0
     }
 296  
 
 297  
     public ThreadingProfile getComponentThreadingProfile()
 298  
     {
 299  410
         return getThreadingProfile(componentPoolThreadingProfile);
 300  
     }
 301  
 
 302  
     public void setComponentThreadingProfile(ThreadingProfile componentPoolThreadingProfile)
 303  
     {
 304  0
         this.componentPoolThreadingProfile = componentPoolThreadingProfile;
 305  0
     }
 306  
 
 307  
     public ThreadingProfile getDefaultThreadingProfile()
 308  
     {
 309  894
         return getThreadingProfile(defaultThreadingProfile);
 310  
     }
 311  
 
 312  
     public void setDefaultThreadingProfile(ThreadingProfile defaultThreadingProfile)
 313  
     {
 314  0
         if (defaultThreadingProfile == null)
 315  
         {
 316  0
             return;
 317  
         }
 318  0
         this.defaultThreadingProfile = defaultThreadingProfile;
 319  0
     }
 320  
 
 321  
     private ThreadingProfile getThreadingProfile(ThreadingProfile profile)
 322  
     {
 323  2860
         if (profile != null)
 324  
         {
 325  894
             return new ThreadingProfile(profile);
 326  
         }
 327  1966
         return new ThreadingProfile(defaultThreadingProfile);
 328  
     }
 329  
 
 330  
     public PoolingProfile getPoolingProfile()
 331  
     {
 332  460
         return new PoolingProfile(poolingProfile);
 333  
     }
 334  
 
 335  
     public void setPoolingProfile(PoolingProfile poolingProfile)
 336  
     {
 337  0
         this.poolingProfile = poolingProfile;
 338  0
     }
 339  
 
 340  
     public int getSynchronousEventTimeout()
 341  
     {
 342  1062
         return synchronousEventTimeout;
 343  
     }
 344  
 
 345  
     public void setSynchronousEventTimeout(int synchronousEventTimeout)
 346  
     {
 347  0
         this.synchronousEventTimeout = synchronousEventTimeout;
 348  0
     }
 349  
 
 350  
     public boolean isRemoteSync()
 351  
     {
 352  0
         return remoteSync;
 353  
     }
 354  
 
 355  
     public void setRemoteSync(boolean remoteSync)
 356  
     {
 357  0
         this.remoteSync = remoteSync;
 358  0
     }
 359  
 
 360  
     public QueueProfile getQueueProfile()
 361  
     {
 362  412
         return new QueueProfile(queueProfile);
 363  
     }
 364  
 
 365  
     public void setQueueProfile(QueueProfile queueProfile)
 366  
     {
 367  0
         this.queueProfile = queueProfile;
 368  0
     }
 369  
 
 370  
     public boolean isRecoverableMode()
 371  
     {
 372  0
         return recoverableMode;
 373  
     }
 374  
 
 375  
     public void setRecoverableMode(boolean recoverableMode)
 376  
     {
 377  0
         this.recoverableMode = recoverableMode;
 378  0
         if (recoverableMode)
 379  
         {
 380  0
             queueProfile.setPersistent(true);
 381  
         }
 382  0
     }
 383  
 
 384  
     public String getWorkingDirectory()
 385  
     {
 386  1974
         return workingDirectory;
 387  
     }
 388  
 
 389  
     public String getMuleHomeDirectory()
 390  
     {
 391  0
         return System.getProperty(MuleProperties.MULE_HOME_DIRECTORY_PROPERTY);
 392  
     }
 393  
 
 394  
     public String getLogDirectory()
 395  
     {
 396  0
         return getMuleHomeDirectory() + File.separator + DEFAULT_LOG_DIRECTORY;
 397  
     }
 398  
 
 399  
     public void setWorkingDirectory(String workingDirectory)
 400  
     {
 401  
         // fix windows backslashes in absolute paths, convert them to forward ones
 402  2296
         this.workingDirectory = FileUtils.newFile(workingDirectory).getAbsolutePath().replaceAll("\\\\", "/");
 403  2296
         updateApplicationProperty(MuleProperties.MULE_WORKING_DIRECTORY_PROPERTY, this.workingDirectory);
 404  2296
     }
 405  
 
 406  
     public String[] getConfigResources()
 407  
     {
 408  0
         return configResources;
 409  
     }
 410  
 
 411  
     public void setConfigResources(String[] configResources)
 412  
     {
 413  0
         if (configResources != null)
 414  
         {
 415  0
             int current = this.configResources.length;
 416  0
             String[] newResources = new String[configResources.length + current];
 417  0
             System.arraycopy(this.configResources, 0, newResources, 0, current);
 418  0
             System.arraycopy(configResources, 0, newResources, current, configResources.length);
 419  0
             this.configResources = newResources;
 420  0
         }
 421  
         else
 422  
         {
 423  0
             this.configResources = configResources;
 424  
         }
 425  0
     }
 426  
 
 427  
     public String getServerUrl()
 428  
     {
 429  48
         return serverUrl;
 430  
     }
 431  
 
 432  
     public void setServerUrl(String serverUrl)
 433  
     {
 434  910
         if (embedded)
 435  
         {
 436  0
             this.serverUrl = null;
 437  
         }
 438  
         else
 439  
         {
 440  910
             this.serverUrl = serverUrl;
 441  
         }
 442  910
     }
 443  
 
 444  
     /**
 445  
      * @deprecated use MuleManifest instead
 446  
      */
 447  
     public String getProductVersion()
 448  
     {
 449  0
         return MuleManifest.getProductVersion();
 450  
     }
 451  
 
 452  
     /**
 453  
      * @deprecated use MuleManifest instead
 454  
      */
 455  
     public String getVendorName()
 456  
     {
 457  0
         return MuleManifest.getVendorName();
 458  
     }
 459  
 
 460  
     /**
 461  
      * @deprecated use MuleManifest instead
 462  
      */
 463  
     public String getVendorUrl()
 464  
     {
 465  0
         return MuleManifest.getVendorUrl();
 466  
     }
 467  
 
 468  
     /**
 469  
      * @deprecated use MuleManifest instead
 470  
      */
 471  
     public String getProductUrl()
 472  
     {
 473  0
         return MuleManifest.getProductUrl();
 474  
     }
 475  
 
 476  
     /**
 477  
      * @deprecated use MuleManifest instead
 478  
      */
 479  
     public String getProductName()
 480  
     {
 481  0
         return MuleManifest.getProductName();
 482  
     }
 483  
 
 484  
     /**
 485  
      * @deprecated use MuleManifest instead
 486  
      */
 487  
     public String getProductMoreInfo()
 488  
     {
 489  0
         return MuleManifest.getProductMoreInfo();
 490  
     }
 491  
 
 492  
     /**
 493  
      * @deprecated use MuleManifest instead
 494  
      */
 495  
     public String getProductSupport()
 496  
     {
 497  0
         return MuleManifest.getProductSupport();
 498  
     }
 499  
 
 500  
     /**
 501  
      * @deprecated use MuleManifest instead
 502  
      */
 503  
     public String getProductLicenseInfo()
 504  
     {
 505  0
         return MuleManifest.getProductLicenseInfo();
 506  
     }
 507  
 
 508  
     /**
 509  
      * @deprecated use MuleManifest instead
 510  
      */
 511  
     public String getProductDescription()
 512  
     {
 513  0
         return MuleManifest.getProductDescription();
 514  
     }
 515  
 
 516  
     /**
 517  
      * @deprecated use MuleManifest.getBuildNumber() instead
 518  
      */
 519  
     public String getBuildDate()
 520  
     {
 521  0
         return MuleManifest.getBuildDate();
 522  
     }
 523  
 
 524  
     /**
 525  
      * @deprecated use MuleManifest instead
 526  
      */
 527  
     public Manifest getManifest()
 528  
     {
 529  0
         if (manifest == null)
 530  
         {
 531  0
             manifest = new Manifest();
 532  
 
 533  0
             InputStream is = null;
 534  
             try
 535  
             {
 536  
                 // We want to load the MANIFEST.MF from the mule-core jar. Sine we
 537  
                 // don't the version we're using
 538  
                 // we have to search for the jar on the classpath
 539  0
                 URL url = (URL) AccessController.doPrivileged(new PrivilegedAction()
 540  
                 {
 541  0
                     public Object run()
 542  
                     {
 543  
                         try
 544  
                         {
 545  0
                             Enumeration e = MuleConfiguration.class.getClassLoader().getResources(
 546  
                                 ("META-INF/MANIFEST.MF"));
 547  0
                             while (e.hasMoreElements())
 548  
                             {
 549  0
                                 URL url = (URL) e.nextElement();
 550  0
                                 if (url.toExternalForm().indexOf("mule-core") > -1)
 551  
                                 {
 552  0
                                     return url;
 553  
                                 }
 554  0
                             }
 555  
                         }
 556  0
                         catch (IOException e1)
 557  
                         {
 558  0
                             logger.error("Failure reading manifest: " + e1.getMessage(), e1);
 559  0
                         }
 560  0
                         return null;
 561  
                     }
 562  
                 });
 563  
 
 564  0
                 if (url != null)
 565  
                 {
 566  0
                     is = url.openStream();
 567  
                 }
 568  
 
 569  0
                 if (is != null)
 570  
                 {
 571  0
                     manifest.read(is);
 572  
                 }
 573  
 
 574  
             }
 575  0
             catch (IOException e)
 576  
             {
 577  0
                 logger.warn("Failed to read manifest Info, Manifest information will not display correctly: "
 578  
                             + e.getMessage());
 579  0
             }
 580  
         }
 581  0
         return manifest;
 582  
     }
 583  
 
 584  
     /**
 585  
      * @deprecated use MuleManifest instead
 586  
      */
 587  
     protected String getManifestProperty(String name)
 588  
     {
 589  0
         return getManifest().getMainAttributes().getValue(new Attributes.Name(name));
 590  
     }
 591  
 
 592  
     public int getTransactionTimeout()
 593  
     {
 594  828
         return transactionTimeout;
 595  
     }
 596  
 
 597  
     public void setTransactionTimeout(int transactionTimeout)
 598  
     {
 599  0
         this.transactionTimeout = transactionTimeout;
 600  0
     }
 601  
 
 602  
     public boolean isClientMode()
 603  
     {
 604  0
         return clientMode;
 605  
     }
 606  
 
 607  
     public void setClientMode(boolean clientMode)
 608  
     {
 609  0
         this.clientMode = clientMode;
 610  0
         if (clientMode)
 611  
         {
 612  0
             setServerUrl("");
 613  
         }
 614  0
     }
 615  
 
 616  
     public QueuePersistenceStrategy getPersistenceStrategy()
 617  
     {
 618  44
         return persistenceStrategy;
 619  
     }
 620  
 
 621  
     public void setPersistenceStrategy(QueuePersistenceStrategy persistenceStrategy)
 622  
     {
 623  0
         this.persistenceStrategy = persistenceStrategy;
 624  0
     }
 625  
 
 626  
     /**
 627  
      * Returns a clone of the default Connection strategy. The clone ensures that the
 628  
      * connection strategy can be manipulated without affecting other connectors
 629  
      * using the same strategy
 630  
      * 
 631  
      * @return a clone of the default Connection strategy
 632  
      */
 633  
     public ConnectionStrategy getConnectionStrategy()
 634  
     {
 635  
         try
 636  
         {
 637  778
             return (ConnectionStrategy) BeanUtils.cloneBean(connectionStrategy);
 638  
         }
 639  0
         catch (Exception e)
 640  
         {
 641  0
             throw new MuleRuntimeException(CoreMessages.failedToClone("Connection Strategy"), e);
 642  
         }
 643  
     }
 644  
 
 645  
     /**
 646  
      * Sets the connection strategy used by all connectors managed in this Mule
 647  
      * instance if the connector has no connection strategy specifically set on it.
 648  
      * 
 649  
      * @param connectionStrategy the default strategy to use
 650  
      */
 651  
     public void setConnectionStrategy(ConnectionStrategy connectionStrategy)
 652  
     {
 653  0
         this.connectionStrategy = connectionStrategy;
 654  0
     }
 655  
 
 656  
     public boolean isEmbedded()
 657  
     {
 658  0
         return embedded;
 659  
     }
 660  
 
 661  
     public void setEmbedded(boolean embedded)
 662  
     {
 663  0
         this.embedded = embedded;
 664  0
         if (embedded)
 665  
         {
 666  0
             serverUrl = null;
 667  
         }
 668  0
     }
 669  
 
 670  
     public String getModelType()
 671  
     {
 672  0
         return modelType;
 673  
     }
 674  
 
 675  
     public void setModelType(String modelType)
 676  
     {
 677  0
         this.modelType = modelType;
 678  0
     }
 679  
 
 680  
     public String getEncoding()
 681  
     {
 682  1052
         return encoding;
 683  
     }
 684  
 
 685  
     public void setEncoding(String encoding)
 686  
     {
 687  42
         if (StringUtils.isEmpty(encoding))
 688  
         {
 689  0
             logger.warn("Cannot set encoding to null or empty String");
 690  0
             return;
 691  
         }
 692  42
         this.encoding = encoding;
 693  42
     }
 694  
 
 695  
     public String getOSEncoding()
 696  
     {
 697  46
         return osEncoding;
 698  
     }
 699  
 
 700  
     public void setOSEncoding(String osEncoding)
 701  
     {
 702  42
         this.osEncoding = osEncoding;
 703  42
     }
 704  
 
 705  
     public boolean isEnableMessageEvents()
 706  
     {
 707  822
         return enableMessageEvents;
 708  
     }
 709  
 
 710  
     public void setEnableMessageEvents(boolean enableMessageEvents)
 711  
     {
 712  0
         this.enableMessageEvents = enableMessageEvents;
 713  0
     }
 714  
 
 715  
     public WorkListener getWorkListener()
 716  
     {
 717  392
         return workListener;
 718  
     }
 719  
 
 720  
     public void setWorkListener(WorkListener workListener)
 721  
     {
 722  0
         if (workListener == null)
 723  
         {
 724  0
             throw new IllegalArgumentException("workListener is null");
 725  
         }
 726  0
         this.workListener = workListener;
 727  0
     }
 728  
 
 729  
     private void updateApplicationProperty(String name, Object value)
 730  
     {
 731  2296
         if (MuleManager.isInstanciated())
 732  
         {
 733  392
             MuleManager.getInstance().setProperty(name, value);
 734  
         }
 735  2296
     }
 736  
 
 737  
     public String getSystemModelType()
 738  
     {
 739  2684
         return systemModelType;
 740  
     }
 741  
 
 742  
     public void setSystemModelType(String systemModelType)
 743  
     {
 744  0
         this.systemModelType = systemModelType;
 745  0
     }
 746  
 }