Removed the jython debug interface module
diff --git a/conf/onos.properties b/conf/onos.properties
index 668da42..d186e54 100644
--- a/conf/onos.properties
+++ b/conf/onos.properties
@@ -11,7 +11,6 @@
net.floodlightcontroller.restserver.RestApiServer.port = 8080
net.floodlightcontroller.core.FloodlightProvider.openflowport = 6633
net.floodlightcontroller.core.FloodlightProvider.workerthreads = 16
-net.floodlightcontroller.jython.JythonDebugInterface.port = 6655
net.floodlightcontroller.forwarding.Forwarding.idletimeout = 5
net.floodlightcontroller.forwarding.Forwarding.hardtimeout = 0
net.floodlightcontroller.onoslistener.OnosPublisher.dbconf = /tmp/cassandra.titan
diff --git a/pom.xml b/pom.xml
index 0d03e90..3428e40 100644
--- a/pom.xml
+++ b/pom.xml
@@ -204,11 +204,11 @@
<artifactId>concurrentlinkedhashmap-lru</artifactId>
<version>1.2</version>
</dependency>
- <dependency>
+ <!--<dependency>
<groupId>org.python</groupId>
<artifactId>jython-standalone</artifactId>
<version>2.5.2</version>
- </dependency>
+ </dependency>-->
<dependency>
<groupId>org.apache.thrift</groupId>
<artifactId>libthrift</artifactId>
diff --git a/src/main/java/net/floodlightcontroller/jython/JythonDebugInterface.java b/src/main/java/net/floodlightcontroller/jython/JythonDebugInterface.java
deleted file mode 100644
index 19a97b5..0000000
--- a/src/main/java/net/floodlightcontroller/jython/JythonDebugInterface.java
+++ /dev/null
@@ -1,68 +0,0 @@
-package net.floodlightcontroller.jython;
-
-import java.util.Collection;
-import java.util.HashMap;
-import java.util.Map;
-
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-import net.floodlightcontroller.core.module.FloodlightModuleContext;
-import net.floodlightcontroller.core.module.FloodlightModuleException;
-import net.floodlightcontroller.core.module.IFloodlightModule;
-import net.floodlightcontroller.core.module.IFloodlightService;
-
-public class JythonDebugInterface implements IFloodlightModule {
- protected static Logger log = LoggerFactory.getLogger(JythonDebugInterface.class);
- protected JythonServer debug_server;
- protected static int JYTHON_PORT = 6655;
-
- @Override
- public Collection<Class<? extends IFloodlightService>> getModuleServices() {
- // We don't export services
- return null;
- }
-
- @Override
- public Map<Class<? extends IFloodlightService>, IFloodlightService>
- getServiceImpls() {
- // We don't export services
- return null;
- }
-
- @Override
- public Collection<Class<? extends IFloodlightService>>
- getModuleDependencies() {
- // We don't have any dependencies
- return null;
- }
-
- @Override
- public void init(FloodlightModuleContext context)
- throws FloodlightModuleException {
- // no-op
- }
-
- @Override
- public void startUp(FloodlightModuleContext context) {
- Map<String, Object> locals = new HashMap<String, Object>();
- // add all existing module references to the debug server
- for (Class<? extends IFloodlightService> s : context.getAllServices()) {
- // Put only the last part of the name
- String[] bits = s.getCanonicalName().split("\\.");
- String name = bits[bits.length-1];
- locals.put(name, context.getServiceImpl(s));
- }
-
- // read our config options
- Map<String, String> configOptions = context.getConfigParams(this);
- int port = JYTHON_PORT;
- String portNum = configOptions.get("port");
- if (portNum != null) {
- port = Integer.parseInt(portNum);
- }
-
- JythonServer debug_server = new JythonServer(port, locals);
- debug_server.start();
- }
-}
diff --git a/src/main/java/net/floodlightcontroller/jython/JythonServer.java b/src/main/java/net/floodlightcontroller/jython/JythonServer.java
deleted file mode 100644
index fc35b15..0000000
--- a/src/main/java/net/floodlightcontroller/jython/JythonServer.java
+++ /dev/null
@@ -1,63 +0,0 @@
-package net.floodlightcontroller.jython;
-
-import java.net.URL;
-import java.util.HashMap;
-import java.util.Map;
-
-import org.python.util.PythonInterpreter;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-/**
- * This class starts a thread that runs a jython interpreter that
- * can be used for debug (or even development).
- *
- * @author mandeepdhami
- *
- */
-public class JythonServer extends Thread {
- protected static Logger log = LoggerFactory.getLogger(JythonServer.class);
-
- int port;
- Map<String, Object> locals;
-
- /**
- * @param port_ Port to use for jython server
- * @param locals_ Locals to add to the interpreters top level name space
- */
- public JythonServer(int port_, Map<String, Object> locals_) {
- this.port = port_ ;
- this.locals = locals_;
- if (this.locals == null) {
- this.locals = new HashMap<String, Object>();
- }
- this.locals.put("log", JythonServer.log);
- this.setName("debugserver");
- }
-
- /**
- * The main thread for this class invoked by Thread.run()
- *
- * @see java.lang.Thread#run()
- */
- public void run() {
- PythonInterpreter p = new PythonInterpreter();
- for (String name : this.locals.keySet()) {
- p.set(name, this.locals.get(name));
- }
-
- URL jarUrl = JythonServer.class.getProtectionDomain().getCodeSource().getLocation();
- String jarPath = jarUrl.getPath();
- if (jarUrl.getProtocol().equals("file")) {
- // If URL is of type file, assume that we are in dev env and set path to python dir.
- // else use the jar file as is
- jarPath = jarPath + "../../src/main/python/";
- }
-
- p.exec("import sys");
- p.exec("sys.path.append('" + jarPath + "')");
- p.exec("from debugserver import run_server");
- p.exec("run_server(" + this.port + ", '0.0.0.0', locals())");
- }
-
-}
diff --git a/src/main/python/PythonClient.py b/src/main/python/PythonClient.py
deleted file mode 100644
index 5c9890e..0000000
--- a/src/main/python/PythonClient.py
+++ /dev/null
@@ -1,48 +0,0 @@
-#!/usr/bin/env python
-
-import sys
-sys.path.append('../../../target/gen-py')
-
-from packetstreamer import PacketStreamer
-from packetstreamer.ttypes import *
-
-from thrift import Thrift
-from thrift.transport import TSocket
-from thrift.transport import TTransport
-from thrift.protocol import TBinaryProtocol
-
-try:
-
- # Make socket
- transport = TSocket.TSocket('localhost', 9090)
-
- # Buffering is critical. Raw sockets are very slow
- transport = TTransport.TFramedTransport(transport)
-
- # Wrap in a protocol
- protocol = TBinaryProtocol.TBinaryProtocol(transport)
-
- # Create a client to use the protocol encoder
- client = PacketStreamer.Client(protocol)
-
- # Connect!
- transport.open()
-
- while 1:
- packets = client.getPackets("session1")
- print 'session1 packets num: %d' % (len(packets))
- count = 1
- for packet in packets:
- print "Packet %d: %s"% (count, packet)
- if "FilterTimeout" in packet:
- sys.exit()
- count += 1
-
- # Close!
- transport.close()
-
-except Thrift.TException, tx:
- print '%s' % (tx.message)
-
-except KeyboardInterrupt, e:
- print 'Bye-bye'
diff --git a/src/main/python/PythonServer.py b/src/main/python/PythonServer.py
deleted file mode 100644
index c3c844e..0000000
--- a/src/main/python/PythonServer.py
+++ /dev/null
@@ -1,49 +0,0 @@
-#!/usr/bin/env python
-
-import sys
-import logging
-sys.path.append('../../../target/gen-py')
-
-from packetstreamer import PacketStreamer
-from packetstreamer.ttypes import *
-
-from thrift.transport import TSocket
-from thrift.transport import TTransport
-from thrift.protocol import TBinaryProtocol
-from thrift.server import TServer
-
-class PacketStreamerHandler:
- def __init__(self):
- logging.handlers.codecs = None
- self.log = logging.getLogger("packetstreamer")
- self.log.setLevel(logging.DEBUG)
- handler = logging.handlers.SysLogHandler("/dev/log")
- handler.setFormatter(logging.Formatter("%(name)s: %(levelname)s %(message)s"))
- self.log.addHandler(handler)
-
- def ping(self):
- self.log.debug('ping()')
- return true
-
- def pushPacketSync(self, packet):
- self.log.debug('receive a packet synchronously: %s' %(packet))
- return 0
-
- def pushPacketAsync(self, packet):
- self.log.debug('receive a packet Asynchronously: %s' %(packet))
-
-handler = PacketStreamerHandler()
-processor = PacketStreamer.Processor(handler)
-transport = TSocket.TServerSocket(9090)
-tfactory = TTransport.TBufferedTransportFactory()
-pfactory = TBinaryProtocol.TBinaryProtocolFactory()
-
-server = TServer.TSimpleServer(processor, transport, tfactory, pfactory)
-
-# You could do one of these for a multithreaded server
-#server = TServer.TThreadedServer(processor, transport, tfactory, pfactory)
-#server = TServer.TThreadPoolServer(processor, transport, tfactory, pfactory)
-
-print 'Starting the server...'
-server.serve()
-print 'done.'
diff --git a/src/main/python/compileall.py b/src/main/python/compileall.py
deleted file mode 100644
index b21d95f..0000000
--- a/src/main/python/compileall.py
+++ /dev/null
@@ -1,157 +0,0 @@
-"""Module/script to "compile" all .py files to .pyc (or .pyo) file.
-
-When called as a script with arguments, this compiles the directories
-given as arguments recursively; the -l option prevents it from
-recursing into directories.
-
-Without arguments, if compiles all modules on sys.path, without
-recursing into subdirectories. (Even though it should do so for
-packages -- for now, you'll have to deal with packages separately.)
-
-See module py_compile for details of the actual byte-compilation.
-
-"""
-
-import os
-import sys
-import py_compile
-
-__all__ = ["compile_dir","compile_path"]
-
-def compile_dir(dir, maxlevels=10, ddir=None,
- force=0, rx=None, quiet=0):
- """Byte-compile all modules in the given directory tree.
-
- Arguments (only dir is required):
-
- dir: the directory to byte-compile
- maxlevels: maximum recursion level (default 10)
- ddir: if given, purported directory name (this is the
- directory name that will show up in error messages)
- force: if 1, force compilation, even if timestamps are up-to-date
- quiet: if 1, be quiet during compilation
-
- """
- if not quiet:
- print 'Listing', dir, '...'
- try:
- names = os.listdir(dir)
- except os.error:
- print "Can't list", dir
- names = []
- names.sort()
- success = 1
- for name in names:
- fullname = os.path.join(dir, name)
- if ddir is not None:
- dfile = os.path.join(ddir, name)
- else:
- dfile = None
- if rx is not None:
- mo = rx.search(fullname)
- if mo:
- continue
- if os.path.isfile(fullname):
- head, tail = name[:-3], name[-3:]
- if tail == '.py':
- cfile = fullname + (__debug__ and 'c' or 'o')
- ftime = os.stat(fullname).st_mtime
- try: ctime = os.stat(cfile).st_mtime
- except os.error: ctime = 0
- if (ctime > ftime) and not force: continue
- if not quiet:
- print 'Compiling', fullname, '...'
- try:
- ok = py_compile.compile(fullname, None, dfile, True)
- except KeyboardInterrupt:
- raise KeyboardInterrupt
- except py_compile.PyCompileError,err:
- if quiet:
- print 'Compiling', fullname, '...'
- print err.msg
- success = 0
- except IOError, e:
- print "Sorry", e
- success = 0
- else:
- if ok == 0:
- success = 0
- elif maxlevels > 0 and \
- name != os.curdir and name != os.pardir and \
- os.path.isdir(fullname) and \
- not os.path.islink(fullname):
- if not compile_dir(fullname, maxlevels - 1, dfile, force, rx, quiet):
- success = 0
- return success
-
-def compile_path(skip_curdir=1, maxlevels=0, force=0, quiet=0):
- """Byte-compile all module on sys.path.
-
- Arguments (all optional):
-
- skip_curdir: if true, skip current directory (default true)
- maxlevels: max recursion level (default 0)
- force: as for compile_dir() (default 0)
- quiet: as for compile_dir() (default 0)
-
- """
- success = 1
- for dir in sys.path:
- if (not dir or dir == os.curdir) and skip_curdir:
- print 'Skipping current directory'
- else:
- success = success and compile_dir(dir, maxlevels, None,
- force, quiet=quiet)
- return success
-
-def main():
- """Script main program."""
- import getopt
- try:
- opts, args = getopt.getopt(sys.argv[1:], 'lfqd:x:')
- except getopt.error, msg:
- print msg
- print "usage: python compileall.py [-l] [-f] [-q] [-d destdir] " \
- "[-x regexp] [directory ...]"
- print "-l: don't recurse down"
- print "-f: force rebuild even if timestamps are up-to-date"
- print "-q: quiet operation"
- print "-d destdir: purported directory name for error messages"
- print " if no directory arguments, -l sys.path is assumed"
- print "-x regexp: skip files matching the regular expression regexp"
- print " the regexp is search for in the full path of the file"
- sys.exit(2)
- maxlevels = 10
- ddir = None
- force = 0
- quiet = 0
- rx = None
- for o, a in opts:
- if o == '-l': maxlevels = 0
- if o == '-d': ddir = a
- if o == '-f': force = 1
- if o == '-q': quiet = 1
- if o == '-x':
- import re
- rx = re.compile(a)
- if ddir:
- if len(args) != 1:
- print "-d destdir require exactly one directory argument"
- sys.exit(2)
- success = 1
- try:
- if args:
- for dir in args:
- if not compile_dir(dir, maxlevels, ddir,
- force, rx, quiet):
- success = 0
- else:
- success = compile_path()
- except KeyboardInterrupt:
- print "\n[interrupt]"
- success = 0
- return success
-
-if __name__ == '__main__':
- exit_status = int(not main())
- sys.exit(exit_status)
diff --git a/src/main/python/debugserver.py b/src/main/python/debugserver.py
deleted file mode 100644
index d8c81f9..0000000
--- a/src/main/python/debugserver.py
+++ /dev/null
@@ -1,76 +0,0 @@
-#!/usr/bin/env python
-
-import sys
-from threading import currentThread
-from SocketServer import BaseRequestHandler, TCPServer
-from code import InteractiveConsole
-
-_locals = None
-
-class DebugLogger(object):
- def do_print(self, *args):
- for i in args:
- print i,
- print
- info = do_print
- warn = do_print
- debug = do_print
-_log = DebugLogger()
-
-
-class DebugConsole(InteractiveConsole):
- def __init__(self, request):
- self.request = request
- InteractiveConsole.__init__(self, _locals)
-
- def raw_input(self, prompt):
- self.request.send(prompt)
- data = self.request.recv(10000).rstrip()
- if len(data) == 1 and ord(data[0]) == 4:
- sys.exit()
- return data
-
- def write(self, data):
- self.request.send(str(data))
-
- def write_nl(self, data):
- self.write(str(data)+"\r\n")
-
-class DebugServerHandler(BaseRequestHandler):
- def __init__(self, request, client_address, server):
- currentThread()._thread.setName("debugserver-%s:%d" % client_address)
- _log.debug('Open connection to DebugServer from %s:%d' % client_address)
- BaseRequestHandler.__init__(self, request, client_address, server)
-
- def handle(self):
- console = DebugConsole(self.request)
- sys.displayhook = console.write_nl
- console.interact('DebugServer')
- self.request.close()
-
-class DebugServer(TCPServer):
- daemon_threads = True
- allow_reuse_address = True
-
- def handle_error(self, request, client_address):
- _log.debug('Closing connection to DebugServer from %s:%d' % client_address)
- request.close()
-
-def run_server(port=6655, host='0.0.0.0', locals=locals()):
- currentThread()._thread.setName("debugserver-main")
-
- global _locals
- _locals = locals
- if "log" in locals.keys():
- global _log
- _log = locals["log"]
-
- _log.info("Starting DebugServer on port %d" % port)
- server = DebugServer(('', port), DebugServerHandler)
- try:
- server.serve_forever()
- except KeyboardInterrupt:
- pass
-
-if __name__ == "__main__":
- run_server()
diff --git a/src/main/resources/META-INF/services/net.floodlightcontroller.core.module.IFloodlightModule b/src/main/resources/META-INF/services/net.floodlightcontroller.core.module.IFloodlightModule
index f720188..d21c157 100644
--- a/src/main/resources/META-INF/services/net.floodlightcontroller.core.module.IFloodlightModule
+++ b/src/main/resources/META-INF/services/net.floodlightcontroller.core.module.IFloodlightModule
@@ -10,7 +10,6 @@
net.floodlightcontroller.perfmon.PktInProcessingTime
net.floodlightcontroller.perfmon.NullPktInProcessingTime
net.floodlightcontroller.restserver.RestApiServer
-net.floodlightcontroller.jython.JythonDebugInterface
net.floodlightcontroller.counter.CounterStore
net.floodlightcontroller.counter.NullCounterStore
net.floodlightcontroller.threadpool.ThreadPool