Search in sources :

Example 1 with TimeLimit

use of io.narayana.sra.annotation.TimeLimit in project narayana by jbosstm.

the class ServerSRAFilter method getTimeOut.

private long getTimeOut(Method method) {
    Annotation timeLimit = method.getDeclaredAnnotation(TimeLimit.class);
    if (timeLimit == null)
        timeLimit = method.getDeclaringClass().getDeclaredAnnotation(TimeLimit.class);
    if (timeLimit == null)
        return SRAClient.DEFAULT_TIMEOUT_MILLIS;
    TimeLimit tl = (TimeLimit) timeLimit;
    return tl.unit().toMillis(tl.limit());
}
Also used : Annotation(java.lang.annotation.Annotation) TimeLimit(io.narayana.sra.annotation.TimeLimit)

Aggregations

TimeLimit (io.narayana.sra.annotation.TimeLimit)1 Annotation (java.lang.annotation.Annotation)1