<?xml version="1.0" encoding="UTF-8"?>
<rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns="http://purl.org/rss/1.0/" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:syn="http://purl.org/rss/1.0/modules/syndication/" xmlns:admin="http://webns.net/mvcb/">
  <channel rdf:about="http://permalink.gmane.org/gmane.comp.java.beanshell.user">
    <title>gmane.comp.java.beanshell.user</title>
    <link>http://permalink.gmane.org/gmane.comp.java.beanshell.user</link>
    <description/>
    <syn:updatePeriod>hourly</syn:updatePeriod>
    <syn:updateFrequency>1</syn:updateFrequency>
    <syn:updateBase>1901-01-01T00:00+00:00</syn:updateBase>
    <items>
      <rdf:Seq>
        <rdf:li rdf:resource="http://permalink.gmane.org/gmane.comp.java.beanshell.user/2151"/>
        <rdf:li rdf:resource="http://permalink.gmane.org/gmane.comp.java.beanshell.user/2150"/>
        <rdf:li rdf:resource="http://permalink.gmane.org/gmane.comp.java.beanshell.user/2149"/>
        <rdf:li rdf:resource="http://permalink.gmane.org/gmane.comp.java.beanshell.user/2148"/>
        <rdf:li rdf:resource="http://permalink.gmane.org/gmane.comp.java.beanshell.user/2147"/>
        <rdf:li rdf:resource="http://permalink.gmane.org/gmane.comp.java.beanshell.user/2146"/>
        <rdf:li rdf:resource="http://permalink.gmane.org/gmane.comp.java.beanshell.user/2145"/>
        <rdf:li rdf:resource="http://permalink.gmane.org/gmane.comp.java.beanshell.user/2144"/>
        <rdf:li rdf:resource="http://permalink.gmane.org/gmane.comp.java.beanshell.user/2143"/>
        <rdf:li rdf:resource="http://permalink.gmane.org/gmane.comp.java.beanshell.user/2142"/>
        <rdf:li rdf:resource="http://permalink.gmane.org/gmane.comp.java.beanshell.user/2141"/>
        <rdf:li rdf:resource="http://permalink.gmane.org/gmane.comp.java.beanshell.user/2140"/>
        <rdf:li rdf:resource="http://permalink.gmane.org/gmane.comp.java.beanshell.user/2139"/>
        <rdf:li rdf:resource="http://permalink.gmane.org/gmane.comp.java.beanshell.user/2138"/>
        <rdf:li rdf:resource="http://permalink.gmane.org/gmane.comp.java.beanshell.user/2137"/>
        <rdf:li rdf:resource="http://permalink.gmane.org/gmane.comp.java.beanshell.user/2136"/>
        <rdf:li rdf:resource="http://permalink.gmane.org/gmane.comp.java.beanshell.user/2135"/>
        <rdf:li rdf:resource="http://permalink.gmane.org/gmane.comp.java.beanshell.user/2134"/>
        <rdf:li rdf:resource="http://permalink.gmane.org/gmane.comp.java.beanshell.user/2133"/>
        <rdf:li rdf:resource="http://permalink.gmane.org/gmane.comp.java.beanshell.user/2132"/>
      </rdf:Seq>
    </items>
    <image rdf:resource="http://gmane.org/img/gmane-25t.png"/>
    <textinput rdf:resource=""/>
  </channel>
  <image rdf:about="http://gmane.org/img/gmane-25t.png">
    <title>Gmane</title>
    <url>http://gmane.org/img/gmane-25t.png</url>
    <link>http://gmane.org</link>
  </image>
  <item rdf:about="http://permalink.gmane.org/gmane.comp.java.beanshell.user/2151">
    <title>User input from JConsole?</title>
    <link>http://permalink.gmane.org/gmane.comp.java.beanshell.user/2151</link>
    <description>&lt;pre&gt;Hi, I've been trying to use your JConsole to create a simple command-line
interface. Every features is perfect, except that I still can't figure out
how to get the user input.

