edu.uci.isr.yancees.server.rmi
Class RemoteYanceesImplementation

java.lang.Object
  extended byjava.rmi.server.RemoteObject
      extended byjava.rmi.server.RemoteServer
          extended byjava.rmi.server.UnicastRemoteObject
              extended byedu.uci.isr.yancees.server.rmi.RemoteYanceesImplementation
All Implemented Interfaces:
java.rmi.Remote, RemoteYanceesInterface, java.io.Serializable

public class RemoteYanceesImplementation
extends java.rmi.server.UnicastRemoteObject
implements RemoteYanceesInterface

This class implements the RemoteYanceesInterface, which is a façade, a remote interface to all Yancees APIs: Publisher, Subscriber and Protocol. It collects the calls and route them to the appropriate API. It glues everything together. This is a remote class since it is registered in the server side to handle yancess calls.

See Also:
Serialized Form

Nested Class Summary
protected  class RemoteYanceesImplementation.NotificationBuffer
          This buffer schedules events to be notified.
 class RemoteYanceesImplementation.SubscriberMediator
          Performs the mapping between the remote interface and the local subscriber interface, working also as a record of the active subscriptions.
 
Field Summary
static boolean MULTI_THREADED_PUBLISH
           
 
Fields inherited from class java.rmi.server.RemoteObject
ref
 
Fields inherited from interface edu.uci.isr.yancees.server.rmi.RemoteYanceesInterface
LOOKUP_NAME
 
Constructor Summary
RemoteYanceesImplementation(java.io.File configFile)
           
 
Method Summary
 RemoteProtocolSessionInterface createNewSession(MessageInterface msg, RemoteSubscriberInterface rsi)
           
static void main(java.lang.String[] args)
           
 void publish(EventInterface evt)
          Multithreaded implementation of the Publish command Note that the YanceesException will not be thrown here
 void publish(EventInterface[] evtList)
           
 void resumeYancees()
           
 void shutdownYancees()
           
 void subscribe(MessageInterface msg, RemoteSubscriberInterface rsi)
          Multithreaded implementation fo the subscribe command.
 void suspendYancees()
           
 void threadGuard()
           
 void unsubscribe(RemoteSubscriberInterface rsi)
          Multithreaded implementaiton of ubsubscribe method
 void unsubscribe(RemoteSubscriberInterface rsi, MessageInterface msg)
          Multithreaded implementaiton of ubsubscribe method
 
Methods inherited from class java.rmi.server.UnicastRemoteObject
clone, exportObject, exportObject, exportObject, unexportObject
 
Methods inherited from class java.rmi.server.RemoteServer
getClientHost, getLog, setLog
 
Methods inherited from class java.rmi.server.RemoteObject
equals, getRef, hashCode, toString, toStub
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

MULTI_THREADED_PUBLISH

public static boolean MULTI_THREADED_PUBLISH
Constructor Detail

RemoteYanceesImplementation

public RemoteYanceesImplementation(java.io.File configFile)
                            throws java.rmi.RemoteException
Method Detail

main

public static void main(java.lang.String[] args)

createNewSession

public RemoteProtocolSessionInterface createNewSession(MessageInterface msg,
                                                       RemoteSubscriberInterface rsi)
                                                throws YanceesException,
                                                       java.rmi.RemoteException
Specified by:
createNewSession in interface RemoteYanceesInterface
Throws:
YanceesException
java.rmi.RemoteException

publish

public void publish(EventInterface evt)
             throws YanceesException,
                    java.rmi.RemoteException
Multithreaded implementation of the Publish command Note that the YanceesException will not be thrown here

Specified by:
publish in interface RemoteYanceesInterface
Parameters:
evt - is the event to be published.
Throws:
YanceesException
java.rmi.RemoteException

publish

public void publish(EventInterface[] evtList)
             throws YanceesException,
                    java.rmi.RemoteException
Specified by:
publish in interface RemoteYanceesInterface
Parameters:
evtList - is a list of events to be published.
Throws:
YanceesException
java.rmi.RemoteException

subscribe

public void subscribe(MessageInterface msg,
                      RemoteSubscriberInterface rsi)
               throws YanceesException,
                      java.rmi.RemoteException
Multithreaded implementation fo the subscribe command. Sends a subscription. When the subscriptio is matched, events are routed back to the remote subscriber.

Specified by:
subscribe in interface RemoteYanceesInterface
Parameters:
msg - is the message having the subscription/notification
Throws:
YanceesException
java.rmi.RemoteException

unsubscribe

public void unsubscribe(RemoteSubscriberInterface rsi)
                 throws YanceesException,
                        java.rmi.RemoteException
Multithreaded implementaiton of ubsubscribe method

Specified by:
unsubscribe in interface RemoteYanceesInterface
Parameters:
rsi - is the remote subscriber engaging in the operation.
Throws:
YanceesException
java.rmi.RemoteException

unsubscribe

public void unsubscribe(RemoteSubscriberInterface rsi,
                        MessageInterface msg)
                 throws YanceesException,
                        java.rmi.RemoteException
Multithreaded implementaiton of ubsubscribe method

Specified by:
unsubscribe in interface RemoteYanceesInterface
Parameters:
rsi - is the remote subscriber engaging in the operation.
msg - is the Subscriptoin being discontinued
Throws:
YanceesException
java.rmi.RemoteException

shutdownYancees

public void shutdownYancees()
                     throws YanceesException,
                            java.rmi.RemoteException
Specified by:
shutdownYancees in interface RemoteYanceesInterface
Throws:
YanceesException
java.rmi.RemoteException

suspendYancees

public void suspendYancees()
                    throws YanceesException,
                           java.rmi.RemoteException
Specified by:
suspendYancees in interface RemoteYanceesInterface
Throws:
YanceesException
java.rmi.RemoteException

resumeYancees

public void resumeYancees()
                   throws YanceesException,
                          java.rmi.RemoteException
Specified by:
resumeYancees in interface RemoteYanceesInterface
Throws:
YanceesException
java.rmi.RemoteException

threadGuard

public void threadGuard()