+public class SonePlugin implements FredPlugin, FredPluginL10n, FredPluginBaseL10n, FredPluginThreadless, FredPluginVersioned {
+
+ static {
+ /* initialize logging. */
+ Logging.setup("sone");
+ Logging.addLoggingListener(new LoggingListener() {
+
+ @Override
+ public void logged(LogRecord logRecord) {
+ Class<?> loggerClass = Logging.getLoggerClass(logRecord.getLoggerName());
+ int recordLevel = logRecord.getLevel().intValue();
+ if (recordLevel < Level.FINE.intValue()) {
+ freenet.support.Logger.debug(loggerClass, String.format(logRecord.getMessage(), logRecord.getParameters()), logRecord.getThrown());
+ } else if (recordLevel < Level.INFO.intValue()) {
+ freenet.support.Logger.minor(loggerClass, String.format(logRecord.getMessage(), logRecord.getParameters()), logRecord.getThrown());
+ } else if (recordLevel < Level.WARNING.intValue()) {
+ freenet.support.Logger.normal(loggerClass, String.format(logRecord.getMessage(), logRecord.getParameters()), logRecord.getThrown());
+ } else if (recordLevel < Level.SEVERE.intValue()) {
+ freenet.support.Logger.warning(loggerClass, String.format(logRecord.getMessage(), logRecord.getParameters()), logRecord.getThrown());
+ } else {
+ freenet.support.Logger.error(loggerClass, String.format(logRecord.getMessage(), logRecord.getParameters()), logRecord.getThrown());
+ }
+ }
+ });
+ }
+
+ /** The version. */
+ public static final Version VERSION = new Version("RC4", 0, 3, 2);
+
+ /** The logger. */
+ private static final Logger logger = Logging.getLogger(SonePlugin.class);
+
+ /** The plugin respirator. */
+ private PluginRespirator pluginRespirator;
+
+ /** The core. */
+ private Core core;
+
+ /** The web interface. */
+ private WebInterface webInterface;
+
+ /** The l10n helper. */
+ private PluginL10n l10n;
+
+ /** The plugin store. */
+ private PluginStore pluginStore;
+
+ /** The identity manager. */
+ private IdentityManager identityManager;
+
+ //
+ // ACCESSORS
+ //
+
+ /**
+ * Returns the plugin respirator for this plugin.
+ *
+ * @return The plugin respirator
+ */
+ public PluginRespirator pluginRespirator() {
+ return pluginRespirator;
+ }
+
+ /**
+ * Returns the core started by this plugin.
+ *
+ * @return The core
+ */
+ public Core core() {
+ return core;
+ }
+
+ /**
+ * Returns the plugin’s l10n helper.
+ *
+ * @return The plugin’s l10n helper
+ */
+ public PluginL10n l10n() {
+ return l10n;
+ }