Coverage Report - org.mule.registry.MuleContextProcessor
 
Classes in this File Line Coverage Branch Coverage Complexity
MuleContextProcessor
0%
0/6
0%
0/2
1.5
 
 1  
 /*
 2  
  * Copyright (c) MuleSoft, Inc.  All rights reserved.  http://www.mulesoft.com
 3  
  * The software in this package is published under the terms of the CPAL v1.0
 4  
  * license, a copy of which has been included with this distribution in the
 5  
  * LICENSE.txt file.
 6  
  */
 7  
 package org.mule.registry;
 8  
 
 9  
 import org.mule.api.MuleContext;
 10  
 import org.mule.api.context.MuleContextAware;
 11  
 import org.mule.api.registry.InjectProcessor;
 12  
 
 13  
 /**
 14  
  * Injects the MuleContext object for objects stored in the {@link TransientRegistry} where the object registered
 15  
  * implements {@link org.mule.api.context.MuleContextAware}.
 16  
  */
 17  
 public class MuleContextProcessor implements InjectProcessor
 18  
 {
 19  
     private MuleContext context;
 20  
 
 21  
     public MuleContextProcessor(MuleContext context)
 22  0
     {
 23  0
         this.context = context;
 24  0
     }
 25  
 
 26  
     public Object process(Object object)
 27  
     {
 28  0
         if (object instanceof MuleContextAware)
 29  
         {
 30  0
             ((MuleContextAware)object).setMuleContext(context);
 31  
         }
 32  0
         return object;
 33  
     }
 34  
 }