Further wired up the client side of the distributed object system. Removed
the facilities for fetching (without subscribing to) an object. This is done extremely rarely and the user might as well just subscribe and immediately unsubscribe because the dichotomy between fetching and subscribing just served to overly complicate the internals for no good reason. git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@30 542714f4-19e9-0310-aa3c-eee0fc999fb1
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
//
|
||||
// $Id: EventNotification.java,v 1.5 2001/06/02 01:30:37 mdb Exp $
|
||||
// $Id: EventNotification.java,v 1.6 2001/06/09 23:39:04 mdb Exp $
|
||||
|
||||
package com.threerings.cocktail.cher.net;
|
||||
|
||||
@@ -35,6 +35,11 @@ public class EventNotification extends DownstreamMessage
|
||||
return TYPE;
|
||||
}
|
||||
|
||||
public DEvent getEvent ()
|
||||
{
|
||||
return _event;
|
||||
}
|
||||
|
||||
public void writeTo (DataOutputStream out)
|
||||
throws IOException
|
||||
{
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
//
|
||||
// $Id: FailureResponse.java,v 1.3 2001/06/02 01:30:37 mdb Exp $
|
||||
// $Id: FailureResponse.java,v 1.4 2001/06/09 23:39:04 mdb Exp $
|
||||
|
||||
package com.threerings.cocktail.cher.net;
|
||||
|
||||
@@ -10,7 +10,7 @@ import java.io.DataOutputStream;
|
||||
public class FailureResponse extends DownstreamMessage
|
||||
{
|
||||
/** The code for a logoff notification. */
|
||||
public static final short TYPE = TYPE_BASE + 3;
|
||||
public static final short TYPE = TYPE_BASE + 4;
|
||||
|
||||
/**
|
||||
* Zero argument constructor used when unserializing an instance.
|
||||
|
||||
@@ -1,63 +0,0 @@
|
||||
//
|
||||
// $Id: FetchRequest.java,v 1.3 2001/06/05 22:44:31 mdb Exp $
|
||||
|
||||
package com.threerings.cocktail.cher.net;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.io.DataInputStream;
|
||||
import java.io.DataOutputStream;
|
||||
|
||||
public class FetchRequest extends UpstreamMessage
|
||||
{
|
||||
/** The code for an object fetch request. */
|
||||
public static final short TYPE = TYPE_BASE + 2;
|
||||
|
||||
/**
|
||||
* Zero argument constructor used when unserializing an instance.
|
||||
*/
|
||||
public FetchRequest ()
|
||||
{
|
||||
super();
|
||||
}
|
||||
|
||||
/**
|
||||
* Constructs a fetch request for the distributed object with the
|
||||
* specified object id.
|
||||
*/
|
||||
public FetchRequest (int oid)
|
||||
{
|
||||
_oid = oid;
|
||||
}
|
||||
|
||||
public short getType ()
|
||||
{
|
||||
return TYPE;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the oid of the object we desire to fetch.
|
||||
*/
|
||||
public int getOid ()
|
||||
{
|
||||
return _oid;
|
||||
}
|
||||
|
||||
public void writeTo (DataOutputStream out)
|
||||
throws IOException
|
||||
{
|
||||
super.writeTo(out);
|
||||
out.writeInt(_oid);
|
||||
}
|
||||
|
||||
public void readFrom (DataInputStream in)
|
||||
throws IOException
|
||||
{
|
||||
super.readFrom(in);
|
||||
_oid = in.readInt();
|
||||
}
|
||||
|
||||
/**
|
||||
* The object id of the distributed object which we are fetching.
|
||||
*/
|
||||
protected int _oid;
|
||||
}
|
||||
@@ -1,5 +1,5 @@
|
||||
//
|
||||
// $Id: ObjectResponse.java,v 1.6 2001/06/02 01:30:37 mdb Exp $
|
||||
// $Id: ObjectResponse.java,v 1.7 2001/06/09 23:39:04 mdb Exp $
|
||||
|
||||
package com.threerings.cocktail.cher.net;
|
||||
|
||||
@@ -12,7 +12,7 @@ import com.threerings.cocktail.cher.dobj.net.DObjectFactory;
|
||||
|
||||
public class ObjectResponse extends DownstreamMessage
|
||||
{
|
||||
/** The code for an event notification. */
|
||||
/** The code for an object repsonse. */
|
||||
public static final short TYPE = TYPE_BASE + 2;
|
||||
|
||||
/**
|
||||
@@ -24,7 +24,7 @@ public class ObjectResponse extends DownstreamMessage
|
||||
}
|
||||
|
||||
/**
|
||||
* Constructs an object response with supplied distributed object.
|
||||
* Constructs an object response with the supplied distributed object.
|
||||
*/
|
||||
public ObjectResponse (DObject dobj)
|
||||
{
|
||||
@@ -36,6 +36,11 @@ public class ObjectResponse extends DownstreamMessage
|
||||
return TYPE;
|
||||
}
|
||||
|
||||
public DObject getObject ()
|
||||
{
|
||||
return _dobj;
|
||||
}
|
||||
|
||||
public void writeTo (DataOutputStream out)
|
||||
throws IOException
|
||||
{
|
||||
|
||||
@@ -1,12 +1,12 @@
|
||||
//
|
||||
// $Id: PongResponse.java,v 1.3 2001/06/05 21:53:45 mdb Exp $
|
||||
// $Id: PongResponse.java,v 1.4 2001/06/09 23:39:04 mdb Exp $
|
||||
|
||||
package com.threerings.cocktail.cher.net;
|
||||
|
||||
public class PongResponse extends DownstreamMessage
|
||||
{
|
||||
/** The code for a pong response. */
|
||||
public static final short TYPE = TYPE_BASE + 4;
|
||||
public static final short TYPE = TYPE_BASE + 5;
|
||||
|
||||
/**
|
||||
* Zero argument constructor used when unserializing an instance.
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
//
|
||||
// $Id: Registry.java,v 1.4 2001/06/05 21:53:45 mdb Exp $
|
||||
// $Id: Registry.java,v 1.5 2001/06/09 23:39:04 mdb Exp $
|
||||
|
||||
package com.threerings.cocktail.cher.net;
|
||||
|
||||
@@ -25,8 +25,6 @@ public class Registry
|
||||
AuthRequest.class);
|
||||
TypedObjectFactory.registerClass(SubscribeRequest.TYPE,
|
||||
SubscribeRequest.class);
|
||||
TypedObjectFactory.registerClass(FetchRequest.TYPE,
|
||||
FetchRequest.class);
|
||||
TypedObjectFactory.registerClass(UnsubscribeRequest.TYPE,
|
||||
UnsubscribeRequest.class);
|
||||
TypedObjectFactory.registerClass(ForwardEventRequest.TYPE,
|
||||
|
||||
Reference in New Issue
Block a user