クラス org.objectweb.cjdbc.console.jmx.RmiJmxClient

すべてのメンバ一覧

説明

This class defines a RmiJmxClient that uses Jmx 2.0 specifications to connect to the RmiSever

作者:
Nicolas Modrzyk
バージョン:
1.0

RmiJmxClient.java60 行で定義されています。

Public メソッド

NotificationListener getNotificationListener ()
void setNotificationListener (NotificationListener notificationListener)
Object getCredentials ()
 RmiJmxClient (String port, String host, String jmxUser, String jmxPassword) throws IOException
 RmiJmxClient (String url, Object credentials) throws IOException
 RmiJmxClient (String port, String host, Object credentials) throws IOException
void connect (String port, String host, Object credentials) throws IOException
VirtualDatabaseMBean getVirtualDatabaseProxy (String database, String user, String password) throws InstanceNotFoundException, IOException, VirtualDatabaseException
ControllerMBean getControllerProxy () throws InstanceNotFoundException, IOException
DataCollectorMBean getDataCollectorProxy () throws IOException
DatabaseBackendMBean getDatabaseBackendProxy (String vdb, String backend, String user, String password) throws InstanceNotFoundException, IOException
String getRemoteName ()
String getRemoteHostAddress ()
String getRemoteHostPort ()
void reconnect () throws Exception
boolean isValidConnection ()

Private 変数

JMXConnector connector
Object credentials
String remoteHostAddress
String remoteHostPort
NotificationListener notificationListener
ControllerMBean controllerMBean
VirtualDatabaseMBean virtualDbMBean
DatabaseBackendMBean backendMBean
DataCollectorMBean dataMBean


コンストラクタとデストラクタ

org.objectweb.cjdbc.console.jmx.RmiJmxClient.RmiJmxClient String  port,
String  host,
String  jmxUser,
String  jmxPassword
throws IOException
 

Creates a new RmiJmxClient.java object

引数:
port the port of the host to connect to
host the host name to connect to
jmxUser the jmxUser if one, to be authenticated with
jmxPassword the jmxPassword if one, to be authenticated with
例外:
IOException if cannot connect
RmiJmxClient.java114 行で定義されています。
00116 { 00117 this(port, host, PasswordAuthenticator.createCredentials(jmxUser, 00118 jmxPassword)); 00119 }

org.objectweb.cjdbc.console.jmx.RmiJmxClient.RmiJmxClient String  url,
Object  credentials
throws IOException
 

Creates a new RmiJmxClient object

引数:
url the jmx connector url
credentials to use for the connection
例外:
IOException if connect fails
RmiJmxClient.java128 行で定義されています。

参照先 org.objectweb.cjdbc.console.jmx.RmiJmxClient.connect(), と org.objectweb.cjdbc.console.jmx.RmiJmxClient.credentials.

00129 { 00130 int index = url.indexOf(":"); 00131 String ip = url.substring(0, index); 00132 String port = url.substring(index + 1); 00133 connect(port, ip, credentials); 00134 }

org.objectweb.cjdbc.console.jmx.RmiJmxClient.RmiJmxClient String  port,
String  host,
Object  credentials
throws IOException
 

Creates a new RmiJmxClient.java object

引数:
port the port of the host to connect to
host the host name to connect to
credentials to use for the connection
例外:
IOException if connect fails
RmiJmxClient.java144 行で定義されています。

参照先 org.objectweb.cjdbc.console.jmx.RmiJmxClient.connect(), と org.objectweb.cjdbc.console.jmx.RmiJmxClient.credentials.

00146 { 00147 connect(port, host, credentials); 00148 }


メソッド

void org.objectweb.cjdbc.console.jmx.RmiJmxClient.connect String  port,
String  host,
Object  credentials
throws IOException
 

Connect to the MBean server

引数:
port the port of the host to connect to
host the host name to connect to
credentials to use for the connection
例外:
IOException if connect fails
RmiJmxClient.java158 行で定義されています。

参照先 org.objectweb.cjdbc.console.jmx.RmiJmxClient.connector, org.objectweb.cjdbc.console.jmx.RmiJmxClient.credentials, org.objectweb.cjdbc.console.jmx.RmiJmxClient.remoteHostAddress, と org.objectweb.cjdbc.console.jmx.RmiJmxClient.remoteHostPort.