I tried using BufferedReader using getIn() as a parameter, but for some
reason the BufferedReader is blocked. I'm not familiar with neither
BufferReader or JConsole so I can't figure out how to fix the problem.

Can you help me fix this or give me an alternative?

Thank you

P/s: to make it easier for you to see the code, please view this URL:
http://stackoverflow.com/questions/10155782/java-how-to-read-user-input-from-beanshells-jconsole

--
View this message in context: http://beanshell.2283338.n4.nabble.com/User-input-from-JConsole-tp4557704p4557704.html
Sent from the BeanShell - User mailing list archive at Nabble.com.

------------------------------------------------------------------------------
For Developers, A Lot Can Happen In A Second.
Boundary is the first to Know...and Tell You.
Monitor Your Applications in Ultra-Fine Res&lt;/pre&gt;</description>
    <dc:creator>FljpFl0p</dc:creator>
    <dc:date>2012-04-14T17:49:53</dc:date>
  </item>
  <item rdf:about="http://permalink.gmane.org/gmane.comp.java.beanshell.user/2150">
    <title>java.io.WriteAbortedException: writing aborted; java.io.NotSerializableException: bsh.CallStack</title>
    <link>http://permalink.gmane.org/gmane.comp.java.beanshell.user/2150</link>
    <description>&lt;pre&gt;I have been receiving this error off and on for sometime now.

Using:
jdk 1.6, bsh_2.04b

The error is difficult to reproduce because it seems random.  If I run the
same script on the same data that caused the error it never seems to
reproduce it.
This is very problematic.

I see that there is an old bug related to serialization.
http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=4171142
Might this be related?

thanks for the help
-ryan
------------------------------------------------------------------------------
Keep Your Developer Skills Current with LearnDevNow!
The most comprehensive online learning library for Microsoft developers
is just $99.99! Visual Studio, SharePoint, SQL - plus HTML5, CSS3, MVC3,
Metro Style Apps, more. Free future releases when you subscribe now!
http://p.sf.net/sfu/learndevnow-d2d
&lt;/pre&gt;</description>
    <dc:creator>Ryan Wexler</dc:creator>
    <dc:date>2012-02-08T18:06:51</dc:date>
  </item>
  <item rdf:about="http://permalink.gmane.org/gmane.comp.java.beanshell.user/2149">
    <title>Re: String Strangeness</title>
    <link>http://permalink.gmane.org/gmane.comp.java.beanshell.user/2149</link>
    <description>&lt;pre&gt;I dont think "\9" is a valid escape sequence.


----------------------------------------
David A. Lee
dlee-66EQdxh4fhxBDgjK7y7TUQ&amp;lt; at &amp;gt;public.gmane.org
http://www.xmlsh.org

-----Original Message-----
From: mark wilkinson [mailto:inyabass-71ubn78lNmomlAP/+Wk3EA&amp;lt; at &amp;gt;public.gmane.org] 
Sent: Tuesday, January 31, 2012 7:39 AM
To: beanshell-users-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f&amp;lt; at &amp;gt;public.gmane.org
Subject: [Beanshell-users] String Strangeness

Using bsh-2.0b5 embedded in JMeter-2.5.1

Trying to do a simple string assignment in a test script (test.bsh):

String rawBCString = "288/SetEntryList/7/ITSPUAT9/Home Page2/\9";

And get the following...

&amp;lt;snip&amp;gt;

bsh % source("test.bsh");
// Error: // Uncaught Exception: Method Invocation
this.interpreter.source : at Line: 14 : in file:
/bsh/commands/source.bsh : this .interpreter .source ( filename , this
.caller .namespace )

Called from method: source : at Line: 1 : in file: &amp;lt;unknown file&amp;gt; :
source ( "test.bsh" )
Target exception: Sourced file: test.bsh Token Parsing Error: Lexica&lt;/pre&gt;</description>
    <dc:creator>David Lee</dc:creator>
    <dc:date>2012-01-31T13:29:42</dc:date>
  </item>
  <item rdf:about="http://permalink.gmane.org/gmane.comp.java.beanshell.user/2148">
    <title>String Strangeness</title>
    <link>http://permalink.gmane.org/gmane.comp.java.beanshell.user/2148</link>
    <description>&lt;pre&gt;Using bsh-2.0b5 embedded in JMeter-2.5.1

