public Object invoke(OperationContext ctx, Map<String, Object> args) throws OperationException {
   try {
     return doInvoke(ctx, args, ctx.getInput());
   } catch (OperationException e) {
     throw e;
   } catch (InvocationTargetException e) {
     Throwable t = e.getTargetException();
     if (t instanceof OperationException) {
       throw (OperationException) t;
     } else {
       throw new OperationException("Failed to invoke operation " + op.getId(), t);
     }
   } catch (Throwable t) {
     throw new OperationException("Failed to invoke operation " + op.getId(), t);
   }
 }
 public synchronized void removeOperation(Class<?> key) {
   OperationType op = operations.remove(key.getAnnotation(Operation.class).id());
   if (op != null) {
     operations.remove(op.getId());
     lookup = null;
   }
 }