参照元 org.objectweb.cjdbc.console.text.commands.controller.Bind.parse(), org.objectweb.cjdbc.console.jmx.RmiJmxClient.reconnect(), と org.objectweb.cjdbc.console.jmx.RmiJmxClient.RmiJmxClient().

00160 { 00161 JMXServiceURL address = new JMXServiceURL("rmi", host, 0, "/jndi/jrmp"); 00162 00163 Map environment = new HashMap(); 00164 environment.put(Context.INITIAL_CONTEXT_FACTORY, 00165 "com.sun.jndi.rmi.registry.RegistryContextFactory"); 00166 environment.put(Context.PROVIDER_URL, "rmi://" + host + ":" + port); 00167 00168 // use username and password for authentication of connections 00169 // with the controller, the values are compared to the ones 00170 // specified in the controller.xml config file. 00171 if (credentials != null) 00172 { 00173 // this line is not required if no username/password has been configered 00174 environment.put(JMXConnector.CREDENTIALS, credentials); 00175 } 00176 00177 this.credentials = credentials; 00178 00179 connector = JMXConnectorFactory.connect(address, environment); 00180 remoteHostAddress = host; 00181 remoteHostPort = port; 00182 }

ControllerMBean org.objectweb.cjdbc.console.jmx.RmiJmxClient.getControllerProxy  )  throws InstanceNotFoundException, IOException
 

Get a proxy to the ControllerMBean

戻り値:
ControllerMBean instance
例外:
IOException if cannot connect to MBean
InstanceNotFoundException if cannot locate MBean
RmiJmxClient.java258 行で定義されています。

参照先 org.objectweb.cjdbc.console.jmx.RmiJmxClient.connector, org.objectweb.cjdbc.console.jmx.RmiJmxClient.controllerMBean, org.objectweb.cjdbc.console.jmx.RmiJmxClient.isValidConnection(), と org.objectweb.cjdbc.console.jmx.RmiJmxClient.notificationListener.

参照元 org.objectweb.cjdbc.console.text.module.VirtualDatabaseAdmin.login(), org.objectweb.cjdbc.console.text.commands.controller.Shutdown.parse(), org.objectweb.cjdbc.console.text.commands.controller.SaveConfiguration.parse(), org.objectweb.cjdbc.console.text.commands.controller.Report.parse(), org.objectweb.cjdbc.console.text.commands.controller.RefreshLogs.parse(), org.objectweb.cjdbc.console.text.commands.controller.Load.parse(), org.objectweb.cjdbc.console.text.commands.controller.ListDatabases.parse(), org.objectweb.cjdbc.console.text.commands.controller.GetXml.parse(), org.objectweb.cjdbc.console.text.commands.controller.GetInfo.parse(), と org.objectweb.cjdbc.console.text.commands.controller.AddDriver.parse().

