dermi
Class DermiProxy

java.lang.Object
  extended by dermi.EventServer
      extended by dermi.DermiProxy
All Implemented Interfaces:
RemoteEventListener, java.io.Serializable, java.lang.reflect.InvocationHandler

public class DermiProxy
extends EventServer
implements java.lang.reflect.InvocationHandler, RemoteEventListener

This class is the Dynamic Proxy that replaces all static stubs that had to be pregenerated in previous versions of Dermi using the 'dermic' tool

Version:
1.2
Author:
Carles Pairot
See Also:
Serialized Form

Field Summary
protected  java.util.logging.Logger logger
           
 
Fields inherited from class dermi.EventServer
className, classStore, conn, eref, uid
 
Method Summary
 java.util.Hashtable anycallEventArrived(java.util.Hashtable evt)
          Standard upcall for anycall arrived events
 void close()
          Closes the stub
 ERemote copy()
          Returns a stub copy of this class
 boolean equals(java.lang.Object objet)
          Compares this object with another
 void eventArrived(java.util.Hashtable evt)
          Method invoked each time the proxy receives an event
 void init()
          Initializes the stub
 java.lang.Object invoke(java.lang.Object proxy, java.lang.reflect.Method m, java.lang.Object[] arguments)
          This method is called by the Proxy before invoking the interface method
static java.lang.Object newInstance(java.lang.Object obj, java.util.Properties props)
          This method returns a new instance of a DermiProxy
static java.lang.Object newInstance(java.lang.Object obj, java.util.Properties props, java.lang.String s)
          This method returns a new instance of a DermiProxy
protected  void start(java.util.Properties env)
          Internal method for initializing proxy's internal object
protected  void start(java.util.Properties env, java.lang.String stub)
          Constructor: entry point to the stub class
 
Methods inherited from class dermi.EventServer
dispatchDirectEvent, dispatchDirectEvent, dispatchEvent, dispatchEvent, dispatchEvent, getBytes, getClassStore, getERef, getUID, writeERef
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

logger

protected transient java.util.logging.Logger logger
Method Detail

newInstance

public static java.lang.Object newInstance(java.lang.Object obj,
                                           java.util.Properties props)
This method returns a new instance of a DermiProxy

Parameters:
obj - Object Object to be intercepted by the proxy
props - Properties Object's initialization properties
Returns:
Object Proxy instance

newInstance

public static java.lang.Object newInstance(java.lang.Object obj,
                                           java.util.Properties props,
                                           java.lang.String s)
This method returns a new instance of a DermiProxy

Parameters:
obj - Object Object to be intercepted by the proxy
props - Properties Object's initialization properties
Returns:
Object Proxy instance

start

protected void start(java.util.Properties env)
Internal method for initializing proxy's internal object

Overrides:
start in class EventServer
Parameters:
env - Properties Object initialization properties

start

protected void start(java.util.Properties env,
                     java.lang.String stub)
Constructor: entry point to the stub class

Parameters:
env - Properties Environment properties
stub - String Stub name
Throws:
RemoteException - If something goes wrong ;-)

invoke

public java.lang.Object invoke(java.lang.Object proxy,
                               java.lang.reflect.Method m,
                               java.lang.Object[] arguments)
                        throws java.lang.Throwable
This method is called by the Proxy before invoking the interface method

Specified by:
invoke in interface java.lang.reflect.InvocationHandler
Parameters:
proxy - Object Proxy class object
m - Method Method to invoke
arguments - Object[] Arguments packed in an object array
Returns:
Object Invocation result
Throws:
java.lang.Throwable

eventArrived

public void eventArrived(java.util.Hashtable evt)
Method invoked each time the proxy receives an event

Specified by:
eventArrived in interface RemoteEventListener
Parameters:
evt - Hashtable Information about the event received

anycallEventArrived

public java.util.Hashtable anycallEventArrived(java.util.Hashtable evt)
                                        throws UnmatchedAnycallMethodException
Description copied from interface: RemoteEventListener
Standard upcall for anycall arrived events

Specified by:
anycallEventArrived in interface RemoteEventListener
Parameters:
evt - Hashtable
Returns:
Hashtable
Throws:
UnmatchedAnycallMethodException

close

public void close()
           throws RemoteException
Closes the stub

Throws:
RemoteException - If something goes wrong ;-)

init

public void init()
          throws RemoteException
Initializes the stub

Throws:
RemoteException - If something goes wrong ;-)

equals

public boolean equals(java.lang.Object objet)
Compares this object with another

Overrides:
equals in class java.lang.Object
Parameters:
obj - Object The other object
Returns:
boolean true if both equal

copy

public ERemote copy()
             throws RemoteException
Returns a stub copy of this class

Returns:
ERemote The returned stub
Throws:
RemoteException - If something goes wrong ;-)