Package org.serviceconnector.util

Examples of org.serviceconnector.util.TimeoutWrapper


    // always cancel old timeouter before setting up a new one
    this.cancelLargeMessageTimeout(sessionComposite);
    LOGGER.trace("schedule large message sid=" + sessionComposite.getSessionId() + " timeout in millis "
        + (long) sessionComposite.getLargeMessageTimeoutMillis());
    // sets up session timeout
    TimeoutWrapper sessionTimeouter = new TimeoutWrapper(new LargeMessageTimeout(sessionComposite));
    // schedule sessionTimeouter in registry timer
    ScheduledFuture<TimeoutWrapper> timeout = (ScheduledFuture<TimeoutWrapper>) this.largeMessageScheduler.schedule(
        sessionTimeouter, (long) sessionComposite.getLargeMessageTimeoutMillis(), TimeUnit.MILLISECONDS);
    sessionComposite.setTimeout(timeout);
  }
View Full Code Here


      return;
    }
    // always cancel old timeouter before setting up a new one
    this.cancelSessionTimeout(session);
    // sets up session timeout
    TimeoutWrapper sessionTimeouter = new TimeoutWrapper(new WebSessionTimeout(session));
    // schedule sessionTimeouter in registry timer
    ScheduledFuture<TimeoutWrapper> timeout = (ScheduledFuture<TimeoutWrapper>) this.sessionScheduler.schedule(
        sessionTimeouter, (long) session.getSessionTimeoutSeconds(), TimeUnit.SECONDS);
    session.setTimeout(timeout);
    session.setTimeouterTask(sessionTimeouter);
View Full Code Here

    IConnection connection = this.connectionPool.getConnection();
    ConnectionContext connectionContext = connection.getContext();
    try {
      ISCMPMessageCallback requesterCallback = new RequesterSCMPCallback(callback, connectionContext);
      // setting up operation timeout after successful send
      TimeoutWrapper timeoutWrapper = new TimeoutWrapper((ITimeout) requesterCallback);
      RequesterSCMPCallback reqCallback = (RequesterSCMPCallback) requesterCallback;
      @SuppressWarnings("unchecked")
      ScheduledFuture<TimeoutWrapper> timeout = (ScheduledFuture<TimeoutWrapper>) AppContext.otiScheduler.schedule(
          timeoutWrapper, (long) timeoutMillis, TimeUnit.MILLISECONDS);
      reqCallback.setOperationTimeout(timeout);
View Full Code Here

        // SCMPLargeRequest handles splitting, works like an iterator
        SCMPCompositeSender largeResponse = new SCMPCompositeSender(message);
        requesterCallback = new SCRequesterSCMPCallback(message, scmpCallback, connectionContext, largeResponse,
            msgSequenceNr);
        // setting up operation timeout after successful send
        TimeoutWrapper timeoutWrapper = new TimeoutWrapper((ITimeout) requesterCallback);
        SCRequesterSCMPCallback reqCallback = (SCRequesterSCMPCallback) requesterCallback;
        ScheduledFuture<TimeoutWrapper> timeout = (ScheduledFuture<TimeoutWrapper>) AppContext.otiScheduler.schedule(
            timeoutWrapper, (long) timeoutMillis, TimeUnit.MILLISECONDS);
        reqCallback.setOperationTimeout(timeout);
        reqCallback.setTimeoutMillis(timeoutMillis);
        // extract first part message & send
        SCMPMessage part = largeResponse.getFirst();
        // handling msgSequenceNr
        if (SCMPMessageSequenceNr.necessaryToWrite(message.getMessageType())) {
          part.setHeader(SCMPHeaderAttributeKey.MESSAGE_SEQUENCE_NR, msgSequenceNr.getCurrentNr());
        }
        // send
        connection.send(part, requesterCallback);
      } else {
        requesterCallback = new SCRequesterSCMPCallback(message, scmpCallback, connectionContext, msgSequenceNr);
        // setting up operation timeout after successful send
        TimeoutWrapper timeoutWrapper = new TimeoutWrapper((ITimeout) requesterCallback);
        SCRequesterSCMPCallback reqCallback = (SCRequesterSCMPCallback) requesterCallback;
        ScheduledFuture<TimeoutWrapper> timeout = (ScheduledFuture<TimeoutWrapper>) AppContext.otiScheduler.schedule(
            timeoutWrapper, (long) timeoutMillis, TimeUnit.MILLISECONDS);
        reqCallback.setOperationTimeout(timeout);
        reqCallback.setTimeoutMillis(timeoutMillis);
View Full Code Here

      return;
    }
    // always cancel old timeout before setting up a new one
    this.cancelSubscriptionTimeout(subscription);
    // sets up subscription timeout
    TimeoutWrapper subscriptionTimeouter = new TimeoutWrapper(new SubscriptionTimeout(subscription));
    // schedule sessionTimeouter in registry timer
    ScheduledFuture<TimeoutWrapper> timeout = (ScheduledFuture<TimeoutWrapper>) this.subscriptionScheduler.schedule(
        subscriptionTimeouter, (long) newTimeoutMillis, TimeUnit.MILLISECONDS);
    subscription.setTimeout(timeout);
    if (SubscriptionLogger.isTraceEnabled()) {
View Full Code Here

    if (this.checkRegistrationIntervalSeconds == 0) {
      // check registration interval not active
      return;
    }
    SCServerTimeout serverTimeout = new SCServerTimeout();
    TimeoutWrapper timeoutWrapper = new TimeoutWrapper(serverTimeout);
    this.serverTimeout = (ScheduledFuture<TimeoutWrapper>) AppContext.eci_cri_Scheduler.schedule(timeoutWrapper,
        (int) (this.checkRegistrationIntervalSeconds * Constants.SEC_TO_MILLISEC_FACTOR), TimeUnit.MILLISECONDS);
  }
