public class ActiveXInvocationProxy extends InvocationProxy
This class that lets event handlers receive events with all java objects as parameters. The standard Jacob event methods all accept an array of Variant objects. When using this class, you can set up your event methods as regular java methods with the correct number of parameters of the correct java type. This does NOT work for any event that wishes to accept a call back and modify the calling parameters to tell windows what to do. An example is when an event lets the receiver cancel the action by setting a boolean flag to false. The java objects cannot be modified and their values will not be passed back into the originating Variants even if they could be modified.
This class acts as a proxy between the windows event callback mechanism and
the Java classes that are looking for events. It assumes that all of the Java
classes that are looking for events implement methods with the same names as
the windows events and that the implemented methods native java objects of
the type and order that match the windows documentation. The methods can
return void or a Variant that will be returned to the calling layer. All
Event methods that will be recognized by InvocationProxyAllEvents have the
signature
void eventMethodName(Object,Object...)
or
Object eventMethodName(Object,Object...)
mTargetObject
Constructor and Description |
---|
ActiveXInvocationProxy() |
Modifier and Type | Method and Description |
---|---|
Variant |
invoke(String methodName,
Variant[] targetParameters)
The method actually invoked by EventProxy.cpp.
|
getVariant, setTarget
public Variant invoke(String methodName, Variant[] targetParameters)
InvocationProxy
Subclasses that override this should make sure mTargetObject is not null before processing.
invoke
in class InvocationProxy
methodName
- name of method in mTargetObject we will invoketargetParameters
- Variant[] that is the single parameter to the methodhttp://jacob-project.sourceforge.net