1   /*
2    * $Id: MockAgent.java 11530 2008-04-08 12:49:14Z 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.agent;
12  
13  import org.mule.api.MuleException;
14  import org.mule.api.agent.Agent;
15  import org.mule.api.lifecycle.InitialisationException;
16  import org.mule.util.ClassUtils;
17  
18  import java.util.Arrays;
19  import java.util.Collections;
20  import java.util.List;
21  
22  public class MockAgent extends Object implements Agent
23  {
24      private String name;
25      private List dependencies = Collections.EMPTY_LIST;
26      
27      public MockAgent()
28      {
29          super();
30      }
31      
32      public MockAgent(Class[] classes)
33      {
34          super();
35          dependencies = Arrays.asList(classes);
36      }
37  
38      public List getDependentAgents()
39      {
40          return dependencies;
41      }
42  
43      public String getDescription()
44      {
45          return ClassUtils.getSimpleName(this.getClass());
46      }
47  
48      public void registered()
49      {
50          // nothing to do
51      }
52  
53      public void unregistered()
54      {
55          // nothing to do
56      }
57  
58      public void initialise() throws InitialisationException
59      {
60          // nothing to do
61      }
62  
63      public void start() throws MuleException
64      {
65          // nothing to do
66      }
67  
68      public void stop() throws MuleException
69      {
70          // nothing to do
71      }
72  
73      public void dispose()
74      {
75          // nothing to do
76      }
77  
78      public String getName()
79      {
80          return name;
81      }
82  
83      public void setName(String name)
84      {
85          this.name = name;
86      }
87  
88  }
89  
90