Trying to do a simple string assignment in a test script (test.bsh):

String rawBCString = "288/SetEntryList/7/ITSPUAT9/Home Page2/\9";

And get the following...

&amp;lt;snip&amp;gt;

bsh % source("test.bsh");
// Error: // Uncaught Exception: Method Invocation
this.interpreter.source : at Line: 14 : in file:
/bsh/commands/source.bsh : this .interpreter .source ( filename , this
.caller .namespace )

Called from method: source : at Line: 1 : in file: &amp;lt;unknown file&amp;gt; :
source ( "test.bsh" )
Target exception: Sourced file: test.bsh Token Parsing Error: Lexical
error at line 1, column 63.  Encountered: "9" (57), after :
"\"288/SetEntryList/7/ITSPUAT9/Home Page2/\\": &amp;lt;at unknown location&amp;gt;


bsh %

&amp;lt;snip&amp;gt;

Anyone got any ideas what's going on here? I think it's something to
do with escape chars but having a "9" after a "\" doesn't seem like
anything odd to me. Looks like java is taking the raw string, escaping
all the "\" chars and then barfing on the result..

Cheers

MarkW

----------&lt;/pre&gt;</description>
    <dc:creator>mark wilkinson</dc:creator>
    <dc:date>2012-01-31T12:38:39</dc:date>
  </item>
  <item rdf:about="http://permalink.gmane.org/gmane.comp.java.beanshell.user/2147">
    <title>Executing Eclipse SaveAll command from beanshell</title>
    <link>http://permalink.gmane.org/gmane.comp.java.beanshell.user/2147</link>
    <description>&lt;pre&gt;I have a beanshell script that is run inside Eclipse via Practically Macro. I need the script to run the File -&amp;gt; SaveAll command, but I'm having problems getting a reference to the ICommandService that Eclipse provides. 

