String env = SystemProperty.environment.value().toString(); String responseMsg = env + ",";
static RawGcsService createRawGcsService(Map<String, String> headers) { ImmutableSet.Builder<HTTPHeader> builder = ImmutableSet.builder(); if (headers != null) { for (Map.Entry<String, String> header : headers.entrySet()) { builder.add(new HTTPHeader(header.getKey(), header.getValue())); } } RawGcsService rawGcsService; Value location = SystemProperty.environment.value(); if (location == SystemProperty.Environment.Value.Production || hasCustomAccessTokenProvider()) { rawGcsService = OauthRawGcsServiceFactory.createOauthRawGcsService(builder.build()); } else if (location == SystemProperty.Environment.Value.Development) { rawGcsService = LocalRawGcsServiceFactory.createLocalRawGcsService(); } else { Delegate<?> delegate = ApiProxy.getDelegate(); if (delegate == null || delegate.getClass().getName().startsWith("com.google.appengine.tools.development")) { rawGcsService = LocalRawGcsServiceFactory.createLocalRawGcsService(); } else { rawGcsService = OauthRawGcsServiceFactory.createOauthRawGcsService(builder.build()); } } return rawGcsService; }
/** * Install our hook in the delegate system. This happens automatically when this class is * loaded, which is typically what you want when working with Objectify. It gets a lot * more complicated when you're working with the RemoteApiInstaller. */ public static synchronized void install() { // Already installed if (ApiProxy.getDelegate() instanceof TriggerFutureHook) return; @SuppressWarnings("unchecked") TriggerFutureHook hook = new TriggerFutureHook(ApiProxy.getDelegate()); if (SystemProperty.environment.value() == SystemProperty.Environment.Value.Production) ApiProxy.setDelegate(hook); else ApiProxy.setDelegate(wrapPartially(ApiProxy.getDelegate(), hook)); }
public static boolean isDev() { return SystemProperty.environment.value() == Value.Development; }
public static boolean isProduction() { return Environment.Value.Production.name() == SystemProperty.Environment.environment.get(); }
@Override protected final Injector getInjector() { if ( SystemProperty.environment.value() == SystemProperty.Environment.Value.Production ) { // The app is running on App Engine... return getProductionInjector(); } else { // The app is running on local development SDK... return getDevelopmentInjector(); } }
public static boolean isDevServer(){ return SystemProperty.environment.value() == SystemProperty.Environment.Value.Development; } }
/** * Check if we are running on the Dev environment * @return */ public static boolean isDevelopment() { return (SystemProperty.environment.value() == SystemProperty.Environment.Value.Development); }
@Override public boolean isProduction() { return SystemProperty.environment.value() == SystemProperty.Environment.Value.Production; }
@Override public boolean isDevelopment() { return SystemProperty.environment.value() == SystemProperty.Environment.Value.Development; }
@Override public boolean isInGaeCloud() { try { return com.google.appengine.api.utils.SystemProperty.environment.value() == com.google.appengine.api.utils.SystemProperty.Environment.Value.Production; } catch (Throwable t) { // Nothing to do } return false; } }
@Override public boolean isInGaeCloud() { try { return com.google.appengine.api.utils.SystemProperty.environment.value() == com.google.appengine.api.utils.SystemProperty.Environment.Value.Production; } catch (Throwable t) { // Nothing to do } return false; } }
@Override protected void doStart() throws Exception { this.helper = createHelper(); this.environment = ApiProxy.getCurrentEnvironment(); getServletContext().setAttribute(API_PROXY_LOCAL, ApiProxy.getDelegate()); getServletContext().setAttribute(APPENGINE_WEB_XML, readAppengineWebXml()); getServletContext().setAttribute(WEB_XML, readWebXml()); SystemProperty.environment.set(SystemProperty.Environment.Value.Development); configureUserRealmAppengineHelper(); super.doStart(); }