play
Class Plugin

java.lang.Object
  extended by play.Plugin
All Implemented Interfaces:
play.api.Plugin
Direct Known Subclasses:
EbeanPlugin, JPAPlugin

public class Plugin
extends java.lang.Object
implements play.api.Plugin

A Play plugin. A plugin must define a single argument constructor that accepts an Application, for example:

 public class MyPlugin extends Plugin {
     private final Application app;
     public MyPlugin(Application app) {
         this.app = app;
     }
     public void onStart() {
         Logger.info("Plugin started!");
     }
 }
 


Constructor Summary
Plugin()
           
 
Method Summary
 boolean enabled()
          Is this plugin enabled.
 void onStart()
          Called when the application starts.
 void onStop()
          Called when the application stops.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Plugin

public Plugin()
Method Detail

onStart

public void onStart()
Called when the application starts.

Specified by:
onStart in interface play.api.Plugin

onStop

public void onStop()
Called when the application stops.

Specified by:
onStop in interface play.api.Plugin

enabled

public boolean enabled()
Is this plugin enabled.

Specified by:
enabled in interface play.api.Plugin