|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
public interface IChannelMessenger
A simple way to multicast method calls over several machines and possibly several objects on each machine.
A channel can be created such that all channel subscribers must implement the same
interface. Channel subscribors can be on multiple machines.
On VM A
RemoteName FOO = new RemoteName("Foo", IFoo.class);
IFoo aFoo = new Foo();
someChannelMessenger.registerChannelSubscribor(aFoo, FOO);
On VM B
IFoo anotherFoo = new Foo(); anotherChannelMessenger.registerChannelSubscribor(anotherFoo, FOO); IFoo multicastFoo = (IFoo) anotherChannelMessenger.getChannelBroadcastor(FOO); multicastFoo.fee();The
multicast.fee() line results in two method calls, one on VM B to anotherFoo, and
another call on VM A to aFoo.Channels and threading
There will only be one thread calling methods in a channel at one time. Methods will be called on subscribors in the order that they are called on broadcasters. This means that if you block the current thread during a client invocation, no further methods can be called on that channel.
| Method Summary | |
|---|---|
IChannelSubscribor |
getChannelBroadcastor(RemoteName channelName)
Get a reference such that methods called on it will be multicast to all subscribors of the channel |
INode |
getLocalNode()
|
boolean |
isServer()
Is the underlying messenger a server? |
void |
registerChannelSubscriber(java.lang.Object implementor,
RemoteName channelName)
register a subscribor to a channel |
void |
unregisterChannelSubscriber(java.lang.Object implementor,
RemoteName channelName)
unregister a subscribor to a channel |
| Method Detail |
|---|
IChannelSubscribor getChannelBroadcastor(RemoteName channelName)
void registerChannelSubscriber(java.lang.Object implementor,
RemoteName channelName)
void unregisterChannelSubscriber(java.lang.Object implementor,
RemoteName channelName)
INode getLocalNode()
boolean isServer()
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||