org.iids.aos.systemservices.communicator
Class SystemServiceProxy

java.lang.Object
  extended by org.iids.aos.systemservices.communicator.SystemServiceProxy
All Implemented Interfaces:
java.lang.reflect.InvocationHandler

public class SystemServiceProxy
extends java.lang.Object
implements java.lang.reflect.InvocationHandler

Author:
michel@cs.vu.nl

Constructor Summary
SystemServiceProxy(Cookie cookie, Address addr)
           
 
Method Summary
 boolean closed()
           
protected  void finalize()
           
static java.lang.Throwable getDeclaredException(java.lang.Throwable t, java.lang.reflect.Method m)
          Traverse all causes from a given exception until a cause is found that is declared by the given method.
 java.lang.Class<?> getInterfaceClass()
           
 java.lang.Object invoke(java.lang.Object proxy, java.lang.reflect.Method method, java.lang.Object[] args)
          Invoke a method on a remote interface.
static boolean isDeclaredException(java.lang.Throwable t, java.lang.reflect.Method m)
           
 void setInterfaceClass(java.lang.Class<?> interfaceClass)
           
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

SystemServiceProxy

public SystemServiceProxy(Cookie cookie,
                          Address addr)
                   throws CommunicatorException
Throws:
CommunicatorException
Method Detail

finalize

protected void finalize()
                 throws java.lang.Throwable
Overrides:
finalize in class java.lang.Object
Throws:
java.lang.Throwable

closed

public boolean closed()

setInterfaceClass

public void setInterfaceClass(java.lang.Class<?> interfaceClass)

getInterfaceClass

public java.lang.Class<?> getInterfaceClass()

invoke

public java.lang.Object invoke(java.lang.Object proxy,
                               java.lang.reflect.Method method,
                               java.lang.Object[] args)
                        throws java.lang.Throwable
Invoke a method on a remote interface.

Specified by:
invoke in interface java.lang.reflect.InvocationHandler
Throws:
java.lang.Throwable

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

getDeclaredException

public static java.lang.Throwable getDeclaredException(java.lang.Throwable t,
                                                       java.lang.reflect.Method m)
Traverse all causes from a given exception until a cause is found that is declared by the given method. This is useful because exceptions from the SystemServiceHandler are usually not in the list with declared exceptions, but rather are an InvocationTargetException or similar instead.

Parameters:
t - The Throwable to process causes from.
m - The method that was called
Returns:
An exception that is part of the declared exceptions for the method m. If there is no cause that can be traced back to the given method then this method returns null.

isDeclaredException

public static boolean isDeclaredException(java.lang.Throwable t,
                                          java.lang.reflect.Method m)


Copyright © 2003, 2004 IIDS Group. All Rights Reserved.