Re: [appengine-java] Re: Is there a recommended way to differentiate between production and dev GAE environments?

2009-12-21 Thread Yasuo Higa
Hi all, App Engine officially supports a way to differentiate between production and development as follows: String env = System.getProperty("com.google.appengine.runtime.environment"); if ("Development".equals(env)) { ... } else if ("Production".equals(env)) { ... } See http://code.goog

Re: [appengine-java] Re: Is there a recommended way to differentiate between production and dev GAE environments?

2009-12-21 Thread Don Schwarz
As of 1.3.0, we also set the com.google.appengine.runtime.environment system property and alternatively provide this programmatic API (which does not require access to a ServletContext): http://code.google.com/appengine/docs/java/javadoc/com/google/appengine/api/utils/SystemProperty.html On Mon,

[appengine-java] Re: Is there a recommended way to differentiate between production and dev GAE environments?

2009-12-21 Thread Jorge
I found this in the Programming GAE book by Dan Sanderson, O'Reilly, 2010: "An app can determine whether it is running on AppEngine or in the development server from the servlet info string in the srvlet context, returned by this.getServletContext()getServletInfo(). This string starts with Google

[appengine-java] Re: Is there a recommended way to differentiate between production and dev GAE environments?

2009-11-28 Thread Guillaume Laforge
Another approach I've just found is doing something like: ApiProxy.getCurrentEnvironment().getClass().getName().contains ("LocalHttpRequestEnvironment") Not sure in the end what's the best approach of them all. On 24 nov, 16:29, Marcel Overdijk wrote: > Or use a Listener as described > herehtt

[appengine-java] Re: Is there a recommended way to differentiate between production and dev GAE environments?

2009-11-25 Thread Jorge
My approach is quite simpler. I keep a configuration file where I setup a different webBaseURL depending on the environment, development VS production. One could a a boolean isProduction and make webBaseURL a function of that. The thing to remember is to setup the config file before uploading to G

Re: [appengine-java] Re: Is there a recommended way to differentiate between production and dev GAE environments?

2009-11-24 Thread Rusty Wright
The filesystem is read only on app engine; would trying to create a file, in WEB-INF for example, work? I'm wondering if there are corner cases I'm not thinking of where that might fail and falsely report that you're on app engine; for example, if you were doing integration tests under Hudson.

[appengine-java] Re: Is there a recommended way to differentiate between production and dev GAE environments?

2009-11-24 Thread Marcel Overdijk
Or use a Listener as described here http://marceloverdijk.blogspot.com/2009/10/determining-runtime-environment-on.html On 23 nov, 15:58, Nacho Coloma wrote: > To answer my own question, this has been my best shot this far: > > SecurityManager sm = System.getSecurityManager(); > localDevelopmentEn

[appengine-java] Re: Is there a recommended way to differentiate between production and dev GAE environments?

2009-11-23 Thread Nacho Coloma
Thanks! I searched a lot but didn't get to this thread. On Nov 23, 4:13 pm, leszek wrote: > Follow that thread: > > http://groups.google.co.uk/group/google-appengine-java/browse_frm/thr... -- You received this message because you are subscribed to the Google Groups "Google App Engine for Java"

[appengine-java] Re: Is there a recommended way to differentiate between production and dev GAE environments?

2009-11-23 Thread leszek
Follow that thread: http://groups.google.co.uk/group/google-appengine-java/browse_frm/thread/8145f547cbaff99e/453847dda0217e71?q=#453847dda0217e71 -- You received this message because you are subscribed to the Google Groups "Google App Engine for Java" group. To post to this group, send email t

[appengine-java] Re: Is there a recommended way to differentiate between production and dev GAE environments?

2009-11-23 Thread Nacho Coloma
To answer my own question, this has been my best shot this far: SecurityManager sm = System.getSecurityManager(); localDevelopmentEnvironment = sm == null || "com.google.appengine.tools.development.DevAppServerFactory $CustomSecurityManager".equals(sm.getClass().getName()); If anyone has a better