-
Notifications
You must be signed in to change notification settings - Fork 48
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add WebListener to init() Objectify 6 (#3213)
- Loading branch information
1 parent
d1f635f
commit 98bb7e7
Showing
8 changed files
with
158 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
22 changes: 22 additions & 0 deletions
22
....tools.eclipse.util.test/testData/templates/appengine/objectifyWebListenerWithPackage.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
package com.example; | ||
|
||
import javax.servlet.ServletContextEvent; | ||
import javax.servlet.ServletContextListener; | ||
import javax.servlet.annotation.WebListener; | ||
|
||
import com.googlecode.objectify.ObjectifyService; | ||
|
||
@WebListener | ||
public class ObjectifyWebListener implements ServletContextListener { | ||
|
||
@Override | ||
public void contextInitialized(ServletContextEvent event) { | ||
ObjectifyService.init(); | ||
// Here is also a great place to register your POJO entity classes. | ||
// ObjectifyService.register(YourEntity.class); | ||
} | ||
|
||
@Override | ||
public void contextDestroyed(ServletContextEvent event) { | ||
} | ||
} |
20 changes: 20 additions & 0 deletions
20
...ols.eclipse.util.test/testData/templates/appengine/objectifyWebListenerWithoutPackage.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
import javax.servlet.ServletContextEvent; | ||
import javax.servlet.ServletContextListener; | ||
import javax.servlet.annotation.WebListener; | ||
|
||
import com.googlecode.objectify.ObjectifyService; | ||
|
||
@WebListener | ||
public class ObjectifyWebListener implements ServletContextListener { | ||
|
||
@Override | ||
public void contextInitialized(ServletContextEvent event) { | ||
ObjectifyService.init(); | ||
// Here is also a great place to register your POJO entity classes. | ||
// ObjectifyService.register(YourEntity.class); | ||
} | ||
|
||
@Override | ||
public void contextDestroyed(ServletContextEvent event) { | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
22 changes: 22 additions & 0 deletions
22
...ins/com.google.cloud.tools.eclipse.util/templates/appengine/ObjectifyWebListener.java.ftl
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
<#if package != "">package ${package}; | ||
|
||
</#if>import javax.servlet.ServletContextEvent; | ||
import javax.servlet.ServletContextListener; | ||
import javax.servlet.annotation.WebListener; | ||
|
||
import com.googlecode.objectify.ObjectifyService; | ||
|
||
@WebListener | ||
public class ObjectifyWebListener implements ServletContextListener { | ||
|
||
@Override | ||
public void contextInitialized(ServletContextEvent event) { | ||
ObjectifyService.init(); | ||
// Here is also a great place to register your POJO entity classes. | ||
// ObjectifyService.register(YourEntity.class); | ||
} | ||
|
||
@Override | ||
public void contextDestroyed(ServletContextEvent event) { | ||
} | ||
} |