Java Code Examples for org.omg.CORBA.Request#poll_response()

The following examples show how to use org.omg.CORBA.Request#poll_response() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: ORBImpl.java    From jdk1.8-source-analysis with Apache License 2.0 5 votes vote down vote up
/**
 * Get the next request that has gotten a response.
 *
 * @result            the next request ready with a response.
 */
public org.omg.CORBA.Request get_next_response()
    throws org.omg.CORBA.WrongTransaction
{
    synchronized( this ) {
        checkShutdownState();
    }

    while (true) {
        // check if there already is a response
        synchronized ( dynamicRequests ) {
            Enumeration elems = dynamicRequests.elements();
            while ( elems.hasMoreElements() ) {
                Request currRequest = (Request)elems.nextElement();
                if ( currRequest.poll_response() ) {
                    // get the response for this successfully polled Request
                    currRequest.get_response();
                    dynamicRequests.removeElement(currRequest);
                    return currRequest;
                }
            }
        }

        // wait for a response
        synchronized(this.svResponseReceived) {
            while (!this.svResponseReceived.value()) {
                try {
                    this.svResponseReceived.wait();
                } catch(java.lang.InterruptedException ex) {
                    // NO-OP
                }
            }
            // reinitialize the response flag
            this.svResponseReceived.reset();
        }
    }
}
 
Example 2
Source File: ORBImpl.java    From TencentKona-8 with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Get the next request that has gotten a response.
 *
 * @result            the next request ready with a response.
 */
public org.omg.CORBA.Request get_next_response()
    throws org.omg.CORBA.WrongTransaction
{
    synchronized( this ) {
        checkShutdownState();
    }

    while (true) {
        // check if there already is a response
        synchronized ( dynamicRequests ) {
            Enumeration elems = dynamicRequests.elements();
            while ( elems.hasMoreElements() ) {
                Request currRequest = (Request)elems.nextElement();
                if ( currRequest.poll_response() ) {
                    // get the response for this successfully polled Request
                    currRequest.get_response();
                    dynamicRequests.removeElement(currRequest);
                    return currRequest;
                }
            }
        }

        // wait for a response
        synchronized(this.svResponseReceived) {
            while (!this.svResponseReceived.value()) {
                try {
                    this.svResponseReceived.wait();
                } catch(java.lang.InterruptedException ex) {
                    // NO-OP
                }
            }
            // reinitialize the response flag
            this.svResponseReceived.reset();
        }
    }
}
 
Example 3
Source File: ORBImpl.java    From jdk8u60 with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Get the next request that has gotten a response.
 *
 * @result            the next request ready with a response.
 */
public org.omg.CORBA.Request get_next_response()
    throws org.omg.CORBA.WrongTransaction
{
    synchronized( this ) {
        checkShutdownState();
    }

    while (true) {
        // check if there already is a response
        synchronized ( dynamicRequests ) {
            Enumeration elems = dynamicRequests.elements();
            while ( elems.hasMoreElements() ) {
                Request currRequest = (Request)elems.nextElement();
                if ( currRequest.poll_response() ) {
                    // get the response for this successfully polled Request
                    currRequest.get_response();
                    dynamicRequests.removeElement(currRequest);
                    return currRequest;
                }
            }
        }

        // wait for a response
        synchronized(this.svResponseReceived) {
            while (!this.svResponseReceived.value()) {
                try {
                    this.svResponseReceived.wait();
                } catch(java.lang.InterruptedException ex) {
                    // NO-OP
                }
            }
            // reinitialize the response flag
            this.svResponseReceived.reset();
        }
    }
}
 
Example 4
Source File: ORBImpl.java    From JDKSourceCode1.8 with MIT License 5 votes vote down vote up
/**
 * Get the next request that has gotten a response.
 *
 * @result            the next request ready with a response.
 */
public org.omg.CORBA.Request get_next_response()
    throws org.omg.CORBA.WrongTransaction
{
    synchronized( this ) {
        checkShutdownState();
    }

    while (true) {
        // check if there already is a response
        synchronized ( dynamicRequests ) {
            Enumeration elems = dynamicRequests.elements();
            while ( elems.hasMoreElements() ) {
                Request currRequest = (Request)elems.nextElement();
                if ( currRequest.poll_response() ) {
                    // get the response for this successfully polled Request
                    currRequest.get_response();
                    dynamicRequests.removeElement(currRequest);
                    return currRequest;
                }
            }
        }

        // wait for a response
        synchronized(this.svResponseReceived) {
            while (!this.svResponseReceived.value()) {
                try {
                    this.svResponseReceived.wait();
                } catch(java.lang.InterruptedException ex) {
                    // NO-OP
                }
            }
            // reinitialize the response flag
            this.svResponseReceived.reset();
        }
    }
}
 
Example 5
Source File: ORBImpl.java    From openjdk-jdk8u with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Get the next request that has gotten a response.
 *
 * @result            the next request ready with a response.
 */
public org.omg.CORBA.Request get_next_response()
    throws org.omg.CORBA.WrongTransaction
{
    synchronized( this ) {
        checkShutdownState();
    }

    while (true) {
        // check if there already is a response
        synchronized ( dynamicRequests ) {
            Enumeration elems = dynamicRequests.elements();
            while ( elems.hasMoreElements() ) {
                Request currRequest = (Request)elems.nextElement();
                if ( currRequest.poll_response() ) {
                    // get the response for this successfully polled Request
                    currRequest.get_response();
                    dynamicRequests.removeElement(currRequest);
                    return currRequest;
                }
            }
        }

        // wait for a response
        synchronized(this.svResponseReceived) {
            while (!this.svResponseReceived.value()) {
                try {
                    this.svResponseReceived.wait();
                } catch(java.lang.InterruptedException ex) {
                    // NO-OP
                }
            }
            // reinitialize the response flag
            this.svResponseReceived.reset();
        }
    }
}
 
