// This method is called when the plugin should shutdown. @Override public void stop() { Log.getInstance().write(Log.LOGLEVEL_TRACE, "stop: Stop received from Plugin Manager."); if (Global.IsClient()) { Log.getInstance().write(Log.LOGLEVEL_WARN, "stop: Running in Client mode."); return; } // registry.eventUnsubscribe(listener, "RecordingCompleted"); registry.eventUnsubscribe(listener, "RecordingStopped"); showInFocus = null; }
@Override public void start() { System.out.println("LIR: Plugin: Starting. Version = " + VERSION); // Set the loglevel to what's in the .properties file. Integer DefaultLevel = Log.LOGLEVEL_WARN; String CurrentLevel = Configuration.GetServerProperty(Log.PROPERTY_LOGLEVEL, DefaultLevel.toString()); Integer SetLevel = Integer.decode(CurrentLevel); Log.getInstance().SetLogLevel(SetLevel); switch (Log.getInstance().GetLogLevel()) { case Log.LOGLEVEL_ALL: System.out.println("LIR: Plugin: LogLevel = Maximum."); break; case Log.LOGLEVEL_ERROR: System.out.println("LIR: Plugin: LogLevel = Error."); break; case Log.LOGLEVEL_NONE: System.out.println("LIR: Plugin: LogLevel = None."); break; case Log.LOGLEVEL_TRACE: System.out.println("LIR: Plugin: LogLevel = Trace."); break; case Log.LOGLEVEL_VERBOSE: System.out.println("LIR: Plugin: LogLevel = Verbose."); break; case Log.LOGLEVEL_WARN: System.out.println("LIR: Plugin: LogLevel = Warn."); break; default: System.out.println("LIR: Plugin: Error. Unknown LogLevel."); break; } // If we're running on a client we are done. if (Global.IsClient()) { Log.getInstance().write(Log.LOGLEVEL_WARN, "start: Running in Client mode."); return; } // Subscribe to what we need. Log.getInstance().write(Log.LOGLEVEL_TRACE, "start: Subscribing to events."); // registry.eventSubscribe(listener, "RecordingCompleted"); registry.eventSubscribe(listener, "RecordingStopped"); }