Coverage Report - org.mule.lifecycle.LifecycleObject
 
Classes in this File Line Coverage Branch Coverage Complexity
LifecycleObject
0%
0/19
0%
0/4
0
 
 1  
 /*
 2  
  * $Id: LifecycleObject.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  
 package org.mule.lifecycle;
 11  
 
 12  
 import org.mule.api.MuleContext;
 13  
 import org.mule.api.context.notification.ServerNotification;
 14  
 import org.mule.util.ClassUtils;
 15  
 
 16  
 public class LifecycleObject
 17  
 {
 18  
     
 19  
     private Class type;
 20  
     private ServerNotification preNotification;
 21  
     private ServerNotification postNotification;
 22  
 
 23  
     public LifecycleObject(Class type)
 24  0
     {
 25  0
         this.type = type;
 26  0
     }
 27  
 
 28  
     public ServerNotification getPostNotification()
 29  
     {
 30  0
         return postNotification;
 31  
     }
 32  
 
 33  
     public void setPostNotification(ServerNotification postNotification)
 34  
     {
 35  0
         this.postNotification = postNotification;
 36  0
     }
 37  
 
 38  
     public ServerNotification getPreNotification()
 39  
     {
 40  0
         return preNotification;
 41  
     }
 42  
 
 43  
     public void setPreNotification(ServerNotification preNotification)
 44  
     {
 45  0
         this.preNotification = preNotification;
 46  0
     }
 47  
 
 48  
     public Class getType()
 49  
     {
 50  0
         return type;
 51  
     }
 52  
 
 53  
     public void setType(Class type)
 54  
     {
 55  0
         this.type = type;
 56  0
     }
 57  
 
 58  
     public void firePreNotification(MuleContext context)
 59  
     {
 60  0
         if(preNotification!=null)
 61  
         {
 62  0
             context.fireNotification(preNotification);
 63  
         }
 64  0
     }
 65  
 
 66  
     public void firePostNotification(MuleContext context)
 67  
     {
 68  0
         if(postNotification!=null)
 69  
         {
 70  0
             context.fireNotification(postNotification);
 71  
         }
 72  0
     }
 73  
 
 74  
     @Override
 75  
     public String toString()
 76  
     {
 77  0
         return super.toString() + " (" + ClassUtils.getSimpleName(type) + ")";
 78  
     }
 79  
         
 80  
 }