38
38
import weblogic .management .configuration .WLDFSystemResourceMBean ;
39
39
import weblogic .management .jmx .MBeanServerInvocationHandler ;
40
40
import weblogic .management .mbeanservers .domainruntime .DomainRuntimeServiceMBean ;
41
- import weblogic .management .mbeanservers .edit .ConfigurationManagerMBean ;
42
- import weblogic .management .mbeanservers .edit .EditServiceMBean ;
43
41
import weblogic .management .mbeanservers .runtime .RuntimeServiceMBean ;
44
- import weblogic .management .runtime .DomainRuntimeMBean ;
45
42
import weblogic .management .runtime .ServerRuntimeMBean ;
46
43
47
44
/**
64
61
*/
65
62
public class SitConfigTests {
66
63
67
- private MBeanServerConnection domainRuntimeMbs , editMbs , runtimeMbs ;
64
+ private MBeanServerConnection runtimeMbs ;
68
65
private JMXConnector jmxConnector ;
69
66
private static ObjectName service ;
70
- private DomainRuntimeMBean domainRuntimeMBean ;
71
- private DomainRuntimeServiceMBean domainServiceMBean ;
72
67
private RuntimeServiceMBean runtimeServiceMBean ;
73
68
private ServerRuntimeMBean serverRuntime ;
74
- private EditServiceMBean editServiceMBean ;
75
-
76
- private DomainMBean editdomain , editTree ;
77
- private ConfigurationManagerMBean cfgMgr ;
78
69
private static final String JNDI = "/jndi/" ;
79
70
80
71
private final String adminHost ;
@@ -129,12 +120,12 @@ public static void main(String args[]) throws Exception {
129
120
}
130
121
131
122
/**
132
- * Constructor
123
+ * Create connections to the MBean servers when the class is instantiated.
133
124
*
134
- * @param adminHost
135
- * @param adminPort
136
- * @param adminUser
137
- * @param adminPassword
125
+ * @param adminHost - administration server t3 public address
126
+ * @param adminPort - administration server t3 public port
127
+ * @param adminUser - administration server user name
128
+ * @param adminPassword - - administration server password
138
129
* @throws Exception
139
130
*/
140
131
public SitConfigTests (String adminHost , String adminPort , String adminUser , String adminPassword )
@@ -146,6 +137,12 @@ public SitConfigTests(String adminHost, String adminPort, String adminUser, Stri
146
137
createConnections ();
147
138
}
148
139
140
+ /**
141
+ * This method creates connection to the RuntimeMBean server Looks up the RuntimeService,
142
+ * DomainRuntimeService and EditService MBeans needed by the tests.
143
+ *
144
+ * @throws Exception
145
+ */
149
146
private void createConnections () throws Exception {
150
147
runtimeMbs =
151
148
lookupMBeanServerConnection (
@@ -154,40 +151,31 @@ private void createConnections() throws Exception {
154
151
adminUser ,
155
152
adminPassword ,
156
153
RuntimeServiceMBean .MBEANSERVER_JNDI_NAME );
157
- domainRuntimeMbs =
158
- lookupMBeanServerConnection (
159
- adminHost ,
160
- adminPort ,
161
- adminUser ,
162
- adminPassword ,
163
- DomainRuntimeServiceMBean .MBEANSERVER_JNDI_NAME );
164
- editMbs =
165
- lookupMBeanServerConnection (
166
- adminHost , adminPort , adminUser , adminPassword , EditServiceMBean .MBEANSERVER_JNDI_NAME );
167
-
168
154
ObjectName runtimeserviceObjectName = new ObjectName (RuntimeServiceMBean .OBJECT_NAME );
169
155
runtimeServiceMBean =
170
156
(RuntimeServiceMBean )
171
157
MBeanServerInvocationHandler .newProxyInstance (runtimeMbs , runtimeserviceObjectName );
172
-
173
158
ObjectName domainServiceObjectName = new ObjectName (DomainRuntimeServiceMBean .OBJECT_NAME );
174
- domainServiceMBean =
175
- (DomainRuntimeServiceMBean )
176
- MBeanServerInvocationHandler .newProxyInstance (
177
- domainRuntimeMbs , domainServiceObjectName );
178
-
179
- ObjectName editserviceObjectName = new ObjectName (EditServiceMBean .OBJECT_NAME );
180
- editServiceMBean =
181
- (EditServiceMBean )
182
- MBeanServerInvocationHandler .newProxyInstance (editMbs , editserviceObjectName );
183
159
}
184
160
161
+ /**
162
+ * Method for creating a connection to a specific Mbean Server Accepts the following parameters
163
+ *
164
+ * @param host - Administration server hostname
165
+ * @param adminPort - Administration server T3 channel port
166
+ * @param user - - Administration server user name
167
+ * @param adminPassword - - Administration server password
168
+ * @param jndiName - jndi name of the MBean server
169
+ * @return MBeanServerConnection - MBean server connection created
170
+ * @throws MalformedURLException - throws MalformedURLException when URL is wrong
171
+ * @throws IOException - throws IOException when it cannot connect the MBean server
172
+ * @throws Exception - throws Exceptioni when created MBeanserver connection is null.
173
+ */
185
174
private MBeanServerConnection lookupMBeanServerConnection (
186
175
String host , String adminPort , String user , String adminPassword , String jndiName )
187
176
throws MalformedURLException , IOException , Exception {
188
177
JMXServiceURL serviceURL ;
189
178
MBeanServerConnection mBeanServerConnection ;
190
-
191
179
println (
192
180
"Host: "
193
181
+ adminHost
@@ -331,6 +319,11 @@ protected void verifyT3ChannelMaxMessageSize(int expectedValue) {
331
319
}
332
320
}
333
321
322
+ /**
323
+ * Looks up the ServerMBean from RuntimeServiceMBean
324
+ *
325
+ * @return
326
+ */
334
327
private ServerMBean getServerMBean () {
335
328
ServerMBean serverMBean = runtimeServiceMBean .getServerConfiguration ();
336
329
println ("ServerMBean: " + serverMBean );
@@ -555,6 +548,11 @@ protected WLDFSystemResourceMBean getWLDFSystemModule(String resourceName) {
555
548
return wldfResource ;
556
549
}
557
550
551
+ /**
552
+ * prints messages
553
+ *
554
+ * @param msg - message to print
555
+ */
558
556
protected static void println (String msg ) {
559
557
System .out .println ("> " + msg );
560
558
}
0 commit comments