org.sapia.ubik.rmi.interceptor
Class SingleDispatcher

java.lang.Object
  extended by org.sapia.ubik.rmi.interceptor.SingleDispatcher

public class SingleDispatcher
extends java.lang.Object

This dispatcher allows to register only one interceptor per event type.

Author:
Yanick Duchesne
Copyright:
Copyright © 2002-2003 Sapia Open Source Software. All Rights Reserved.
License:
Read the license.txt file of the jar or visit the license page at the Sapia OSS web site

Constructor Summary
SingleDispatcher()
           
 
Method Summary
 void dispatch(Event event)
          Dispatches the given event to the interceptor that has registered for the event's class.
protected  void handleError(java.lang.Throwable t)
          Template method that is called internally when an error is trapped when invoking the call-back method on a given interceptor instance.
 void registerInterceptor(java.lang.Class event, Interceptor it)
          Registers an interceptor with the given event type.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SingleDispatcher

public SingleDispatcher()
Method Detail

registerInterceptor

public void registerInterceptor(java.lang.Class event,
                                Interceptor it)
                         throws InvalidInterceptorException
Registers an interceptor with the given event type.

Parameters:
event - an event class.
it - an Interceptor instance.
Throws:
InvalidInterceptorException - if the interceptor could not be registered.

dispatch

public void dispatch(Event event)
Dispatches the given event to the interceptor that has registered for the event's class.


handleError

protected void handleError(java.lang.Throwable t)
Template method that is called internally when an error is trapped when invoking the call-back method on a given interceptor instance.



Copyright © 2010 Sapia OSS. All Rights Reserved.