The service locator generally uses PlatformUI which doesn't seem accessible inside beanscript. I've also tried getSite() per the Eclipse Services help (http://tinyurl.com/c9o8a9g). It's unclear to me if I will be able to access these inside a beanscript.

I end up getting the error "Typed variable declaration : Command not found: getSite()" or "Attempt to resolve method: getWorkbench() on undefined variable or class name: PlatformUI"

Any pointers?

TIA,
J.D.

import org.eclipse.swt.custom.StyledText;
import org.eclipse.jface.text.IFindReplaceTarget;

import org.eclipse.debug.core.DebugPlugin;
import org.eclipse.debug.core.ILaunchConfiguration;
import org.eclipse.debug.core.ILaunch;
import org.eclipse.debug.ui.DebugUITools;
import org.eclipse.ui.commands.ICommandService;

try
{
// Sa&lt;/pre&gt;</description>
    <dc:creator>J.D. Mullin</dc:creator>
    <dc:date>2011-12-29T22:49:29</dc:date>
  </item>
  <item rdf:about="http://permalink.gmane.org/gmane.comp.java.beanshell.user/2146">
    <title>Re: Reg. Non-English string literal in Java code</title>
    <link>http://permalink.gmane.org/gmane.comp.java.beanshell.user/2146</link>
    <description>&lt;pre&gt;I've put literal Japanese characters into strings sent to beanshell and it
worked fine.  So I know it can be done without changes to bsh internals.

Perhaps its using the default encoding ... I always start my java programs
(in this case tomcat) with

export LANG=en_US.UTF-8
java ... -Dfile.encoding=UTF-8  

This sets the default character set to UTF-8 ... 


----------------------------------------
David A. Lee
dlee-66EQdxh4fhxBDgjK7y7TUQ&amp;lt; at &amp;gt;public.gmane.org
http://www.xmlsh.org


-----Original Message-----
From: Dan Leuck [mailto:dan-Cbr7ef+9YwXQT0dZR+AlfA&amp;lt; at &amp;gt;public.gmane.org] 
Sent: Thursday, November 10, 2011 8:44 AM
To: dlee-66EQdxh4fhxBDgjK7y7TUQ&amp;lt; at &amp;gt;public.gmane.org
Cc: Rathna Kumar; &amp;lt;beanshell-users-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f&amp;lt; at &amp;gt;public.gmane.org&amp;gt;
Subject: Re: [Beanshell-users] Reg. Non-English string literal in Java code


It's Beanshell. The interpreter should be assuming UTF8 and reading the
cyrillic chars directly just as XML parsers do by default. Writing non-ASCII
chars with Unicode escapes is laboriou&lt;/pre&gt;</description>
    <dc:creator>David Lee</dc:creator>
    <dc:date>2011-11-10T14:27:35</dc:date>
  </item>
  <item rdf:about="http://permalink.gmane.org/gmane.comp.java.beanshell.user/2145">
    <title>Re: Reg. Non-English string literal in Java code</title>
    <link>http://permalink.gmane.org/gmane.comp.java.beanshell.user/2145</link>
    <description>&lt;pre&gt;It's Beanshell. The interpreter should be assuming UTF8 and reading the cyrillic chars directly just as XML parsers do by default. Writing non-ASCII chars with Unicode escapes is laborious. It drives me nuts with Japanese (and yes, I know there is tool support but this should be default for all interpreters and compilers these days.) Hopefully we can find some time to fix this.

Sent from my iPad

On Nov 10, 2011, at 3:10 AM, "David Lee" &amp;lt;dlee-66EQdxh4fhxBDgjK7y7TUQ&amp;lt; at &amp;gt;public.gmane.org&amp;gt; wrote:


------------------------------------------------------------------------------
RSA(R) Conference 2012
Save $700 by Nov 18
Register now
http://p.sf.net/sfu/rsa-sfdev2dev1
&lt;/pre&gt;</description>
    <dc:creator>Dan Leuck</dc:creator>
    <dc:date>2011-11-10T13:43:49</dc:date>
  </item>
  <item rdf:about="http://permalink.gmane.org/gmane.comp.java.beanshell.user/2144">
    <title>Re: Reg. Non-English string literal in Java code</title>
    <link>http://permalink.gmane.org/gmane.comp.java.beanshell.user/2144</link>
    <description>&lt;pre&gt;It's been a while since I looked at it, but it comes down to there being streams where there should be readers and writers in the console and interpreter. It's just a very old part of the code that needs about 30 minutes of attention.

Sent from my iPad

On Nov 10, 2011, at 1:31 AM, Rathna Kumar &amp;lt;rathna.raman-Re5JQEeQqe8AvxtiuMwx3w&amp;lt; at &amp;gt;public.gmane.org&amp;gt; wrote:


------------------------------------------------------------------------------
RSA(R) Conference 2012
Save $700 by Nov 18
Register now
http://p.sf.net/sfu/rsa-sfdev2dev1
&lt;/pre&gt;</description>
    <dc:creator>Dan Leuck</dc:creator>
    <dc:date>2011-11-10T13:31:49</dc:date>
  </item>
  <item rdf:about="http://permalink.gmane.org/gmane.comp.java.beanshell.user/2143">
    <title>Re: Reg. Non-English string literal in Java code</title>
    <link>http://permalink.gmane.org/gmane.comp.java.beanshell.user/2143</link>
    <description>&lt;pre&gt;Are you sure this is beanshell not javac which is corrupting things ?
Take beanshell out and print your array to see.

#1 guess is that when you save the file its not saving it in a unicode (UTF8
or UTF16) representation so when javac comes along the data is already
corrupted.
You can use unicode escapes to solve this   "\uXXXX\uXXXX ..."   
And possibly (not tested) is to use the  system property  file.encoding to
make sure you file matches javac's expectation.
But you also need a text editor which stores in a known encoding.


----------------------------------------
David A. Lee
dlee-66EQdxh4fhxBDgjK7y7TUQ&amp;lt; at &amp;gt;public.gmane.org
http://www.xmlsh.org

-----Original Message-----
From: Rathna Kumar [mailto:rathna.raman-Re5JQEeQqe8AvxtiuMwx3w&amp;lt; at &amp;gt;public.gmane.org] 
Sent: Thursday, November 10, 2011 6:31 AM
To: beanshell-users-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f&amp;lt; at &amp;gt;public.gmane.org
Subject: [Beanshell-users] Reg. Non-English string literal in Java code

Hi,
I am using bean shell interpreter to execute Java code.
If any string&lt;/pre&gt;</description>
    <dc:creator>David Lee</dc:creator>
    <dc:date>2011-11-10T13:10:53</dc:date>
  </item>
  <item rdf:about="http://permalink.gmane.org/gmane.comp.java.beanshell.user/2142">
    <title>Reg. Non-English string literal in Java code</title>
    <link>http://permalink.gmane.org/gmane.comp.java.beanshell.user/2142</link>
    <description>&lt;pre&gt;Hi,
I am using bean shell interpreter to execute Java code.
If any string literal in Java code has non-English characters
(say, Russian) then such characters becomes garbled when
the interpreter is executing the code.
Is there a way to support internationalization during
bean shell interpreter execution of Java code ?

Usage of bean shell interpreter
Interpreter interpreter = new Interpreter();
interpreter.eval(javaCode);

Content of javaCode
ArrayList aList = new ArrayList();
aList.add("&amp;lt;RussianCharsHere&amp;gt;");
aList.add("&amp;lt;RussianCharsHere&amp;gt;");

Any help is appreciated.

Thanks
Rathna Kumar R
------------------------------------------------------------------------------
RSA(R) Conference 2012
Save $700 by Nov 18
Register now
http://p.sf.net/sfu/rsa-sfdev2dev1
&lt;/pre&gt;</description>
    <dc:creator>Rathna Kumar</dc:creator>
    <dc:date>2011-11-10T11:31:03</dc:date>
  </item>
  <item rdf:about="http://permalink.gmane.org/gmane.comp.java.beanshell.user/2141">
    <title>Re: (no subject)</title>
    <link>http://permalink.gmane.org/gmane.comp.java.beanshell.user/2141</link>
    <description>&lt;pre&gt;I want you to be in a good form so I recommend you to visit this shop now.... http://www.toutesleschambresdhotes.com/com.page.php?etifriend_id=08er9
       
------------------------------------------------------------------------------
BlackBerry&amp;amp;reg; DevCon Americas, Oct. 18-20, San Francisco, CA
The must-attend event for mobile developers. Connect with experts. 
Get tools for creating Super Apps. See the latest technologies.
Sessions, hands-on labs, demos &amp;amp; much more. Register early &amp;amp; save!
http://p.sf.net/sfu/rim-blackberry-1
&lt;/pre&gt;</description>
    <dc:creator>Michael Pitoniak</dc:creator>
    <dc:date>2011-08-06T10:06:44</dc:date>
  </item>
  <item rdf:about="http://permalink.gmane.org/gmane.comp.java.beanshell.user/2140">
    <title>Re: (no subject)</title>
    <link>http://permalink.gmane.org/gmane.comp.java.beanshell.user/2140</link>
    <description>&lt;pre&gt;Save your money and time.. http://xp2600amd.free.fr/com.page.php?esiyahooID=82e8
       
------------------------------------------------------------------------------
BlackBerry&amp;amp;reg; DevCon Americas, Oct. 18-20, San Francisco, CA
The must-attend event for mobile developers. Connect with experts. 
Get tools for creating Super Apps. See the latest technologies.
Sessions, hands-on labs, demos &amp;amp; much more. Register early &amp;amp; save!
http://p.sf.net/sfu/rim-blackberry-1
&lt;/pre&gt;</description>
    <dc:creator>Michael Pitoniak</dc:creator>
    <dc:date>2011-08-05T22:51:34</dc:date>
  </item>
  <item rdf:about="http://permalink.gmane.org/gmane.comp.java.beanshell.user/2139">
    <title>Re: Loading .java Files</title>
    <link>http://permalink.gmane.org/gmane.comp.java.beanshell.user/2139</link>
    <description>&lt;pre&gt;I don't believe that beanshell is 100% backwards compatible with Java.
Especially Java 1.6.
bsh java compatibility syntax is pre 1.4.
Plus even if the syntax is compatible, as you have discovered, its use case
is not.
You can load a java class file into bsh but you cannot access it from java
natively (only from bsh).
The internal bits it creates from parsing "java" code are not  java JVM
Bytecode.  Its beanshell interpreted runtime codes.   So in some cases you
might get away with reading pure java files, in other cases maybe not.
In no cases is it exactly the same.

If you want pure java you need to use javacc or equivalent and use a
classloader.
Its actually not as complicated as one might imagine.

As for beanshell2 ... I'll let others comment, I haven't followed it for a
while.







----------------------------------------
David A. Lee
dlee-66EQdxh4fhxBDgjK7y7TUQ&amp;lt; at &amp;gt;public.gmane.org
http://www.xmlsh.org


-----Original Message-----
From: spring-CFr20CYPKuQ&amp;lt; at &amp;gt;public.gmane.org [mailto:spring-CFr20CYPKuQ&amp;lt; at &amp;gt;publi&lt;/pre&gt;</description>
    <dc:creator>David Lee</dc:creator>
    <dc:date>2011-06-26T20:51:43</dc:date>
  </item>
  <item rdf:about="http://permalink.gmane.org/gmane.comp.java.beanshell.user/2138">
    <title>Re: Loading .java Files</title>
    <link>http://permalink.gmane.org/gmane.comp.java.beanshell.user/2138</link>
    <description>&lt;pre&gt;
Yes. Java isn't Bsh compatible.
But Bsh is Java compatible? I mean that Bsh can eval successfully every
script in Java-1.4 syntax?


I doesn't meant Bsh with "not elegant". I meant that my code removes the
"class {}" lines before loading the script.


Hm, I cannot find any docs at http://code.google.com/p/beanshell2/.

What are the enhancements to the original Bsh?

Thank you!


------------------------------------------------------------------------------
All of the data generated in your IT infrastructure is seriously valuable.
Why? It contains a definitive record of application performance, security 
threats, fraudulent activity, and more. Splunk takes this data and makes 
sense of it. IT sense. And common sense.
http://p.sf.net/sfu/splunk-d2d-c2
&lt;/pre&gt;</description>
    <dc:creator>spring-CFr20CYPKuQ&lt; at &gt;public.gmane.org</dc:creator>
    <dc:date>2011-06-26T20:24:45</dc:date>
  </item>
  <item rdf:about="http://permalink.gmane.org/gmane.comp.java.beanshell.user/2137">
    <title>Re: Loading .java Files</title>
    <link>http://permalink.gmane.org/gmane.comp.java.beanshell.user/2137</link>
    <description>&lt;pre&gt;

Hm, this I do not understand.

------------
BSH has java-incompatible syntax.   A IDE that is expecting java will
produce errors when given bsh code that doesn't conform to java.
For example a method with no class.  Or using the {} notation to access a
Hash or bsh iterators, typeless variables, closers and anything else in bsh
which isnt java. 






========================
Cool feature! But it seem that this does not work, when the bsh-.script is
in a class

Runnable r =(Runnable)interpreter.getInterface(Runnable.class);
r.run();

=============
It "works" exactly how its supposed to work, just not how  *you* want it to
work.
See above notes about how bsh is not java.

======================================


In the moment I help me out be removing "... class ... {" and the last "}"
from the script before I load it into the interpreter. Not that elegant ;)

Thank you!


P.S. Is bsh still under development?
================================================

bsh is what it is.  If you believe that is 'Not th&lt;/pre&gt;</description>
    <dc:creator>David Lee</dc:creator>
    <dc:date>2011-06-26T15:11:45</dc:date>
  </item>
  <item rdf:about="http://permalink.gmane.org/gmane.comp.java.beanshell.user/2136">
    <title>Re: Loading .java Files</title>
    <link>http://permalink.gmane.org/gmane.comp.java.beanshell.user/2136</link>
    <description>&lt;pre&gt;
Of cause not.


Hm, this I do not understand.


It's a webapp running in a servlet container. Would be quite complicated
compared to bsh with all these compiling and classloader issues...


Cool feature! But it seem that this does not work, when the bsh-.script is
in a class

Runnable r =(Runnable)interpreter.getInterface(Runnable.class);
r.run();

Caused by: Method run() not found in bsh scripted object: global : at Line:
-1 : in file: &amp;lt;Called from Java Code&amp;gt; : &amp;lt;Compiled Java Code&amp;gt;

at bsh.This.invokeMethod(Unknown Source)
at bsh.This.invokeMethod(Unknown Source)
at bsh.XThis$Handler.invokeImpl(Unknown Source)
at bsh.XThis$Handler.invoke(Unknown Source)
... 113 more


In the moment I help me out be removing "... class ... {" and the last "}"
from the script before I load it into the interpreter. Not that elegant ;)

