Coverage Report - org.mule.config.builders.DefaultsConfigurationBuilder
 
Classes in this File Line Coverage Branch Coverage Complexity
DefaultsConfigurationBuilder
0%
0/22
N/A
1
 
 1  
 /*
 2  
  * $Id: DefaultsConfigurationBuilder.java 19191 2010-08-25 21:05:23Z tcarlson $
 3  
  * --------------------------------------------------------------------------------------
 4  
  * Copyright (c) MuleSoft, Inc.  All rights reserved.  http://www.mulesoft.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.builders;
 12  
 
 13  
 import org.mule.api.MuleContext;
 14  
 import org.mule.api.config.MuleProperties;
 15  
 import org.mule.api.config.ThreadingProfile;
 16  
 import org.mule.api.model.Model;
 17  
 import org.mule.api.registry.MuleRegistry;
 18  
 import org.mule.config.ChainedThreadingProfile;
 19  
 import org.mule.config.bootstrap.SimpleRegistryBootstrap;
 20  
 import org.mule.endpoint.DefaultEndpointFactory;
 21  
 import org.mule.model.seda.SedaModel;
 22  
 import org.mule.retry.policies.NoRetryPolicyTemplate;
 23  
 import org.mule.security.MuleSecurityManager;
 24  
 import org.mule.util.DefaultStreamCloserService;
 25  
 import org.mule.util.queue.FilePersistenceStrategy;
 26  
 import org.mule.util.queue.QueueManager;
 27  
 import org.mule.util.queue.TransactionalQueueManager;
 28  
 
 29  
 /**
 30  
  * Configures defaults required by Mule. This configuration builder is used to
 31  
  * configure mule with these defaults when no other ConfigurationBuilder that sets
 32  
  * these is being used. This is used by both AbstractMuleTestCase and MuleClient.
 33  
  * <br>
 34  
  * <br>
 35  
  * Default instances of the following are configured:
 36  
  * <li> {@link SimpleRegistryBootstrap}
 37  
  * <li> {@link QueueManager}
 38  
  * <li> {@link SecurityManager}
 39  
  * <li> {@link DefaultEndpointFactory}
 40  
  * <li> {@link Model} systemModel
 41  
  * <li> {@link ThreadingProfile} defaultThreadingProfile
 42  
  * <li> {@link ThreadingProfile} defaultMessageDispatcherThreadingProfile
 43  
  * <li> {@link ThreadingProfile} defaultMessageRequesterThreadingProfile
 44  
  * <li> {@link ThreadingProfile} defaultMessageReceiverThreadingProfile
 45  
  * <li> {@link ThreadingProfile} defaultComponentThreadingProfile
 46  
  */
 47  0
 public class DefaultsConfigurationBuilder extends AbstractConfigurationBuilder
 48  
 {
 49  
     protected void doConfigure(MuleContext muleContext) throws Exception
 50  
     {
 51  0
         MuleRegistry registry = muleContext.getRegistry();
 52  
         
 53  
         //registry.registerObject(MuleProperties.OBJECT_MULE_CONFIGURATION, new MuleConfiguration());
 54  0
         registry.registerObject(MuleProperties.OBJECT_MULE_SIMPLE_REGISTRY_BOOTSTRAP,
 55  
             new SimpleRegistryBootstrap());
 56  
         
 57  0
         FilePersistenceStrategy ps = new FilePersistenceStrategy();
 58  0
         ps.setMuleContext(muleContext);
 59  0
         QueueManager queueManager = new TransactionalQueueManager();
 60  0
         queueManager.setPersistenceStrategy(ps);
 61  0
         registry.registerObject(MuleProperties.OBJECT_QUEUE_MANAGER, queueManager);
 62  
         
 63  0
         registry.registerObject(MuleProperties.OBJECT_SECURITY_MANAGER, new MuleSecurityManager());
 64  
         
 65  0
         registry.registerObject(MuleProperties.OBJECT_MULE_ENDPOINT_FACTORY, new DefaultEndpointFactory());
 66  0
         registry.registerObject(MuleProperties.OBJECT_MULE_STREAM_CLOSER_SERVICE, new DefaultStreamCloserService());
 67  
         
 68  0
         ThreadingProfile defaultThreadingProfile = new ChainedThreadingProfile();
 69  0
         registry.registerObject(MuleProperties.OBJECT_DEFAULT_THREADING_PROFILE, defaultThreadingProfile);
 70  0
         registry.registerObject(MuleProperties.OBJECT_DEFAULT_MESSAGE_RECEIVER_THREADING_PROFILE,
 71  
             new ChainedThreadingProfile(defaultThreadingProfile));
 72  0
         registry.registerObject(MuleProperties.OBJECT_DEFAULT_MESSAGE_REQUESTER_THREADING_PROFILE,
 73  
             new ChainedThreadingProfile(defaultThreadingProfile));
 74  0
         registry.registerObject(MuleProperties.OBJECT_DEFAULT_MESSAGE_DISPATCHER_THREADING_PROFILE,
 75  
             new ChainedThreadingProfile(defaultThreadingProfile));
 76  0
         registry.registerObject(MuleProperties.OBJECT_DEFAULT_SERVICE_THREADING_PROFILE,
 77  
             new ChainedThreadingProfile(defaultThreadingProfile));
 78  
         
 79  0
         registry.registerObject(MuleProperties.OBJECT_DEFAULT_RETRY_POLICY_TEMPLATE, new NoRetryPolicyTemplate());
 80  
         
 81  0
         Model systemModel = new SedaModel();
 82  0
         systemModel.setName(MuleProperties.OBJECT_SYSTEM_MODEL);
 83  0
         registry.registerModel(systemModel);
 84  0
     }
 85  
 }