Coverage Report - org.mule.impl.internal.notifications.AdminNotification
 
Classes in this File Line Coverage Branch Coverage Complexity
AdminNotification
0%
0/14
0%
0/1
1.333
 
 1  
 /*
 2  
  * $Id: AdminNotification.java 7976 2007-08-21 14:26:13Z 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.impl.internal.notifications;
 12  
 
 13  
 import org.mule.umo.UMOMessage;
 14  
 import org.mule.umo.manager.UMOServerNotification;
 15  
 
 16  
 import java.util.HashMap;
 17  
 import java.util.Map;
 18  
 
 19  
 /**
 20  
  * <code>AdminNotification</code> is used to invoke actions on a remote mule server
 21  
  */
 22  
 
 23  
 public class AdminNotification extends UMOServerNotification
 24  
 {
 25  
     /**
 26  
      * Serial version
 27  
      */
 28  
     private static final long serialVersionUID = -53091546441476249L;
 29  
     public static final int ACTION_RECEIVE = ADMIN_EVENT_ACTION_START_RANGE + 1;
 30  
     public static final int ACTION_DISPATCH = ADMIN_EVENT_ACTION_START_RANGE + 2;
 31  
     public static final int ACTION_SEND = ADMIN_EVENT_ACTION_START_RANGE + 3;
 32  
     public static final int ACTION_INVOKE = ADMIN_EVENT_ACTION_START_RANGE + 4;
 33  
 
 34  0
     private static final transient String[] ACTIONS = new String[]{"receive event", "dispatch event",
 35  
         "send event", "invoke component"};
 36  
 
 37  0
     private Map properties = new HashMap();
 38  
     private UMOMessage message;
 39  
 
 40  
     public AdminNotification(UMOMessage message, int action, String resourceIdentifier)
 41  
     {
 42  0
         super(message, action, resourceIdentifier);
 43  0
         this.message = message;
 44  0
     }
 45  
 
 46  
     public UMOMessage getMessage()
 47  
     {
 48  0
         return message;
 49  
     }
 50  
 
 51  
     public void setProperty(Object key, Object value)
 52  
     {
 53  0
         properties.put(key, value);
 54  0
     }
 55  
 
 56  
     public Object getProperty(Object key)
 57  
     {
 58  0
         return properties.get(key);
 59  
     }
 60  
 
 61  
     public Map getProperties()
 62  
     {
 63  0
         return properties;
 64  
     }
 65  
 
 66  
     protected String getActionName(int action)
 67  
     {
 68  0
         int i = action - ADMIN_EVENT_ACTION_START_RANGE;
 69  0
         if (i - 1 > ACTIONS.length)
 70  
         {
 71  0
             return String.valueOf(action);
 72  
         }
 73  0
         return ACTIONS[i - 1];
 74  
     }
 75  
 }