Interface JOP.persist.PersistMarshall
All Packages Class Hierarchy This Package Previous Next Index Home
Interface JOP.persist.PersistMarshall
- public interface PersistMarshall
- extends Object
- extends Persistable
A class implementation that supports this interface
can act as a custom marshaller for an object. This
is useful where the source to the object is not
available, where you don't want to modify the source or
where native methods are not suitable.
The PersistMarshall interface also allows an object
that naturally consists of an array of instances to
be marshalled and stored efficiently. Examples of this
include Hashtables, Vectors and Arrays.
A custom marshaller class must:
- Implement this interface
- Have an empty, public constructor
- Have a name the same as the class that it is marshalling
with thr suffix '_JOP'.
- Must appear in a package that is the same relationship to
JOP.persistmarshall as the original object is to CLASSPATH (eg the custom marshall
class for 'java.lang.String' is 'JOP.persistmarshall.java.lang.String_JOP')
-
canModify()
- Returns TRUE if the object can be modified by the custom
marshaller after it has been created and returned by
'getObject()'.
-
getObject()
- Invoked by the PersistManager to retrieve an object
that was created by the customer marshaller.
-
setObject(Object)
- Called by the PersistManager to initialise the
customer marshaller when reading an object where the
object already exists.
setObject
public abstract void setObject(Object o) throws Exception
- Called by the PersistManager to initialise the
customer marshaller when reading an object where the
object already exists.
The customer marshaller must reset and overwrite the
slot values of the existing object.
- Parameters:
- o - an existing object
getObject
public abstract Object getObject() throws Exception
- Invoked by the PersistManager to retrieve an object
that was created by the customer marshaller. Called
after initInput(). Can also be called after initInput(o)
in which case the original object should be returned.
canModify
public abstract boolean canModify()
- Returns TRUE if the object can be modified by the custom
marshaller after it has been created and returned by
'getObject()'. This method is used to choose the order in
which the 'streamIn()' method is invoked, ie before or after
'getObject()'.
If the object to be marhshalled can't be modified once created
AND the object references other objects then errors will occur. In
this case you should not use the custom marshall, but rather use
either Persistable or a native marshall.
All Packages Class Hierarchy This Package Previous Next Index Home