package net.kencochrane.raven.appengine.event.helper;

import com.google.apphosting.api.ApiProxy;
import net.kencochrane.raven.event.EventBuilder;
import net.kencochrane.raven.event.helper.EventBuilderHelper;

/**
 * EventBuildHelper defining Google App Engine specific properties (hostname).
 */
public class AppEngineEventBuilderHelper implements EventBuilderHelper {
    /**
     * Property used internally by GAE to define
     */
    private static final String CURRENT_VERSION_HOSTNAME_PROPERTY = "com.google.appengine.runtime.default_version_hostname";

    @Override
    public void helpBuildingEvent(EventBuilder eventBuilder) {
        ApiProxy.Environment env = ApiProxy.getCurrentEnvironment();
        eventBuilder.setServerName((String) env.getAttributes().get(CURRENT_VERSION_HOSTNAME_PROPERTY));
    }
}

@@ -419,16 +419,153 @@
 o define
+ the hostname.%0A     *%0A     * @see %3Ca href=%22https://developers.google.com/appengine/docs/java/appidentity/%22%3EGAE: App Identity Java API%3C/a%3E
 %0A     */
@@ -837,16 +837,79 @@
 ment();%0A
+        // Set the hostname to the actual application hostname%0A
         

Fix documentation