01: /*
02: * ChainBuilder ESB
03: * Visual Enterprise Integration
04: *
05: * Copyright (C) 2006 Bostech Corporation
06: *
07: * This program is free software; you can redistribute it and/or modify it
08: * under the terms of the GNU General Public License as published by the
09: * Free Software Foundation; either version 2 of the License, or (at your option)
10: * any later version.
11: *
12: * This program is distributed in the hope that it will be useful,
13: * but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
14: * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
15: * for more details.
16: *
17: * You should have received a copy of the GNU General Public License along with
18: * this program; if not, write to the Free Software Foundation, Inc.,
19: * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
20: *
21: *
22: * $Id$
23: */
24: package com.bostechcorp.cbesb.common.sa.component;
25:
26: import com.bostechcorp.cbesb.common.sa.service.PropertiesKey;
27:
28: public class ComponentFactory {
29:
30: public static AbstractComponent createComponent(String type) {
31: if (type.equalsIgnoreCase(PropertiesKey.COMPONENTTYPE_FILE)) {
32: return new FileComponent();
33: }
34: if (type.equalsIgnoreCase(PropertiesKey.COMPONENTTYPE_FTP)) {
35: return new FTPComponent();
36: }
37: if (type.equalsIgnoreCase(PropertiesKey.COMPONENTTYPE_CBR)) {
38: return new CBRComponent();
39: } else if (type
40: .equalsIgnoreCase(PropertiesKey.COMPONENTTYPE_HTTP)) {
41: return new HTTPComponent();
42: } else if (type
43: .equalsIgnoreCase(PropertiesKey.COMPONENTTYPE_JMS)) {
44: return new JMSComponent();
45: } else if (type
46: .equalsIgnoreCase(PropertiesKey.COMPONENTTYPE_PARSER)) {
47: return new ParserComponent();
48: } else if (type
49: .equalsIgnoreCase(PropertiesKey.COMPONENTTYPE_SEQUENCER)) {
50: return new SequencerComponent();
51: } else if (type
52: .equalsIgnoreCase(PropertiesKey.COMPONENTTYPE_TRANSFORMER)) {
53: return new TransformerComponent();
54: } else if (type
55: .equalsIgnoreCase(PropertiesKey.COMPONENTTYPE_XSLT)) {
56: return new XSLTComponent();
57: } else if (type
58: .equalsIgnoreCase(PropertiesKey.COMPONENTTYPE_JDBC)) {
59: return new JDBCComponent();
60: } else if (type
61: .equalsIgnoreCase(PropertiesKey.COMPONENTTYPE_SCRIPT)) {
62: return new ScriptComponent();
63: } else if (type
64: .equalsIgnoreCase(PropertiesKey.COMPONENTTYPE_TCPIP)) {
65: return new TCPIPComponent();
66: } else if (type
67: .equalsIgnoreCase(PropertiesKey.COMPONENTTYPE_EMAIL)) {
68: return new EmailComponent();
69: } else if (type
70: .equalsIgnoreCase(PropertiesKey.COMPONENTTYPE_CUSTOM)) {
71: return new CustomComponent();
72: }
73: return null;
74: }
75:
76: }
|