Created
January 12, 2018 19:23
-
-
Save vegegoku/6bcae1ce42d93835bf25e015e4fccb8f to your computer and use it in GitHub Desktop.
Inject context without super sourcing
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
public class Base { | |
private static final Logger LOGGER=Logger.getLogger(Base.class.getName()); | |
public void log(){ | |
LOGGER.info("Hello from JS base...."); | |
} | |
} |
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
public void onModuleLoad() { | |
JavaBase base=new JavaBase(); | |
base.log();//will log Hello from JS base.... | |
} |
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
public class JavaBase extends Base { | |
private static final Logger LOGGER=Logger.getLogger(JavaBase.class.getName()); | |
@GwtIncompatible | |
@Override | |
public void log() { | |
LOGGER.info("Hello from Java base-----"); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment