01: package com.sun.xml.ws.developer;
02:
03: import javax.xml.ws.spi.WebServiceFeatureAnnotation;
04: import java.lang.annotation.*;
05: import java.io.File;
06:
07: /**
08: * This feature represents the use of StreamingAttachment attachments with a
09: * web service.
10: *
11: * <pre>
12: * for e.g.: To keep all MIME attachments in memory, do the following
13: *
14: * <p>
15: * @WebService
16: * @MIME(memoryThreshold=-1L)
17: * public class HelloService {
18: * }
19: * </pre>
20: *
21: * @see StreamingAttachmentFeature
22: *
23: * @author Jitendra Kotamraju
24: */
25: @Retention(RetentionPolicy.RUNTIME)
26: @Target(ElementType.TYPE)
27: @Documented
28: @WebServiceFeatureAnnotation(id=StreamingAttachmentFeature.ID,bean=StreamingAttachmentFeature.class)
29: public @interface StreamingAttachment {
30:
31: /**
32: * Directory in which large attachments are stored. {@link File#createTempFile}
33: * methods are used to create temp files for storing attachments. This
34: * value is used in {@link File#createTempFile}, if specified. If a file
35: * cannot be created in this dir, then all the content is kept in memory.
36: */
37: String dir() default "";
38:
39: /**
40: * MIME message is parsed eagerly.
41: */
42: boolean parseEagerly() default false;
43:
44: /**
45: * After this threshold(no of bytes per attachment), large attachment is
46: * written to file system.
47: *
48: * If the value is -1, then all the attachment content is kept in memory.
49: */
50: long memoryThreshold() default 1048576L;
51:
52: }
|