Author: sebb Date: Wed Apr 5 12:12:10 2006 New Revision: 391728 URL: http://svn.apache.org/viewcvs?rev=391728&view=rev Log: Ensure the transient object is recreated by the server
Modified: jakarta/jmeter/branches/rel-2-1/src/components/org/apache/jmeter/timers/BeanShellTimer.java jakarta/jmeter/branches/rel-2-1/src/components/org/apache/jmeter/visualizers/BeanShellListener.java Modified: jakarta/jmeter/branches/rel-2-1/src/components/org/apache/jmeter/timers/BeanShellTimer.java URL: http://svn.apache.org/viewcvs/jakarta/jmeter/branches/rel-2-1/src/components/org/apache/jmeter/timers/BeanShellTimer.java?rev=391728&r1=391727&r2=391728&view=diff ============================================================================== --- jakarta/jmeter/branches/rel-2-1/src/components/org/apache/jmeter/timers/BeanShellTimer.java (original) +++ jakarta/jmeter/branches/rel-2-1/src/components/org/apache/jmeter/timers/BeanShellTimer.java Wed Apr 5 12:12:10 2006 @@ -42,11 +42,24 @@ // can be specified in jmeter.properties private static final String INIT_FILE = "beanshell.timer.init"; //$NON-NLS-1$ - public BeanShellTimer() throws ClassNotFoundException { + public BeanShellTimer() { super(); - bshInterpreter = new BeanShellInterpreter(JMeterUtils.getProperty(INIT_FILE),log); + init(); } + private void init() { + try { + bshInterpreter = new BeanShellInterpreter(JMeterUtils.getProperty(INIT_FILE),log); + } catch (ClassNotFoundException e) { + log.error(e.getLocalizedMessage()); + } + } + + private Object readResolve() { + init(); + return this; + } + /* * (non-Javadoc) * Modified: jakarta/jmeter/branches/rel-2-1/src/components/org/apache/jmeter/visualizers/BeanShellListener.java URL: http://svn.apache.org/viewcvs/jakarta/jmeter/branches/rel-2-1/src/components/org/apache/jmeter/visualizers/BeanShellListener.java?rev=391728&r1=391727&r2=391728&view=diff ============================================================================== --- jakarta/jmeter/branches/rel-2-1/src/components/org/apache/jmeter/visualizers/BeanShellListener.java (original) +++ jakarta/jmeter/branches/rel-2-1/src/components/org/apache/jmeter/visualizers/BeanShellListener.java Wed Apr 5 12:12:10 2006 @@ -49,11 +49,24 @@ private String script = ""; - public BeanShellListener() throws ClassNotFoundException { - bshInterpreter = new BeanShellInterpreter(JMeterUtils.getProperty(INIT_FILE),log); + public BeanShellListener() { + init(); } + private void init() { + try { + bshInterpreter = new BeanShellInterpreter(JMeterUtils.getProperty(INIT_FILE),log); + } catch (ClassNotFoundException e) { + log.error(e.getLocalizedMessage()); + } + } + + private Object readResolve() { + init(); + return this; + } + public String getScript() { return script; } --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]