Thank you!


P.S. Is bsh still under development?


------------------------------------------------------------------------------
All of the data generated in your IT infrastructure is se&lt;/pre&gt;</description>
    <dc:creator>spring-CFr20CYPKuQ&lt; at &gt;public.gmane.org</dc:creator>
    <dc:date>2011-06-26T14:22:32</dc:date>
  </item>
  <item rdf:about="http://permalink.gmane.org/gmane.comp.java.beanshell.user/2135">
    <title>Re: Loading .java Files</title>
    <link>http://permalink.gmane.org/gmane.comp.java.beanshell.user/2135</link>
    <description>&lt;pre&gt;
The only reason why I want to use .java-Files is that I can edit them in my
IDE with full IDE-support (autocomplete, syntax check etc).
------------------------------------

That is a worthwhile goal but I believe your making a fundamental mistake
assuming that beanshell is java.
It is not.   It is similar to java but it is not identical to java.
Using a Java IDE is useful but if it thinks your editing beanshell code it
will give you false information.


===========
What do you mean with "top level"?
===========

In java all methods must be in a class like

class Foo {
   void bar() {} ;
};

In Beanshell methods need not (and usually DO not ) reside in a class. I.e. 

bar() {};


Java and Beanshell are quite different languages in this respect.

By "top level" I mean these methods which are not in classes. They are put
into the "global namespace" which is the namespace used by the
BSHMethod.invoke() method.