00260 { 00261 00262 if (controllerMBean != null && isValidConnection()) 00263 { 00264 return controllerMBean; 00265 } 00266 else 00267 { 00268 ObjectName db = JmxConstants.getControllerObjectName(); 00269 00270 // we create a new proxy to the controller 00271 controllerMBean = (ControllerMBean) MBeanServerInvocationHandler 00272 .newProxyInstance(connector.getMBeanServerConnection(), db, 00273 ControllerMBean.class, false); 00274 00275 // Add notification listener 00276 if (notificationListener != null) 00277 { 00278 connector.getMBeanServerConnection().addNotificationListener(db, 00279 notificationListener, null, null); 00280 } 00281 00282 return controllerMBean; 00283 } 00284 }

Object org.objectweb.cjdbc.console.jmx.RmiJmxClient.getCredentials  ) 
 

Returns the credentials value.

戻り値:
Returns the credentials.
RmiJmxClient.java100 行で定義されています。

参照先 org.objectweb.cjdbc.console.jmx.RmiJmxClient.credentials.

参照元 org.objectweb.cjdbc.console.text.commands.controller.Bind.parse().

00101 { 00102 return credentials; 00103 }

DatabaseBackendMBean org.objectweb.cjdbc.console.jmx.RmiJmxClient.getDatabaseBackendProxy String  vdb,
String  backend,
String  user,
String  password
throws InstanceNotFoundException, IOException
 

Get a proxy to the DatabaseBackendMBean

戻り値:
DatabaseBackendMBean instance
引数:
vdb virtual database name
backend backend name
user user name
password password name
例外:
IOException if cannot connect to MBean
InstanceNotFoundException if cannot locate MBean
RmiJmxClient.java322 行で定義されています。

参照先 org.objectweb.cjdbc.console.jmx.RmiJmxClient.backendMBean, org.objectweb.cjdbc.console.jmx.RmiJmxClient.connector, org.objectweb.cjdbc.console.jmx.RmiJmxClient.isValidConnection(), と org.objectweb.cjdbc.console.jmx.RmiJmxClient.notificationListener.

参照元 org.objectweb.cjdbc.console.text.commands.dbadmin.EnableWrite.parse(), org.objectweb.cjdbc.console.text.commands.dbadmin.EnableRead.parse(), org.objectweb.cjdbc.console.text.commands.dbadmin.DisableWrite.parse(), と org.objectweb.cjdbc.console.text.commands.dbadmin.DisableRead.parse().

00325 { 00326 if (backendMBean != null && isValidConnection()) 00327 { 00328 try 00329 { 00330 if (backendMBean.getName().equals(backend)) 00331 return backendMBean; 00332 } 00333 catch (Exception e) 00334 { 00335 // backend is no more there 00336 } 00337 } 00338 00339 // we build a subject for authentication 00340 AdminUser dbUser = new AdminUser(user, password); 00341 Set principals = new HashSet(); 00342 principals.add(dbUser); 00343 Subject subj = new Subject(true, principals, new HashSet(), new HashSet()); 00344 00345 ObjectName db = JmxConstants.getDatabaseBackendObjectName(vdb, backend); 00346 MBeanServerConnection delegateConnection = connector 00347 .getMBeanServerConnection(subj); 00348 00349 if (notificationListener != null) 00350 { 00351 delegateConnection.addNotificationListener(db, notificationListener, 00352 null, null); 00353 } 00354 00355 // we create a proxy to the database backend 00356 backendMBean = (DatabaseBackendMBean) MBeanServerInvocationHandler 00357 .newProxyInstance(delegateConnection, db, DatabaseBackendMBean.class, 00358 false); 00359 return backendMBean; 00360 }

DataCollectorMBean org.objectweb.cjdbc.console.jmx.RmiJmxClient.getDataCollectorProxy  )  throws IOException
 

Get a proxy to the DataCollectorMBean

戻り値:
DataCollectorMBean instance
例外:
IOException if fails
RmiJmxClient.java292 行で定義されています。

参照先 org.objectweb.cjdbc.console.jmx.RmiJmxClient.connector, org.objectweb.cjdbc.console.jmx.RmiJmxClient.dataMBean, と org.objectweb.cjdbc.console.jmx.RmiJmxClient.isValidConnection().

参照元 org.objectweb.cjdbc.console.text.commands.monitor.ShowStats.parse(), org.objectweb.cjdbc.console.text.commands.monitor.ShowScheduler.parse(), org.objectweb.cjdbc.console.text.commands.monitor.ShowRecoveryLog.parse(), org.objectweb.cjdbc.console.text.commands.monitor.ShowDatabases.parse(), org.objectweb.cjdbc.console.text.commands.monitor.ShowController.parse(), org.objectweb.cjdbc.console.text.commands.monitor.ShowCacheStats.parse(), org.objectweb.cjdbc.console.text.commands.monitor.ShowCache.parse(), org.objectweb.cjdbc.console.text.commands.monitor.ChangeTarget.parse(), と org.objectweb.cjdbc.console.text.commands.monitor.ShowBackends.parse().

00293 { 00294 00295 if (dataMBean != null && isValidConnection()) 00296 { 00297 return dataMBean; 00298 } 00299 else 00300 { 00301 ObjectName db = JmxConstants.getDataCollectorObjectName(); 00302 00303 // we create a new proxy to the data collector 00304 dataMBean = (DataCollectorMBean) MBeanServerInvocationHandler 00305 .newProxyInstance(connector.getMBeanServerConnection(), db, 00306 DataCollectorMBean.class, false); 00307 return dataMBean; 00308 } 00309 }

NotificationListener org.objectweb.cjdbc.console.jmx.RmiJmxClient.getNotificationListener  ) 
 

Returns the notificationListener value.

戻り値:
Returns the notificationListener.
RmiJmxClient.java80 行で定義されています。

参照先 org.objectweb.cjdbc.console.jmx.RmiJmxClient.notificationListener.

00081 { 00082 return notificationListener; 00083 }

String org.objectweb.cjdbc.console.jmx.RmiJmxClient.getRemoteHostAddress  ) 
 

Returns the remoteHostAddress value.

戻り値:
Returns the remoteHostAddress.
RmiJmxClient.java378 行で定義されています。

参照先 org.objectweb.cjdbc.console.jmx.RmiJmxClient.remoteHostAddress.

00379 { 00380 return remoteHostAddress; 00381 }

String org.objectweb.cjdbc.console.jmx.RmiJmxClient.getRemoteHostPort  ) 
 

Returns the remoteHostPort value.

戻り値:
Returns the remoteHostPort.
RmiJmxClient.java388 行で定義されています。

参照先 org.objectweb.cjdbc.console.jmx.RmiJmxClient.remoteHostPort.

00389 { 00390 return remoteHostPort; 00391 }

String org.objectweb.cjdbc.console.jmx.RmiJmxClient.getRemoteName  ) 
 

Get the controller name used for jmx connection This is [hostname]:[jmxServerPort]

戻り値:
remoteHostName+":"+remoteHostPort
RmiJmxClient.java368 行で定義されています。

参照先 org.objectweb.cjdbc.console.jmx.RmiJmxClient.remoteHostAddress, と org.objectweb.cjdbc.console.jmx.RmiJmxClient.remoteHostPort.

参照元 org.objectweb.cjdbc.console.text.module.ControllerConsole.getPromptString(), と org.objectweb.cjdbc.console.text.commands.monitor.ChangeTarget.parse().

00369 { 00370 return remoteHostAddress + ":" + remoteHostPort; 00371 }

VirtualDatabaseMBean org.objectweb.cjdbc.console.jmx.RmiJmxClient.getVirtualDatabaseProxy String  database,
String  user,
String  password
throws InstanceNotFoundException, IOException, VirtualDatabaseException
 

Get a reference to the virtualdatabaseMbean with the given authentication

引数:
database the virtual database name
user the user recognized as the VirtualDatabaseUser
password the password for the VirtualDatabaseUser
戻り値:
VirtualDatabaseMBean instance
例外:
IOException if cannot connect to MBean
InstanceNotFoundException if cannot locate MBean
VirtualDatabaseException if virtual database fails
RmiJmxClient.java195 行で定義されています。

参照先 org.objectweb.cjdbc.console.jmx.RmiJmxClient.connector, org.objectweb.cjdbc.console.jmx.RmiJmxClient.isValidConnection(), org.objectweb.cjdbc.console.jmx.RmiJmxClient.notificationListener, と org.objectweb.cjdbc.console.jmx.RmiJmxClient.virtualDbMBean.

参照元 org.objectweb.cjdbc.console.text.module.VirtualDatabaseAdmin.login(), org.objectweb.cjdbc.console.text.commands.dbadmin.ViewCheckpointNames.parse(), org.objectweb.cjdbc.console.text.commands.dbadmin.TransferBackend.parse(), org.objectweb.cjdbc.console.text.commands.dbadmin.ShowBackends.parse(), org.objectweb.cjdbc.console.text.commands.dbadmin.Restore.parse(), org.objectweb.cjdbc.console.text.commands.dbadmin.RemoveCheckpoint.parse(), org.objectweb.cjdbc.console.text.commands.dbadmin.EnableWrite.parse(), org.objectweb.cjdbc.console.text.commands.dbadmin.EnableAll.parse(), org.objectweb.cjdbc.console.text.commands.dbadmin.Enable.parse(), org.objectweb.cjdbc.console.text.commands.dbadmin.DisableAll.parse(), と org.objectweb.cjdbc.console.text.commands.dbadmin.Disable.parse().

00198 { 00199 if (virtualDbMBean != null && isValidConnection() 00200 && virtualDbMBean.getName().equals(database)) 00201 { 00202 return virtualDbMBean; 00203 } 00204 else 00205 { 00206 ObjectName db = JmxConstants.getVirtualDbObjectName(database); 00207 00208 // we build a subject for authentication 00209 AdminUser dbUser = new AdminUser(user, password); 00210 Set principals = new HashSet(); 00211 principals.add(dbUser); 00212 Subject subj = new Subject(true, principals, new HashSet(), new HashSet()); 00213 00214 // we open a connection for this subject, all subsequent calls with this 00215 // connection will be executed on the behalf of our subject. 00216 MBeanServerConnection delegateConnection = connector 00217 .getMBeanServerConnection(subj); 00218 00219 // we create a proxy to the virtual database 00220 VirtualDatabaseMBean local = (VirtualDatabaseMBean) MBeanServerInvocationHandler 00221 .newProxyInstance(delegateConnection, db, VirtualDatabaseMBean.class, 00222 false); 00223 00224 // Check authentication 00225 boolean authenticated = false; 00226 try 00227 { 00228 authenticated = local.checkAdminAuthentication(user, password); 00229 } 00230 catch (Exception e) 00231 { 00232 throw new VirtualDatabaseException( 00233 "Could not check authentication. MBean is not accessible."); 00234 } 00235 if (!authenticated) 00236 throw new VirtualDatabaseException("Authentication Failed"); 00237 00238 // Add notification listener 00239 if (notificationListener != null) 00240 { 00241 delegateConnection.addNotificationListener(db, notificationListener, 00242 null, null); 00243 } 00244 00245 this.virtualDbMBean = local; 00246 00247 return virtualDbMBean; 00248 } 00249 }

boolean org.objectweb.cjdbc.console.jmx.RmiJmxClient.isValidConnection  ) 
 

Test if the connection with the mbean server is still valid

戻り値:
true if it is
RmiJmxClient.java408 行で定義されています。

参照先 org.objectweb.cjdbc.console.jmx.RmiJmxClient.backendMBean, org.objectweb.cjdbc.console.jmx.RmiJmxClient.connector, org.objectweb.cjdbc.console.jmx.RmiJmxClient.controllerMBean, org.objectweb.cjdbc.console.jmx.RmiJmxClient.dataMBean, と org.objectweb.cjdbc.console.jmx.RmiJmxClient.virtualDbMBean.

参照元 org.objectweb.cjdbc.console.jmx.RmiJmxClient.getControllerProxy(), org.objectweb.cjdbc.console.jmx.RmiJmxClient.getDatabaseBackendProxy(), org.objectweb.cjdbc.console.jmx.RmiJmxClient.getDataCollectorProxy(), と org.objectweb.cjdbc.console.jmx.RmiJmxClient.getVirtualDatabaseProxy().

00409 { 00410 try 00411 { 00412 connector.getMBeanServerConnection().getMBeanCount(); 00413 return true; 00414 } 00415 catch (Exception e) 00416 { 00417 controllerMBean = null; 00418 backendMBean = null; 00419 virtualDbMBean = null; 00420 dataMBean = null; 00421 return false; 00422 } 00423 }

void org.objectweb.cjdbc.console.jmx.RmiJmxClient.reconnect  )  throws Exception
 

Reconnect to the same mbean server

例外:
Exception if reconnection failed
RmiJmxClient.java398 行で定義されています。

参照先 org.objectweb.cjdbc.console.jmx.RmiJmxClient.connect(), org.objectweb.cjdbc.console.jmx.RmiJmxClient.credentials, org.objectweb.cjdbc.console.jmx.RmiJmxClient.remoteHostAddress, と org.objectweb.cjdbc.console.jmx.RmiJmxClient.remoteHostPort.

00399 { 00400 connect(remoteHostPort, remoteHostAddress, credentials); 00401 }

void org.objectweb.cjdbc.console.jmx.RmiJmxClient.setNotificationListener NotificationListener  notificationListener  ) 
 

