public class GbjObject extends GbjGciObject implements Cloneable
GbjObject defines methods for fundamental operations on server objects. Other methods for specific objects will be available on the server and may be accessed through the GbjObject instance with the sendMsg() methods.
GbjObject(long, GbjSession)
which was originally used to create a GbjObject with a particular oop, now generates a GS object representing that long as a GS SmallInteger object. Application developers *must* review their application code and replace these GbjObject() constructor calls with the method call:
GbjObject.withOop(long, GbjSession)
Constructor and Description |
---|
GbjObject()
Special constructor - should only be used for generating
a template object for java/GS class mapping operations
|
GbjObject(boolean b,
GbjSession s)
Construct a GS object representing a boolean for this session.
|
GbjObject(byte b,
GbjSession s)
Construct a GS object representing a byte for this session.
|
GbjObject(Calendar c,
GbjSession s)
Construct a GS object representing a calendar for this session.
|
GbjObject(char c,
GbjSession s)
Construct a GS object representing a character for this session.
|
GbjObject(Date d,
GbjSession s)
Construct a GS object representing a date for this session.
|
GbjObject(DoubleByteString dbStr,
GbjSession s)
Deprecated.
GBJ30 can now directly convert java strings to either
GS Strings or DoubleByteStrings as needed, so there is no need for
the java DoubleByteString wrapper.
|
GbjObject(double d,
GbjSession s)
Construct a GS object representing a double for this session.
|
GbjObject(float f,
GbjSession s)
Construct a GS object representing a float for this session.
|
GbjObject(int i,
GbjSession s)
Construct a GS object representing an int for this session.
|
GbjObject(long i,
GbjSession s)
Construct a GS object representing a long for this session.
|
GbjObject(Object o,
GbjSession s)
Construct a GS object representing an object for this session.
|
GbjObject(short i,
GbjSession s)
Construct a GS object representing a short for this session.
|
GbjObject(String str,
GbjSession s)
Construct a GS object representing a string for this session.
|
Modifier and Type | Method and Description |
---|---|
void |
assignToSegment(GbjObject segment)
Assign the server object, but not its contents, to the given segment.
|
String |
asString()
Convert the server object to a string
|
GbjObject |
at(int index)
Access one of the server object's anonymous instance variables.
|
Object |
atPut(int index,
Object value)
Update one of the server object's anonymous instance variables.
|
Object |
cachedValue()
This method simulates the behavior of the pre-GBJ30 field
cachedValue.
|
boolean |
canBeWritten()
Does the user have write access to the server object?
|
void |
changeToSegment(GbjObject segment)
Change the server object's segment and do the same with its contents.
|
boolean |
cluster()
Cluster the server object
|
int |
clusterBucket()
The cluster id that the server object was assigned during
the current clustering operation
|
boolean |
clusterDepthFirst()
Cluster the server object and its contents doing a depth-first
traversal.
|
StringBuffer |
dbStringBufferValue()
Return the cached Unicode string object held by the receiver as a new
StringBuffer object.
|
String |
dbStringValue()
Return the cached Unicode string object held by the receiver.
|
GbjObject |
deepCopy()
Return a deep copy of the server object.
|
void |
exclusiveLock()
Lock this database object.
|
GbjObject |
execute(String code)
Transmit a string holding GemStone Smalltalk code to the server and
compile and execute it, returning the result of execution.
|
static GbjObject |
fromInteger(int value,
GbjSession session)
Deprecated.
Use GbjObject(int, GbjSession) instead.
|
static GbjObject |
fromLong(long value,
GbjSession session)
Deprecated.
Use GbjObject(long, GbjSession) instead.
|
GbjSession |
getSession()
Return the GbjSession associated with this GbjObject
|
void |
immediateInvariant()
Make the server object invariant (immutable).
|
boolean |
in(GbjCollection collection)
Is the server object in the given remote collection?
|
boolean |
isBehavior()
Is the server object a class or metaclass object
|
boolean |
isCommitted()
Was the server object in existence before the current transaction?
|
boolean |
isConnected()
Is the server object has been written to disk or is committed?
|
boolean |
isInvariant()
Is the server object invariant (immutable)?
|
boolean |
isKindOf(GbjObject remoteClass)
Is the server object an instance of the given class or one of
its superclasses?
|
boolean |
isMemberOf(GbjObject remoteClass)
Is the server object an instance of the given class?
|
boolean |
isNil()
Is the server object a nil value?
|
boolean |
isWritten()
Is the server object new in this transaction or
been modified in this transaction
|
void |
moveToDisk()
Force the server object to disk if not already there
|
GbjObject[] |
namedInstanceVariables()
Return the named instance variables of this server object, in their
order of appearance (see GemStone Smalltalk
Behavior>>allInstVarNames.
|
void |
nilFields()
nil the instance variables of the server object
|
boolean |
notNil()
Is the receiver not a nil value?
Does not currently require a message send to the server.
|
int |
page()
The page number of the server object, or nil if a special or
unconnected object
|
Date |
pageCreationTime()
The page creation time of the server object
|
GbjObject |
perform(String message,
Object[] args,
int numArgs)
Send a message to a GemStone object and expect a server object in reply.
|
String |
printString()
Fetch a printable representation of the server object.
|
void |
readLock()
Lock this database object.
|
GbjObject |
remoteClass()
Fetch the server object's class.
|
GbjObject |
remoteClone()
Return a shallow copy of the server object.
|
GbjObject |
remoteCopy()
Return a shallow copy of the server object.
|
boolean |
remoteEquals(Object arg)
Return whether the server object and the argument have equal values.
|
boolean |
remoteEqualsIdentical(Object arg)
Return whether the server object is identical to the given object.
|
boolean |
remoteEqualsNoCase(Object arg)
Return whether the server object is equal to the given object with
case-insensitive comparison.
|
int |
remoteHash()
Return the server object's equality hash code.
|
int |
remoteIdentityHash()
Return the server object's identity hash code.
|
boolean |
remoteIsEquivalent(GbjObject otherObj)
Is the server object equivalent to the given object?
This test is oriented toward string comparisons and is not
generally useful for other types of objects.
|
int |
remoteSize()
Fetch the server object's size.
|
GbjObject |
remoteSpecies()
The server object's class for cloning operations
|
void |
removeLock()
Release any lock held on this object by this application.
|
boolean |
respondsTo(String selector)
Does the server object responds to the given message selector?
|
GbjObject |
segment()
Answer the segment that the server object is currently assigned to.
|
GbjObject |
sendMsg(String selector)
Send a unary message to a GemStone object and expect an Object reply.
|
GbjObject |
sendMsg(String selector,
Object arg)
Send a one-keyword or binary message to a GemStone object and
expect an Object reply.
|
GbjObject |
sendMsg(String keyword1,
Object arg1,
String keyword2,
Object arg2)
Send a two-keyword message to a GemStone object and expect
an Object reply.
|
GbjObject |
sendMsg(String keyword1,
Object arg1,
String keyword2,
Object arg2,
String keyword3,
Object arg3)
Send a three-keyword message to a GemStone object and expect
an Object reply.
|
GbjObject |
sendMsg(String keyword1,
Object arg1,
String keyword2,
Object arg2,
String keyword3,
Object arg3,
String keyword4,
Object arg4)
Send a four-keyword message to a GemStone object and expect
an Object reply.
|
GbjObject |
sendMsg(String keyword1,
Object arg1,
String keyword2,
Object arg2,
String keyword3,
Object arg3,
String keyword4,
Object arg4,
String keyword5,
Object arg5)
Send a five-keyword message to a GemStone object and expect
an Object reply.
|
void |
size(int newSize)
Alter the size of the server object's anonymous part.
|
StringBuffer |
stringBufferValue()
Return the cached String object held by the receiver as a new
StringBuffer.
|
static GbjObject |
withOop(long oopValue,
GbjSession s)
Return the GS object with this designated oop.
|
void |
writeLock()
Lock this database object.
|
bigIntegerValue, booleanValue, bytesValue, byteValue, calendarValue, charValue, dateValue, debugPrint, doubleValue, equals, floatValue, getByte, getBytes, getIndexedSize, getNamedObj, getNamedObjs, getNamedSize, getObj, getObjs, getObjs, getObjType, getTotalSize, getValType, hashCode, intValue, isString, longValue, named, putByte, putBytes, putBytes, putNamedObj, putNamedObjs, putNamedObjs, putObj, putObjs, putObjs, shortValue, stringValue, toString, withOop
clone, getOop, isSpecial
addObserver, countObservers, deleteObserver, deleteObservers, hasChanged, notifyObservers, notifyObservers
public GbjObject()
public GbjObject(boolean b, GbjSession s)
b
- booleans
- sessionpublic GbjObject(byte b, GbjSession s)
b
- bytes
- sessionpublic GbjObject(char c, GbjSession s)
c
- chars
- sessionpublic GbjObject(short i, GbjSession s)
i
- shorts
- sessionpublic GbjObject(int i, GbjSession s)
i
- ints
- sessionpublic GbjObject(long i, GbjSession s)
i
- longs
- sessionpublic GbjObject(float f, GbjSession s)
f
- floats
- sessionpublic GbjObject(double d, GbjSession s)
d
- doubles
- sessionpublic GbjObject(String str, GbjSession s)
str
- Strings
- sessionpublic GbjObject(Date d, GbjSession s)
d
- dates
- sessionpublic GbjObject(Calendar c, GbjSession s)
c
- calendars
- sessionpublic GbjObject(DoubleByteString dbStr, GbjSession s)
dbStr
- DoubleByteStrings
- sessionpublic GbjObject(Object o, GbjSession s)
o
- Objects
- sessionpublic static GbjObject withOop(long oopValue, GbjSession s)
oopValue
- Designated oops
- GbjSessionpublic static GbjObject fromInteger(int value, GbjSession session)
value
- Java intsession
- GbjSessionpublic static GbjObject fromLong(long value, GbjSession session)
value
- Java longsession
- GbjSessionpublic Object cachedValue()
public GbjSession getSession()
getSession
in class GbjGciObject
public StringBuffer stringBufferValue() throws ClassCastException
ClassCastException
- on receiver not holding a StringBufferpublic String dbStringValue() throws ClassCastException
ClassCastException
- on receiver not a DoubleByteStringpublic StringBuffer dbStringBufferValue() throws ClassCastException
ClassCastException
- on receiver not a DoubleByteStringpublic GbjObject execute(String code) throws GbjException
code
- GemStone Smalltalk source code to be compiled and executedGbjException
- thrown if there is a server exceptionpublic GbjObject perform(String message, Object[] args, int numArgs) throws GbjException
message
- a message selector that is dynamically looked up
on the serverargs
- an array of arguments that must be GbjObject
instances or wrappers of fundamental typesnumArgs
- the number of entries in args that are significantGbjException
- thrown if there is a server exceptionpublic GbjObject sendMsg(String selector) throws GbjException
selector
- the message selectorGbjException
- thrown if there is a server exceptionpublic GbjObject sendMsg(String selector, Object arg) throws GbjException
selector
- the message selectorarg
- the argument to the message.GbjException
- thrown if there is a server exceptionpublic GbjObject sendMsg(String keyword1, Object arg1, String keyword2, Object arg2) throws GbjException
keyword1
- the first keyword of the message selectorarg1
- the argument to the message for the first keyword.keyword2
- the second keyword of the message selectorarg2
- the argument to the message for the second keyword.GbjException
- thrown if there is a server exceptionpublic GbjObject sendMsg(String keyword1, Object arg1, String keyword2, Object arg2, String keyword3, Object arg3) throws GbjException
keyword1
- the first keyword of the message selectorarg1
- the argument to the message for the first keyword.keyword2
- the second keyword of the message selectorarg2
- the argument to the message for the second keyword.keyword3
- the third keyword of the message selectorarg3
- the argument to the message for the third keyword.GbjException
- thrown if there is a server exceptionpublic GbjObject sendMsg(String keyword1, Object arg1, String keyword2, Object arg2, String keyword3, Object arg3, String keyword4, Object arg4) throws GbjException
keyword1
- the first keyword of the message selectorarg1
- the argument to the message for the first keyword.keyword2
- the second keyword of the message selectorarg2
- the argument to the message for the second keyword.keyword3
- the third keyword of the message selectorarg3
- the argument to the message for the third keyword.keyword4
- the third keyword of the message selectorarg4
- the argument to the message for the third keyword.GbjException
- thrown if there is a server exceptionpublic GbjObject sendMsg(String keyword1, Object arg1, String keyword2, Object arg2, String keyword3, Object arg3, String keyword4, Object arg4, String keyword5, Object arg5) throws GbjException
keyword1
- the first keyword of the message selectorarg1
- the argument to the message for the first keyword.keyword2
- the second keyword of the message selectorarg2
- the argument to the message for the second keyword.keyword3
- the third keyword of the message selectorarg3
- the argument to the message for the third keyword.keyword4
- the third keyword of the message selectorarg4
- the argument to the message for the third keyword.keyword5
- the third keyword of the message selectorarg5
- the argument to the message for the third keyword.GbjException
- thrown if there is a server exceptionpublic GbjObject[] namedInstanceVariables() throws GbjException
GbjException
- thrown if the session is not connected or
there is a server exceptionpublic int remoteSize() throws GbjException
GbjException
- thrown if there is a server exceptionpublic GbjObject remoteClass() throws GbjException
GbjException
- thrown if there is a server exceptionpublic String printString() throws GbjException
GbjException
- thrown if there is a server exceptionpublic boolean remoteEquals(Object arg) throws GbjException
arg
- Argument to useGbjException
- thrown if there is a server exceptionpublic boolean remoteEqualsIdentical(Object arg)
arg
- Argument to useGbjException
- thrown if there is a server exceptionpublic boolean remoteEqualsNoCase(Object arg) throws GbjException
arg
- Argument to useGbjException
- thrown if there is a server exceptionpublic int remoteIdentityHash()
public int remoteHash() throws GbjException
GbjException
- thrown if there is a server exceptionpublic GbjObject remoteCopy() throws GbjException
GbjException
- thrown if there is a server exceptionpublic GbjObject remoteClone() throws GbjException
GbjException
- thrown if there is a server exceptionpublic GbjObject deepCopy() throws GbjException
GbjException
- thrown if there is a server exceptionpublic void immediateInvariant() throws GbjException
GbjException
- thrown if there is a server exceptionpublic boolean isInvariant() throws GbjException
GbjException
- thrown if there is a server exceptionpublic boolean in(GbjCollection collection) throws GbjException
collection
- Collection to useGbjException
- thrown if there is a server exceptionpublic boolean isKindOf(GbjObject remoteClass) throws GbjException
remoteClass
- Class to useGbjException
- thrown if there is a server exceptionpublic boolean isMemberOf(GbjObject remoteClass) throws GbjException
remoteClass
- Class to useGbjException
- thrown if there is a server exceptionpublic boolean canBeWritten() throws GbjException
GbjException
- thrown if there is a server exceptionpublic void changeToSegment(GbjObject segment) throws GbjException
segment
- Segment to useGbjException
- thrown if there is a server exceptionpublic void assignToSegment(GbjObject segment) throws GbjException
segment
- Segment to useGbjException
- thrown if there is a server exceptionpublic GbjObject at(int index) throws GbjException
index
- Index to useGbjException
- thrown if there is a server exceptionpublic Object atPut(int index, Object value) throws GbjException
index
- Index to usevalue
- Value to use for updateGbjException
- thrown if there is a server exceptionpublic GbjObject segment() throws GbjException
GbjException
- thrown if there is a server exceptionpublic void size(int newSize) throws GbjException
newSize
- Size to useGbjException
- thrown if there is a server exceptionpublic boolean remoteIsEquivalent(GbjObject otherObj) throws GbjException
otherObj
- given objectGbjException
- thrown if there is a server exceptionpublic boolean isNil()
isNil
in class GbjGciReport
public boolean notNil()
public boolean isCommitted() throws GbjException
GbjException
- thrown if there is a server exceptionpublic boolean isConnected() throws GbjException
GbjException
- thrown if there is a server exceptionpublic boolean isWritten() throws GbjException
GbjException
- thrown if there is a server exceptionpublic boolean isBehavior() throws GbjException
GbjException
- thrown if there is a server exceptionpublic String asString() throws GbjException
GbjException
- thrown if there is a server exceptionpublic int page() throws GbjException
GbjException
- thrown if there is a server exceptionpublic Date pageCreationTime() throws GbjException
GbjException
- thrown if there is a server exceptionpublic void moveToDisk() throws GbjException
GbjException
- thrown if there is a server exceptionpublic boolean cluster() throws GbjException
GbjException
- thrown if there is a server exceptionpublic boolean clusterDepthFirst() throws GbjException
GbjException
- thrown if there is a server exceptionpublic int clusterBucket() throws GbjException
GbjException
- thrown if there is a server exceptionpublic void nilFields() throws GbjException
GbjException
- thrown if there is a server exceptionpublic boolean respondsTo(String selector) throws GbjException
selector
- message selector to checkGbjException
- thrown if there is a server exceptionpublic GbjObject remoteSpecies() throws GbjException
GbjException
- thrown if there is a server exceptionpublic void readLock() throws GbjException
GbjException
- thrown if there is a server exceptionGbjGemStoneErrors.LOCK_ERR_OBJ_HAS_CHANGED
public void writeLock() throws GbjException
GbjException
- thrown if there is a server exceptionGbjGemStoneErrors.LOCK_ERR_OBJ_HAS_CHANGED
public void exclusiveLock() throws GbjException
GbjException
- thrown if there is a server exceptionGbjGemStoneErrors.LOCK_ERR_OBJ_HAS_CHANGED
public void removeLock() throws GbjException
GbjException
- thrown if there is a server exceptionGbjGemStoneErrors.LOCK_ERR_REMOVE