If you want to edit and dynamically compile and load pure java I suggest
using the Javac classes fo&lt;/pre&gt;</description>
    <dc:creator>David Lee</dc:creator>
    <dc:date>2011-06-26T13:00:15</dc:date>
  </item>
  <item rdf:about="http://permalink.gmane.org/gmane.comp.java.beanshell.user/2134">
    <title>Re: Loading .java Files</title>
    <link>http://permalink.gmane.org/gmane.comp.java.beanshell.user/2134</link>
    <description>&lt;pre&gt;
The only reason why I want to use .java-Files is that I can edit them in my
IDE with full IDE-support (autocomplete, syntax check etc).


I do not call the Bsh-class from Bsh, I call it from Java.


But my Bsh-Class does not implement an interface.


What do you mean with "top level"?



------------------------------------------------------------------------------
All of the data generated in your IT infrastructure is seriously valuable.
Why? It contains a definitive record of application performance, security 
threats, fraudulent activity, and more. Splunk takes this data and makes 
sense of it. IT sense. And common sense.
http://p.sf.net/sfu/splunk-d2d-c2
&lt;/pre&gt;</description>
    <dc:creator>spring-CFr20CYPKuQ&lt; at &gt;public.gmane.org</dc:creator>
    <dc:date>2011-06-26T12:23:39</dc:date>
  </item>
  <item rdf:about="http://permalink.gmane.org/gmane.comp.java.beanshell.user/2133">
    <title>Re: Loading .java Files</title>
    <link>http://permalink.gmane.org/gmane.comp.java.beanshell.user/2133</link>
    <description>&lt;pre&gt;Ok you are using "eval".  The terminology ".java" confused me.