View Full Code Here

      return;
    }
    // always cancel old timeouter before setting up a new one
    this.cancelSessionTimeout(session);
    // sets up session timeout
    TimeoutWrapper sessionTimeouter = new TimeoutWrapper(new SessionTimeout(session, session.getSessionTimeoutMillis()));
    // schedule sessionTimeouter in registry timer
    ScheduledFuture<TimeoutWrapper> timeout = (ScheduledFuture<TimeoutWrapper>) this.sessionScheduler.schedule(
        sessionTimeouter, (long) newTimeoutMillis, TimeUnit.MILLISECONDS);
    if (SessionLogger.isTraceEnabled()) {
      SessionLogger.logScheduleTimeout(session.getId(), newTimeoutMillis, timeout.getDelay(TimeUnit.MILLISECONDS));
View Full Code Here

      return;
    }
    // always cancel old timeouter before setting up a new one
    this.cancelServerTimeout(server);
    // sets up server timeout
    TimeoutWrapper serverTimeouter = new TimeoutWrapper(new ServerTimeout(server, server.getServerTimeoutMillis()));
    // schedule serverTimeouter in registry timer
    ScheduledFuture<TimeoutWrapper> timeout = (ScheduledFuture<TimeoutWrapper>) this.serverScheduler.schedule(serverTimeouter,
        (long) newTimeoutMillis, TimeUnit.MILLISECONDS);
    LOGGER.trace("schedule server timeout server=" + server.getServerKey() + " timeout=" + newTimeoutMillis);
    server.setTimeout(timeout);
View Full Code Here

   * Trigger session timeout.
   */
  @SuppressWarnings("unchecked")
  private void triggerSessionTimeout() {
    SCSessionTimeout sessTimeout = new SCSessionTimeout();
    TimeoutWrapper timeoutWrapper = new TimeoutWrapper(sessTimeout);
    this.sessionTimeout = (ScheduledFuture<TimeoutWrapper>) AppContext.eci_cri_Scheduler.schedule(timeoutWrapper,
        (echoIntervalSeconds * Constants.SEC_TO_MILLISEC_FACTOR), TimeUnit.MILLISECONDS);
  }
View Full Code Here

    if (this.scServer.getCheckRegistrationIntervalSeconds() == 0) {
      // check registration interval not active
      return;
    }
    SCServerTimeout serverTimeout = new SCServerTimeout();
    TimeoutWrapper timeoutWrapper = new TimeoutWrapper(serverTimeout);
    this.serverTimeout = (ScheduledFuture<TimeoutWrapper>) AppContext.eci_cri_Scheduler.schedule(timeoutWrapper,
        (this.scServer.getCheckRegistrationIntervalSeconds() * Constants.SEC_TO_MILLISEC_FACTOR), TimeUnit.MILLISECONDS);
  }
View Full Code Here

TOP

Related Classes of org.serviceconnector.util.TimeoutWrapper

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.