outqueue.add(new DBusErrorMessage(m, new DBusExecutionException("Error Executing Method "+m.getType()+"."+m.getName()+": "+e.getMessage())));
outqueue.add(new Error(m, new DBusExecutionException("Error Executing Method "+m.getType()+"."+m.getName()+": "+e.getMessage())));
   private void handleMessage(final MethodCall m)    {      // get the method signature      Object[] params = m.getParameters();      ExportedObject eo = null;      Method meth = null;      Object o;            synchronized (exportedObjects) {         eo = exportedObjects.get(null);      }      if (null != eo) {         meth = eo.methods.get(new MethodTuple(m.getName(), m.getSig()));      }      if (null != meth)         o = new _globalhandler(m.getObjectPath());      else {         // now check for specific exported functions         synchronized (exportedObjects) {            eo = exportedObjects.get(m.getObjectPath());         }         if (null == eo) {            synchronized (outgoing) {               outgoing.add(new DBusErrorMessage(m, new DBus.Error.UnknownObject(m.getObjectPath()+" is not an object provided by this process."))); }            return;         }         meth = eo.methods.get(new MethodTuple(m.getName(), m.getSig()));         if (null == meth) {            synchronized (outgoing) {               outgoing.add(new DBusErrorMessage(m, new DBus.Error.UnknownMethod("The method `"+m.getType()+"."+m.getName()+"' does not exist on this object."))); }            return;         }         o = eo.object;      }      // now execute it      final Method me = meth;      final Object ob = o;      final EfficientQueue outqueue = outgoing;      final boolean noreply = (1 == (m.getFlags() & MethodCall.NO_REPLY));      final DBusCallInfo info = new DBusCallInfo(m);      addRunnable(new Runnable()       {          public void run()          {             try {               Type[] ts = me.getGenericParameterTypes();               m.parameters = deSerializeParameters(m.parameters, ts);            } catch (Exception e) {               if (DBusConnection.EXCEPTION_DEBUG) e.printStackTrace();               synchronized (outqueue) {                  outqueue.add(new DBusErrorMessage(m, new DBus.Error.UnknownMethod("Failure in de-serializing message ("+e+")"))); }               return;            }            try {                synchronized (infomap) {                  infomap.put(Thread.currentThread(), info);               }               Object result;               try {                  result = me.invoke(ob, m.parameters);               } catch (InvocationTargetException ITe) {                  if (DBusConnection.EXCEPTION_DEBUG) ITe.getCause().printStackTrace();                  throw ITe.getCause();               }               synchronized (infomap) {                  infomap.remove(Thread.currentThread());               }               if (!noreply) {                  MethodReply reply;                  if (Void.TYPE.equals(me.getReturnType()))                      reply = new MethodReply(m);                  else {                     // need to recursively convert Tuple with types                     if (Tuple.class.isAssignableFrom(me.getReturnType()))                        ((Tuple) result).getParameters(((ParameterizedType) me.getGenericReturnType()).getActualTypeArguments());                     else                        result = convertParameter(result, me.getGenericReturnType());                     reply = new MethodReply(m, result);                  }                  synchronized (outqueue) {                     outqueue.add(reply);                  }               }            } catch (DBusExecutionException DBEe) {               if (DBusConnection.EXCEPTION_DEBUG) DBEe.printStackTrace();               synchronized (outqueue) {                  outqueue.add(new DBusErrorMessage(m, DBEe));                }            } catch (Throwable e) {               if (DBusConnection.EXCEPTION_DEBUG) e.printStackTrace();               synchronized (outqueue) {                  outqueue.add(new DBusErrorMessage(m, new DBusExecutionException("Error Executing Method "+m.getType()+"."+m.getName()+": "+e.getMessage())));                }            }          }      });   }