You are loading  a "beanshell" file  not a "java" file.  Although they are
often similar.

If you want to invoke a non-static method in a class you do it the same way
in beanshell as you do in java.
you need to instantiate the class to invoke the method.
    
    new Foo().bar()

I dont think you can do this with BSHMethod.invoke()
(You can with eval)

My prefered method of executing bsh from within java is to use the Interface
methods.
 e.g.
     (ICampaignScript) mInterpreter.getInterface(ICampaignScript.class);

then you can call bsh methods directly via the interface.

but again this only calls 'top level' methods.   To create classes and call
them you need to run eval() or to expose a top level method which calls
them.
I dont know of any way directly from the java API to do it.










----------------------------------------
David A. Lee
dlee-66EQdxh4fhxBDgjK7y7TUQ&amp;lt; at &amp;gt;public.gmane.org
http://www.xmlsh.org


-----Original Message-----
From: s&lt;/pre&gt;</description>
    <dc:creator>David Lee</dc:creator>
    <dc:date>2011-06-26T11:56:26</dc:date>
  </item>
  <item rdf:about="http://permalink.gmane.org/gmane.comp.java.beanshell.user/2132">
    <title>Re: Loading .java Files</title>
    <link>http://permalink.gmane.org/gmane.comp.java.beanshell.user/2132</link>
    <description>&lt;pre&gt;By what mechanism are you "loading" a java file ?
