if (log.isTraceEnabled()) { log.trace(this + " invokes " + methodName + " on " + category + "." + id); }
if (log.isTraceEnabled()) { log.trace(this + " invokes " + methodName + " on " + category + "." + Util.guidToString((String)id)); }
   public Collection invoke(Serializable category, String methodName,                            Object[] args, String[] signature)         throws Exception   {      if (log.isTraceEnabled()) { log.trace(this + ": method " + methodName + " invoked on category " + category); }      Class[] parameterTypes = new Class[signature.length];      for (int i = 0; i < signature.length; i++)      {         parameterTypes[i] = Class.forName(signature[i]);      }      synchronized(servers)      {         Object o = servers.get(category);         if (o == null)         {            if (log.isTraceEnabled()) { log.trace(this + ": category " + category + " not found"); }            return Collections.EMPTY_SET;         }         Set equivalents = null;         if (o instanceof Set)         {            if (log.isTraceEnabled()) { log.trace(this + ": sub-servers found for category " + category); }            equivalents = (Set)o;         }         else         {            if (log.isTraceEnabled()) { log.trace(this + ": unique server found for category " + category); }            // deal with unique servers in a consistent manner            equivalents = new HashSet();            equivalents.add(o);         }         Collection results = new ArrayList();         for(Iterator i = equivalents.iterator(); i.hasNext(); )         {            ServerFacade subordinate = (ServerFacade)i.next();            Serializable id = subordinate.getID();                        try            {               Method method = subordinate.getClass().getMethod(methodName, parameterTypes);               if (log.isTraceEnabled()) { log.trace(this + " invokes " + methodName + " on " + category + "." + id); }               Object result = method.invoke(subordinate, args);               if (log.isTraceEnabled()) { log.trace(this + ": " + methodName + " invocation successful"); }               results.add(new SubordinateServerResponse(id, result));            }            catch(Throwable t)            {               if (log.isTraceEnabled()) { log.trace(this + ": " + methodName + " invocation failed", t); }               results.add(new SubordinateServerResponse(id, t));            }         }         if (log.isTraceEnabled() && results.isEmpty()) { log.trace(this + ": no target server found for " + methodName); }         return results;      }   }