Whitespace fix.
[Sone.git] / src / main / java / net / pterodactylus / sone / web / WebInterface.java
index fce52c4..7fb8da9 100644 (file)
@@ -57,7 +57,6 @@ import net.pterodactylus.sone.web.page.PageToadlet;
 import net.pterodactylus.sone.web.page.PageToadletFactory;
 import net.pterodactylus.sone.web.page.StaticPage;
 import net.pterodactylus.util.logging.Logging;
-import net.pterodactylus.util.service.AbstractService;
 import net.pterodactylus.util.template.DateFilter;
 import net.pterodactylus.util.template.DefaultTemplateFactory;
 import net.pterodactylus.util.template.MatchFilter;
@@ -78,7 +77,7 @@ import freenet.l10n.BaseL10n;
  *
  * @author <a href="mailto:bombe@pterodactylus.net">David ‘Bombe’ Roden</a>
  */
-public class WebInterface extends AbstractService {
+public class WebInterface {
 
        /** The logger. */
        private static final Logger logger = Logging.getLogger(WebInterface.class);
@@ -99,7 +98,6 @@ public class WebInterface extends AbstractService {
         *            The Sone plugin
         */
        public WebInterface(SonePlugin sonePlugin) {
-               super("Sone Web Interface", false);
                this.sonePlugin = sonePlugin;
                formPassword = sonePlugin.pluginRespirator().getToadletContainer().getFormPassword();
        }
@@ -113,7 +111,7 @@ public class WebInterface extends AbstractService {
         *
         * @return The Sone core
         */
-       public Core core() {
+       public Core getCore() {
                return sonePlugin.core();
        }
 
@@ -122,7 +120,7 @@ public class WebInterface extends AbstractService {
         *
         * @return The node’s l10n helper
         */
-       public BaseL10n l10n() {
+       public BaseL10n getL10n() {
                return sonePlugin.l10n().getBase();
        }
 
@@ -131,7 +129,7 @@ public class WebInterface extends AbstractService {
         *
         * @return The node’s session manager
         */
-       public SessionManager sessionManager() {
+       public SessionManager getSessionManager() {
                try {
                        return sonePlugin.pluginRespirator().getSessionManager(new URI("/"));
                } catch (URISyntaxException use1) {
@@ -145,27 +143,25 @@ public class WebInterface extends AbstractService {
         *
         * @return The form password
         */
-       public String formPassword() {
+       public String getFormPassword() {
                return formPassword;
        }
 
        //
-       // SERVICE METHODS
+       // ACTIONS
        //
 
        /**
-        * {@inheritDoc}
+        * Starts the web interface and registers all toadlets.
         */
-       @Override
-       protected void serviceStart() {
+       public void start() {
                registerToadlets();
        }
 
        /**
-        * {@inheritDoc}
+        * Stops the web interface and unregisters all toadlets.
         */
-       @Override
-       protected void serviceStop() {
+       public void stop() {
                unregisterToadlets();
        }
 
@@ -180,12 +176,12 @@ public class WebInterface extends AbstractService {
                DefaultTemplateFactory templateFactory = new DefaultTemplateFactory();
                templateFactory.addAccessor(Object.class, new ReflectionAccessor());
                templateFactory.addAccessor(Collection.class, new CollectionAccessor());
-               templateFactory.addAccessor(Sone.class, new SoneAccessor(core()));
-               templateFactory.addAccessor(Post.class, new PostAccessor(core()));
-               templateFactory.addAccessor(Reply.class, new ReplyAccessor(core()));
-               templateFactory.addAccessor(Identity.class, new IdentityAccessor(core()));
+               templateFactory.addAccessor(Sone.class, new SoneAccessor(getCore()));
+               templateFactory.addAccessor(Post.class, new PostAccessor(getCore()));
+               templateFactory.addAccessor(Reply.class, new ReplyAccessor(getCore()));
+               templateFactory.addAccessor(Identity.class, new IdentityAccessor(getCore()));
                templateFactory.addFilter("date", new DateFilter());
-               templateFactory.addFilter("l10n", new L10nFilter(l10n()));
+               templateFactory.addFilter("l10n", new L10nFilter(getL10n()));
                templateFactory.addFilter("substring", new SubstringFilter());
                templateFactory.addFilter("xml", new XmlFilter());
                templateFactory.addFilter("change", new RequestChangeFilter());
@@ -338,4 +334,5 @@ public class WebInterface extends AbstractService {
                }
 
        }
+
 }