@Test public void testInterpreterGroupResetBeforeProcessStarts() { Properties p = new Properties(); RemoteInterpreter intpA = createMockInterpreterA(p); intpA.setInterpreterGroup(intpGroup); RemoteInterpreterProcess processA = intpA.getInterpreterProcess(); intpA.setInterpreterGroup(new InterpreterGroup(intpA.getInterpreterGroup().getId())); RemoteInterpreterProcess processB = intpA.getInterpreterProcess(); assertNotSame(processA.hashCode(), processB.hashCode()); }
public RemoteInterpreterProcess getInterpreterProcess() { InterpreterGroup intpGroup = getInterpreterGroup(); if (intpGroup == null) { return null; } synchronized (intpGroup) { if (intpGroup.getRemoteInterpreterProcess() == null) { RemoteInterpreterProcess remoteProcess; if (connectToExistingProcess()) { remoteProcess = new RemoteInterpreterRunningProcess( connectTimeout, remoteInterpreterProcessListener, applicationEventListener, host, port); } else { remoteProcess = new RemoteInterpreterManagedProcess( interpreterRunner, interpreterPath, localRepoPath, env, connectTimeout, remoteInterpreterProcessListener, applicationEventListener); } intpGroup.setRemoteInterpreterProcess(remoteProcess); } return intpGroup.getRemoteInterpreterProcess(); } }
RemoteInterpreter extends Interpreter { public RemoteInterpreterProcess getInterpreterProcess() { InterpreterGroup intpGroup = getInterpreterGroup(); if (intpGroup == null) { return null; } synchronized (intpGroup) { if (intpGroup.getRemoteInterpreterProcess() == null) { RemoteInterpreterProcess remoteProcess; if (connectToExistingProcess()) { remoteProcess = new RemoteInterpreterRunningProcess( connectTimeout, remoteInterpreterProcessListener, applicationEventListener, host, port); } else { remoteProcess = new RemoteInterpreterManagedProcess( interpreterRunner, interpreterPath, localRepoPath, env, connectTimeout, remoteInterpreterProcessListener, applicationEventListener); } intpGroup.setRemoteInterpreterProcess(remoteProcess); } return intpGroup.getRemoteInterpreterProcess(); } } }
RemoteInterpreter extends Interpreter { public RemoteInterpreterProcess getInterpreterProcess() { InterpreterGroup intpGroup = getInterpreterGroup(); if (intpGroup == null) { return null; } synchronized (intpGroup) { if (intpGroup.getRemoteInterpreterProcess() == null) { RemoteInterpreterProcess remoteProcess; if (connectToExistingProcess()) { remoteProcess = new RemoteInterpreterRunningProcess( connectTimeout, remoteInterpreterProcessListener, applicationEventListener, host, port); } else { remoteProcess = new RemoteInterpreterManagedProcess( interpreterRunner, interpreterPath, localRepoPath, env, connectTimeout, remoteInterpreterProcessListener, applicationEventListener); } intpGroup.setRemoteInterpreterProcess(remoteProcess); } return intpGroup.getRemoteInterpreterProcess(); } } RemoteInterpreter(Properties property, String sessionKey, String className,
      String interpreterRunner, String interpreterPath, String localRepoPath, int connectTimeout,
      int maxPoolSize, RemoteInterpreterProcessListener remoteInterpreterProcessListener,
      ApplicationEventListener appListener, String userName, Boolean isUserImpersonate,
      int outputLimit);  RemoteInterpreter(Properties property, String sessionKey, String className, String host,
      int port, String localRepoPath, int connectTimeout, int maxPoolSize,
      RemoteInterpreterProcessListener remoteInterpreterProcessListener,
      ApplicationEventListener appListener, String userName, Boolean isUserImpersonate,
      int outputLimit);  RemoteInterpreter(Properties property, String sessionKey, String className,
      String interpreterRunner, String interpreterPath, String localRepoPath,
      Map<String, String> env, int connectTimeout,
      RemoteInterpreterProcessListener remoteInterpreterProcessListener,
      ApplicationEventListener appListener, String userName, Boolean isUserImpersonate); }
