Source Code Cross Referenced for TestMapProducerFactory.java in  » GIS » GeoServer » org » vfny » geoserver » wms » responses » 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 » GIS » GeoServer » org.vfny.geoserver.wms.responses 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        /* Copyright (c) 2001 - 2007 TOPP - www.openplans.org.  All rights reserved.
002:         * This code is licensed under the GPL 2.0 license, availible at the root
003:         * application directory.
004:         */
005:        package org.vfny.geoserver.wms.responses;
006:
007:        import org.vfny.geoserver.ServiceException;
008:        import org.vfny.geoserver.config.WMSConfig;
009:        import org.vfny.geoserver.global.WMS;
010:        import org.vfny.geoserver.wms.GetMapProducer;
011:        import org.vfny.geoserver.wms.GetMapProducerFactorySpi;
012:        import org.vfny.geoserver.wms.WMSMapContext;
013:        import org.vfny.geoserver.wms.WmsException;
014:        import java.io.IOException;
015:        import java.io.OutputStream;
016:        import java.util.Collections;
017:        import java.util.Map;
018:        import java.util.Set;
019:
020:        /**
021:         * A GetMapProducerFactorySpi just for testing GetMapResponse without depending
022:         * on a real one.
023:         *
024:         * @author Gabriel Roldan, Axios Engineering
025:         * @version $Id: TestMapProducerFactory.java 7467 2007-08-28 22:29:03Z afabiani $
026:         */
027:        public class TestMapProducerFactory implements  GetMapProducerFactorySpi {
028:            /** a fictional image format mime type this factory claims to support */
029:            public static final String TESTING_MIME_TYPE = "image/unit+testing";
030:
031:            /**
032:             * whether an instance returns it is available or not. Set from inside
033:             * GetMapResponseTest.
034:             */
035:            public static boolean available = true;
036:
037:            /**
038:             * DOCUMENT ME!
039:             *
040:             * @return DOCUMENT ME!
041:             */
042:            public String getName() {
043:                return "GetMapProducerFactorySpi for unit testing GetMapResponse only";
044:            }
045:
046:            /**
047:             * DOCUMENT ME!
048:             *
049:             * @return DOCUMENT ME!
050:             */
051:            public Set getSupportedFormats() {
052:                return Collections.singleton(TESTING_MIME_TYPE);
053:            }
054:
055:            /**
056:             * DOCUMENT ME!
057:             *
058:             * @return DOCUMENT ME!
059:             */
060:            public boolean isAvailable() {
061:                return true;
062:            }
063:
064:            /**
065:             * DOCUMENT ME!
066:             *
067:             * @param mapFormat DOCUMENT ME!
068:             *
069:             * @return DOCUMENT ME!
070:             */
071:            public boolean canProduce(String mapFormat) {
072:                return TESTING_MIME_TYPE.equals(mapFormat);
073:            }
074:
075:            /**
076:             * DOCUMENT ME!
077:             *
078:             * @param mapFormat DOCUMENT ME!
079:             *
080:             * @return DOCUMENT ME!
081:             *
082:             * @throws IllegalArgumentException DOCUMENT ME!
083:             */
084:            public GetMapProducer createMapProducer(String mapFormat, WMS wms)
085:                    throws IllegalArgumentException {
086:                if (!canProduce(mapFormat)) {
087:                    throw new IllegalArgumentException();
088:                }
089:
090:                return new TestingMapProducer();
091:            }
092:
093:            /**
094:             * DOCUMENT ME!
095:             *
096:             * @author Gabriel Roldan, Axios Engineering
097:             * @version $Id: TestMapProducerFactory.java 7467 2007-08-28 22:29:03Z afabiani $
098:             */
099:            private class TestingMapProducer extends AbstractGetMapProducer
100:                    implements  GetMapProducer {
101:                /**
102:                 * DOCUMENT ME!
103:                 *
104:                 * @param map DOCUMENT ME!
105:                 *
106:                 * @throws WmsException DOCUMENT ME!
107:                 */
108:                public void produceMap() throws WmsException {
109:                }
110:
111:                /**
112:                 * DOCUMENT ME!
113:                 *
114:                 * @param out DOCUMENT ME!
115:                 *
116:                 * @throws ServiceException DOCUMENT ME!
117:                 * @throws IOException DOCUMENT ME!
118:                 */
119:                public void writeTo(OutputStream out) throws ServiceException,
120:                        IOException {
121:                }
122:
123:                /**
124:                 * DOCUMENT ME!
125:                 *
126:                 * @return DOCUMENT ME!
127:                 *
128:                 * @throws IllegalStateException DOCUMENT ME!
129:                 */
130:                public String getContentType() throws IllegalStateException {
131:                    return TestMapProducerFactory.TESTING_MIME_TYPE;
132:                }
133:
134:                /**
135:                 * DOCUMENT ME!
136:                 */
137:                public void abort() {
138:                }
139:
140:                public String getContentDisposition() {
141:                    // can be null
142:                    return null;
143:                }
144:            }
145:
146:            /* (non-Javadoc)
147:             * @see org.geotools.factory.Factory#getImplementationHints()
148:             * This just returns java.util.Collections.EMPTY_MAP
149:             */
150:            public Map getImplementationHints() {
151:                return java.util.Collections.EMPTY_MAP;
152:            }
153:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.