@Override protected Integer fromAnnotation(final AnnotationInstance annotationInstance, final PropertyReplacer propertyReplacer) { final long timeout = annotationInstance.value().asLong(); AnnotationValue unitAnnVal = annotationInstance.value("unit"); final TimeUnit unit = unitAnnVal != null ? TimeUnit.valueOf(unitAnnVal.asEnum()) : TimeUnit.SECONDS; return (int) unit.toSeconds(timeout); } }
@Override protected AccessTimeoutDetails fromAnnotation(final AnnotationInstance annotationInstance, final PropertyReplacer propertyReplacer) { final long timeout = annotationInstance.value().asLong(); AnnotationValue unitAnnVal = annotationInstance.value("unit"); final TimeUnit unit = unitAnnVal != null ? TimeUnit.valueOf(unitAnnVal.asEnum()) : TimeUnit.MILLISECONDS; return new AccessTimeoutDetails(timeout, unit); } }
@Override protected StatefulTimeoutInfo fromAnnotation(final AnnotationInstance annotationInstance, final PropertyReplacer propertyReplacer) { final long value = annotationInstance.value().asLong(); final AnnotationValue unitValue = annotationInstance.value("unit"); final TimeUnit unit; if (unitValue != null) { unit = TimeUnit.valueOf(unitValue.asEnum()); } else { unit = TimeUnit.MINUTES; } return new StatefulTimeoutInfo(value, unit); } }
public long[] asLongArray() { int length = value.length; long[] array = new long[length]; for (int i = 0; i < length; i++) { array[i] = value[i].asLong(); } return array; }
@Override protected Integer fromAnnotation(final AnnotationInstance annotationInstance) { final long timeout = annotationInstance.value().asLong(); AnnotationValue unitAnnVal = annotationInstance.value("unit"); final TimeUnit unit = unitAnnVal != null ? TimeUnit.valueOf(unitAnnVal.asEnum()) : TimeUnit.SECONDS; return (int) unit.toSeconds(timeout); } }
@Override protected AccessTimeoutDetails fromAnnotation(final AnnotationInstance annotationInstance) { final long timeout = annotationInstance.value().asLong(); AnnotationValue unitAnnVal = annotationInstance.value("unit"); final TimeUnit unit = unitAnnVal != null ? TimeUnit.valueOf(unitAnnVal.asEnum()) : TimeUnit.MILLISECONDS; return new AccessTimeoutDetails(timeout, unit); } }
@Override protected StatefulTimeoutInfo fromAnnotation(final AnnotationInstance annotationInstance) { final long value = annotationInstance.value().asLong(); final AnnotationValue unitValue = annotationInstance.value("unit"); final TimeUnit unit; if (unitValue != null) { unit = TimeUnit.valueOf(unitValue.asEnum()); } else { unit = TimeUnit.MINUTES; } return new StatefulTimeoutInfo(value, unit); } }
} else if (value instanceof AnnotationValue.LongValue) { stream.writeByte(AVALUE_LONG); stream.writeLong(value.asLong()); } else if (value instanceof AnnotationValue.BooleanValue) { stream.writeByte(AVALUE_BOOLEAN);
} else if (value instanceof AnnotationValue.LongValue) { stream.writeByte(AVALUE_LONG); stream.writeLong(value.asLong()); } else if (value instanceof AnnotationValue.BooleanValue) { stream.writeByte(AVALUE_BOOLEAN);