code: public synchronized void addHandler(Class iface, Object handler) {
          try {
              iface.cast(handler);
          }
          catch (Exception e) {
              throw new IllegalArgumentException("Handler: " + handler.getClass().getName() +
                                                 " does not implement: " + iface.getName());
          }
  
          if (contract.getInterfaces().get(iface.getSimpleName()) == null) {
              throw new IllegalArgumentException("Interface: " + iface.getName() + 
                                                 " is not a part of this Contract");
          }
  
          if (contract.getPackage() == null) {
              setContractPackage(iface);
          }
  
          handlers.put(iface.getSimpleName(), handler);
      }
docs: Associates the handler instance with the given IDL interface.  Replaces
  an existing handler for this iface if one was previously registered.
  
  @param iface Interface class that this handler implements.  This is usually
  an Idl2Java generated interface Class
  @param handler Object that implements iface.  Generally one of your application classes
  @throws IllegalArgumentException if iface is not an interface on this Server's Contract
  or if handler cannot be cast to iface