public class GbjObject extends GbjGciObject implements java.lang.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.
Constructor and Description |
---|
GbjObject()
Special constructor - should only be used for generating
a template object for java/GS class mapping operations
|
GbjObject(BigDecimalFloat df,
GbjSession s)
Construct a GS object representing a BigDecimalFloat for this session.
|
GbjObject(java.math.BigDecimal d,
GbjSession s)
Construct a GS object representing a BigDecimal for this session.
|
GbjObject(org.apache.commons.math3.fraction.BigFraction f,
GbjSession s)
Construct a GS object representing a BigFraction for this session.
|
GbjObject(java.math.BigInteger i,
GbjSession s)
Construct a GS object representing a BigInteger for this session.
|
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(char c,
GbjSession s)
Construct a GS object representing a character for this session.
|
GbjObject(java.util.Date d,
GbjSession s)
Construct a GS object representing a Date for this session.
|
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(GbjSession s) |
GbjObject(java.time.Instant i,
GbjSession s)
Construct a GS object representing an Instant for this session.
|
GbjObject(int i,
GbjSession s)
Construct a GS object representing an int for this session.
|
GbjObject(java.time.LocalDate d,
GbjSession s)
Construct a GS object representing a LocalDate for this session.
|
GbjObject(java.time.LocalDateTime ldt,
GbjSession s)
Construct a GS object representing a LocalDateTime for this session.
|
GbjObject(java.time.LocalTime t,
GbjSession s)
Construct a GS object representing a LocalTime for this session.
|
GbjObject(long i,
GbjSession s)
Construct a GS object representing a long for this session.
|
GbjObject(java.lang.Object o,
GbjSession s)
Construct a GS object representing an object for this session.
|
GbjObject(java.time.OffsetDateTime odt,
GbjSession s)
Construct a GS object representing a OffsetDateTime for this session.
|
GbjObject(short i,
GbjSession s)
Construct a GS object representing a short for this session.
|
GbjObject(java.lang.String str,
GbjSession s)
Construct a GS object representing a string for this session.
|
GbjObject(java.time.ZonedDateTime zdt,
GbjSession s)
Construct a GS object representing a ZonedDateTime 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.
|
java.lang.String |
asString()
Convert the server object to a string
|
GbjObject |
at(int index)
Access one of the server object's anonymous instance variables.
|
java.lang.Object |
atPut(int index,
java.lang.Object value)
Update one of the server object's anonymous instance variables.
|
java.lang.Object |
cachedValue()
This method returns the cachedValue if the receiver represents a server object
for which there is a direct mapping from the Server class to a Java class .
|
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.
|
java.lang.StringBuffer |
dbStringBufferValue()
Deprecated.
Use stringBufferValue()
|
java.lang.String |
dbStringValue()
Deprecated.
Use stringValue() inherited from GbjGciObject
|
GbjObject |
deepCopy()
Return a deep copy of the server object.
|
void |
exclusiveLock()
Lock this database object.
|
GbjObject |
execute(java.lang.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()
Deprecated.
no longer supported by the server
|
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 |
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
|
java.util.Date |
pageCreationTime()
The page creation time of the server object
|
GbjObject |
perform(java.lang.String message) |
GbjObject |
perform(java.lang.String message,
java.lang.Object[] args,
int numArgs)
Send a message to a GemStone object and expect a server object in reply.
|
java.lang.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(java.lang.Object arg)
Return whether the server object and the argument have equal values.
|
boolean |
remoteEqualsIdentical(java.lang.Object arg)
Return whether the server object is identical to the given object.
|
boolean |
remoteEqualsNoCase(java.lang.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(java.lang.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(java.lang.String selector)
Send a unary message to a GemStone object and expect an Object reply.
|
GbjObject |
sendMsg(java.lang.String selector,
java.lang.Object arg)
Send a one-keyword or binary message to a GemStone object and
expect an Object reply.
|
GbjObject |
sendMsg(java.lang.String keyword1,
java.lang.Object arg1,
java.lang.String keyword2,
java.lang.Object arg2)
Send a two-keyword message to a GemStone object and expect
an Object reply.
|
GbjObject |
sendMsg(java.lang.String keyword1,
java.lang.Object arg1,
java.lang.String keyword2,
java.lang.Object arg2,
java.lang.String keyword3,
java.lang.Object arg3)
Send a three-keyword message to a GemStone object and expect
an Object reply.
|
GbjObject |
sendMsg(java.lang.String keyword1,
java.lang.Object arg1,
java.lang.String keyword2,
java.lang.Object arg2,
java.lang.String keyword3,
java.lang.Object arg3,
java.lang.String keyword4,
java.lang.Object arg4)
Send a four-keyword message to a GemStone object and expect
an Object reply.
|
GbjObject |
sendMsg(java.lang.String keyword1,
java.lang.Object arg1,
java.lang.String keyword2,
java.lang.Object arg2,
java.lang.String keyword3,
java.lang.Object arg3,
java.lang.String keyword4,
java.lang.Object arg4,
java.lang.String keyword5,
java.lang.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.
|
java.lang.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.
|
bigDecimalFloatValue, bigDecimalValue, bigFractionValue, bigIntegerValue, booleanValue, bytesValue, byteValue, charValue, dateValue, debugPrint, doubleValue, equals, floatValue, getByte, getBytes, getIndexedSize, getNamedObj, getNamedObjs, getNamedSize, getObj, getObjs, getObjs, getObjType, getTotalSize, getValType, hashCode, instantValue, intValue, isString, localDateTimeValue, localDateValue, localTimeValue, longValue, named, offsetDateTimeValue, putByte, putBytes, putBytes, putNamedObj, putNamedObjs, putNamedObjs, putObj, putObjs, putObjs, shortValue, stringValue_, stringValue, toString, withOop, zonedDateTimeValue
clone, getOop, getValTypeString, isNil, isSpecial, javaClass, javaValue
public GbjObject()
public GbjObject(GbjSession s)
public GbjObject(boolean b, GbjSession s)
b
- booleans
- sessionpublic GbjObject(char c, GbjSession s)
c
- chars
- sessionpublic GbjObject(byte b, GbjSession s)
b
- bytes
- 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(java.math.BigInteger i, GbjSession s)
i
- BigIntegers
- sessionpublic GbjObject(float f, GbjSession s)
f
- floats
- sessionpublic GbjObject(double d, GbjSession s)
d
- doubles
- sessionpublic GbjObject(java.math.BigDecimal d, GbjSession s)
d
- doubles
- sessionpublic GbjObject(BigDecimalFloat df, GbjSession s)
df
- BigDecimalFloats
- sessionpublic GbjObject(org.apache.commons.math3.fraction.BigFraction f, GbjSession s)
f
- BigFractions
- sessionpublic GbjObject(java.lang.String str, GbjSession s)
str
- Strings
- sessionpublic GbjObject(java.time.LocalDate d, GbjSession s)
d
- LocalDates
- sessionpublic GbjObject(java.time.LocalTime t, GbjSession s)
t
- LocalTimes
- sessionpublic GbjObject(java.time.LocalDateTime ldt, GbjSession s)
ldt
- LocalDateTimes
- sessionpublic GbjObject(java.time.ZonedDateTime zdt, GbjSession s)
zdt
- LocalTimes
- sessionpublic GbjObject(java.time.OffsetDateTime odt, GbjSession s)
odt
- OffsetDateTimes
- sessionpublic GbjObject(java.util.Date d, GbjSession s)
d
- Dates
- sessionpublic GbjObject(java.time.Instant i, GbjSession s)
i
- Instants
- sessionpublic GbjObject(java.lang.Object o, GbjSession s)
o
- Objects
- sessionpublic static GbjObject withOop(long oopValue, GbjSession s)
oopValue
- Designated oops
- GbjSession@Deprecated public static GbjObject fromInteger(int value, GbjSession session)
value
- Java intsession
- GbjSession@Deprecated public static GbjObject fromLong(long value, GbjSession session)
value
- Java longsession
- GbjSessionpublic java.lang.Object cachedValue()
public GbjSession getSession()
getSession
in class GbjGciObject
public java.lang.StringBuffer stringBufferValue() throws java.lang.ClassCastException
java.lang.ClassCastException
- on receiver not holding a StringBufferpublic java.lang.String dbStringValue() throws java.lang.ClassCastException
java.lang.ClassCastException
- on receiver not a DoubleByteStringpublic java.lang.StringBuffer dbStringBufferValue() throws java.lang.ClassCastException
java.lang.ClassCastException
- on receiver not a DoubleByteStringpublic GbjObject execute(java.lang.String code) throws GbjException
code
- GemStone Smalltalk source code to be compiled and executedGbjException
- thrown if there is a server exceptionpublic GbjObject perform(java.lang.String message, java.lang.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 perform(java.lang.String message) throws GbjException
GbjException
public GbjObject sendMsg(java.lang.String selector) throws GbjException
selector
- the message selectorGbjException
- thrown if there is a server exceptionpublic GbjObject sendMsg(java.lang.String selector, java.lang.Object arg) throws GbjException
selector
- the message selectorarg
- the argument to the message.GbjException
- thrown if there is a server exceptionpublic GbjObject sendMsg(java.lang.String keyword1, java.lang.Object arg1, java.lang.String keyword2, java.lang.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(java.lang.String keyword1, java.lang.Object arg1, java.lang.String keyword2, java.lang.Object arg2, java.lang.String keyword3, java.lang.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(java.lang.String keyword1, java.lang.Object arg1, java.lang.String keyword2, java.lang.Object arg2, java.lang.String keyword3, java.lang.Object arg3, java.lang.String keyword4, java.lang.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(java.lang.String keyword1, java.lang.Object arg1, java.lang.String keyword2, java.lang.Object arg2, java.lang.String keyword3, java.lang.Object arg3, java.lang.String keyword4, java.lang.Object arg4, java.lang.String keyword5, java.lang.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 java.lang.String printString() throws GbjException
GbjException
- thrown if there is a server exceptionpublic boolean remoteEquals(java.lang.Object arg) throws GbjException
arg
- Argument to useGbjException
- thrown if there is a server exceptionpublic boolean remoteEqualsIdentical(java.lang.Object arg)
arg
- Argument to useGbjException
- thrown if there is a server exceptionpublic boolean remoteEqualsNoCase(java.lang.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 java.lang.Object atPut(int index, java.lang.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 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 java.lang.String asString() throws GbjException
GbjException
- thrown if there is a server exceptionpublic int page() throws GbjException
GbjException
- thrown if there is a server exceptionpublic java.util.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(java.lang.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