S-PLUS Connect/Java v1.0

com.insightful.splus
Class ClientUtilitiesImpl

java.lang.Object
  extended byjava.rmi.server.RemoteObject
      extended byjava.rmi.server.RemoteServer
          extended byjava.rmi.server.UnicastRemoteObject
              extended bycom.insightful.splus.ClientUtilitiesImpl
All Implemented Interfaces:
ClientUtilities, Remote, Serializable

public class ClientUtilitiesImpl
extends UnicastRemoteObject
implements ClientUtilities

Implementation for ClientUtilities. Uses ClassUtilities methods to perform operations.

See Also:
ClassUtilities, Serialized Form

Field Summary
 
Fields inherited from class java.rmi.server.RemoteObject
ref
 
Constructor Summary
ClientUtilitiesImpl()
          Create an instance to expose remotely.
ClientUtilitiesImpl(SplusSession session)
          Create an instance to expose remotely (with SSL encryption of RMI).
 
Method Summary
 void attachClassPath(String classPath)
          Attach a new class path to the classloader.
 void attachClassPath(String[] paths)
          Attach a set of new class paths to the classloader.
 boolean classExists(String className)
          Test whether a class exists.
 boolean fieldExists(String className, String fieldName)
          Test whether a field exists.
 Object getStaticFieldValue(String className, String fieldName)
          Get a static field value from the client JVM.
 Object invokeStaticMethod(String className, String methodName, Class[] parameterTypes, Object[] args)
          Invoke a static method in the client JVM.
 boolean methodExists(String className, String methodName, Class[] parameterTypes)
          Test whether a method exists.
 
Methods inherited from class java.rmi.server.UnicastRemoteObject
clone, exportObject, exportObject, exportObject, unexportObject
 
Methods inherited from class java.rmi.server.RemoteServer
getClientHost, getLog, setLog
 
Methods inherited from class java.rmi.server.RemoteObject
equals, getRef, hashCode, toString, toStub
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ClientUtilitiesImpl

public ClientUtilitiesImpl()
                    throws RemoteException
Create an instance to expose remotely.


ClientUtilitiesImpl

public ClientUtilitiesImpl(SplusSession session)
                    throws RemoteException
Create an instance to expose remotely (with SSL encryption of RMI).

Method Detail

getStaticFieldValue

public Object getStaticFieldValue(String className,
                                  String fieldName)
                           throws ClassNotFoundException,
                                  NoSuchFieldException,
                                  IllegalAccessException,
                                  RemoteException
Get a static field value from the client JVM.

Specified by:
getStaticFieldValue in interface ClientUtilities
Parameters:
className - The class containing the field of interest.
fieldName - The field of interest.
Throws:
ClassNotFoundException
NoSuchFieldException
IllegalAccessException
RemoteException
See Also:
Class.getField(String name)

invokeStaticMethod

public Object invokeStaticMethod(String className,
                                 String methodName,
                                 Class[] parameterTypes,
                                 Object[] args)
                          throws ClassNotFoundException,
                                 NoSuchMethodException,
                                 IllegalAccessException,
                                 InvocationTargetException,
                                 RemoteException
Invoke a static method in the client JVM.

Specified by:
invokeStaticMethod in interface ClientUtilities
Parameters:
className - The class containing the method to invoke.
methodName - The method to invoke.
parameterTypes - Array of Class objects matching the arguments to the method. The class for a primitive argument such as "double" is obtained from the wrapper class "Double" using the static field "Double.TYPE".
args - Array of arguments to the method. Primitive arguments such as "double" must be wrapped in an object such as "Double".
Returns:
The Object returned by the method.
Throws:
ClassNotFoundException
NoSuchMethodException
IllegalAccessException
InvocationTargetException
RemoteException
See Also:
Method.invoke(Object obj, Object [] args)

classExists

public boolean classExists(String className)
                    throws RemoteException
Test whether a class exists.

Specified by:
classExists in interface ClientUtilities
Parameters:
className - Class to find.
Returns:
boolean indicating whether the class can be found.
Throws:
RemoteException
See Also:
ClassLoader.loadClass(String name)

fieldExists

public boolean fieldExists(String className,
                           String fieldName)
                    throws SecurityException,
                           RemoteException
Test whether a field exists.

Specified by:
fieldExists in interface ClientUtilities
Parameters:
className - The class containing the field of interest.
fieldName - The field of interest.
Returns:
Returns true if the class exists and contains a public field with the specified name.
Throws:
SecurityException
RemoteException

methodExists

public boolean methodExists(String className,
                            String methodName,
                            Class[] parameterTypes)
                     throws RemoteException
Test whether a method exists.

Specified by:
methodExists in interface ClientUtilities
Parameters:
className - The class containing the method.
methodName - The method.
parameterTypes - Array of Class objects matching the arguments to the method. The class for a primitive argument such as "double" is obtained from the wrapper class "Double" using the static field "Double.TYPE".
Returns:
Returns true if the class exists and has a public method with the specified parameter types.
Throws:
RemoteException

attachClassPath

public void attachClassPath(String classPath)
                     throws Exception,
                            RemoteException
Attach a new class path to the classloader.

Specified by:
attachClassPath in interface ClientUtilities
Parameters:
classPath - a jar file or a directory containing classes.
Throws:
Exception
RemoteException

attachClassPath

public void attachClassPath(String[] paths)
                     throws Exception,
                            RemoteException
Attach a set of new class paths to the classloader.

Specified by:
attachClassPath in interface ClientUtilities
Parameters:
paths - an array of jar files and directories containing classes.
Throws:
Exception
RemoteException

S-PLUS Connect/Java v1.0

Copyright © 2000, 2002 Insightful Corporation
Warning: Classes not documented in the S-PLUS Programmer's Guide may change in future releases.