Source Code Cross Referenced for RemoteRIFRegistry.java in  » 6.0-JDK-Modules » Java-Advanced-Imaging » javax » media » jai » registry » 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 » Java Advanced Imaging » javax.media.jai.registry 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        /*
002:         * $RCSfile: RemoteRIFRegistry.java,v $
003:         *
004:         * Copyright (c) 2005 Sun Microsystems, Inc. All rights reserved.
005:         *
006:         * Use is subject to license terms.
007:         *
008:         * $Revision: 1.1 $
009:         * $Date: 2005/02/11 04:57:48 $
010:         * $State: Exp $
011:         */package javax.media.jai.registry;
012:
013:        import java.awt.RenderingHints;
014:        import java.awt.image.renderable.ParameterBlock;
015:        import javax.media.jai.OperationRegistry;
016:        import javax.media.jai.JAI;
017:        import javax.media.jai.remote.RemoteRIF;
018:        import javax.media.jai.remote.RemoteRenderedImage;
019:
020:        /**
021:         * Utility class to provide type-safe interaction with the
022:         * <code>OperationRegistry</code> for <code>RemoteRIF</code> objects.
023:         *
024:         * <p> If the <code>OperationRegistry</code> specified as an argument to
025:         * the methods in this class is null, then 
026:         * <code>JAI.getOperationRegistry()</code> will be used.
027:         *
028:         * @since JAI 1.1
029:         */
030:        public final class RemoteRIFRegistry {
031:
032:            private static final String MODE_NAME = RemoteRenderedRegistryMode.MODE_NAME;
033:
034:            /**
035:             * Registers the given <code>RemoteRIF</code> with the given 
036:             * <code>OperationRegistry</code> under the given protocolName.
037:             *
038:             * @param registry     The <code>OperationRegistry</code> to register 
039:             *                     the <code>RemoteRIF</code> with. If this is
040:             *                     <code>null</code>, then <code>
041:             *                     JAI.getDefaultInstance().getOperationRegistry()</code>
042:             *                     will be used.
043:             * @param protocolName The protocolName to register the 
044:             *                     <code>RemoteRIF</code> under.
045:             * @param rrif         The <code>RemoteRIF</code> to register.
046:             *
047:             * @throws IllegalArgumentException if protocolName is null.
048:             * @throws IllegalArgumentException if rrif is null.
049:             * @throws IllegalArgumentException if there is no 
050:             * <code>RemoteDescriptor</code> registered against the 
051:             * given protocolName.
052:             */
053:            public static void register(OperationRegistry registry,
054:                    String protocolName, RemoteRIF rrif) {
055:
056:                registry = (registry != null) ? registry : JAI
057:                        .getDefaultInstance().getOperationRegistry();
058:
059:                registry.registerFactory(MODE_NAME, protocolName, null, rrif);
060:            }
061:
062:            /**
063:             * Unregisters the given <code>RemoteRIF</code> previously registered 
064:             * under the given protocolName in the given
065:             * <code>OperationRegistry</code>.
066:             *
067:             * @param registry     The <code>OperationRegistry</code> to unregister
068:             *                     the <code>RemoteRIF</code> from. If this is
069:             *                     <code>null</code>, then <code>
070:             *                     JAI.getDefaultInstance().getOperationRegistry()</code>
071:             *                     will be used.
072:             * @param protocolName The protocolName to unregister the
073:             *                     <code>RemoteRIF</code> from under.
074:             * @param rrif         The <code>RemoteRIF</code> to unregister.
075:             *
076:             * @throws IllegalArgumentException if protocolName is null.
077:             * @throws IllegalArgumentException if rrif is null.
078:             * @throws IllegalArgumentException if there is no 
079:             * <code>RemoteDescriptor</code> registered against the 
080:             * given protocolName.
081:             * @throws IllegalArgumentException if the rrif was not previously
082:             * registered against protocolName.
083:             */
084:            public static void unregister(OperationRegistry registry,
085:                    String protocolName, RemoteRIF rrif) {
086:
087:                registry = (registry != null) ? registry : JAI
088:                        .getDefaultInstance().getOperationRegistry();
089:
090:                registry.unregisterFactory(MODE_NAME, protocolName, null, rrif);
091:            }
092:
093:            /**
094:             * Returns the <code>RemoteRIF</code> registered under the given
095:             * protocol name in the specified <code>OperationRegistry</code>.
096:             *
097:             * @param registry     The <code>OperationRegistry</code> to use.
098:             *                     If this is <code>null</code>, then <code>
099:             *                     JAI.getDefaultInstance().getOperationRegistry()</code>
100:             *                     will be used.
101:             * @param protocolName The name of the remote imaging protocol.
102:             *
103:             * @throws IllegalArgumentException if protocolName is null.
104:             * @throws IllegalArgumentException if there is no
105:             * <code>RemoteDescriptor</code> registered against the given
106:             * <code>protocolName</code>.
107:             */
108:            public static RemoteRIF get(OperationRegistry registry,
109:                    String protocolName) {
110:
111:                registry = (registry != null) ? registry : JAI
112:                        .getDefaultInstance().getOperationRegistry();
113:
114:                return (RemoteRIF) registry.getFactory(MODE_NAME, protocolName);
115:            }
116:
117:            /**
118:             * Constructs a <code>RemoteRenderedImage</code> representing the 
119:             * results of remotely applying the given operation to the source(s),
120:             * and parameters specified in the specified <code>ParameterBlock</code>,
121:             * using the specified rendering hints. The registry
122:             * is used to determine the <code>RemoteRIF</code> to be used to
123:             * instantiate the operation.
124:             *
125:             * <p>Since this class is a simple type-safe wrapper around 
126:             * <code>OperationRegistry</code>'s type-unsafe methods, no additional
127:             * argument validation is performed in this method. Thus errors/exceptions
128:             * may occur if incorrect values are provided for the input arguments.
129:             * If argument validation is desired as part of creating a rendering,
130:             * <code>RemoteJAI.create()</code> may be used instead.
131:             *
132:             * <p>Exceptions thrown by the <code>RemoteRIF</code>s used to create
133:             * the rendering will be caught by this method and will not be propagated.
134:             *
135:             * @param registry      The <code>OperationRegistry</code> to use to
136:             *                      create the rendering. If this is
137:             *                      <code>null</code>, then <code>
138:             *                     JAI.getDefaultInstance().getOperationRegistry()</code>
139:             *                      will be used.
140:             * @param protocolName  The protocol to be used for remote imaging.
141:             * @param serverName    The name of the server.
142:             * @param operationName The name of the operation to be performed remotely.
143:             * @param paramBlock    The <code>ParameterBlock</code> specifying the
144:             *                      sources and parameters required for the operation.
145:             * @param renderHints   A <code>RenderingHints</code> object containing
146:             *                      rendering hints.
147:             *
148:             * @throws IllegalArgumentException if protocolName is null.
149:             * @throws IllegalArgumentException if there is no 
150:             * <code>RemoteDescriptor</code> registered against the given
151:             * protocolName.
152:             */
153:            public static RemoteRenderedImage create(
154:                    OperationRegistry registry, String protocolName,
155:                    String serverName, String operationName,
156:                    ParameterBlock paramBlock, RenderingHints renderHints) {
157:
158:                registry = (registry != null) ? registry : JAI
159:                        .getDefaultInstance().getOperationRegistry();
160:
161:                Object args[] = { serverName, operationName, paramBlock,
162:                        renderHints };
163:
164:                return (RemoteRenderedImage) registry.invokeFactory(MODE_NAME,
165:                        protocolName, args);
166:            }
167:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.