@SuppressWarnings({"unchecked", "UseOfSystemOutOrSystemErr"})
  @Override
  protected <I extends RemoteExternalSystemService<S>, C extends I> I createService(@NotNull Class<I> interfaceClass, @NotNull final C impl)
    throws RemoteException
  {
    if (!myStdOutputConfigured) {
      myStdOutputConfigured = true;
      System.setOut(new LineAwarePrintStream(System.out));
      System.setErr(new LineAwarePrintStream(System.err));
    }

    I proxy = ReflectionUtil.proxy(getClass().getClassLoader(), interfaceClass, new InvocationHandler() {
      @Override
      public Object invoke(Object proxy, Method method, Object[] args) throws Throwable {
        myCallsInProgressNumber.incrementAndGet();
        try {
          return method.invoke(impl, args);
        }
        catch (InvocationTargetException e) {
          throw e.getCause();
        }
        finally {
          myCallsInProgressNumber.decrementAndGet();
          updateAutoShutdownTime();
        }
      }
    });
    return  (I)UnicastRemoteObject.exportObject(proxy, 0);
  }
@SuppressWarnings({"unchecked", "UseOfSystemOutOrSystemErr"})
  @Override
  protected <I extends RemoteExternalSystemService<S>, C extends I> I createService(@NotNull Class<I> interfaceClass, @NotNull final C impl)