code: public RemoteTask getNewRemoteTask(Application app, Map<String,Object> properties)
      {
          try   {
              // Map<String,Object> propApp = this.getApplicationProperties(properties);
  
              // Map<String,Object> propInitial = ProxyTask.getInitialProperties(this.getBasicServlet(), SERVLET_TYPE.PROXY);
              // if (propInitial != null)
              //	propApp.putAll(propInitial);
              
              if (app == null)
                  app = new MainApplication(((BaseApplication)m_application).getEnvironment(), properties, null);	// propApp, null);
              RemoteTask remoteServer = new TaskSession(app);
              ((TaskSession)remoteServer).setProperties(properties);
              return remoteServer;
          } catch (Exception ex) {
              ex.printStackTrace();
              return null;
          }
      }
docs: Get a remote session from the pool and initialize it.
  If the pool is empty, create a new remote session.
  @param strUserID The user name/ID of the user, or null if unknown.
  @return The remote Task.