Package com.google.gwt.dev

Examples of com.google.gwt.dev.ModuleHandle


        moduleName, sessionKey, agentTag, agentIcon);
    final ViewerServiceTreeLogger moduleLogger = new ViewerServiceTreeLogger(
        viewerServiceClient);
    moduleLogger.setLogHandle(logHandle);
    moduleLogger.setMaxDetail(getLogLevel());
    ModuleHandle handle = new ModuleHandle() {
      public TreeLogger getLogger() {
        return moduleLogger;
      }

      public void unload() {
View Full Code Here


  @Override
  public ExceptionOrReturnValue getProperty(BrowserChannel channel, int refId,
      int dispId) {
    BrowserChannelServer serverChannel = (BrowserChannelServer) channel;
    ModuleSpace moduleSpace = moduleMap.get(serverChannel);
    ModuleHandle moduleHandle = moduleHandleMap.get(serverChannel);
    assert moduleSpace != null && moduleHandle != null;
    TreeLogger logger = moduleHandle.getLogger();
    ServerObjectsTable localObjects = serverChannel.getJavaObjectsExposedInBrowser();
    try {
      JsValueOOPHM obj = new JsValueOOPHM();
      DispatchObject dispObj;
      CompilingClassLoader ccl = moduleSpace.getIsolatedClassLoader();
View Full Code Here

  public ExceptionOrReturnValue invoke(BrowserChannel channel, Value thisVal,
      int methodDispatchId, Value[] args) {
    BrowserChannelServer serverChannel = (BrowserChannelServer) channel;
    ServerObjectsTable localObjects = serverChannel.getJavaObjectsExposedInBrowser();
    ModuleSpace moduleSpace = moduleMap.get(serverChannel);
    ModuleHandle moduleHandle = moduleHandleMap.get(serverChannel);
    assert moduleSpace != null && moduleHandle != null;
    TreeLogger logger = moduleHandle.getLogger();
    CompilingClassLoader cl = moduleSpace.getIsolatedClassLoader();

    // Treat dispatch id 0 as toString()
    if (methodDispatchId == 0) {
      methodDispatchId = cl.getDispId("java.lang.Object::toString()");
View Full Code Here

  public synchronized TreeLogger loadModule(BrowserChannel channel,
      String moduleName, String userAgent, String url, String tabKey,
      String sessionKey, byte[] userAgentIcon) {
    PerfLogger.start("OophmSessionHandler.loadModule " + moduleName);
    BrowserChannelServer serverChannel = (BrowserChannelServer) channel;
    ModuleHandle moduleHandle = host.createModuleLogger(moduleName, userAgent,
        url, tabKey, sessionKey, serverChannel, userAgentIcon);
    TreeLogger logger = moduleHandle.getLogger();
    moduleHandleMap.put(serverChannel, moduleHandle);
    ModuleSpace moduleSpace = null;
    try {
      // Attach a new ModuleSpace to make it programmable.
      ModuleSpaceHost msh = host.createModuleSpaceHost(moduleHandle,
          moduleName);
      moduleSpace = new ModuleSpaceOOPHM(msh, moduleName, serverChannel);
      moduleMap.put(serverChannel, moduleSpace);
      PerfLogger.start("ModuleSpace.onLoad");
      moduleSpace.onLoad(logger);
      moduleHandle.getLogger().log(TreeLogger.INFO,
          "Module " + moduleName + " has been loaded");
    } catch (Throwable e) {
      // We do catch Throwable intentionally because there are a ton of things
      // that can go wrong trying to load a module, including Error-derived
      // things like NoClassDefFoundError.
      //
      moduleHandle.getLogger().log(TreeLogger.ERROR, "Failed to load module '"
          + moduleName + "' from user agent '" + userAgent + "' at "
          + channel.getRemoteEndpoint(), e);
      if (moduleSpace != null) {
        moduleSpace.dispose();       
      }
      moduleHandle.unload();
      moduleMap.remove(serverChannel);
      moduleHandleMap.remove(serverChannel);
      return null;
    } finally {
      PerfLogger.end();
      PerfLogger.end();
    }
    return moduleHandle.getLogger();
  }
View Full Code Here

  @Override
  public ExceptionOrReturnValue setProperty(BrowserChannel channel, int refId,
      int dispId, Value newValue) {
    BrowserChannelServer serverChannel = (BrowserChannelServer) channel;
    ModuleSpace moduleSpace = moduleMap.get(serverChannel);
    ModuleHandle moduleHandle = moduleHandleMap.get(serverChannel);
    assert moduleSpace != null && moduleHandle != null;
    TreeLogger logger = moduleHandle.getLogger();
    ServerObjectsTable localObjects = serverChannel.getJavaObjectsExposedInBrowser();
    try {
      JsValueOOPHM obj = new JsValueOOPHM();
      DispatchObject dispObj;
      obj.setWrappedJavaObject(moduleSpace.getIsolatedClassLoader(),
View Full Code Here

  }

  @Override
  public void unloadModule(BrowserChannel channel, String moduleName) {
    BrowserChannelServer serverChannel = (BrowserChannelServer) channel;
    ModuleHandle moduleHandle = moduleHandleMap.get(serverChannel);
    ModuleSpace moduleSpace = moduleMap.get(serverChannel);
    if (moduleSpace == null || moduleHandle == null) {
      topLogger.log(TreeLogger.ERROR, "Unload request without a module loaded",
          null);
      return;
    }
    moduleHandle.getLogger().log(
        TreeLogger.INFO,
        "Unloading module " + moduleSpace.getModuleName() + " (" + moduleName
            + ")", null);
    moduleSpace.dispose();
    moduleHandle.unload();
    moduleMap.remove(serverChannel);
    moduleHandleMap.remove(serverChannel);
  }
View Full Code Here

        tabKey, moduleName, sessionKey, agentTag, agentIcon);
    final ViewerServiceTreeLogger moduleLogger = new ViewerServiceTreeLogger(
        viewerServiceClient);
    moduleLogger.initLogHandle(logHandle);
    moduleLogger.setMaxDetail(getLogLevel());
    ModuleHandle handle = new ModuleHandle() {
      @Override
      public TreeLogger getLogger() {
        return moduleLogger;
      }
View Full Code Here

  @Override
  public ExceptionOrReturnValue getProperty(BrowserChannelServer channel,
      int refId, int dispId) {
    ModuleSpace moduleSpace = moduleMap.get(channel);
    ModuleHandle moduleHandle = moduleHandleMap.get(channel);
    assert moduleSpace != null && moduleHandle != null;
    TreeLogger logger = moduleHandle.getLogger();
    ServerObjectsTable localObjects = channel.getJavaObjectsExposedInBrowser();
    try {
      JsValueOOPHM obj = new JsValueOOPHM();
      DispatchObject dispObj;
      CompilingClassLoader ccl = moduleSpace.getIsolatedClassLoader();
View Full Code Here

      Value thisVal, int methodDispatchId, Value[] args) {
    Event jsToJavaCallEvent =
        SpeedTracerLogger.start(channel.getDevModeSession(), DevModeEventType.JS_TO_JAVA_CALL);
    ServerObjectsTable localObjects = channel.getJavaObjectsExposedInBrowser();
    ModuleSpace moduleSpace = moduleMap.get(channel);
    ModuleHandle moduleHandle = moduleHandleMap.get(channel);
    assert moduleSpace != null && moduleHandle != null;
    TreeLogger logger = moduleHandle.getLogger();
    CompilingClassLoader cl = moduleSpace.getIsolatedClassLoader();

    // Treat dispatch id 0 as toString()
    if (methodDispatchId == 0) {
      methodDispatchId = cl.getDispId("java.lang.Object::toString()");
View Full Code Here

      String moduleName, String userAgent, String url, String tabKey,
      String sessionKey, byte[] userAgentIcon) {
    Event moduleInit =
        SpeedTracerLogger.start(channel.getDevModeSession(), DevModeEventType.MODULE_INIT,
            "Module Name", moduleName);
    ModuleHandle moduleHandle = host.createModuleLogger(moduleName, userAgent,
        url, tabKey, sessionKey, channel, userAgentIcon);
    TreeLogger logger = moduleHandle.getLogger();
    moduleHandleMap.put(channel, moduleHandle);
    ModuleSpace moduleSpace = null;
    try {
      // Attach a new ModuleSpace to make it programmable.
      ModuleSpaceHost msh = host.createModuleSpaceHost(moduleHandle, moduleName);
      moduleSpace = new ModuleSpaceOOPHM(msh, moduleName, channel);
      moduleMap.put(channel, moduleSpace);
      moduleSpace.onLoad(logger);
      if (logger.isLoggable(TreeLogger.INFO)) {
        moduleHandle.getLogger().log(TreeLogger.INFO,
            "Module " + moduleName + " has been loaded");
      }
    } catch (Throwable e) {
      // We do catch Throwable intentionally because there are a ton of things
      // that can go wrong trying to load a module, including Error-derived
      // things like NoClassDefFoundError.
      //
      moduleHandle.getLogger().log(
          TreeLogger.ERROR,
          "Failed to load module '" + moduleName + "' from user agent '"
              + userAgent + "' at " + channel.getRemoteEndpoint(), e);
      if (moduleSpace != null) {
        moduleSpace.dispose();
      }
      moduleHandle.unload();
      moduleMap.remove(channel);
      moduleHandleMap.remove(channel);
      return null;
    } finally {
      moduleInit.end();
    }
    return moduleHandle.getLogger();
  }
View Full Code Here

TOP

Related Classes of com.google.gwt.dev.ModuleHandle

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.