Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

exposing CurrentPort

  • Loading branch information...
commit c2fc992e33ab12936e43ae76c21a7e034339203c 1 parent 1ee925d
@belaban authored
Showing with 9 additions and 4 deletions.
  1. +9 −4 src/org/jgroups/protocols/BSH.java
View
13 src/org/jgroups/protocols/BSH.java
@@ -4,9 +4,7 @@
import bsh.EvalError;
import bsh.Interpreter;
-import org.jgroups.annotations.Experimental;
-import org.jgroups.annotations.Property;
-import org.jgroups.annotations.Unsupported;
+import org.jgroups.annotations.*;
import org.jgroups.stack.Protocol;
import org.jgroups.util.Util;
import org.jgroups.Global;
@@ -28,7 +26,9 @@
* Time: 1:57:07 PM
* @author Bela Ban
*/
-@Experimental @Unsupported
+@Experimental
+@MBean(description="Protocol which has a running Beanshell (beanshell.org) interpreter, to which clients can " +
+ "connect via TCP and submit any Java commands")
public class BSH extends Protocol implements Runnable {
protected Interpreter interpreter=null;
protected ServerSocket srv_sock;
@@ -43,6 +43,11 @@
public BSH() {
}
+ @ManagedAttribute(description="beanshell port",writable=false)
+ public int getCurrentPort() {
+ return srv_sock.getLocalPort();
+ }
+
public void start() throws Exception {
srv_sock=Util.createServerSocket(getSocketFactory(), Global.BSH_SRV_SOCK, bind_port);
log.info("Server socket listening at " + srv_sock.getLocalSocketAddress());
Please sign in to comment.
Something went wrong with that request. Please try again.