and yes the behavior is right.
If a method is in a class then it's not in the global namespace it's in a
class.


----------------------------------------
David A. Lee
dlee-66EQdxh4fhxBDgjK7y7TUQ&amp;lt; at &amp;gt;public.gmane.org
http://www.xmlsh.org


-----Original Message-----
From: spring-CFr20CYPKuQ&amp;lt; at &amp;gt;public.gmane.org [mailto:spring-CFr20CYPKuQ&amp;lt; at &amp;gt;public.gmane.org] 
Sent: Sunday, June 26, 2011 6:50 AM
To: beanshell-users-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f&amp;lt; at &amp;gt;public.gmane.org
Subject: [Beanshell-users] Loading .java Files

Hi,

when I load a complete .java File, the global namespace has no methods:

public class Foo() {
  void bar() {
    //
  }
}

When I load this, the namespace has the method bar():

//public class Foo() {
  void bar() {
    //
  }
//}

Is this a bug or by design?

Thank you


----------------------------------------------------------------------------
--
All of the data generated in your IT infrastructure is seriously valuable.
Why? It contains a definitive recor&lt;/pre&gt;</description>
    <dc:creator>David Lee</dc:creator>
    <dc:date>2011-06-26T11:28:50</dc:date>
  </item>
  <item rdf:about="http://permalink.gmane.org/gmane.comp.java.beanshell.user/2131">
    <title>Loading .java Files</title>
    <link>http://permalink.gmane.org/gmane.comp.java.beanshell.user/2131</link>
    <description>&lt;pre&gt;Hi,

when I load a complete .java File, the global namespace has no methods:

public class Foo() {
  void bar() {
    //
  }
}

When I load this, the namespace has the method bar():

//public class Foo() {
  void bar() {
    //
  }
//}

Is this a bug or by design?

Thank you


------------------------------------------------------------------------------
All of the data generated in your IT infrastructure is seriously valuable.
Why? It contains a definitive record of application performance, security 
threats, fraudulent activity, and more. Splunk takes this data and makes 
sense of it. IT sense. And common sense.
http://p.sf.net/sfu/splunk-d2d-c2
&lt;/pre&gt;</description>
    <dc:creator>spring-CFr20CYPKuQ&lt; at &gt;public.gmane.org</dc:creator>
    <dc:date>2011-06-26T10:50:10</dc:date>
  </item>
  <textinput rdf:about="http://search.gmane.org/?group=$group=gmane.comp.java.beanshell.user">
    <title>Search Engine</title>
    <description>Search the mailing list at Gmane</description>
    <name>query</name>
    <link>http://search.gmane.org/?group=$group=gmane.comp.java.beanshell.user</link>
  </textinput>
</rdf:RDF>

