org.jgroups.protocols
Class BSH
java.lang.Object
org.jgroups.stack.Protocol
org.jgroups.protocols.BSH
- All Implemented Interfaces:
- java.lang.Runnable
public class BSH
- extends Protocol
- implements java.lang.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 Summary |
protected java.lang.Thread |
acceptor
|
protected bsh.Interpreter |
interpreter
|
protected java.util.List<java.net.Socket> |
sockets
|
protected java.net.ServerSocket |
srv_sock
|
Constructor Summary |
BSH()
|
Methods inherited from class org.jgroups.stack.Protocol |
destroy, down, dumpStats, enableStats, getConfigurableObjects, getDownProtocol, getDownServices, getId, getIdsAbove, getLevel, getName, getProtocolStack, getSocketFactory, getThreadFactory, getTransport, getUpProtocol, getUpServices, getValue, init, isErgonomics, printStats, providedDownServices, providedUpServices, requiredDownServices, requiredUpServices, resetStatistics, resetStats, setDownProtocol, setErgonomics, setId, setLevel, setProtocolStack, setSocketFactory, setUpProtocol, setValue, setValues, statsEnabled, up |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
interpreter
protected bsh.Interpreter interpreter
srv_sock
protected java.net.ServerSocket srv_sock
acceptor
protected java.lang.Thread acceptor
sockets
protected final java.util.List<java.net.Socket> sockets
BSH
public BSH()
getCurrentPort
public int getCurrentPort()
start
public void start()
throws java.lang.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:
java.lang.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 java.lang.Runnable
Copyright © 1998-2012 Bela Ban / Red Hat. All Rights Reserved.