Package org.omg.CORBA

Examples of org.omg.CORBA.TIMEOUT


            {
                ex.printStackTrace();
                tryToClose(socket);
              if (useTimeout && System.currentTimeMillis() > expireTime)
              {
                throw new TIMEOUT("couldn't open socket within " + timeout + ". Last exception details: " + ex.toString());
              }
            }
        }

        if (logger.isWarnEnabled())
View Full Code Here


      {
        return doCreateSocket(host, port, timeout);
      }
      catch(SocketTimeoutException e)
      {
        throw new TIMEOUT(e.toString());
      }
    }
View Full Code Here

     */
    private void checkTimeout()
    {
        if (replyEndTime != null && Time.hasPassed (replyEndTime))
        {
            throw new TIMEOUT("Reply End Time exceeded",
                              3,
                              CompletionStatus.COMPLETED_NO);
        }
    }
View Full Code Here

    {
        if (reqET != null)
        {
            if (Time.hasPassed(reqET))
            {
                throw new TIMEOUT("Request End Time exceeded",
                                  2,
                                  CompletionStatus.COMPLETED_NO);
            }
        }

        if (repET != null)
        {
            if (Time.hasPassed(repET))
            {
                throw new TIMEOUT("Reply End Time exceeded",
                                  3,
                                  CompletionStatus.COMPLETED_NO);
            }
        }
    }
View Full Code Here

                        if (clearCurrentContext)
                        {
                           clearInvocationContext();
                        }

                        throw new TIMEOUT("Request End Time exceeded prior to invocation",
                                          2,
                                          CompletionStatus.COMPLETED_NO);
                    }
                }

                currentCtxt.put (INVOCATION_KEY.REQUEST_END_TIME, requestEndTime);
            }
            else
            {
                if (Time.hasPassed (requestEndTime))
                {
                    if (clearCurrentContext)
                    {
                       clearInvocationContext();
                    }

                    throw new TIMEOUT("Request End Time exceeded",
                                      2,
                                      CompletionStatus.COMPLETED_NO);
                }
            }

            if (replyEndTime == null)
            {
                replyEndTime = getReplyEndTime();

                final long roundtripTimeout = getRelativeRoundtripTimeout();

                if ((roundtripTimeout > 0) || (replyEndTime != null))
                {
                    replyEndTime = Time.earliest(Time.corbaFuture (roundtripTimeout), replyEndTime);

                    if (Time.hasPassed(replyEndTime))
                    {
                        if (clearCurrentContext)
                        {
                           clearInvocationContext();
                        }

                        throw new TIMEOUT("Reply End Time exceeded prior to invocation",
                                          3,
                                          CompletionStatus.COMPLETED_NO);
                    }
                }

                currentCtxt.put (INVOCATION_KEY.REPLY_END_TIME, replyEndTime);
            }
            else
            {
                if (Time.hasPassed(replyEndTime))
                {
                    if (clearCurrentContext)
                    {
                        clearInvocationContext();
                    }

                    throw new TIMEOUT("Reply End Time exceeded",
                                      3,
                                      CompletionStatus.COMPLETED_NO);
                }
            }
        }
View Full Code Here

        if (!selectorManager.add (request))
        {
            if (request.status == SelectorRequest.Status.EXPIRED)
            {
                throw new TIMEOUT("Message expired before write attempt.");
            }
            else
            {
                throw handleCommFailure(new IOException("Unable to add read request to SelectorManager"));
            }
        }
        request.waitOnCompletion (nanoDeadline);

        if (request.status == SelectorRequest.Status.EXPIRED || !request.isFinalized())
        {
            throw new TIMEOUT("Message expired before write attempt.");
        }
        else if (request.status == SelectorRequest.Status.FAILED)
        {
            throw new org.omg.CORBA.COMM_FAILURE ("Read request failed. Request status: FAILED");
        }
View Full Code Here

        if (!selectorManager.add (request))
        {
            if (request.status == SelectorRequest.Status.EXPIRED)
            {
                throw new TIMEOUT("Message expired before write attempt.");
            }
            else
            {
                throw handleCommFailure(new IOException("Unable to add write request to SelectorManager"));
            }
        }
        request.waitOnCompletion (nanoDeadline);

        if (!writeCallback.writeFinished())
        {

            int failCount = 0;
            synchronized (this)
            {
                failCount = ++failedWriteAttempts;
            }

            if (failCount >= maxConsecutiveTimeouts)
            {

                boolean isConnected;
                isConnected = myChannel.isConnected();
                try
                {
                    myChannel.close();
                }
                catch (IOException ex)
                {
                    // disregard
                    logger.debug ("Exception while trying to close channel after write failure. "
                                  + ex.getMessage());
                }

                if (isDebugEnabled)
                {
                    logger.debug ("Write attempts exceeded maximum allowed attempts (" + maxConsecutiveTimeouts +
                                  "). " + (isConnected ? "Closing channel." : "Channel already closed."));
                }

                return;
            }

            throw new TIMEOUT("Message expired before write attempt.");

        }
        else
        {
            synchronized (this)
View Full Code Here

                    throw new TRANSIENT ("unable to connect");
                }
                else if (request.status == SelectorRequest.Status.EXPIRED ||
                    !request.isFinalized())
                {
                    throw new TIMEOUT("connection timeout expired");
                }
                else if (request.status == SelectorRequest.Status.FAILED ||
                         request.status == SelectorRequest.Status.SHUTDOWN ||
                         request.status == SelectorRequest.Status.CLOSED)
                {
View Full Code Here

        if (exception != null)
        {
            if (exception instanceof SocketTimeoutException)
            {
                throw new TIMEOUT("connection timeout of " + time_out + " milliseconds expired: " + exception );
            }
            else if( exception instanceof IOException )
            {
                throw (IOException) exception;
            }
View Full Code Here

TOP

Related Classes of org.omg.CORBA.TIMEOUT

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.