RemoteInterpreter extends Interpreter { public RemoteInterpreterProcess getInterpreterProcess() { InterpreterGroup intpGroup = getInterpreterGroup(); if (intpGroup == null) { return null; } synchronized (intpGroup) { if (intpGroup.getRemoteInterpreterProcess() == null) { RemoteInterpreterProcess remoteProcess; if (connectToExistingProcess()) { remoteProcess = new RemoteInterpreterRunningProcess( connectTimeout, remoteInterpreterProcessListener, applicationEventListener, host, port); } else { remoteProcess = new RemoteInterpreterManagedProcess( interpreterRunner, interpreterPath, localRepoPath, env, connectTimeout, remoteInterpreterProcessListener, applicationEventListener); } intpGroup.setRemoteInterpreterProcess(remoteProcess); } return intpGroup.getRemoteInterpreterProcess(); } } RemoteInterpreter(Properties property, String sessionKey, String className,
      String interpreterRunner, String interpreterPath, String localRepoPath, int connectTimeout,
      int maxPoolSize, RemoteInterpreterProcessListener remoteInterpreterProcessListener,
      ApplicationEventListener appListener, String userName, Boolean isUserImpersonate,
      int outputLimit);  RemoteInterpreter(Properties property, String sessionKey, String className, String host,
      int port, String localRepoPath, int connectTimeout, int maxPoolSize,
      RemoteInterpreterProcessListener remoteInterpreterProcessListener,
      ApplicationEventListener appListener, String userName, Boolean isUserImpersonate,
      int outputLimit);  RemoteInterpreter(Properties property, String sessionKey, String className,
      String interpreterRunner, String interpreterPath, String localRepoPath,
      Map<String, String> env, int connectTimeout,
      RemoteInterpreterProcessListener remoteInterpreterProcessListener,
      ApplicationEventListener appListener, String userName, Boolean isUserImpersonate); @Override String getClassName(); RemoteInterpreterProcess getInterpreterProcess(); synchronized void init(); @Override void open(); @Override void close(); void closeInterpreter(); @Override InterpreterResult interpret(String st, InterpreterContext context); @Override void cancel(InterpreterContext context); @Override FormType getFormType(); @Override int getProgress(InterpreterContext context); @Override List<InterpreterCompletion> completion(String buf, int cursor); @Override Scheduler getScheduler(); Map<String, String> getEnv(); void setEnv(Map<String, String> env); void addEnv(Map<String, String> env); String getInterpreterRunner(); }
RemoteInterpreter extends Interpreter { public RemoteInterpreterProcess getInterpreterProcess() { InterpreterGroup intpGroup = getInterpreterGroup(); if (intpGroup == null) { return null; } synchronized (intpGroup) { if (intpGroup.getRemoteInterpreterProcess() == null) { RemoteInterpreterProcess remoteProcess; if (connectToExistingProcess()) { remoteProcess = new RemoteInterpreterRunningProcess( connectTimeout, remoteInterpreterProcessListener, applicationEventListener, host, port); } else { remoteProcess = new RemoteInterpreterManagedProcess( interpreterRunner, interpreterPath, localRepoPath, env, connectTimeout, remoteInterpreterProcessListener, applicationEventListener); } intpGroup.setRemoteInterpreterProcess(remoteProcess); } return intpGroup.getRemoteInterpreterProcess(); } } RemoteInterpreter(Properties property, String sessionKey, String className,
      String interpreterRunner, String interpreterPath, String localRepoPath, int connectTimeout,
      int maxPoolSize, RemoteInterpreterProcessListener remoteInterpreterProcessListener,
      ApplicationEventListener appListener, String userName, Boolean isUserImpersonate,
      int outputLimit);  RemoteInterpreter(Properties property, String sessionKey, String className, String host,
      int port, String localRepoPath, int connectTimeout, int maxPoolSize,
      RemoteInterpreterProcessListener remoteInterpreterProcessListener,
      ApplicationEventListener appListener, String userName, Boolean isUserImpersonate,
      int outputLimit);  RemoteInterpreter(Properties property, String sessionKey, String className,
      String interpreterRunner, String interpreterPath, String localRepoPath,
      Map<String, String> env, int connectTimeout,
      RemoteInterpreterProcessListener remoteInterpreterProcessListener,
      ApplicationEventListener appListener, String userName, Boolean isUserImpersonate); @Override String getClassName(); RemoteInterpreterProcess getInterpreterProcess(); synchronized void init(); @Override void open(); @Override void close(); void closeInterpreter(); @Override InterpreterResult interpret(String st, InterpreterContext context); @Override void cancel(InterpreterContext context); @Override FormType getFormType(); @Override int getProgress(InterpreterContext context); @Override List<InterpreterCompletion> completion(String buf, int cursor); @Override Scheduler getScheduler(); Map<String, String> getEnv(); void setEnv(Map<String, String> env); void addEnv(Map<String, String> env); String getInterpreterRunner();  }