com.sun.grid.jgdi.management
public class JGDIProxy extends java.lang.Object implements java.lang.reflect.InvocationHandler, javax.management.NotificationListener
This class can be used to communicate with qmaster over JMX.
Constructor and Description |
---|
JGDIProxy(javax.management.remote.JMXServiceURL url,
java.lang.Object credentials)
Create a new proxy to the jgdi MBean
|
Modifier and Type | Method and Description |
---|---|
void |
addEventListener(EventListener lis)
Register an jgdi event listener.
|
void |
close()
Close the connection to the MBean server
|
static java.lang.String[] |
createCredentialsFromKeyStore(java.security.KeyStore ks,
java.lang.String username,
char[] pw)
Create JMX credentials for password less authentication with a keystore
|
javax.management.MBeanServerConnection |
getMBeanServerConnection()
Get the MBeanServerConnection connection
|
JGDIJMXMBean |
getProxy()
Get the dynamic proxy object
|
void |
handleNotification(javax.management.Notification notification,
java.lang.Object handback)
JMX will call this method of a notification for the proxy is available.
|
java.lang.Object |
invoke(java.lang.Object proxy,
java.lang.reflect.Method method,
java.lang.Object[] args)
Invoke a method on the remote MBean.
|
static java.lang.String |
isAttributeSetter(java.lang.reflect.Method method)
Get a new instanceof of
ComponentAttributeDescriptor from an
attribute getter. |
boolean |
isConnected()
Determine of the connection to the JMX MBean servers is established
|
void |
removeEventListener(EventListener lis)
Remove a jgdi event listener.
|
static void |
resetSSL(java.io.File caTop)
Deprecated.
|
static void |
resetSSL(java.lang.String serverHostname,
int serverPort,
java.io.File caTop)
Reset the SSL setup.
|
static void |
setupSSL(java.io.File caTop,
java.io.File ks,
char[] pw)
Deprecated.
|
static void |
setupSSL(java.io.File caTop,
java.security.KeyStore ks,
char[] pw)
Deprecated.
|
static void |
setupSSL(java.lang.String serverHostname,
int serverPort,
java.io.File caTop,
java.io.File ks,
char[] pw)
Set up the ssl context
|
static void |
setupSSL(java.lang.String serverHostname,
int serverPort,
java.io.File caTop,
java.security.KeyStore ks,
char[] pw)
Set up the ssl context
|
public JGDIProxy(javax.management.remote.JMXServiceURL url, java.lang.Object credentials)
url
- jmx connection url to qmaster
allows username/password authentication this parameter must be a
string array. The first element is the username, the second element
is the password.credentials
- the credentials for jmx authenticationpublic JGDIJMXMBean getProxy()
public javax.management.MBeanServerConnection getMBeanServerConnection()
public static void setupSSL(java.io.File caTop, java.security.KeyStore ks, char[] pw)
caTop
- ca top directory if the Grid Engine CA ($SGE_ROOT/$SGE_CELL/common/sgeCAks
- keystore of the userpw
- password for the keystorepublic static void setupSSL(java.io.File caTop, java.io.File ks, char[] pw)
caTop
- ca top directory if the Grid Engine CA ($SGE_ROOT/$SGE_CELL/common/sgeCAks
- keystore file of the userpw
- password for the keystorepublic static void resetSSL(java.io.File caTop)
caTop
- the ca top directory of the clusterpublic static void setupSSL(java.lang.String serverHostname, int serverPort, java.io.File caTop, java.security.KeyStore ks, char[] pw)
serverHostname
- the server hostnameserverPort
- the server portcaTop
- ca top directory if the Grid Engine CA ($SGE_ROOT/$SGE_CELL/common/sgeCAks
- keystore of the userpw
- password for the keystorepublic static void setupSSL(java.lang.String serverHostname, int serverPort, java.io.File caTop, java.io.File ks, char[] pw)
serverHostname
- the server hostnameserverPort
- the server portcaTop
- ca top directory if the Grid Engine CA ($SGE_ROOT/$SGE_CELL/common/sgeCAks
- keystore file of the userpw
- password for the keystorepublic static void resetSSL(java.lang.String serverHostname, int serverPort, java.io.File caTop)
serverHostname
- the server hostnameserverPort
- the server portcaTop
- the ca top directory of the clusterpublic void addEventListener(EventListener lis)
lis
- the jgdi event listenerpublic void removeEventListener(EventListener lis)
lis
- the jgdi event listenerpublic void handleNotification(javax.management.Notification notification, java.lang.Object handback)
handleNotification
in interface javax.management.NotificationListener
notification
- the notificationhandback
- the handback objectpublic boolean isConnected()
true
if the connection is established otherwise
false
public void close()
public java.lang.Object invoke(java.lang.Object proxy, java.lang.reflect.Method method, java.lang.Object[] args) throws java.lang.Throwable
invoke
in interface java.lang.reflect.InvocationHandler
proxy
- the JGDIProxy objectmethod
- the method which should be invokedargs
- arguments for the methodjava.lang.Throwable
public static java.lang.String isAttributeSetter(java.lang.reflect.Method method)
ComponentAttributeDescriptor
from an
attribute getter.method
- the attribute getterCoComponentAttributeDescriptorcode> or null
if method
is not an attribute getter
public static java.lang.String[] createCredentialsFromKeyStore(java.security.KeyStore ks, java.lang.String username, char[] pw) throws JGDIException
ks
- the keystoreusername
- the usernamepw
- password of the private key in the keystoreJGDIException
Copyright © 2007 Sun Microsystems, Inc. All rights reserved.