Created a test service and provider and sorted out further details.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@71 542714f4-19e9-0310-aa3c-eee0fc999fb1
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
//
|
||||
// $Id: Client.java,v 1.8 2001/07/19 07:09:16 mdb Exp $
|
||||
// $Id: Client.java,v 1.9 2001/07/19 07:48:25 mdb Exp $
|
||||
|
||||
package com.threerings.cocktail.cher.client;
|
||||
|
||||
@@ -253,6 +253,9 @@ public class Client
|
||||
|
||||
// create our invocation manager
|
||||
_invmgr = new InvocationManager(this, data.invOid);
|
||||
|
||||
// let the client know that logon has now fully succeeded
|
||||
notifyObservers(Client.CLIENT_DID_LOGON, null);
|
||||
}
|
||||
|
||||
protected Credentials _creds;
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
//
|
||||
// $Id: Communicator.java,v 1.9 2001/07/19 07:09:16 mdb Exp $
|
||||
// $Id: Communicator.java,v 1.10 2001/07/19 07:48:25 mdb Exp $
|
||||
|
||||
package com.threerings.cocktail.cher.client;
|
||||
|
||||
@@ -163,8 +163,8 @@ public class Communicator
|
||||
_writer = new Writer();
|
||||
_writer.start();
|
||||
|
||||
// let the client know that logon succeeded
|
||||
_client.notifyObservers(Client.CLIENT_DID_LOGON, null);
|
||||
// wait for the bootstrap notification before we claim that we're
|
||||
// actually logged on
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -365,6 +365,7 @@ public class Communicator
|
||||
|
||||
} catch (ObjectStreamException ose) {
|
||||
Log.warning("Error decoding message: " + ose);
|
||||
Log.logStackTrace(ose);
|
||||
|
||||
} catch (InterruptedIOException iioe) {
|
||||
// somebody set up us the bomb! we've been interrupted
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
//
|
||||
// $Id: TypedObjectRegistry.java,v 1.1 2001/06/11 17:44:04 mdb Exp $
|
||||
// $Id: TypedObjectRegistry.java,v 1.2 2001/07/19 07:48:25 mdb Exp $
|
||||
|
||||
package com.threerings.cocktail.cher.io;
|
||||
|
||||
@@ -36,6 +36,8 @@ public class TypedObjectRegistry
|
||||
// register our downstream message classes
|
||||
TypedObjectFactory.registerClass(AuthResponse.TYPE,
|
||||
AuthResponse.class);
|
||||
TypedObjectFactory.registerClass(BootstrapNotification.TYPE,
|
||||
BootstrapNotification.class);
|
||||
TypedObjectFactory.registerClass(EventNotification.TYPE,
|
||||
EventNotification.class);
|
||||
TypedObjectFactory.registerClass(ObjectResponse.TYPE,
|
||||
@@ -54,5 +56,7 @@ public class TypedObjectRegistry
|
||||
AttributeChangedEvent.class);
|
||||
TypedObjectFactory.registerClass(AttributesChangedEvent.TYPE,
|
||||
AttributesChangedEvent.class);
|
||||
TypedObjectFactory.registerClass(MessageEvent.TYPE,
|
||||
MessageEvent.class);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
//
|
||||
// $Id: InvocationManager.java,v 1.2 2001/07/19 07:09:16 mdb Exp $
|
||||
// $Id: InvocationManager.java,v 1.3 2001/07/19 07:48:25 mdb Exp $
|
||||
|
||||
package com.threerings.cocktail.cher.server;
|
||||
|
||||
@@ -80,7 +80,7 @@ public class InvocationManager
|
||||
return true;
|
||||
}
|
||||
|
||||
// make sure the name is proper just for sanities sake
|
||||
// make sure the name is proper just for sanity's sake
|
||||
MessageEvent mevt = (MessageEvent)event;
|
||||
if (!mevt.getName().equals(InvocationObject.MESSAGE_NAME)) {
|
||||
return true;
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
//
|
||||
// $Id: PresentsClient.java,v 1.6 2001/07/19 07:17:46 mdb Exp $
|
||||
// $Id: PresentsClient.java,v 1.7 2001/07/19 07:48:25 mdb Exp $
|
||||
|
||||
package com.threerings.cocktail.cher.server;
|
||||
|
||||
@@ -107,6 +107,8 @@ public class Client implements Subscriber, MessageHandler
|
||||
*/
|
||||
protected void sendBootstrap ()
|
||||
{
|
||||
Log.info("Sending bootstrap [client=" + this + "].");
|
||||
|
||||
// create and populate our bootstrap data
|
||||
BootstrapData data = createBootstrapData();
|
||||
populateBootstrapData(data);
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
//
|
||||
// $Id: PresentsServer.java,v 1.6 2001/07/19 07:09:16 mdb Exp $
|
||||
// $Id: PresentsServer.java,v 1.7 2001/07/19 07:48:25 mdb Exp $
|
||||
|
||||
package com.threerings.cocktail.cher.server;
|
||||
|
||||
@@ -9,6 +9,8 @@ import com.threerings.cocktail.cher.server.net.AuthManager;
|
||||
import com.threerings.cocktail.cher.server.net.ConnectionManager;
|
||||
|
||||
import com.threerings.cocktail.cher.server.test.TestObject;
|
||||
import com.threerings.cocktail.cher.server.test.TestProvider;
|
||||
import com.threerings.cocktail.cher.client.test.TestService;
|
||||
|
||||
/**
|
||||
* The cher server provides a central point of access to the various
|
||||
@@ -51,6 +53,9 @@ public class CherServer
|
||||
// create an object for testing
|
||||
omgr.createObject(TestObject.class, null, false);
|
||||
|
||||
// register our test provider
|
||||
invmgr.registerProvider(TestService.MODULE, new TestProvider());
|
||||
|
||||
} catch (Exception e) {
|
||||
Log.warning("Unable to initialize server.");
|
||||
Log.logStackTrace(e);
|
||||
|
||||
Reference in New Issue
Block a user