beanshell interpreter

Discussion in 'Java' started by timinganalyzer, Jul 7, 2008.

  1. Hello All,

    I am trying to use the beanshell interpreter and JConsole in my
    application.

    I have a problem when I start the interpreter in a new thread.

    //JConsole bshConsole = new JConsole();
    // Interpreter interpreter = new Interpreter(bshConsole);
    // interpreter.set("taApp", this);
    // Thread thread = new Thread(interpreter,"BeanShell");
    // thread.setDaemon(true);
    // thread.start();

    Sometimes my scripts generate a ConcurrentModificationException. I
    think I know why, my main application is redrawing the objects from
    paintComponent() when the bsh script is trying to modify one of the
    objects,

    I can run the scripts as shown in the code below that does not use the
    JConsole..

    try
    {
    interp = new Interpreter();
    interp.set("taApp", taApp );
    interp.source( scriptDir +
    System.getProperty("file.separator") +
    scriptFileName);
    } catch ( TargetError e1 ) {

    I have no experience with threads and didn't plan on using threads but
    It looks like you have to use a thread as shown above to get the
    interpreter started in the JConsole. I hope I am wrong, but I
    wanted to ask you if I have any other options? Looking for advice?

    Thanks in advance,
     
    timinganalyzer, Jul 7, 2008
    #1
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. SOl

    [BEANSHELL] Extends

    SOl, Jul 19, 2003, in forum: Java
    Replies:
    0
    Views:
    395
  2. Wolfgang Groiss
    Replies:
    0
    Views:
    402
    Wolfgang Groiss
    Nov 19, 2003
  3. Michael Pitoniak
    Replies:
    1
    Views:
    559
    Michael Pitoniak
    Dec 20, 2003
  4. vnssoftware
    Replies:
    0
    Views:
    446
    vnssoftware
    Feb 4, 2004
  5. timinganalyzer

    beanshell interpreter thread

    timinganalyzer, Sep 10, 2008, in forum: Java
    Replies:
    0
    Views:
    559
    timinganalyzer
    Sep 10, 2008
Loading...

Share This Page