< prev index next >

src/java.corba/share/classes/com/sun/corba/se/impl/orb/ORBImpl.java

Print this page




 568     {
 569         checkShutdownState();
 570 
 571         /* _REVISIT_
 572            The implementation of get_current is not clear. How would
 573            ORB know whether the caller wants a Current for transactions
 574            or security ?? Or is it assumed that there is just one
 575            implementation for both ? If Current is thread-specific,
 576            then it should not be instantiated; so where does the
 577            ORB get a Current ?
 578 
 579            This should probably be deprecated. */
 580 
 581         throw wrapper.genericNoImpl() ;
 582     }
 583 
 584     /**
 585      * Create an NVList
 586      *
 587      * @param count     size of list to create
 588      * @result          NVList created
 589      *
 590      * @see NVList
 591      */
 592     public synchronized NVList create_list(int count)
 593     {
 594         checkShutdownState();
 595         return new NVListImpl(this, count);
 596     }
 597 
 598     /**
 599      * Create an NVList corresponding to an OperationDef
 600      *
 601      * @param oper      operation def to use to create list
 602      * @result          NVList created
 603      *
 604      * @see NVList
 605      */
 606     public synchronized NVList create_operation_list(org.omg.CORBA.Object oper)
 607     {
 608         checkShutdownState();
 609         throw wrapper.genericNoImpl() ;
 610     }
 611 
 612     /**
 613      * Create a NamedValue
 614      *
 615      * @result          NamedValue created
 616      */
 617     public synchronized NamedValue create_named_value(String s, Any any, int flags)
 618     {
 619         checkShutdownState();
 620         return new NamedValueImpl(this, s, any, flags);
 621     }
 622 
 623     /**
 624      * Create an ExceptionList
 625      *
 626      * @result          ExceptionList created
 627      */
 628     public synchronized org.omg.CORBA.ExceptionList create_exception_list()
 629     {
 630         checkShutdownState();
 631         return new ExceptionListImpl();
 632     }
 633 
 634     /**
 635      * Create a ContextList
 636      *
 637      * @result          ContextList created
 638      */
 639     public synchronized org.omg.CORBA.ContextList create_context_list()
 640     {
 641         checkShutdownState();
 642         return new ContextListImpl(this);
 643     }
 644 
 645     /**
 646      * Get the default Context object
 647      *
 648      * @result          the default Context object
 649      */
 650     public synchronized org.omg.CORBA.Context get_default_context()
 651     {
 652         checkShutdownState();
 653         throw wrapper.genericNoImpl() ;
 654     }
 655 
 656     /**
 657      * Create an Environment
 658      *
 659      * @result          Environment created
 660      */
 661     public synchronized org.omg.CORBA.Environment create_environment()
 662     {
 663         checkShutdownState();
 664         return new EnvironmentImpl();
 665     }
 666 
 667     public synchronized void send_multiple_requests_oneway(Request[] req)
 668     {
 669         checkShutdownState();
 670 
 671         // Invoke the send_oneway on each new Request
 672         for (int i = 0; i < req.length; i++) {
 673             req[i].send_oneway();
 674         }
 675     }
 676 
 677     /**
 678      * Send multiple dynamic requests asynchronously.
 679      *


 702     public synchronized boolean poll_next_response()
 703     {
 704         checkShutdownState();
 705 
 706         Request currRequest;
 707 
 708         // poll on each pending request
 709         Enumeration ve = dynamicRequests.elements();
 710         while (ve.hasMoreElements() == true) {
 711             currRequest = (Request)ve.nextElement();
 712             if (currRequest.poll_response() == true) {
 713                 return true;
 714             }
 715         }
 716         return false;
 717     }
 718 
 719     /**
 720      * Get the next request that has gotten a response.
 721      *
 722      * @result            the next request ready with a response.
 723      */
 724     public org.omg.CORBA.Request get_next_response()
 725         throws org.omg.CORBA.WrongTransaction
 726     {
 727         synchronized( this ) {
 728             checkShutdownState();
 729         }
 730 
 731         while (true) {
 732             // check if there already is a response
 733             synchronized ( dynamicRequests ) {
 734                 Enumeration elems = dynamicRequests.elements();
 735                 while ( elems.hasMoreElements() ) {
 736                     Request currRequest = (Request)elems.nextElement();
 737                     if ( currRequest.poll_response() ) {
 738                         // get the response for this successfully polled Request
 739                         currRequest.get_response();
 740                         dynamicRequests.removeElement(currRequest);
 741                         return currRequest;
 742                     }




 568     {
 569         checkShutdownState();
 570 
 571         /* _REVISIT_
 572            The implementation of get_current is not clear. How would
 573            ORB know whether the caller wants a Current for transactions
 574            or security ?? Or is it assumed that there is just one
 575            implementation for both ? If Current is thread-specific,
 576            then it should not be instantiated; so where does the
 577            ORB get a Current ?
 578 
 579            This should probably be deprecated. */
 580 
 581         throw wrapper.genericNoImpl() ;
 582     }
 583 
 584     /**
 585      * Create an NVList
 586      *
 587      * @param count     size of list to create
 588      * @return          NVList created
 589      *
 590      * @see NVList
 591      */
 592     public synchronized NVList create_list(int count)
 593     {
 594         checkShutdownState();
 595         return new NVListImpl(this, count);
 596     }
 597 
 598     /**
 599      * Create an NVList corresponding to an OperationDef
 600      *
 601      * @param oper      operation def to use to create list
 602      * @return          NVList created
 603      *
 604      * @see NVList
 605      */
 606     public synchronized NVList create_operation_list(org.omg.CORBA.Object oper)
 607     {
 608         checkShutdownState();
 609         throw wrapper.genericNoImpl() ;
 610     }
 611 
 612     /**
 613      * Create a NamedValue
 614      *
 615      * @return          NamedValue created
 616      */
 617     public synchronized NamedValue create_named_value(String s, Any any, int flags)
 618     {
 619         checkShutdownState();
 620         return new NamedValueImpl(this, s, any, flags);
 621     }
 622 
 623     /**
 624      * Create an ExceptionList
 625      *
 626      * @return          ExceptionList created
 627      */
 628     public synchronized org.omg.CORBA.ExceptionList create_exception_list()
 629     {
 630         checkShutdownState();
 631         return new ExceptionListImpl();
 632     }
 633 
 634     /**
 635      * Create a ContextList
 636      *
 637      * @return          ContextList created
 638      */
 639     public synchronized org.omg.CORBA.ContextList create_context_list()
 640     {
 641         checkShutdownState();
 642         return new ContextListImpl(this);
 643     }
 644 
 645     /**
 646      * Get the default Context object
 647      *
 648      * @return          the default Context object
 649      */
 650     public synchronized org.omg.CORBA.Context get_default_context()
 651     {
 652         checkShutdownState();
 653         throw wrapper.genericNoImpl() ;
 654     }
 655 
 656     /**
 657      * Create an Environment
 658      *
 659      * @return          Environment created
 660      */
 661     public synchronized org.omg.CORBA.Environment create_environment()
 662     {
 663         checkShutdownState();
 664         return new EnvironmentImpl();
 665     }
 666 
 667     public synchronized void send_multiple_requests_oneway(Request[] req)
 668     {
 669         checkShutdownState();
 670 
 671         // Invoke the send_oneway on each new Request
 672         for (int i = 0; i < req.length; i++) {
 673             req[i].send_oneway();
 674         }
 675     }
 676 
 677     /**
 678      * Send multiple dynamic requests asynchronously.
 679      *


 702     public synchronized boolean poll_next_response()
 703     {
 704         checkShutdownState();
 705 
 706         Request currRequest;
 707 
 708         // poll on each pending request
 709         Enumeration ve = dynamicRequests.elements();
 710         while (ve.hasMoreElements() == true) {
 711             currRequest = (Request)ve.nextElement();
 712             if (currRequest.poll_response() == true) {
 713                 return true;
 714             }
 715         }
 716         return false;
 717     }
 718 
 719     /**
 720      * Get the next request that has gotten a response.
 721      *
 722      * @return            the next request ready with a response.
 723      */
 724     public org.omg.CORBA.Request get_next_response()
 725         throws org.omg.CORBA.WrongTransaction
 726     {
 727         synchronized( this ) {
 728             checkShutdownState();
 729         }
 730 
 731         while (true) {
 732             // check if there already is a response
 733             synchronized ( dynamicRequests ) {
 734                 Enumeration elems = dynamicRequests.elements();
 735                 while ( elems.hasMoreElements() ) {
 736                     Request currRequest = (Request)elems.nextElement();
 737                     if ( currRequest.poll_response() ) {
 738                         // get the response for this successfully polled Request
 739                         currRequest.get_response();
 740                         dynamicRequests.removeElement(currRequest);
 741                         return currRequest;
 742                     }


< prev index next >