VirtualBox

Changeset 31008 in vbox for trunk/src/VBox/Main/glue


Ignore:
Timestamp:
Jul 22, 2010 3:24:27 PM (15 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
63924
Message:

Main: reorganize session APIs

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Main/glue/glue-java.xsl

    r30987 r31008  
    24942494    }
    24952495
    2496     public ISession openMachineSession(String mid) throws Exception
     2496    public ISession openMachineSession(IMachine m) throws Exception
    24972497    {
    24982498        ISession s = getSessionObject();
    2499         try {
    2500           this.vbox.openExistingSession(s, mid);
    2501           return s;
    2502         } catch (Exception e) {
    2503           try {
    2504             this.vbox.openSession(s, mid);
    2505             return s;
    2506           } catch (Exception e1) {
    2507             closeMachineSession(s);
    2508             throw e1;
    2509           }
    2510         }
    2511     }
    2512 
    2513     public ISession openMachineSession(IMachine m) throws Exception
    2514     {
    2515           return openMachineSession(m.getId());
     2499        m.lockForSession(s, true /* fPermitShared */);
     2500        return s;
    25162501    }
    25172502
     
    25802565        ISession session = getSessionObject();
    25812566
    2582         String mid = m.getId();
    25832567        if (type == null)
    25842568            type = "gui";
    2585         IProgress p = vbox.openRemoteSession(session, mid, type, "");
     2569        IProgress p = m.launchVMProcess(session, type, "");
    25862570        progressBar(p, timeout);
    25872571        session.close();
     
    34723456    }
    34733457
    3474     public ISession openMachineSession(String mid) throws Exception
     3458    public ISession openMachineSession(IMachine m) throws Exception
    34753459    {
    34763460        ISession s = getSessionObject();
    3477         try {
    3478           this.vbox.openExistingSession(s, mid);
    3479           return s;
    3480         } catch (Exception e) {
    3481           try {
    3482             this.vbox.openSession(s, mid);
    3483             return s;
    3484           } catch (Exception e1) {
    3485             closeMachineSession(s);
    3486             throw e1;
    3487           }
    3488         }
    3489     }
    3490 
    3491     public ISession openMachineSession(IMachine m) throws Exception
    3492     {
    3493           return openMachineSession(m.getId());
     3461        m.lockForSession(s, true /* fPermitShared */ );
     3462        return s;
    34943463    }
    34953464
     
    35403509        ISession session = getSessionObject();
    35413510
    3542         String mid = m.getId();
    35433511        if (type == null)
    35443512            type = "gui";
    3545         IProgress p = vbox.openRemoteSession(session, mid, type, "");
     3513        IProgress p = m.launchVMProcess(session, type, "");
    35463514        progressBar(p, timeout);
    35473515        session.close();
Note: See TracChangeset for help on using the changeset viewer.

© 2025 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette