Package flash.tools.debugger

Examples of flash.tools.debugger.SessionManager


    {
      err(getLocalizationManager().getLocalizedTextString("sessionInProgress")); //$NON-NLS-1$
      return;
    }

    SessionManager mgr = Bootstrap.sessionManager();

    if (hasMoreTokens())
    {
      if (!setLaunchURI(restOfLine()))
        return;
    }

    if (m_connectPort == null)
      mgr.startListening();

    try
    {
      if (m_connectPort != null) {
        out(getLocalizationManager().getLocalizedTextString("waitingToConnectToPlayer")); //$NON-NLS-1$
        m_session = mgr.connect(Integer.valueOf(m_connectPort), null);
      }
      else if (m_launchURI == null)
      {
        out(getLocalizationManager().getLocalizedTextString("waitingForPlayerToConnect")); //$NON-NLS-1$
        m_session = mgr.accept(null);
      }
      else
      {
        out(getLocalizationManager().getLocalizedTextString("launchingWithUrl") + m_newline + m_launchURI); //$NON-NLS-1$
        m_session = mgr.launch(m_launchURI, null, true, null, null);
      }

      // now see what happened
      if (m_session == null)
      {
        // shouldn't have gotten here
        throw new SocketTimeoutException();
      }
      else
      {
        out(getLocalizationManager().getLocalizedTextString("playerConnectedSessionStarting")); //$NON-NLS-1$
        initSession(m_session);

        // pause for a while during startup, don't let exceptions ripple outwards
        try { waitTilHalted(); } catch(Exception e) {}

        setInitialSourceFile();

        out(getLocalizationManager().getLocalizedTextString("setBreakpointsThenResume")); //$NON-NLS-1$

        // now poke to see if the player is good enough
        try
        {
          if (m_session.getPreference(SessionManager.PLAYER_SUPPORTS_GET) == 0 )
            err(m_newline + getLocalizationManager().getLocalizedTextString("warningNotAllCommandsSupported")); //$NON-NLS-1$
        }
        catch(Exception npe) {}
      }
    }
    catch (FileNotFoundException fnf)
    {
      Map<String, Object> args = new HashMap<String, Object>();
      args.put("uri", fnf.getLocalizedMessage()); //$NON-NLS-1$
      err(getLocalizationManager().getLocalizedTextString("fileDoesNotExist", args)); //$NON-NLS-1$
    }
    catch (SocketTimeoutException ste)
    {
      err(getLocalizationManager().getLocalizedTextString("failedToConnect")); //$NON-NLS-1$
    }
    catch (IOException io)
    {
      err(io.getLocalizedMessage());
    }
    finally
    {
      // turn off listening, to allow other session to connect
      if (m_connectPort == null)
        mgr.stopListening();
    }
  }
View Full Code Here


  private boolean setLaunchURI(String launchURI)
  {
    if (launchURI != null)
    {
      SessionManager mgr = Bootstrap.sessionManager();

      // If doing fdbunit, we always try to do launch(), even on platforms
      // that say they don't support it
      if (!mgr.supportsLaunch() && System.getProperty("fdbunit") == null) //$NON-NLS-1$
      {
        err(getLocalizationManager().getLocalizedTextString("manuallyLaunchPlayer")); //$NON-NLS-1$
        return false;
      }
View Full Code Here

    {
      err(getLocalizationManager().getLocalizedTextString("sessionInProgress")); //$NON-NLS-1$
      return;
    }

    SessionManager mgr = Bootstrap.sessionManager();

    if (hasMoreTokens())
    {
      if (!setLaunchURI(restOfLine()))
        return;
    }

    if (m_connectPort == null)
      mgr.startListening();

    try
    {
      if (m_connectPort != null) {
        out(getLocalizationManager().getLocalizedTextString("waitingToConnectToPlayer")); //$NON-NLS-1$
        m_session = mgr.connect(Integer.valueOf(m_connectPort), null);
      }
      else if (m_launchURI == null)
      {
        out(getLocalizationManager().getLocalizedTextString("waitingForPlayerToConnect")); //$NON-NLS-1$
        m_session = mgr.accept(null);
      }
      else
      {
        out(getLocalizationManager().getLocalizedTextString("launchingWithUrl") + m_newline + m_launchURI); //$NON-NLS-1$
        m_session = mgr.launch(m_launchURI, null, true, null, null);
      }

      // now see what happened
      if (m_session == null)
      {
        // shouldn't have gotten here
        throw new SocketTimeoutException();
      }
      else
      {
        out(getLocalizationManager().getLocalizedTextString("playerConnectedSessionStarting")); //$NON-NLS-1$
        initSession(m_session);

        // pause for a while during startup, don't let exceptions ripple outwards
        try { waitTilHalted(); } catch(Exception e) {}

        // pause for a while during startup, don't let exceptions ripple outwards
        try { waitForMetaData(); } catch(Exception e) {}

        setInitialSourceFile();

        out(getLocalizationManager().getLocalizedTextString("setBreakpointsThenResume")); //$NON-NLS-1$

        // now poke to see if the player is good enough
        try
        {
          if (m_session.getPreference(SessionManager.PLAYER_SUPPORTS_GET) == 0 )
            err(m_newline + getLocalizationManager().getLocalizedTextString("warningNotAllCommandsSupported")); //$NON-NLS-1$
        }
        catch(Exception npe) {}
      }
    }
    catch (FileNotFoundException fnf)
    {
      Map<String, Object> args = new HashMap<String, Object>();
      args.put("uri", fnf.getLocalizedMessage()); //$NON-NLS-1$
      err(getLocalizationManager().getLocalizedTextString("fileDoesNotExist", args)); //$NON-NLS-1$
    }
    catch (SocketTimeoutException ste)
    {
      err(getLocalizationManager().getLocalizedTextString("failedToConnect")); //$NON-NLS-1$
    }
    catch (IOException io)
    {
      err(io.getLocalizedMessage());
    }
    finally
    {
      // turn off listening, to allow other session to connect
      if (m_connectPort == null)
        mgr.stopListening();
    }
  }
View Full Code Here

  private boolean setLaunchURI(String launchURI)
  {
    if (launchURI != null)
    {
      SessionManager mgr = Bootstrap.sessionManager();

      // If doing fdbunit, we always try to do launch(), even on platforms
      // that say they don't support it
      if (!mgr.supportsLaunch() && System.getProperty("fdbunit") == null) //$NON-NLS-1$
      {
        err(getLocalizationManager().getLocalizedTextString("manuallyLaunchPlayer")); //$NON-NLS-1$
        return false;
      }
View Full Code Here

TOP

Related Classes of flash.tools.debugger.SessionManager

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.