Source Code Cross Referenced for TransparentAppConfig.java in  » Net » Terracotta » com » tctest » runner » 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 » Net » Terracotta » com.tctest.runner 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        /*
002:         * All content copyright (c) 2003-2006 Terracotta, Inc., except as may otherwise be noted in a separate copyright
003:         * notice. All rights reserved.
004:         */
005:        package com.tctest.runner;
006:
007:        import com.tc.net.proxy.TCPProxy;
008:        import com.tc.object.config.DSOClientConfigHelper;
009:        import com.tc.objectserver.control.ServerControl;
010:        import com.tc.simulator.app.ApplicationConfig;
011:        import com.tc.simulator.app.ApplicationConfigBuilder;
012:        import com.tc.simulator.app.GlobalIdGenerator;
013:
014:        import java.util.HashMap;
015:        import java.util.Map;
016:
017:        public class TransparentAppConfig implements  ApplicationConfig,
018:                ApplicationConfigBuilder {
019:            public static final String adapterMapKey = "adapterMap";
020:            public static final String PROXY_CONNECT_MGR = "PROXY_CONNECT_MGR";
021:
022:            private final String applicationClassname;
023:            private final GlobalIdGenerator idGenerator;
024:            private final Map extraConfigAttributes = new HashMap();
025:            private final ServerControl serverControl;
026:            private ServerControl[] serverControls;
027:            private TCPProxy[] proxies;
028:            private int intensity;
029:            private int clientCount;
030:            private int applicationInstancePerClientCount = 1;
031:            private int validatorCount;
032:            private int adaptedMutatorCount;
033:            private int adaptedValidatorCount;
034:
035:            public TransparentAppConfig(String applicationClassname,
036:                    GlobalIdGenerator idGenerator, int clientCount,
037:                    int intensity, ServerControl[] serverControls,
038:                    TCPProxy[] proxies) {
039:                this (applicationClassname, idGenerator, clientCount, intensity,
040:                        null, 0, 0, 0);
041:                this .serverControls = serverControls;
042:                this .proxies = proxies;
043:            }
044:
045:            public TransparentAppConfig(String applicationClassname,
046:                    GlobalIdGenerator idGenerator, int clientCount,
047:                    int intensity, ServerControl serverControl) {
048:                this (applicationClassname, idGenerator, clientCount, intensity,
049:                        serverControl, 0, 0, 0);
050:            }
051:
052:            public TransparentAppConfig(String applicationClassname,
053:                    GlobalIdGenerator idGenerator, int clientCount,
054:                    int intensity, ServerControl serverControl,
055:                    int validatorCount, int adaptedMutatorCount,
056:                    int adaptedValidatorCount) {
057:                this .applicationClassname = applicationClassname;
058:                this .idGenerator = idGenerator;
059:                if (clientCount < 1)
060:                    throw new AssertionError(
061:                            "Client count must be greater than 0");
062:                this .clientCount = clientCount;
063:                this .intensity = intensity;
064:                this .serverControl = serverControl;
065:                this .validatorCount = validatorCount;
066:                this .adaptedMutatorCount = adaptedMutatorCount;
067:                isLessThanOrEqualTo(adaptedMutatorCount, clientCount,
068:                        "adaptedMutatorCount");
069:                this .adaptedValidatorCount = adaptedValidatorCount;
070:                isLessThanOrEqualTo(adaptedValidatorCount, validatorCount,
071:                        "adaptedValidatorCount");
072:            }
073:
074:            public int getAdaptedMutatorCount() {
075:                return adaptedMutatorCount;
076:            }
077:
078:            public int getAdaptedValidatorCount() {
079:                return adaptedValidatorCount;
080:            }
081:
082:            public void setAttribute(String key, String value) {
083:                extraConfigAttributes.put(key, value);
084:            }
085:
086:            public void setAttribute(String key, Object value) {
087:                extraConfigAttributes.put(key, value);
088:            }
089:
090:            public String getAttribute(String key) {
091:                return (String) extraConfigAttributes.get(key);
092:            }
093:
094:            public Object getAttributeObject(String key) {
095:                return extraConfigAttributes.get(key);
096:            }
097:
098:            public int nextGlobalId() {
099:                return (int) idGenerator.nextId();
100:            }
101:
102:            public int getGlobalParticipantCount() {
103:                return this .clientCount
104:                        * this .applicationInstancePerClientCount;
105:            }
106:
107:            public TransparentAppConfig setApplicationInstancePerClientCount(
108:                    int applicationInstanceCount) {
109:                this .applicationInstancePerClientCount = applicationInstanceCount;
110:                return this ;
111:            }
112:
113:            public int getApplicationInstancePerClientCount() {
114:                return this .applicationInstancePerClientCount;
115:            }
116:
117:            public int getClientCount() {
118:                return this .clientCount;
119:            }
120:
121:            public TransparentAppConfig setClientCount(int i) {
122:                this .clientCount = i;
123:                return this ;
124:            }
125:
126:            public int getIntensity() {
127:                return this .intensity;
128:            }
129:
130:            public TransparentAppConfig setIntensity(int i) {
131:                this .intensity = i;
132:                return this ;
133:            }
134:
135:            public String getApplicationClassname() {
136:                return this .applicationClassname;
137:            }
138:
139:            public int getGlobalValidatorCount() {
140:                return (clientCount + validatorCount)
141:                        * applicationInstancePerClientCount;
142:            }
143:
144:            public int getValidatorCount() {
145:                return this .validatorCount;
146:            }
147:
148:            public TransparentAppConfig setValidatorCount(int count) {
149:                validatorCount = count;
150:                return this ;
151:            }
152:
153:            public TransparentAppConfig setAdaptedMutatorCount(int count) {
154:                adaptedMutatorCount = count;
155:                isLessThanOrEqualTo(adaptedMutatorCount, clientCount,
156:                        "adaptedMutatorCount");
157:                return this ;
158:            }
159:
160:            public TransparentAppConfig setAdaptedValidatorCount(int count) {
161:                adaptedValidatorCount = count;
162:                isLessThanOrEqualTo(adaptedValidatorCount, validatorCount,
163:                        "adaptedValidatorCount");
164:                return this ;
165:            }
166:
167:            private void isLessThanOrEqualTo(int a, int b, String description) {
168:                if (a > b) {
169:                    throw new AssertionError(description + " is too big!");
170:                }
171:            }
172:
173:            // ApplicationConfigBuilder interface...
174:
175:            public void visitClassLoaderConfig(DSOClientConfigHelper config) {
176:                return;
177:            }
178:
179:            public ApplicationConfig newApplicationConfig() {
180:                return this ;
181:            }
182:
183:            public ApplicationConfig copy() {
184:                throw new AssertionError();
185:            }
186:
187:            public ServerControl getServerControl() {
188:                return serverControl;
189:            }
190:
191:            public ServerControl[] getServerControls() {
192:                return serverControls;
193:            }
194:
195:            public TCPProxy[] getProxies() {
196:                return proxies;
197:            }
198:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.