public class GbjGciSession extends Object
Much of the core functionality of the GBJ class GbjSession has been moved to this class, providing sufficient functionality for a "GBJ lite".
Modifier and Type | Field and Description |
---|---|
GbjGciObject |
gbjGciInterface
The server object representing the GbjGciInterface class.
|
boolean |
monitorChangedObjects
Flag used to control if changed objects should be monitored
|
Constructor and Description |
---|
GbjGciSession()
Create an instance of GbjGciSession
|
Modifier and Type | Method and Description |
---|---|
void |
checkErrors()
Check for asynchronous errors on this session
|
GbjGciObject |
execute(GbjGciObject execStrObj)
Execute a GS/S Smalltak String (represented as a GS Object)
|
GbjGciObject |
execute(String execStr)
Execute a GS/S Smalltalk String (represented as a java String)
|
byte[] |
getBytes(GbjGciObject obj,
long startIndex,
int numBytes)
Retrieve the designated bytes from this byte-based GS object.
|
GbjGciObject[] |
getNamedObjs(GbjGciObject obj,
long startIndex,
int numObjs)
Retrieve the designated GS objects from the named instvars for this GS object.
|
GbjGciObject[] |
getNamedObjs(GbjGciObject obj,
long startIndex,
int numObjs,
GbjGciObject[] objs)
Retrieve the designated GS objects from the named instvars for this GS object.
|
GbjGciObject[] |
getObjs(GbjGciObject obj,
long startIndex,
int numObjs)
Retrieve the designated GS objects from this indexable GS object
|
GbjGciObject[] |
getObjs(GbjGciObject obj,
long startIndex,
int numObjs,
GbjGciObject[] objs)
Retrieve the designated GS objects from this indexable GS object,
returning the results in the supplied array.
|
int |
getSessionId()
Return the session ID for this session
|
int |
hashCode()
Return a hash code value for this object
|
boolean |
isKindOf(GbjGciObject obj,
GbjGciObject cls)
Return true if this GS object is a member of the designated GS class
or one of it's subclasses.
|
boolean |
isLoggedIn()
Return true if this session is logged in
|
void |
login(String serverName,
String gemnetName,
String userName,
String password,
String hostUserName,
String hostPassword)
Login a GS session using this GbjGciSession.
|
void |
logout()
Logout the GS session associated with this GbjGciSession
|
void |
mapGsToJavaClass(GbjGciObject gsClass,
GbjGciObject javaExample)
Map instances of a GemStone class to a designated java class,
represented by an example instance.
|
void |
mapGsToJavaClass(String gsClassName,
GbjGciObject javaExample)
Map instances of a GemStone class to a designated java class,
represented by an example instance.
|
GbjGciObject |
objectNamed(String name)
Return the GS object with this name in the DB.
|
GbjGciObject |
objWithOop(long oopValue)
Return the GS object with the designed oop.
|
GbjGciObject |
perform(GbjGciObject receiver,
String selector,
GbjGciObject[] args,
int numArgs)
Execute a Smalltalk method against a designated receiver using these arguments.
|
void |
putBytes(GbjGciObject obj,
long startIndex,
int numBytes,
byte[] bytes)
Write the designated bytes to this byte-based GS object.
|
void |
putNamedObjs(GbjGciObject obj,
long startIndex,
int numObjs,
GbjGciObject[] objs)
Write the designated GS objects to the named instvars for this GS object.
|
void |
putObjs(GbjGciObject obj,
long startIndex,
int numObjs,
GbjGciObject[] objs)
Write the designated GS objects to this indexable GS object.
|
public boolean monitorChangedObjects
public GbjGciObject gbjGciInterface
public void mapGsToJavaClass(String gsClassName, GbjGciObject javaExample)
gsClassName
- Name of the GemStone classjavaExample
- An instance of the java classpublic void mapGsToJavaClass(GbjGciObject gsClass, GbjGciObject javaExample)
gsClass
- GS object of the GemStone classjavaExample
- An instance of the java classpublic void login(String serverName, String gemnetName, String userName, String password, String hostUserName, String hostPassword)
serverName
- The name of the GS stone process.gemnetName
- The name of the Gem Service. If null, the default "gemnetobject" is used.userName
- The GS username for the session.password
- The GS password for this username.hostUserName
- The OS username for this session (if needed).hostPassword
- The OS password for this OS username (if needed).GbjGciException
- thrown on any errorpublic void logout()
GbjGciException
- thrown on any errorpublic GbjGciObject execute(String execStr)
execStr
- The Smalltalk string to execute.GbjGciException
- thrown on any errorpublic GbjGciObject execute(GbjGciObject execStrObj)
execStrObj
- The Smalltalk string to execute.GbjGciException
- thrown on any errorpublic GbjGciObject perform(GbjGciObject receiver, String selector, GbjGciObject[] args, int numArgs)
receiver
- The GS object to execute this method against.selector
- The method to execute.args
- The list of arguments.numArgs
- The number of arguments in the list.GbjGciException
- thrown on any errorpublic byte[] getBytes(GbjGciObject obj, long startIndex, int numBytes)
obj
- The GS object to retrieve the bytes from.startIndex
- The starting index (1-based)numBytes
- The number of bytes to retrieveGbjGciException
- thrown on any errorpublic GbjGciObject[] getObjs(GbjGciObject obj, long startIndex, int numObjs)
obj
- The GS object to retrieve the GS objects from.startIndex
- The starting index (1-based)numObjs
- The number of objects to retrieveGbjGciException
- thrown on any errorpublic GbjGciObject[] getObjs(GbjGciObject obj, long startIndex, int numObjs, GbjGciObject[] objs)
obj
- The GS object to retrieve the GS objects from.startIndex
- The starting index (1-based)numObjs
- The number of objects to retrieveobjs
- An array of GS objects to return the resultsGbjGciException
- thrown on any errorpublic GbjGciObject[] getNamedObjs(GbjGciObject obj, long startIndex, int numObjs)
obj
- The GS object to retrieve the GS objects from.startIndex
- The starting index (1-based)numObjs
- The number of objects to retrieveGbjGciException
- thrown on any errorpublic GbjGciObject[] getNamedObjs(GbjGciObject obj, long startIndex, int numObjs, GbjGciObject[] objs)
obj
- The GS object to retrieve the GS objects from.startIndex
- The starting index (1-based)numObjs
- The number of objects to retrieveobjs
- An array of GS objects to return the resultsGbjGciException
- thrown on any errorpublic void putBytes(GbjGciObject obj, long startIndex, int numBytes, byte[] bytes)
obj
- The GS object to write the bytes to.startIndex
- The starting index (1-based)numBytes
- The number of bytes to writebytes
- The bytes to write outGbjGciException
- thrown on any errorpublic void putObjs(GbjGciObject obj, long startIndex, int numObjs, GbjGciObject[] objs)
obj
- The GS object to write the GS objects to.startIndex
- The starting index (1-based)numObjs
- The number of objects to writeobjs
- An array of GS objects to write outGbjGciException
- thrown on any errorpublic void putNamedObjs(GbjGciObject obj, long startIndex, int numObjs, GbjGciObject[] objs)
obj
- The GS object to write the GS objects to.startIndex
- The starting index (1-based)numObjs
- The number of objects to writeobjs
- An array of GS objects to write outGbjGciException
- thrown on any errorpublic GbjGciObject objWithOop(long oopValue)
oopValue
- The oop to search for.GbjGciException
- thrown on any errorpublic boolean isKindOf(GbjGciObject obj, GbjGciObject cls)
obj
- The GS object to check.cls
- The GS class to check against.GbjGciException
- thrown on any errorpublic GbjGciObject objectNamed(String name)
name
- Stringpublic boolean isLoggedIn()
public int getSessionId()
public int hashCode()
public void checkErrors()