public class Gateway extends Object
A Gateway manages various states: entryPoint, references to objects returned to a Python program, etc.
This class is not intended to be directly accessed by users.
Constructor and Description |
---|
Gateway(Object entryPoint) |
Gateway(Object entryPoint,
CallbackClient cbClient) |
Modifier and Type | Method and Description |
---|---|
void |
closeConnection()
Called when a connection is closed.
|
void |
deleteObject(String objectId) |
protected AtomicInteger |
getArgCounter() |
Map<String,Object> |
getBindings() |
CallbackClient |
getCallbackClient() |
JVMView |
getDefaultJVMView() |
Object |
getEntryPoint() |
protected String |
getNextObjectId() |
protected AtomicInteger |
getObjCounter() |
Object |
getObject(String objectId) |
protected Object |
getObjectFromId(String targetObjectId) |
ReflectionEngine |
getReflectionEngine() |
ReturnObject |
getReturnObject(Object object) |
ReturnObject |
invoke(String fqn,
List<Object> args)
Invokes a constructor and returned the constructed object.
|
ReturnObject |
invoke(String methodName,
String targetObjectId,
List<Object> args)
Invokes a method.
|
protected boolean |
isArray(Object object) |
protected boolean |
isDecimalObject(Object object) |
protected boolean |
isList(Object object) |
protected boolean |
isMap(Object object) |
protected boolean |
isPrimitiveObject(Object object) |
protected boolean |
isSet(Object object) |
boolean |
isStarted() |
String |
putNewObject(Object object)
Adds a new object to the gateway bindings and return the generated ID.
|
Object |
putObject(String id,
Object object) |
void |
setStarted(boolean isStarted) |
void |
shutdown()
Releases all objects that were referenced by this Gateway.
|
void |
startup() |
public Gateway(Object entryPoint)
public Gateway(Object entryPoint, CallbackClient cbClient)
public void closeConnection()
Called when a connection is closed.
public void deleteObject(String objectId)
protected AtomicInteger getArgCounter()
public Map<String,Object> getBindings()
public CallbackClient getCallbackClient()
public JVMView getDefaultJVMView()
public Object getEntryPoint()
protected String getNextObjectId()
protected AtomicInteger getObjCounter()
public Object getObject(String objectId)
objectId
- public ReflectionEngine getReflectionEngine()
public ReturnObject getReturnObject(Object object)
public ReturnObject invoke(String fqn, List<Object> args)
Invokes a constructor and returned the constructed object.
fqn
- The fully qualified name of the class.args
- public ReturnObject invoke(String methodName, String targetObjectId, List<Object> args)
Invokes a method.
methodName
- targetObjectId
- args
- protected boolean isArray(Object object)
protected boolean isDecimalObject(Object object)
protected boolean isList(Object object)
protected boolean isMap(Object object)
protected boolean isPrimitiveObject(Object object)
protected boolean isSet(Object object)
public boolean isStarted()
public String putNewObject(Object object)
Adds a new object to the gateway bindings and return the generated ID. Should NEVER be called by other classes except subclasses and testing classes.
object
- public void setStarted(boolean isStarted)
public void shutdown()
Releases all objects that were referenced by this Gateway.
public void startup()