View Javadoc

1   /*
2    * $Id: AbstractAgent.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;
11  
12  import org.mule.api.MuleContext;
13  import org.mule.api.agent.Agent;
14  import org.mule.api.context.MuleContextAware;
15  
16  /**
17   * Implements common methods for all Agents. Importantly, the Management context is made available to Agents that
18   * extend this.
19   */
20  public abstract class AbstractAgent implements Agent, MuleContextAware
21  {
22  
23      protected MuleContext muleContext;
24  
25      protected String name;
26  
27      protected AbstractAgent(String name)
28      {
29          this.name = name;
30      }
31  
32      public final String getName()
33      {
34          return name;
35      }
36  
37      public final void setName(String name)
38      {
39          this.name = name;
40      }
41  
42      public String getDescription()
43      {
44          return name;
45      }
46  
47      public void setMuleContext(MuleContext context)
48      {
49          this.muleContext = context;
50      }
51  }