当前位置: 首页>>代码示例>>Java>>正文


Java UInteger.MAX_VALUE属性代码示例

本文整理汇总了Java中org.eclipse.milo.opcua.stack.core.types.builtin.unsigned.UInteger.MAX_VALUE属性的典型用法代码示例。如果您正苦于以下问题:Java UInteger.MAX_VALUE属性的具体用法?Java UInteger.MAX_VALUE怎么用?Java UInteger.MAX_VALUE使用的例子?那么恭喜您, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在org.eclipse.milo.opcua.stack.core.types.builtin.unsigned.UInteger的用法示例。


在下文中一共展示了UInteger.MAX_VALUE属性的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: getTimeoutHint

private UInteger getTimeoutHint() {
    double minKeepAlive = subscriptions.values().stream()
        .map(s -> s.getRevisedPublishingInterval() * s.getRevisedMaxKeepAliveCount().doubleValue())
        .min(Comparator.naturalOrder())
        .orElse(client.getConfig().getRequestTimeout().doubleValue());

    long maxPendingPublishes = getMaxPendingPublishes();

    double timeoutHint = maxPendingPublishes * minKeepAlive * 1.25;

    if (Double.isInfinite(timeoutHint)) {
        timeoutHint = UInteger.MAX_VALUE;
    } else if (timeoutHint > UInteger.MAX_VALUE) {
        timeoutHint = UInteger.MAX_VALUE;
    }

    logger.debug(
        "getTimeoutHint() minKeepAlive={} maxPendingPublishes={} timeoutHint={}",
        minKeepAlive, maxPendingPublishes, timeoutHint);

    return uint((long) timeoutHint);
}
 
开发者ID:eclipse,项目名称:milo,代码行数:22,代码来源:OpcUaSubscriptionManager.java

示例2: setMaxKeepAliveCount

private void setMaxKeepAliveCount(long maxKeepAliveCount) {
    if (maxKeepAliveCount == 0) maxKeepAliveCount = 3;

    double keepAliveInterval = maxKeepAliveCount * publishingInterval;

    // keep alive interval cannot be longer than the max subscription lifetime.
    if (keepAliveInterval > MAX_LIFETIME) {
        maxKeepAliveCount = (long) (MAX_LIFETIME / publishingInterval);

        if (maxKeepAliveCount < UInteger.MAX_VALUE) {
            if (MAX_LIFETIME % publishingInterval != 0) {
                maxKeepAliveCount++;
            }
        }

        keepAliveInterval = maxKeepAliveCount * publishingInterval;
    }

    // the time between publishes cannot exceed the max publishing interval.
    if (keepAliveInterval > MAX_PUBLISHING_INTERVAL) {
        maxKeepAliveCount = (long) (MAX_PUBLISHING_INTERVAL / publishingInterval);

        if (maxKeepAliveCount < UInteger.MAX_VALUE) {
            if (MAX_PUBLISHING_INTERVAL % publishingInterval != 0) {
                maxKeepAliveCount++;
            }
        }
    }

    this.maxKeepAliveCount = maxKeepAliveCount;
}
 
开发者ID:eclipse,项目名称:milo,代码行数:31,代码来源:Subscription.java

示例3: setLifetimeCount

private void setLifetimeCount(long lifetimeCount) {
    double lifetimeInterval = lifetimeCount * publishingInterval;

    // lifetime cannot be longer than the max subscription lifetime.
    if (lifetimeInterval > MAX_LIFETIME) {
        lifetimeCount = (long) (MAX_LIFETIME / publishingInterval);

        if (lifetimeCount < UInteger.MAX_VALUE) {
            if (MAX_LIFETIME % publishingInterval != 0) {
                lifetimeCount++;
            }
        }
    }

    // the lifetime must be greater than the keepalive.
    if (maxKeepAliveCount < UInteger.MAX_VALUE / 3) {
        if (maxKeepAliveCount * 3 > lifetimeCount) {
            lifetimeCount = maxKeepAliveCount * 3;
        }

        lifetimeInterval = lifetimeCount * publishingInterval;
    } else {
        lifetimeCount = UInteger.MAX_VALUE;
        lifetimeInterval = Double.MAX_VALUE;
    }

    // apply the minimum.
    if (MIN_LIFETIME > publishingInterval && MIN_LIFETIME > lifetimeInterval) {
        lifetimeCount = (long) (MIN_LIFETIME / publishingInterval);

        if (lifetimeCount < UInteger.MAX_VALUE) {
            if (MIN_LIFETIME % publishingInterval != 0) {
                lifetimeCount++;
            }
        }
    }

    this.lifetimeCount = lifetimeCount;
}
 
开发者ID:eclipse,项目名称:milo,代码行数:39,代码来源:Subscription.java


注:本文中的org.eclipse.milo.opcua.stack.core.types.builtin.unsigned.UInteger.MAX_VALUE属性示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。