Sets the notificationListener value.

引数:
notificationListener The notificationListener to set.
RmiJmxClient.java90 行で定義されています。
00091 { 00092 this.notificationListener = notificationListener; 00093 }


変数

DatabaseBackendMBean org.objectweb.cjdbc.console.jmx.RmiJmxClient.backendMBean [private]
 

RmiJmxClient.java72 行で定義されています。

参照元 org.objectweb.cjdbc.console.jmx.RmiJmxClient.getDatabaseBackendProxy(), と org.objectweb.cjdbc.console.jmx.RmiJmxClient.isValidConnection().

JMXConnector org.objectweb.cjdbc.console.jmx.RmiJmxClient.connector [private]
 

RmiJmxClient.java62 行で定義されています。

参照元 org.objectweb.cjdbc.console.jmx.RmiJmxClient.connect(), org.objectweb.cjdbc.console.jmx.RmiJmxClient.getControllerProxy(), org.objectweb.cjdbc.console.jmx.RmiJmxClient.getDatabaseBackendProxy(), org.objectweb.cjdbc.console.jmx.RmiJmxClient.getDataCollectorProxy(), org.objectweb.cjdbc.console.jmx.RmiJmxClient.getVirtualDatabaseProxy(), と org.objectweb.cjdbc.console.jmx.RmiJmxClient.isValidConnection().

