~ubuntu-branches/ubuntu/karmic/virtualbox-ose/karmic-updates

« back to all changes in this revision

Viewing changes to src/VBox/Main/webservice/glue-jaxws.xsl

  • Committer: Bazaar Package Importer
  • Author(s): Felix Geyer
  • Date: 2009-09-14 18:25:07 UTC
  • mfrom: (0.4.1 squeeze)
  • Revision ID: james.westby@ubuntu.com-20090914182507-c98g07mq16hjmn6d
Tags: 3.0.6-dfsg-1ubuntu1
* Merge from debian unstable (LP: #429697), remaining changes:
  - Enable DKMS support on virtualbox host and guest modules (LP: #267097)
    - Drop virtualbox-ose{-guest,}-modules-* package templates
    - Recommend *-source instead of *-modules packages
    - Replace error messages related to missing/mismatched
      kernel module accordingly
  - Autoload kernel module
    - LOAD_VBOXDRV_MODULE=1 in virtualbox-ose.default
  - Disable update action
    - patches/u01-disable-update-action.dpatch
  - Virtualbox should go in Accessories, not in System tools (LP: #288590)
    - virtualbox-ose-qt.files/virtualbox-ose.desktop
  - Add apport hook
    - virtualbox-ose.files/source_virtualbox-ose.py
    - virtualbox-ose.install
  - Add launchpad integration
    - control
    - lpi-bug.xpm
    - patches/u02-lp-integration.dpatch
  - virtualbox, virtualbox-* (names of the upstream proprietary packages)
    conflict with virtualbox-ose (LP: #379878)
* Make debug package depend on normal or guest utils package
* Drop patches/22-pulseaudio-stubs.dpatch (applied upstream)
* Rename Ubuntu specific patches to uXX-*.dpatch
* Fix lintian warnings in maintainer scripts

Show diffs side-by-side

added added

removed removed

Lines of Context:
513
513
    synchronized VboxPortType getPort()
514
514
    {
515
515
        VboxPortType port = null;
 
516
        int ttl = 0;
 
517
 
516
518
        for (VboxPortType cur: known.keySet())
517
519
        {
518
 
            if (known.get(cur) == 0)
 
520
            int value = known.get(cur);
 
521
            if ((value & 0x10000) == 0)
519
522
            {
520
523
                port = cur;
 
524
                ttl = value & 0xffff;
521
525
                break;
522
526
            }
523
527
        }
533
537
                                                "vboxService"));
534
538
            }
535
539
            port = svc.getVboxServicePort();
 
540
            // reuse this object 0x10 times
 
541
            ttl = 0x10;
536
542
        }
537
 
        known.put(port, new Integer(1));
 
543
        // mark as used
 
544
        known.put(port, new Integer(0x10000 | ttl));
538
545
        return port;
539
546
    }
540
547
 
546
553
            // know you not
547
554
            return;
548
555
        }
549
 
        known.put(port, val - 1);
 
556
        int v = val;
 
557
        int ttl = v & 0xffff;
 
558
        // decrement TTL, and throw away port if used too much times
 
559
        if (--ttl <= 0)
 
560
        {
 
561
            known.remove(port);
 
562
        }
 
563
        else
 
564
        {
 
565
            v = ttl; // set new TTL and clear busy bit
 
566
            known.put(port, v);
 
567
        }
550
568
    }
551
569
}
552
570
 
583
601
    public void connect(String url)
584
602
    {
585
603
        this.port = pool.getPort();
586
 
        ((BindingProvider)port).getRequestContext().
 
604
        try {
 
605
          ((BindingProvider)port).getRequestContext().
587
606
                put(BindingProvider.ENDPOINT_ADDRESS_PROPERTY, url);
 
607
        }  catch (Throwable t) {
 
608
             if (this.port != null)
 
609
                pool.releasePort(this.port);
 
610
             // we have to throw smth derived from RuntimeException
 
611
             throw new WebServiceException(t);
 
612
        }
588
613
    }
589
614
 
590
615
    public void connect(String url, Map<String, Object> requestContext, Map<String, Object> responseContext)
591
616
    {
592
617
         this.port = pool.getPort();
593
618
 
594
 
         ((BindingProvider)port).getRequestContext();
595
 
         if (requestContext != null)
 
619
         try {
 
620
            ((BindingProvider)port).getRequestContext();
 
621
            if (requestContext != null)
596
622
               ((BindingProvider)port).getRequestContext().putAll(requestContext);
597
623
 
598
 
         if (responseContext != null)
 
624
            if (responseContext != null)
599
625
               ((BindingProvider)port).getResponseContext().putAll(responseContext);
600
626
 
601
 
         ((BindingProvider)port).getRequestContext().
 
627
            ((BindingProvider)port).getRequestContext().
602
628
                put(BindingProvider.ENDPOINT_ADDRESS_PROPERTY, url);
 
629
         } catch (Throwable t) {
 
630
             if (this.port != null)
 
631
                pool.releasePort(port);
 
632
             // we have to throw smth derived from RuntimeException
 
633
             throw new WebServiceException(t);
 
634
          }
603
635
    }
604
636
 
605
637
 
606
638
    public void disconnect(IVirtualBox refIVirtualBox)
607
639
    {
608
 
        logoff(refIVirtualBox);
609
 
        pool.releasePort(port);
 
640
        try {
 
641
           logoff(refIVirtualBox);
 
642
        } finally {
 
643
           if (this.port != null) {
 
644
             pool.releasePort(this.port);
 
645
             this.port = null;
 
646
           }
 
647
        }
610
648
    }
611
649
 
612
650
    public void cleanupUnused()