Source Code Cross Referenced for ClusteredBpmScriptConfiguration.java in  » Workflow-Engines » bpmscript » org » bpmscript » jbi » component » Java Source Code / Java DocumentationJava Source Code and Java Documentation

Java Source Code / Java Documentation
1. 6.0 JDK Core
2. 6.0 JDK Modules
3. 6.0 JDK Modules com.sun
4. 6.0 JDK Modules com.sun.java
5. 6.0 JDK Modules sun
6. 6.0 JDK Platform
7. Ajax
8. Apache Harmony Java SE
9. Aspect oriented
10. Authentication Authorization
11. Blogger System
12. Build
13. Byte Code
14. Cache
15. Chart
16. Chat
17. Code Analyzer
18. Collaboration
19. Content Management System
20. Database Client
21. Database DBMS
22. Database JDBC Connection Pool
23. Database ORM
24. Development
25. EJB Server geronimo
26. EJB Server GlassFish
27. EJB Server JBoss 4.2.1
28. EJB Server resin 3.1.5
29. ERP CRM Financial
30. ESB
31. Forum
32. GIS
33. Graphic Library
34. Groupware
35. HTML Parser
36. IDE
37. IDE Eclipse
38. IDE Netbeans
39. Installer
40. Internationalization Localization
41. Inversion of Control
42. Issue Tracking
43. J2EE
44. JBoss
45. JMS
46. JMX
47. Library
48. Mail Clients
49. Net
50. Parser
51. PDF
52. Portal
53. Profiler
54. Project Management
55. Report
56. RSS RDF
57. Rule Engine
58. Science
59. Scripting
60. Search Engine
61. Security
62. Sevlet Container
63. Source Control
64. Swing Library
65. Template Engine
66. Test Coverage
67. Testing
68. UML
69. Web Crawler
70. Web Framework
71. Web Mail
72. Web Server
73. Web Services
74. Web Services apache cxf 2.0.1
75. Web Services AXIS2
76. Wiki Engine
77. Workflow Engines
78. XML
79. XML UI
Java
Java Tutorial
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
Photoshop Tutorials
Maya Tutorials
Flash Tutorials
3ds-Max Tutorials
Illustrator Tutorials
GIMP Tutorials
C# / C Sharp
C# / CSharp Tutorial
C# / CSharp Open Source
ASP.Net
ASP.NET Tutorial
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
Ruby
PHP
Python
Python Tutorial
Python Open Source
SQL Server / T-SQL
SQL Server / T-SQL Tutorial
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
Flash / Flex / ActionScript
VBA / Excel / Access / Word
XML
XML Tutorial
Microsoft Office PowerPoint 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Microsoft Office Word 2007 Tutorial
Java Source Code / Java Documentation » Workflow Engines » bpmscript » org.bpmscript.jbi.component 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        /*
002:         * Licensed to the Apache Software Foundation (ASF) under one or more
003:         * contributor license agreements.  See the NOTICE file distributed with
004:         * this work for additional information regarding copyright ownership.
005:         * The ASF licenses this file to You under the Apache License, Version 2.0
006:         * (the "License"); you may not use this file except in compliance with
007:         * the License.  You may obtain a copy of the License at
008:         *
009:         *      http://www.apache.org/licenses/LICENSE-2.0
010:         *
011:         * Unless required by applicable law or agreed to in writing, software
012:         * distributed under the License is distributed on an "AS IS" BASIS,
013:         * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
014:         * See the License for the specific language governing permissions and
015:         * limitations under the License.
016:         */
017:        package org.bpmscript.jbi.component;
018:
019:        import java.io.File;
020:        import java.io.FileInputStream;
021:        import java.io.FileOutputStream;
022:        import java.io.IOException;
023:        import java.util.Properties;
024:
025:        public class ClusteredBpmScriptConfiguration implements 
026:                ClusteredBpmScriptConfigurationMBean {
027:
028:            public final static String CONFIG_FILE = "component.properties";
029:
030:            private String rootDir;
031:
032:            private String jmsUrl = "tcp://localhost:61616";
033:
034:            private String dataSourceDriverClassName = "org.apache.derby.jdbc.EmbeddedDriver";
035:
036:            private String dataSourceUrl = "jdbc:derby:bpmscript;create=true";
037:
038:            private String dataSourceUsername = "";
039:
040:            private String dataSourcePassword = "";
041:
042:            private String hibernateDialect = "org.hibernate.dialect.DerbyDialect";
043:
044:            private String processExecutorLibraries = "classpath:/org/bpmscript/jbi/component/bpmscriptlibrary.js";
045:
046:            private Properties properties = new Properties();
047:
048:            public void save() {
049:                properties.setProperty("jmsUrl", jmsUrl);
050:                properties.setProperty("dataSourceDriverClassName",
051:                        dataSourceDriverClassName);
052:                properties.setProperty("dataSourceUrl", dataSourceUrl);
053:                properties
054:                        .setProperty("dataSourceUsername", dataSourceUsername);
055:                properties
056:                        .setProperty("dataSourcePassword", dataSourcePassword);
057:                properties.setProperty("hibernateDialect", hibernateDialect);
058:                properties.setProperty("processExecutorLibraries",
059:                        processExecutorLibraries);
060:
061:                if (rootDir != null) {
062:                    File f = new File(rootDir, CONFIG_FILE);
063:                    try {
064:                        this .properties.store(new FileOutputStream(f), null);
065:                    } catch (Exception e) {
066:                        throw new RuntimeException(
067:                                "Could not store component configuration", e);
068:                    }
069:                }
070:            }
071:
072:            public boolean load() {
073:                if (rootDir == null) {
074:                    return false;
075:                }
076:                File f = new File(rootDir, CONFIG_FILE);
077:                if (!f.exists()) {
078:                    return false;
079:                }
080:                try {
081:                    properties.load(new FileInputStream(f));
082:                } catch (IOException e) {
083:                    throw new RuntimeException(
084:                            "Could not load component configuration", e);
085:                }
086:                if (properties.getProperty("jmsUrl") != null) {
087:                    jmsUrl = properties.getProperty("jmsUrl");
088:                }
089:                if (properties.getProperty("dataSourceDriverClassName") != null) {
090:                    dataSourceDriverClassName = properties
091:                            .getProperty("dataSourceDriverClassName");
092:                }
093:                if (properties.getProperty("dataSourceUrl") != null) {
094:                    dataSourceUrl = properties.getProperty("dataSourceUrl");
095:                }
096:                if (properties.getProperty("dataSourceUsername") != null) {
097:                    dataSourceUsername = properties
098:                            .getProperty("dataSourceUsername");
099:                }
100:                if (properties.getProperty("dataSourcePassword") != null) {
101:                    dataSourcePassword = properties
102:                            .getProperty("dataSourcePassword");
103:                }
104:                if (properties.getProperty("hibernateDialect") != null) {
105:                    hibernateDialect = properties
106:                            .getProperty("hibernateDialect");
107:                }
108:                if (properties.getProperty("processExecutorLibraries") != null) {
109:                    processExecutorLibraries = properties
110:                            .getProperty("processExecutorLibraries");
111:                }
112:                return true;
113:            }
114:
115:            public void setRootDir(String rootDir) {
116:                this .rootDir = rootDir;
117:            }
118:
119:            /*
120:             * (non-Javadoc)
121:             * 
122:             * @see org.bpmscript.jbi.component.ClusteredBpmScriptConfigurationMBean#getDataSourceDriverClassName()
123:             */
124:            /*
125:             * (non-Javadoc)
126:             * 
127:             * @see org.bpmscript.jbi.component.ClusteredBpmScriptConfigurationMBean#getDataSourceDriverClassName()
128:             */
129:            public String getDataSourceDriverClassName() {
130:                return dataSourceDriverClassName;
131:            }
132:
133:            /*
134:             * (non-Javadoc)
135:             * 
136:             * @see org.bpmscript.jbi.component.ClusteredBpmScriptConfigurationMBean#setDataSourceDriverClassName(java.lang.String)
137:             */
138:            public void setDataSourceDriverClassName(
139:                    String dataSourceDriverClassName) {
140:                this .dataSourceDriverClassName = dataSourceDriverClassName;
141:            }
142:
143:            /*
144:             * (non-Javadoc)
145:             * 
146:             * @see org.bpmscript.jbi.component.ClusteredBpmScriptConfigurationMBean#getDataSourceUrl()
147:             */
148:            /*
149:             * (non-Javadoc)
150:             * 
151:             * @see org.bpmscript.jbi.component.ClusteredBpmScriptConfigurationMBean#getDataSourceUrl()
152:             */
153:            public String getDataSourceUrl() {
154:                return dataSourceUrl;
155:            }
156:
157:            /*
158:             * (non-Javadoc)
159:             * 
160:             * @see org.bpmscript.jbi.component.ClusteredBpmScriptConfigurationMBean#setDataSourceUrl(java.lang.String)
161:             */
162:            public void setDataSourceUrl(String dataSourceUrl) {
163:                this .dataSourceUrl = dataSourceUrl;
164:            }
165:
166:            /*
167:             * (non-Javadoc)
168:             * 
169:             * @see org.bpmscript.jbi.component.ClusteredBpmScriptConfigurationMBean#getJmsUrl()
170:             */
171:            /*
172:             * (non-Javadoc)
173:             * 
174:             * @see org.bpmscript.jbi.component.ClusteredBpmScriptConfigurationMBean#getJmsUrl()
175:             */
176:            public String getJmsUrl() {
177:                return jmsUrl;
178:            }
179:
180:            /*
181:             * (non-Javadoc)
182:             * 
183:             * @see org.bpmscript.jbi.component.ClusteredBpmScriptConfigurationMBean#setJmsUrl(java.lang.String)
184:             */
185:            public void setJmsUrl(String jmsUrl) {
186:                this .jmsUrl = jmsUrl;
187:            }
188:
189:            /*
190:             * (non-Javadoc)
191:             * 
192:             * @see org.bpmscript.jbi.component.ClusteredBpmScriptConfigurationMBean#getProcessExecutorLibraries()
193:             */
194:            /*
195:             * (non-Javadoc)
196:             * 
197:             * @see org.bpmscript.jbi.component.ClusteredBpmScriptConfigurationMBean#getProcessExecutorLibraries()
198:             */
199:            public String getProcessExecutorLibraries() {
200:                return processExecutorLibraries;
201:            }
202:
203:            /*
204:             * (non-Javadoc)
205:             * 
206:             * @see org.bpmscript.jbi.component.ClusteredBpmScriptConfigurationMBean#setProcessExecutorLibraries(java.lang.String)
207:             */
208:            public void setProcessExecutorLibraries(
209:                    String processExecutorLibraries) {
210:                this .processExecutorLibraries = processExecutorLibraries;
211:            }
212:
213:            /*
214:             * (non-Javadoc)
215:             * 
216:             * @see org.bpmscript.jbi.component.ClusteredBpmScriptConfigurationMBean#getHibernateDialect()
217:             */
218:            public String getHibernateDialect() {
219:                return hibernateDialect;
220:            }
221:
222:            /*
223:             * (non-Javadoc)
224:             * 
225:             * @see org.bpmscript.jbi.component.ClusteredBpmScriptConfigurationMBean#setHibernateDialect(java.lang.String)
226:             */
227:            public void setHibernateDialect(String hibernateDialect) {
228:                this .hibernateDialect = hibernateDialect;
229:            }
230:
231:            /*
232:             * (non-Javadoc)
233:             * 
234:             * @see org.bpmscript.jbi.component.ClusteredBpmScriptConfigurationMBean#getDataSourcePassword()
235:             */
236:            public String getDataSourcePassword() {
237:                return dataSourcePassword;
238:            }
239:
240:            /*
241:             * (non-Javadoc)
242:             * 
243:             * @see org.bpmscript.jbi.component.ClusteredBpmScriptConfigurationMBean#setDataSourcePassword(java.lang.String)
244:             */
245:            public void setDataSourcePassword(String dataSourcePassword) {
246:                this .dataSourcePassword = dataSourcePassword;
247:            }
248:
249:            /*
250:             * (non-Javadoc)
251:             * 
252:             * @see org.bpmscript.jbi.component.ClusteredBpmScriptConfigurationMBean#getDataSourceUsername()
253:             */
254:            public String getDataSourceUsername() {
255:                return dataSourceUsername;
256:            }
257:
258:            /*
259:             * (non-Javadoc)
260:             * 
261:             * @see org.bpmscript.jbi.component.ClusteredBpmScriptConfigurationMBean#setDataSourceUsername(java.lang.String)
262:             */
263:            public void setDataSourceUsername(String dataSourceUsername) {
264:                this .dataSourceUsername = dataSourceUsername;
265:            }
266:
267:            public String getRootDir() {
268:                return rootDir;
269:            }
270:
271:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.