KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > mule > registry > ComponentType


1 /*
2  * $Id: ComponentType.java 3798 2006-11-04 04:07:14Z aperepel $
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 MuleSource MPL
7  * license, a copy of which has been included with this distribution in the
8  * LICENSE.txt file.
9  */

10
11 package org.mule.registry;
12
13 /**
14  * Represents a Component type in the registry
15  *
16  * @author <a HREF="mailto:ross.mason@symphonysoft.com">Ross Mason</a>
17  * @version $Revision: 3798 $
18  */

19 public class ComponentType
20 {
21
22     public static final ComponentType MULE_COMPONENT = new ComponentType("mule.engine",
23         "A Mule component type");
24     public static final ComponentType MULE_CONNECTOR_COMPONENT = new ComponentType("mule.binding",
25         "A Mule connector type");
26     public static final ComponentType MULE_TRANSFORMER_COMPONENT = new ComponentType("mule.transformer",
27         "A Mule transformer type");
28     public static final ComponentType MULE_AGENT_COMPONENT = new ComponentType("mule.agent",
29         "A Mule Agent type");
30     public static final ComponentType JBI_ENGINE_COMPONENT = new ComponentType("jbi.engine",
31         "A JBI engine component type");
32     public static final ComponentType JBI_BINDING_COMPONENT = new ComponentType("jbi.binding",
33         "A JBI binding component type");
34
35     public static final ComponentType[] COMPONENT_TYPES = new ComponentType[]{MULE_COMPONENT, MULE_COMPONENT,
36         MULE_TRANSFORMER_COMPONENT, MULE_AGENT_COMPONENT, JBI_ENGINE_COMPONENT, JBI_BINDING_COMPONENT};
37
38     private String JavaDoc name;
39     private String JavaDoc description;
40
41     public ComponentType(String JavaDoc name, String JavaDoc description)
42     {
43         this.name = name;
44         this.description = description;
45     }
46
47     public String JavaDoc getName()
48     {
49         return name;
50     }
51
52     public String JavaDoc getDescription()
53     {
54         return description;
55     }
56
57     public boolean equals(Object JavaDoc o)
58     {
59         if (this == o)
60         {
61             return true;
62         }
63         if (!(o instanceof ComponentType))
64         {
65             return false;
66         }
67
68         final ComponentType componentType = (ComponentType)o;
69
70         if (name != null ? !name.equals(componentType.name) : componentType.name != null)
71         {
72             return false;
73         }
74
75         return true;
76     }
77
78     public int hashCode()
79     {
80         return (name != null ? name.hashCode() : 0);
81     }
82
83     public String JavaDoc toString()
84     {
85         return name;
86     }
87 }
88
Popular Tags