Changed InvocationReceiver into an interface because it needn't be a class
and that allows classes that normally do other things to register themselves as an invocation receiver. git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@179 542714f4-19e9-0310-aa3c-eee0fc999fb1
This commit is contained in:
@@ -1,34 +1,36 @@
|
|||||||
//
|
//
|
||||||
// $Id: InvocationReceiver.java,v 1.1 2001/07/19 19:18:06 mdb Exp $
|
// $Id: InvocationReceiver.java,v 1.2 2001/08/04 02:31:20 mdb Exp $
|
||||||
|
|
||||||
package com.threerings.cocktail.cher.client;
|
package com.threerings.cocktail.cher.client;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Classes registered to process invocation notifications should extend
|
* Classes registered to process invocation notifications should implement
|
||||||
* the invocation receiver class and register themselves with the
|
* the invocation receiver interface and register themselves with the
|
||||||
* invocation manager. Because the invocation notification procedures are
|
* invocation manager. Because the invocation notification procedures are
|
||||||
* looked up using reflection, there are no methods to override in the
|
* looked up using reflection, there are no methods to implement in the
|
||||||
* receiver class, but it serves as a useful point for documentation and
|
* receiver interface, but it serves as a useful point for documentation
|
||||||
* as a useful indicator that the derived class in question is actually
|
* and as a useful indicator that the class in question is serving as an
|
||||||
* serving as an invocation receiver.
|
* invocation receiver.
|
||||||
*
|
*
|
||||||
* <p> Invocation notifications are identified by a module name and a
|
* <p> Invocation notifications are identified by a module name and a
|
||||||
* procedure name. The module name identifies which invocation receiver
|
* procedure name. The module name identifies which invocation receiver
|
||||||
* instance will receive the notification. Receivers are registered with
|
* instance will receive the notification. Receivers are registered with
|
||||||
* the invocation manager as handling all notification procedures for a
|
* the invocation manager as handling all notification procedures for a
|
||||||
* particular module. The notification procedure name is used to construct
|
* particular module. The notification procedure name is used to construct
|
||||||
* a method name which is then reflected and invoked. The name
|
* a method name which is then reflected and invoked.
|
||||||
* construction is as follows: a notification message requesting the
|
*
|
||||||
* invocation of a procedure named <code>Tell</code> will result in a
|
* <p> The name construction is as follows: a notification message
|
||||||
* method named <code>handleTellNotification</code> being invoked on the
|
* requesting the invocation of a procedure named <code>Tell</code> will
|
||||||
* invocation receiver instance. The signature of that method is defined
|
* result in a method named <code>handleTellNotification</code> being
|
||||||
* by the arguments supplied with the invocation notification message.
|
* invoked on the invocation receiver instance. The signature of that
|
||||||
* These arguments must always be of the same type and must exactly match
|
* method is defined by the arguments supplied with the invocation
|
||||||
* the signature of the implementing method (with the standard reflection
|
* notification message. These arguments must always be of the same type
|
||||||
* argument type conversion process taken into account).
|
* and must exactly match the signature of the implementing method (with
|
||||||
|
* the standard reflection argument type conversion process taken into
|
||||||
|
* account).
|
||||||
*
|
*
|
||||||
* @see InvocationManager#registerReceiver
|
* @see InvocationManager#registerReceiver
|
||||||
*/
|
*/
|
||||||
public class InvocationReceiver
|
public interface InvocationReceiver
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,12 +1,12 @@
|
|||||||
//
|
//
|
||||||
// $Id: TestReceiver.java,v 1.1 2001/07/19 19:18:06 mdb Exp $
|
// $Id: TestReceiver.java,v 1.2 2001/08/04 02:31:20 mdb Exp $
|
||||||
|
|
||||||
package com.threerings.cocktail.cher.client.test;
|
package com.threerings.cocktail.cher.client.test;
|
||||||
|
|
||||||
import com.threerings.cocktail.cher.Log;
|
import com.threerings.cocktail.cher.Log;
|
||||||
import com.threerings.cocktail.cher.client.InvocationReceiver;
|
import com.threerings.cocktail.cher.client.InvocationReceiver;
|
||||||
|
|
||||||
public class TestReceiver extends InvocationReceiver
|
public class TestReceiver implements InvocationReceiver
|
||||||
{
|
{
|
||||||
public void handleTestNotification (int one, String two)
|
public void handleTestNotification (int one, String two)
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user