Source Code Cross Referenced for StreamingAttachmentFeature.java in  » 6.0-JDK-Modules » jax-ws-runtime » com » sun » xml » ws » developer » Java Source Code / Java DocumentationJava Source Code and Java Documentation

Java Source Code / Java Documentation
1. 6.0 JDK Core
2. 6.0 JDK Modules
3. 6.0 JDK Modules com.sun
4. 6.0 JDK Modules com.sun.java
5. 6.0 JDK Modules sun
6. 6.0 JDK Platform
7. Ajax
8. Apache Harmony Java SE
9. Aspect oriented
10. Authentication Authorization
11. Blogger System
12. Build
13. Byte Code
14. Cache
15. Chart
16. Chat
17. Code Analyzer
18. Collaboration
19. Content Management System
20. Database Client
21. Database DBMS
22. Database JDBC Connection Pool
23. Database ORM
24. Development
25. EJB Server geronimo
26. EJB Server GlassFish
27. EJB Server JBoss 4.2.1
28. EJB Server resin 3.1.5
29. ERP CRM Financial
30. ESB
31. Forum
32. GIS
33. Graphic Library
34. Groupware
35. HTML Parser
36. IDE
37. IDE Eclipse
38. IDE Netbeans
39. Installer
40. Internationalization Localization
41. Inversion of Control
42. Issue Tracking
43. J2EE
44. JBoss
45. JMS
46. JMX
47. Library
48. Mail Clients
49. Net
50. Parser
51. PDF
52. Portal
53. Profiler
54. Project Management
55. Report
56. RSS RDF
57. Rule Engine
58. Science
59. Scripting
60. Search Engine
61. Security
62. Sevlet Container
63. Source Control
64. Swing Library
65. Template Engine
66. Test Coverage
67. Testing
68. UML
69. Web Crawler
70. Web Framework
71. Web Mail
72. Web Server
73. Web Services
74. Web Services apache cxf 2.0.1
75. Web Services AXIS2
76. Wiki Engine
77. Workflow Engines
78. XML
79. XML UI
Java
Java Tutorial
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
Photoshop Tutorials
Maya Tutorials
Flash Tutorials
3ds-Max Tutorials
Illustrator Tutorials
GIMP Tutorials
C# / C Sharp
C# / CSharp Tutorial
C# / CSharp Open Source
ASP.Net
ASP.NET Tutorial
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
Ruby
PHP
Python
Python Tutorial
Python Open Source
SQL Server / T-SQL
SQL Server / T-SQL Tutorial
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
Flash / Flex / ActionScript
VBA / Excel / Access / Word
XML
XML Tutorial
Microsoft Office PowerPoint 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Microsoft Office Word 2007 Tutorial
Java Source Code / Java Documentation » 6.0 JDK Modules » jax ws runtime » com.sun.xml.ws.developer 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


01:        package com.sun.xml.ws.developer;
02:
03:        import com.sun.xml.ws.api.FeatureConstructor;
04:        import com.sun.istack.Nullable;
05:
06:        import javax.xml.ws.WebServiceFeature;
07:
08:        import org.jvnet.mimepull.MIMEConfig;
09:
10:        /**
11:         * Proxy needs to be created with this feature to configure StreamingAttachment
12:         * attachments behaviour.
13:         * 
14:         * <pre>
15:         * for e.g.: To configure all StreamingAttachment attachments to be kept in memory
16:         * <p>
17:         *
18:         * StreamingAttachmentFeature feature = new StreamingAttachmentFeature();
19:         * feature.setAllMemory(true);
20:         *
21:         * proxy = HelloService().getHelloPort(feature);
22:         *
23:         * </pre>
24:         *
25:         * @author Jitendra Kotamraju
26:         */
27:        public final class StreamingAttachmentFeature extends WebServiceFeature {
28:            /**
29:             * Constant value identifying the {@link @StreamingAttachment} feature.
30:             */
31:            public static final String ID = "http://jax-ws.dev.java.net/features/mime";
32:
33:            private MIMEConfig config;
34:
35:            private String dir;
36:            private boolean parseEagerly;
37:            private long memoryThreshold;
38:
39:            public StreamingAttachmentFeature() {
40:            }
41:
42:            @FeatureConstructor({"dir","parseEagerly","memoryThreshold"})
43:            public StreamingAttachmentFeature(@Nullable
44:            String dir, boolean parseEagerly, long memoryThreshold) {
45:                this .enabled = true;
46:                this .dir = dir;
47:                this .parseEagerly = parseEagerly;
48:                this .memoryThreshold = memoryThreshold;
49:            }
50:
51:            public String getID() {
52:                return ID;
53:            }
54:
55:            /**
56:             * Returns the configuration object. Once this is called, you cannot
57:             * change the configuration.
58:             *
59:             * @return
60:             */
61:            public MIMEConfig getConfig() {
62:                if (config == null) {
63:                    config = new MIMEConfig();
64:                    config.setDir(dir);
65:                    config.setParseEagerly(parseEagerly);
66:                    config.setMemoryThreshold(memoryThreshold);
67:                    config.validate();
68:                }
69:                return config;
70:            }
71:
72:            /**
73:             * Directory in which large attachments are stored
74:             */
75:            public void setDir(String dir) {
76:                this .dir = dir;
77:            }
78:
79:            /**
80:             * StreamingAttachment message is parsed eagerly
81:             */
82:            public void setParseEagerly(boolean parseEagerly) {
83:                this .parseEagerly = parseEagerly;
84:            }
85:
86:            /**
87:             * After this threshold(no of bytes), large attachments are
88:             * written to file system
89:             */
90:            public void setMemoryThreshold(int memoryThreshold) {
91:                this.memoryThreshold = memoryThreshold;
92:            }
93:
94:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.