Move the references to javax.servlet into the anonymous class
Merge pull request #857 from HiJon89/master

Move the references to javax.servlet classes into the anonymous class
Use 'mvn license:format -N' at top of project to add missing headers
Results of 'mvn license:format -N' plus some minor tweaking
Merge pull request #845 from mcculls/add-missing-license-headers

Add missing license headers (and support easy means to add headers in the future)
Allow JPA properties to be Objects as well as simple strings.

JpaPersistService takes a parameter thus:
   Properties persistenceProperties

However, this is used later to create an entity manager:
  Persistence.createEntityManagerFactory(persistenceUnitName,
                                         persistenceProperties);

The signature for that method is (String, Map) NOT (String, Properties).

If one is using Hibernate, you can pass the desired DataSource object in
using that Map with Environment.DATASOURCE storing the actual object.
Clearly you cannot do that if it's Properties (String->String map)

Changing this so that the persistenceProperties is a Map would solves this,
so you may now do (for example)

  DataSource ds = ...;
  Map p = new HashMap();
  p.put( Environment.DATASOURCE, ds );
  JpaPersistModule jpaPersistModule = new JpaPersistModule("myapp-db")
                                          .properties(p);

Since all Properties objects *are* Map instances, this is a non-breaking
change.

Signed-off-by: Nigel Magnay <nigel.magnay@gmail.com>
Update tests to use JPA 2.0.

Stopping the persistence service now causes a 'service not registered'
exception, hence catch that as it is not an error.

Signed-off-by: Nigel Magnay <nigel.magnay@gmail.com>
Introduce a test that shows a JPA provider being passed a datasource
from guice in a map, rather than from the persistence.xml file.

Note that this requires a modern version of hibernate since older versions
did not correctly process passed objects.

Signed-off-by: Nigel Magnay <nigel.magnay@gmail.com>
Merge pull request #839 from magnayn/master

Allow JPA properties to be Objects as well as simple strings.
Add support for java.util.Optional, reflectively.  If the class exists, we bind
it the same way we bind com.google.common.base.Optional.  Update tests
accordingly.
-------------
Created by MOE: http://code.google.com/p/moe-java
MOE_MIGRATED_REVID=77215848
Merge pull request #859 from google/moe_writing_branch_from_74b915b1eaa6de6b5efcf905b346b24ff563bbbb

Merge internal changes