ControllerMBean org.objectweb.cjdbc.console.jmx.RmiJmxClient.controllerMBean [private]
 

RmiJmxClient.java70 行で定義されています。

参照元 org.objectweb.cjdbc.console.jmx.RmiJmxClient.getControllerProxy(), と org.objectweb.cjdbc.console.jmx.RmiJmxClient.isValidConnection().

Object org.objectweb.cjdbc.console.jmx.RmiJmxClient.credentials [private]
 

RmiJmxClient.java63 行で定義されています。

参照元 org.objectweb.cjdbc.console.jmx.RmiJmxClient.connect(), org.objectweb.cjdbc.console.jmx.RmiJmxClient.getCredentials(), org.objectweb.cjdbc.console.jmx.RmiJmxClient.reconnect(), と org.objectweb.cjdbc.console.jmx.RmiJmxClient.RmiJmxClient().

DataCollectorMBean org.objectweb.cjdbc.console.jmx.RmiJmxClient.dataMBean [private]
 

RmiJmxClient.java73 行で定義されています。

参照元 org.objectweb.cjdbc.console.jmx.RmiJmxClient.getDataCollectorProxy(), と org.objectweb.cjdbc.console.jmx.RmiJmxClient.isValidConnection().

NotificationListener org.objectweb.cjdbc.console.jmx.RmiJmxClient.notificationListener [private]
 

