|
|||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||
java.lang.Object | +--org.omegahat.Interfaces.NativeInterface.ForeignReference
An abstract class that implements the basic functionality for converting a foreign reference (i.e. an object exported from R or S) to an appropriate Java object. This contains information identifying the R/S object and the target Java class. If the class does not exist (or is not likely to) the object can be initialized with the names of classes and interfaces which a dynamically generated class should extend and implement, respectively The foreign reference is then converted to an instance of this class so that it can be used appropriately. This new instance implements its methods via calls back to the foreign system and methods for the specified remote object. This is used as a transfer agent between the foreign system and Omegahat/Java. The foreign system creates an object of this class via C routines and then passes this object to the Omegahat system as an argument in a method call.
| Field Summary | |
protected OmegaInterfaceManager |
evaluator
|
protected java.lang.String |
name
The identifier of the object in the foreign system. |
| Constructor Summary | |
ForeignReference(ForeignReference ref)
|
|
ForeignReference(ForeignReference ref,
OmegaInterfaceManager evaluator)
|
|
ForeignReference(java.lang.String id)
|
|
ForeignReference(java.lang.String id,
OmegaInterfaceManager evaluator)
|
|
| Method Summary | |
java.lang.Object |
convertResult(java.lang.Object value,
java.lang.String type)
This is used to convert the object the foreign system (e.g R/S) gives us when we call a function in that system from a dynamically generated Java method (e.g. |
java.lang.Object |
eval(org.omegahat.Environment.Parser.Parse.List args,
java.lang.String methodName,
java.lang.String returnClass,
java.lang.String[] jsignature)
The method that performs the callback to the foreign system and arranges to resolve the reference, convert the arguments, invoke the appropriate method identified by methodName,
convert the return value, etc. |
OmegaInterfaceManager |
getEvaluator()
Accessor for evaluator field. |
java.lang.String |
getReferenceName()
Accessor for name field |
protected java.lang.Object |
processArg(java.lang.Object arg)
Convert an argument to an anonymous reference, or leave as is. |
protected java.lang.Object[] |
processArgs(org.omegahat.Environment.Parser.Parse.List args)
Iterates over the specified arguments and processes each one so it can be passed to the native method which will call the foreign system - R or S - converting non-convertable objects to anonymous references. |
protected int |
removeTemporaryAnonymousReferences(java.lang.Object[] args,
org.omegahat.Environment.Parser.Parse.List l)
Used to clean up any anonymous references created by processArgs()
before the call to the foreign system. |
OmegaInterfaceManager |
setEvaluator(OmegaInterfaceManager value)
Accessor for setting evaluator field |
java.lang.String |
setReferenceName(java.lang.String value)
Accessor for name field |
java.lang.String |
toString()
|
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
protected java.lang.String name
protected OmegaInterfaceManager evaluator
| Constructor Detail |
public ForeignReference(java.lang.String id)
public ForeignReference(java.lang.String id,
OmegaInterfaceManager evaluator)
public ForeignReference(ForeignReference ref)
public ForeignReference(ForeignReference ref,
OmegaInterfaceManager evaluator)
| Method Detail |
protected java.lang.Object[] processArgs(org.omegahat.Environment.Parser.Parse.List args)
throws java.lang.Exception
protected java.lang.Object processArg(java.lang.Object arg)
throws java.lang.Exception
protected int removeTemporaryAnonymousReferences(java.lang.Object[] args,
org.omegahat.Environment.Parser.Parse.List l)
processArgs()
before the call to the foreign system.
public java.lang.Object eval(org.omegahat.Environment.Parser.Parse.List args,
java.lang.String methodName,
java.lang.String returnClass,
java.lang.String[] jsignature)
throws java.lang.Exception
methodName,
convert the return value, etc.
This is currently implemented as a dummy version that prints its information.
It is left up to the sub-classes to perform the actual
call to the host system (R or S).eval in interface ForeignReferenceInt
public java.lang.Object convertResult(java.lang.Object value,
java.lang.String type)
throws java.lang.Throwable
eval(List, String, String, String[]).public java.lang.String getReferenceName()
name fieldgetReferenceName in interface ForeignReferenceIntpublic java.lang.String setReferenceName(java.lang.String value)
name fieldpublic OmegaInterfaceManager getEvaluator()
evaluator field.
This can now compute its evaluator if it has not been
previously set.org.omegahat.Environment.System.Globals#evaluator()public OmegaInterfaceManager setEvaluator(OmegaInterfaceManager value)
evaluator fieldpublic java.lang.String toString()
toString in class java.lang.Object
|
|||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||