Example 6
Source File: ORBImpl.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Get the next request that has gotten a response.
 *
 * @result            the next request ready with a response.
 */
public org.omg.CORBA.Request get_next_response()
    throws org.omg.CORBA.WrongTransaction
{
    synchronized( this ) {
        checkShutdownState();
    }

    while (true) {
        // check if there already is a response
        synchronized ( dynamicRequests ) {
            Enumeration elems = dynamicRequests.elements();
            while ( elems.hasMoreElements() ) {
                Request currRequest = (Request)elems.nextElement();
                if ( currRequest.poll_response() ) {
                    // get the response for this successfully polled Request
                    currRequest.get_response();
                    dynamicRequests.removeElement(currRequest);
                    return currRequest;
                }
            }
        }

        // wait for a response
        synchronized(this.svResponseReceived) {
            while (!this.svResponseReceived.value()) {
                try {
                    this.svResponseReceived.wait();
                } catch(java.lang.InterruptedException ex) {
                    // NO-OP
                }
            }
            // reinitialize the response flag
            this.svResponseReceived.reset();
        }
    }
}
 
Example 7
Source File: ORBImpl.java    From openjdk-jdk9 with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Get the next request that has gotten a response.
 *
 * @return            the next request ready with a response.
 */
public org.omg.CORBA.Request get_next_response()
    throws org.omg.CORBA.WrongTransaction
{
    synchronized( this ) {
        checkShutdownState();
    }

    while (true) {
        // check if there already is a response
        synchronized ( dynamicRequests ) {
            Enumeration elems = dynamicRequests.elements();
            while ( elems.hasMoreElements() ) {
                Request currRequest = (Request)elems.nextElement();
                if ( currRequest.poll_response() ) {
                    // get the response for this successfully polled Request
                    currRequest.get_response();
                    dynamicRequests.removeElement(currRequest);
                    return currRequest;
                }
            }
        }

        // wait for a response
        synchronized(this.svResponseReceived) {
            while (!this.svResponseReceived.value()) {
                try {
                    this.svResponseReceived.wait();
                } catch(java.lang.InterruptedException ex) {
                    // NO-OP
                }
            }
            // reinitialize the response flag
            this.svResponseReceived.reset();
        }
    }
}
 
Example 8
Source File: ORBImpl.java    From hottub with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Get the next request that has gotten a response.
 *
 * @result            the next request ready with a response.
 */
public org.omg.CORBA.Request get_next_response()
    throws org.omg.CORBA.WrongTransaction
{
    synchronized( this ) {
        checkShutdownState();
    }

    while (true) {
        // check if there already is a response
        synchronized ( dynamicRequests ) {
            Enumeration elems = dynamicRequests.elements();
            while ( elems.hasMoreElements() ) {
                Request currRequest = (Request)elems.nextElement();
                if ( currRequest.poll_response() ) {
                    // get the response for this successfully polled Request
                    currRequest.get_response();
                    dynamicRequests.removeElement(currRequest);
                    return currRequest;
                }
            }
        }

        // wait for a response
        synchronized(this.svResponseReceived) {
            while (!this.svResponseReceived.value()) {
                try {
                    this.svResponseReceived.wait();
                } catch(java.lang.InterruptedException ex) {
                    // NO-OP
                }
            }
            // reinitialize the response flag
            this.svResponseReceived.reset();
        }
    }
}
 
Example 9
Source File: ORBImpl.java    From openjdk-8-source with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Get the next request that has gotten a response.
 *
 * @result            the next request ready with a response.
 */
public org.omg.CORBA.Request get_next_response()
    throws org.omg.CORBA.WrongTransaction
{
    synchronized( this ) {
        checkShutdownState();
    }

    while (true) {
        // check if there already is a response
        synchronized ( dynamicRequests ) {
            Enumeration elems = dynamicRequests.elements();
            while ( elems.hasMoreElements() ) {
                Request currRequest = (Request)elems.nextElement();
                if ( currRequest.poll_response() ) {
                    // get the response for this successfully polled Request
                    currRequest.get_response();
                    dynamicRequests.removeElement(currRequest);
                    return currRequest;
                }
            }
        }

        // wait for a response
        synchronized(this.svResponseReceived) {
            while (!this.svResponseReceived.value()) {
                try {
                    this.svResponseReceived.wait();
                } catch(java.lang.InterruptedException ex) {
                    // NO-OP
                }
            }
            // reinitialize the response flag
            this.svResponseReceived.reset();
        }
    }
}
 
Example 10
Source File: ORBImpl.java    From openjdk-8 with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Get the next request that has gotten a response.
 *
 * @result            the next request ready with a response.
 */
public org.omg.CORBA.Request get_next_response()
    throws org.omg.CORBA.WrongTransaction
{
    synchronized( this ) {
        checkShutdownState();
    }

    while (true) {
        // check if there already is a response
        synchronized ( dynamicRequests ) {
            Enumeration elems = dynamicRequests.elements();
            while ( elems.hasMoreElements() ) {
                Request currRequest = (Request)elems.nextElement();
                if ( currRequest.poll_response() ) {
                    // get the response for this successfully polled Request
                    currRequest.get_response();
                    dynamicRequests.removeElement(currRequest);
                    return currRequest;
                }
            }
        }

        // wait for a response
        synchronized(this.svResponseReceived) {
            while (!this.svResponseReceived.value()) {
                try {
                    this.svResponseReceived.wait();
                } catch(java.lang.InterruptedException ex) {
                    // NO-OP
                }
            }
            // reinitialize the response flag
            this.svResponseReceived.reset();
        }
    }
}