S-PLUS Connect/Java v1.0

com.insightful.splus
Class ClientUtilitiesReceiver

java.lang.Object
  extended bycom.insightful.splus.ClientUtilitiesReceiver

public class ClientUtilitiesReceiver
extends Object

A server-side object providing access to a remote ClientUtilities object. Similar in use to com.insightful.gdevice.SGraphicsDeviceReceiver. Called from the S-PLUS engine to perform remote .JavaField() and .JavaMethod() calls.

See Also:
ClientUtilities, ClassUtilities, SGraphicsDeviceReceiver

Constructor Summary
ClientUtilitiesReceiver()
          Create a server-side object with a handle on a client-side ClientUtilities object.
 
Method Summary
 void attachClassPath(String classPath)
          Add a class loader for the specified class path to the class loader search list.
 void attachClassPath(String[] paths)
          Add a class loader for the specified set of class paths to the class loader search list.
 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 the value of a static field.
 Object invokeStaticMethod(String className, String methodName, Class[] parameterTypes, Object[] args)
          Invoke a static method.
 boolean methodExists(String className, String methodName, Class[] parameterTypes)
          Test whether a method exists.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ClientUtilitiesReceiver

public ClientUtilitiesReceiver()
                        throws RemoteException
Create a server-side object with a handle on a client-side ClientUtilities object. If not in client/server mode, the ClientUtilities object will be a local ClientUtilitiesImpl.

Method Detail

getStaticFieldValue

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

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.

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. Typically this is done by seeing whether the system ClassLoader can find the class.

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.

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.

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
Add a class loader for the specified class path to the class loader search list.

Parameters:
classPath - a jar file or a directory containing classes.
Throws:
Exception
RemoteException

attachClassPath

public void attachClassPath(String[] paths)
                     throws Exception,
                            RemoteException
Add a class loader for the specified set of class paths to the class loader search list.

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.