org.openware.jdf
Class JDFObject

java.lang.Object
  |
  +--org.openware.jdf.JDFObject
All Implemented Interfaces:
IMovable, IProxy, JDFServerConstants

public class JDFObject
extends java.lang.Object
implements IProxy, IMovable, JDFServerConstants

Base class for all JDF remote objects. Each object that gets "remotified" will subclass this, via the proxy that gets created in the JDFClassLoader class, where the proxy object is created on the fly.

Author:
Vincent Sheffer

Field Summary
protected  Location location_
           
protected  java.lang.String oid_
           
protected  IProtocolHandler phandler_
           
 
Fields inherited from interface org.openware.jdf.server.JDFServerConstants
CREATE_METHOD_INDEX, FORWARD_METHOD_INDEX, JDFSERVER_METHOD_INDEX_BASE, MOVETO_METHOD_INDEX, SERVER_OID, SET_TIMEOUT_METHOD_INDEX
 
Constructor Summary
JDFObject()
           
 
Method Summary
protected  JDFReply callRemoteMethod(JDFRequest req)
           
 void checkForException(JDFReply reply)
           
 void checkReturn(JDFReply reply)
          Check for JDF related stuff and exceptions coming back from JDF server.
protected  void finalize()
          Need to decrement the reference count for this remote object proxy.
 Location getHome()
          Get the home location for the remote object.
 Location getLocation()
          Get the Location object for this remote object.
 java.lang.String getOID()
          Get the object ID.
 void init(Location loc, IProtocolHandler phandler, java.lang.String oid)
           
 void moveTo(java.lang.String newurl)
          Move the remote object to a new location given by the url String.
 void setLastAccess(long time)
           
 void setLocation(Location location)
          Set the location of the remote object.
 void setTimeout(long timeout)
          Set the timeout for the remote object.
 
Methods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

location_

protected Location location_

oid_

protected java.lang.String oid_

phandler_

protected IProtocolHandler phandler_
Constructor Detail

JDFObject

public JDFObject()
Method Detail

init

public void init(Location loc,
                 IProtocolHandler phandler,
                 java.lang.String oid)

checkReturn

public void checkReturn(JDFReply reply)
                 throws java.lang.Throwable
Check for JDF related stuff and exceptions coming back from JDF server. If an exception is returned from the JDF server than throw it.

moveTo

public void moveTo(java.lang.String newurl)
            throws JDFException
Move the remote object to a new location given by the url String.

NOTE: For the move to successful the remote object must be Serializable.

Specified by:
moveTo in interface IMovable

setTimeout

public void setTimeout(long timeout)
                throws JDFException
Set the timeout for the remote object.
Specified by:
setTimeout in interface IProxy
Parameters:
timeout - The timeout in seconds. If the remote object has not been accessed in the number of seconds specified here it is removed.

checkForException

public void checkForException(JDFReply reply)
                       throws java.lang.Throwable

callRemoteMethod

protected JDFReply callRemoteMethod(JDFRequest req)
                             throws JDFException

getOID

public java.lang.String getOID()
Get the object ID.
Specified by:
getOID in interface IProxy

getLocation

public Location getLocation()
Get the Location object for this remote object.
Specified by:
getLocation in interface IProxy

setLocation

public void setLocation(Location location)
Set the location of the remote object.

getHome

public Location getHome()
Get the home location for the remote object. The home location is where the object was originally create.
Specified by:
getHome in interface IProxy

setLastAccess

public void setLastAccess(long time)

finalize

protected void finalize()
                 throws java.lang.Throwable
Need to decrement the reference count for this remote object proxy. Seems okay to do this in the finalize method since we don't care exactly when it is decremented, just as long as it is sometime.
Overrides:
finalize in class java.lang.Object


Copyright © 2000, 2001 Openware, Spin Software. All Rights Reserved.