RmiJmxClient.java67 行で定義されています。

参照元 org.objectweb.cjdbc.console.jmx.RmiJmxClient.getControllerProxy(), org.objectweb.cjdbc.console.jmx.RmiJmxClient.getDatabaseBackendProxy(), org.objectweb.cjdbc.console.jmx.RmiJmxClient.getNotificationListener(), と org.objectweb.cjdbc.console.jmx.RmiJmxClient.getVirtualDatabaseProxy().

String org.objectweb.cjdbc.console.jmx.RmiJmxClient.remoteHostAddress [private]
 

RmiJmxClient.java64 行で定義されています。

参照元 org.objectweb.cjdbc.console.jmx.RmiJmxClient.connect(), org.objectweb.cjdbc.console.jmx.RmiJmxClient.getRemoteHostAddress(), org.objectweb.cjdbc.console.jmx.RmiJmxClient.getRemoteName(), と org.objectweb.cjdbc.console.jmx.RmiJmxClient.reconnect().

String org.objectweb.cjdbc.console.jmx.RmiJmxClient.remoteHostPort [private]
 

RmiJmxClient.java65 行で定義されています。

参照元 org.objectweb.cjdbc.console.jmx.RmiJmxClient.connect(), org.objectweb.cjdbc.console.jmx.RmiJmxClient.getRemoteHostPort(), org.objectweb.cjdbc.console.jmx.RmiJmxClient.getRemoteName(), と org.objectweb.cjdbc.console.jmx.RmiJmxClient.reconnect().

VirtualDatabaseMBean org.objectweb.cjdbc.console.jmx.RmiJmxClient.virtualDbMBean [private]
 

RmiJmxClient.java71 行で定義されています。

参照元 org.objectweb.cjdbc.console.jmx.RmiJmxClient.getVirtualDatabaseProxy(), と org.objectweb.cjdbc.console.jmx.RmiJmxClient.isValidConnection().


このクラスの説明は次のファイルから生成されました:
CJDBCversion1.0.4に対してTue Oct 12 15:16:24 2004に生成されました。 doxygen 1.3.8