Source Code Cross Referenced for BonitaConfig.java in  » Workflow-Engines » bonita-v3.1 » hero » util » 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 » bonita v3.1 » hero.util 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        package hero.util;
002:
003:        /**
004:         *
005:         * Bonita
006:         * Copyright (C) 1999 Bull S.A.
007:         * Bull 68 route de versailles  78434 Louveciennes Cedex France
008:         * Further information: bonita@objectweb.org
009:         *
010:         * This library is free software; you can redistribute it and/or
011:         * modify it under the terms of the GNU Lesser General Public
012:         * License as published by the Free Software Foundation; either
013:         * version 2.1 of the License, or any later version.
014:         *
015:         * This library is distributed in the hope that it will be useful,
016:         * but WITHOUT ANY WARRANTY; without even the implied warranty of
017:         * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
018:         * Lesser General Public License for more details.
019:         *
020:         * You should have received a copy of the GNU Lesser General Public
021:         * License along with this library; if not, write to the Free Software
022:         * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307
023:         * USA
024:         *
025:         *
026:         --------------------------------------------------------------------------
027:         * $Id: BonitaConfig.java,v 1.7 2006/05/23 13:41:51 brice Exp $
028:         *
029:         --------------------------------------------------------------------------
030:         */
031:
032:        import java.util.List;
033:
034:        import javax.management.Attribute;
035:        import javax.management.MBeanServer;
036:        import javax.management.MBeanServerFactory;
037:        import javax.management.ObjectName;
038:
039:        public class BonitaConfig {
040:
041:            private ObjectName config;
042:            private MBeanServer server;
043:            private static BonitaConfig bc = null; // Singleton pattern
044:
045:            public BonitaConfig() throws HeroException {
046:                try {
047:                    config = new ObjectName(
048:                            "bonita:type=bonitaservice,name=Config");
049:                    List list = MBeanServerFactory.findMBeanServer(null);
050:                    server = (MBeanServer) list.iterator().next();
051:                } catch (Exception e) {
052:                    e.printStackTrace();
053:                    throw new HeroException(e.getMessage());
054:                }
055:            }
056:
057:            public static BonitaConfig getInstance() throws HeroException {
058:                if (bc == null) {
059:                    bc = new BonitaConfig();
060:                }
061:                return bc;
062:            }
063:
064:            public void setJms(boolean jms) throws HeroException {
065:                try {
066:                    server.invoke(config, "updateJms",
067:                            new Object[] { new Boolean(jms) },
068:                            new String[] { "boolean" });
069:                } catch (Exception e) {
070:                    throw new HeroException(e.getMessage());
071:                }
072:            }
073:
074:            public void setHistoric(String value) throws HeroException {
075:                try {
076:                    server.invoke(config, "updateHistoric",
077:                            new Object[] { value }, new String[] { ""
078:                                    .getClass().getName() });
079:                } catch (Exception e) {
080:                    throw new HeroException(e.getMessage());
081:                }
082:            }
083:
084:            public void setLogLevel(String value) throws HeroException {
085:                try {
086:                    server.invoke(config, "updateLogLevel",
087:                            new Object[] { value }, new String[] { ""
088:                                    .getClass().getName() });
089:                } catch (Exception e) {
090:                    throw new HeroException(e.getMessage());
091:                }
092:            }
093:
094:            public void setTraceLevel(String value) throws HeroException {
095:                try {
096:                    server.invoke(config, "updateTraceLevel",
097:                            new Object[] { value }, new String[] { ""
098:                                    .getClass().getName() });
099:                } catch (Exception e) {
100:                    throw new HeroException(e.getMessage());
101:                }
102:            }
103:
104:            public void setProperty(String key, String value)
105:                    throws HeroException {
106:                try {
107:                    server.invoke(config, "updateProperty", new Object[] { key,
108:                            value }, new String[] { "".getClass().getName(),
109:                            "".getClass().getName() });
110:                } catch (Exception e) {
111:                    throw new HeroException(e.getMessage());
112:                }
113:            }
114:
115:            public boolean getJms() throws HeroException {
116:                try {
117:                    return (((Boolean) server.getAttribute(config, "Jms"))
118:                            .booleanValue());
119:                } catch (Exception e) {
120:                    throw new HeroException(e.getMessage());
121:                }
122:            }
123:
124:            public String getHistoric() throws HeroException {
125:                try {
126:                    return ((String) server.getAttribute(config, "Historic"));
127:                } catch (Exception e) {
128:                    throw new HeroException(e.getMessage());
129:                }
130:            }
131:
132:            public String getLogLevel() throws HeroException {
133:                try {
134:                    return ((String) server.getAttribute(config, "LogLevel"));
135:                } catch (Exception e) {
136:                    throw new HeroException(e.getMessage());
137:                }
138:            }
139:
140:            public String getTraceLevel() throws HeroException {
141:                try {
142:                    return ((String) server.getAttribute(config, "TraceLevel"));
143:                } catch (Exception e) {
144:                    throw new HeroException(e.getMessage());
145:                }
146:            }
147:
148:            public String getProperty(String key) throws HeroException {
149:                try {
150:                    return ((String) server.invoke(config, "getProperty",
151:                            new Object[] { key }, new String[] { "".getClass()
152:                                    .getName() }));
153:                } catch (Exception e) {
154:                    throw new HeroException(e.getMessage());
155:                }
156:            }
157:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.