Skip to content

Commit

Permalink
[playframework#59] Docs: class enhancement
Browse files Browse the repository at this point in the history
  • Loading branch information
Peter Hilton (Lunatech) authored and greenlaw110 committed Aug 25, 2011
1 parent 01ff9e2 commit 25c66eb
Showing 1 changed file with 10 additions and 10 deletions.
20 changes: 10 additions & 10 deletions documentation/manual/main.textile
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -134,20 +134,20 @@ For example, using the NetBeans debugger:

h2. Class enhancement

A Play plug-in (i.e. a subclass of @play.PlayPlugin@) may include ‘enhancers’ that modify application classes at runtime, to add functionality. This is how some of Play’s magic works.
A Play plug-in (i.e. a subclass of **play.PlayPlugin**) may include ‘enhancers’ that modify application classes at runtime, to add functionality. This is how some of Play’s magic works.

The built-in @play.CorePlugin@ uses enhancers from the @play.classloading.enhancers@ package to dynamically add code to your application’s classes:
The built-in **play.CorePlugin** uses several enhancers from the **play.classloading.enhancers** package to dynamically add code to your application’s classes:

* @ContinuationEnhancer@ - adds continuations support to controller classes
* @ControllersEnhancer@ - makes controller action methods thread-safe and adds HTTP redirects for method calls
* @LocalvariablesNamesEnhancer@ - tracks local variable names in controllers
* @MailerEnhancer@ - sets-up @play.mvc.Mailer@ subclasses
* @PropertiesEnhancer@ - turns all application classes into valid JavaBeans, with properties based on fields
* @SigEnhancer@ - computes a unique hash for each class’ signature, to enable automatic reloading.
* **ContinuationEnhancer** - adds continuations support to controller classes
* **ControllersEnhancer** - makes controller action methods thread-safe and adds HTTP redirects for method calls
* **LocalvariablesNamesEnhancer** - tracks local variable names in controllers
* **MailerEnhancer** - sets-up **play.mvc.Mailer** subclasses
* **PropertiesEnhancer** - turns all application classes into valid JavaBeans, with properties based on fields
* **SigEnhancer** - computes a unique hash for each class’ signature, to enable automatic reloading.

In addition, the @play.db.jpa.JPAPlugin@ enhances subclasses of @play.db.jpa.JPABase@ with implementations of the convenience methods for JPA queries. This normally applies to your application's model classes that subclass @play.db.jpa.Model@. The JPA queries in question are those defined in @play.db.jpa.GenericModel@.
In addition, the **play.db.jpa.JPAPlugin** enhances subclasses of **play.db.jpa.JPABase** with implementations of the convenience methods for JPA queries. This normally applies to your application's model classes that subclass **play.db.jpa.Model**. The JPA queries in question are those defined in **play.db.jpa.GenericModel**.

To add your own enhancer, use a subclass of @play.classloading.enhancers.Enhancer@ in your plug-in’s @enhance(ApplicationClass)@ method.
To add your own enhancer, call a subclass of **play.classloading.enhancers.Enhancer** from your plug-in’s **enhance(ApplicationClass)** method.

p(note). **Continuing the discussion**

Expand Down

0 comments on commit 25c66eb

Please sign in to comment.