I agree. My workaround was to create a ServletEventListener and put this in
the contextInitialized() method:
System.setProperty( "appengine.server",
event.getServletContext().getServerInfo().contains( "Development" ) ?
"development" : "production" );
Vince
On Thu, Dec 3, 2009 at 1:15 PM, Jeff Schnitzer <[email protected]> wrote:
> Why isn't there a system property that can be used to detect if a
> program is running on appengine?
>
> This is really a glaring oversight. I would expect something like
> System.getProperty("google.appengine") to be "development" or
> "production" (or of course null).
>
> Before someone says "check the servlet context", realize that this is
> grossly inadequate - library writers do not have access to the servlet
> context.
>
> I'm trying to get the Hessian RPC library working on appengine so we
> have an easy-to-use web services protocol. One of the first things
> the hessian java client does is teardown any keepalive connections by
> making a quick request expired at 10ms. This terminates with a caught
> IOException in the normal world, but produces an
> ApiDeadlineExceededException in appengine.
>
> I'd like to simply short-circuit this unnecessary behavior when
> running on appengine. I found the SecurityManager check but that
> seems unreliable. Why isn't there a nice easy system property?
>
> Thanks,
> Jeff
>
> --
>
> 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 to
> [email protected].
> To unsubscribe from this group, send email to
> [email protected]<google-appengine-java%[email protected]>
> .
> For more options, visit this group at
> http://groups.google.com/group/google-appengine-java?hl=en.
>
>
>
--
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 to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/google-appengine-java?hl=en.