Class BSH

java.lang.Object
org.jgroups.stack.Protocol
org.jgroups.protocols.BSH
All Implemented Interfaces:
Runnable

public class BSH extends Protocol implements Runnable
Beanshell (www.beanshell.org) interpreter class. The eval() method receives Java code, executes it and returns the result of the evaluation (or an exception).

This protocol is experimental User: Bela Date: Mar 8, 2003 Time: 1:57:07 PM

Author:
Bela Ban
  • Field Details

    • interpreter

      protected bsh.Interpreter interpreter
    • srv_sock

      protected ServerSocket srv_sock
    • acceptor

      protected Thread acceptor
    • sockets

      protected final List<Socket> sockets
  • Constructor Details

    • BSH

      public BSH()
  • Method Details

    • start

      public void start() throws Exception
      Description copied from class: Protocol
      This method is called on a Channel.connect(String). Starts work. Protocols are connected and queues are ready to receive events. Will be called from bottom to top. This call will replace the START and START_OK events.
      Overrides:
      start in class Protocol
      Throws:
      Exception - Thrown if protocol cannot be started successfully. This will cause the ProtocolStack to fail, so Channel.connect(String) will throw an exception
    • stop

      public void stop()
      Description copied from class: Protocol
      This method is called on a Channel.disconnect(). Stops work (e.g. by closing multicast socket). Will be called from top to bottom. This means that at the time of the method invocation the neighbor protocol below is still working. This method will replace the STOP, STOP_OK, CLEANUP and CLEANUP_OK events. The ProtocolStack guarantees that when this method is called all messages in the down queue will have been flushed
      Overrides:
      stop in class Protocol
    • run

      public void run()
      Specified by:
      run in interface Runnable