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


java.lang.Object
   javax.media.jai.OperationRegistry

All known Subclasses:   javax.media.jai.ThreadSafeOperationRegistry,
OperationRegistry
public class OperationRegistry implements Externalizable(Code)
A class responsible for maintaining a registry of various types of factory objects and preferences among them. The operation registry hierarchy looks as follows
 |-object1-
 |-product1-|-object2-
 |-descriptor1-|          |-object3-
 |             |
 |             |          |-object1-
 |             |-product2-|-object2-
 |-mode1-|                        |-object3-
 |       |
 |-OperationRegistry-|       |                        |-object1-
 |       |             |-product1-|-object2-
 |       |-descriptor2-|          |-object3-
 |                     |
 |                     |          |-object1-
 |                     |-product2-|-object2-
 |                                |-object3-
 |
 |-mode2-|-descriptor1-|-object1--
 |
 |-descriptor2-|-object1--
 

The OperationRegistry class maps a descriptor name (for example, an image operation name) into the particular kind of factory object requested, capable of implementing the functionality described by the descriptor. The mapping is constructed in several stages:

At the highest level all objects are registered against some mode. A mode is specified by a String which must be one of those returned by RegistryMode.getModeNames(). Examples of known registry modes include "rendered", "renderable", "collection", "renderableCollection", "tileEncoder", "tileDecoder", "remoteRendered", "remoteRenderable", etc.

Each registry mode is associated with a RegistryElementDescriptor which describes some functionality to be implemented by factory objects associated with this descriptor. For example, the "rendered" registry mode is associated with OperationDescriptor.class and "tileEncoder" is associated with TileCodecDescriptor.class. Different registry modes can share the same RegistryElementDescriptor. For example "rendered", "renderable" (and other image operation registry modes) are all associated with OperationDescriptor.class.

If a registry mode supports preferences (for example "rendered", "tileEncoder" etc.), then the hierarchy of objects registered under that mode looks like that of "mode1" above. Descriptors are first registered against all modes that the specific instance supports. Each factory object that implements the functionality specified by that descriptor is registered against some product (name) under that descriptor. Preferences can be set among products under a given descriptor or among objects under a specific product/descriptor.

The ordering of such factory objects is determined by the order of the products attached to an OperationDescriptor, and by the order of the factory objects within each product. The orders are established by setting pairwise preferences, resulting in a partial order which is then sorted topologically. The results of creating a cycle are undefined.

The ordering of factory objects within a product is intended to allow vendors to create complex "fallback" chains. An example would be installing a RenderedImageFactory that implements separable convolution ahead of a RenderedImageFactory that implements a more general algorithm.

If a registry mode does not support preferences (for example, "renderable", "remoteRenderable" etc.) then the hierarchy of objects registered under that mode looks like that of "mode2" above. Only a single factory object belonging to this mode can be associated with a given descriptor. If multiple objects are registered under the same descriptor, the last one registered is retained.

The OperationRegistry has several methods to manage this hierarchy, which accept a modeName and work with Objects. The preferred manner of usage is through the type-safe wrapper class which are specific to each mode (for example RIFRegistry, CRIFRegistry etc.)

Vendors are encouraged to use unique product names (by means of the Java programming language convention of reversed Internet addresses) in order to maximize the likelihood of clean installation. See The Java Programming Language, §10.1 for a discussion of this convention in the context of package naming.

Users will, for the most part, only wish to set ordering preferences on the product level, since the factory object level orderings will be complex. However, it is possible for a knowledgable user to insert a specific factory object into an existing product for tuning purposes.

The OperationRegistry also has the responsibility of associating a set of PropertyGenerators with each descriptor. This set will be coalesced into a PropertySource suitable for use by the getPropertySource() method. If several PropertyGenerators associated with a particular descriptor generate the same property, only the last one to be registered will have any effect.

The registry handles all names (except class names) in a case-insensitive but retentive manner.

Initialization and automatic loading of registry objects.

The user has two options for automatic loading of registry objects.

  • For most normal situations the user can create a "registryFile.jai" with entries for operators and preferences specific to their packages. This registry file must be put it in the META-INF directory of the jarfile or classpath.
  • For situations where more control over the operation registry is needed, (for example remove an operator registered by JAI etc.) the user can implement a concrete sub-class of the OperationRegistrySpi interface and register it as service provider (see OperationRegistrySpi for more details). The updateRegistry method of such registered service providers will be called with the default OperationRegistry of JAI once it has been initialized.

The initialization of the OperationRegistry of the default instance of JAI happens as follows

  1. Load the JAI distributed registry file "META-INF/javax.media.jai.registryFile.jai" (from jai_core.jar)
  2. Find and load all "META-INF/registryFile.jai" files found in the classpath in some arbitrary order.
  3. Look for registered service providers of OperationRegistrySpi listed in all "META-INF/services/javax.media.jai.OperationRegistrySpi" files found in the classpath and call their updateRegistry method passing in the default OperationRegistry. The order of these calls to updateRegistry is arbitrary.
Note that the user should not make any assumption about the order of loading WITHIN step 2 or 3. If there is a need for the updateRegistry method to be called right after the associated registryFile.jai is read in, the following could be done.

The user could give the registry file a package qualified name for e.g xxx.yyy.registryFile.jai and put this in the META-INF directory of the jar file. Then in the concrete class that implements OperationRegistrySpi

 void updateRegistry(OperationRegistry or) {
 String registryFile = "META-INF/xxx.yyy.registryFile.jai";
 InputStream is = ClassLoader.getResourceAsStream(registryFile);
 or.updateFromStream(is);
 // Make other changes to "or" ...
 }
 
For information on the format of the registry file, see the serialized form of the OperationRegistry.
See Also:   OperationRegistrySpi
See Also:   RegistryMode
See Also:   RegistryElementDescriptor


Field Summary
static  StringJAI_REGISTRY_FILE
    
static  StringUSR_REGISTRY_FILE
    

Constructor Summary
public  OperationRegistry()
     Default Constructor.

Method Summary
public  voidaddPropertyGenerator(String modeName, String descriptorName, PropertyGenerator generator)
     Adds a PropertyGenerator to the registry, associating it with a particular descriptor registered against a registry mode.
public  voidaddPropertyGenerator(String operationName, PropertyGenerator generator)
     Adds a PropertyGenerator to the registry, associating it with a particular OperationDescriptor.
public  voidclearCIFPreferences(String operationName, String productName)
     Removes all preferences between CIFs within a product registered under a particular OperationDescriptor.
public  voidclearFactoryPreferences(String modeName, String descriptorName, String productName)
     Removes all preferences between instances of a factory within a product registered under a particular OperationDescriptor.
public  voidclearOperationPreferences(String operationName, String productName)
     Removes all RIF and CIF preferences within a product registered under a particular OperationDescriptor.
public  voidclearProductPreferences(String modeName, String descriptorName)
     Remove all the preferences between products for a descriptor registered under a registry mode.
public  voidclearProductPreferences(String operationName)
     Removes all preferences between products registered under a common OperationDescriptor.
public  voidclearPropertyState(String modeName)
     Removes all property associated information for this registry mode from this OperationRegistry.
public  voidclearPropertyState()
     Removes all property associated information from this OperationRegistry.
public  voidclearRIFPreferences(String operationName, String productName)
     Removes all preferences between RIFs within a product registered under a particular OperationDescriptor.
public  voidcopyPropertyFromSource(String modeName, String descriptorName, String propertyName, int sourceIndex)
     Forces a property to be copied from the specified source by nodes performing a particular operation.
public  voidcopyPropertyFromSource(String operationName, String propertyName, int sourceIndex)
     Forces a property to be copied from the specified source image by RenderedOp nodes performing a particular operation.
public  PlanarImagecreate(String operationName, ParameterBlock paramBlock, RenderingHints renderHints)
     Constructs a PlanarImage (usually a RenderedOp) representing the results of applying a given operation to a particular ParameterBlock and rendering hints.
public  CollectionImagecreateCollection(String operationName, ParameterBlock args, RenderingHints hints)
     Constructs a CollectionImage (usually a CollectionOp) representing the results of applying a given operation to a particular ParameterBlock and rendering hints. The registry is used to determine the CIF to be used to instantiate the operation.

If none of the CIFs registered with this OperationRegistry returns a non-null value, null is returned.

public  ContextualRenderedImageFactorycreateRenderable(String operationName, ParameterBlock paramBlock)
     Constructs the CRIF to be used to instantiate the operation.
public  RegistryElementDescriptorgetDescriptor(Class descriptorClass, String descriptorName)
     Get the RegistryElementDescriptor corresponding to a descriptorClass and a descriptorName.
public  RegistryElementDescriptorgetDescriptor(String modeName, String descriptorName)
     Get the RegistryElementDescriptor corresponding to descriptorName which supports the specified mode. This is done by matching up the descriptorName against RegistryElementDescriptor.getName in a case-insensitive manner.
public  String[]getDescriptorNames(Class descriptorClass)
     Get an array of all the descriptor names corresponding to the descriptorClass.
public  String[]getDescriptorNames(String modeName)
     Get an array of all descriptor-names of descriptors registered under a given registry mode.
public  ListgetDescriptors(Class descriptorClass)
     Get a List of all RegistryElementDescriptor corresponding to the descriptorClass.
public  ListgetDescriptors(String modeName)
     Get a list of all RegistryElementDescriptors registered under a given registry mode.
public  ObjectgetFactory(String modeName, String descriptorName)
     Returns the factory of the specified type for the named operation.
public  IteratorgetFactoryIterator(String modeName, String descriptorName)
     Returns an Iterator over all factory objects registered with the specified factory and operation names over all products.
public  Object[][]getFactoryPreferences(String modeName, String descriptorName, String productName)
     Get all pairwise preferences between instances of a factory within a product registered under a particular OperationDescriptor.
public  String[]getGeneratedPropertyNames(String modeName, String descriptorName)
     Returns a list of the properties generated by nodes implementing the descriptor associated with a particular descriptor Name.
public  String[]getGeneratedPropertyNames(String operationName)
     Returns a list of the properties generated by nodes implementing the operation associated with a particular Operation Name.
 StringgetLocalName(String modeName, Object factoryInstance)
     Get the local name for a factory instance used in the DescriptorCache (to be used in writing out the registry file).
public  OperationDescriptorgetOperationDescriptor(String operationName)
     Returns the OperationDescriptor that is currently registered under the given name, or null if none exists. Though unlikely, it is possible to have different descriptors registered under different modes.
public  VectorgetOperationDescriptors()
     Returns a Vector of all currently registered OperationDescriptors.
public  String[]getOperationNames()
     Returns a list of names under which all the OperationDescriptors in the registry are registered.
public  VectorgetOrderedCIFList(String operationName, String productName)
     Returns a list of the CIFs of a product registered under a particular OperationDescriptor, in an ordering that satisfies all of the pairwise preferences that have been set.
public  ListgetOrderedFactoryList(String modeName, String descriptorName, String productName)
     Returns a list of the factory instances of a product registered under a particular OperationDescriptor, in an ordering that satisfies all of the pairwise preferences that have been set.
public  VectorgetOrderedProductList(String modeName, String descriptorName)
     Returns a list of the products registered under a particular descriptor in an ordering that satisfies all of the pairwise preferences that have been set.
public  VectorgetOrderedProductList(String operationName)
     Returns a list of the products registered under a particular OperationDescriptor, in an ordering that satisfies all of the pairwise preferences that have been set.
public  VectorgetOrderedRIFList(String operationName, String productName)
     Returns a list of the RIFs of a product registered under a particular OperationDescriptor, in an ordering that satisfies all of the pairwise preferences that have been set.
public  String[][]getProductPreferences(String modeName, String descriptorName)
     Returns a list of the pairwise product preferences under a particular descriptor registered against a registry mode.
public  String[][]getProductPreferences(String operationName)
     Returns a list of the pairwise product preferences under a particular OperationDescriptor.
public  PropertySourcegetPropertySource(String modeName, String descriptorName, Object op, Vector sources)
     Merge mode-specific property environment with mode-independent property environment of the descriptor.
public  PropertySourcegetPropertySource(OperationNode op)
     Constructs and returns a PropertySource suitable for use by a given OperationNode.
public  PropertySourcegetPropertySource(RenderedOp op)
     Constructs and returns a PropertySource suitable for use by a given RenderedOp.
public  PropertySourcegetPropertySource(RenderableOp op)
     Constructs and returns a PropertySource suitable for use by a given RenderableOp.
public  String[]getRegistryModes()
     Get's the list of known registry modes known to the OperationRegistry.
public static  OperationRegistrygetThreadSafeOperationRegistry()
     Creates and returns a new thread-safe version of the OperationRegistry which uses reader-writer locks to wrap every method with a read or a write lock as appropriate.
public  voidinitializeFromStream(InputStream in)
     Initializes the OperationRegistry from an InputStream.
static  OperationRegistryinitializeRegistry()
     Creates a new thread-safe OperationRegistry.
public  ObjectinvokeFactory(String modeName, String descriptorName, Object[] args)
     Finds the factory of the specified type for the named operation and invokes its default factory method with the supplied parameters.
public  voidreadExternal(ObjectInput in)
     Restores the contents of the registry from an ObjectInput which was previously written using the writeExternal method.

All non-IO exceptions encountered while parsing the registry files are caught and their error messages are redirected to System.err.

public  voidregisterCIF(String operationName, String productName, CollectionImageFactory CIF)
     Registers a CIF with a particular product and operation.
public  voidregisterCRIF(String operationName, ContextualRenderedImageFactory CRIF)
     Registers a CRIF under a particular operation.
public  voidregisterDescriptor(RegistryElementDescriptor descriptor)
     Register a descriptor against all the registry modes it supports.
public  voidregisterFactory(String modeName, String descriptorName, String productName, Object factory)
     Register a factory object with a particular product and descriptor against a specified mode.
public  voidregisterOperationDescriptor(OperationDescriptor odesc, String operationName)
     Registers an OperationDescriptor with the registry.
public  voidregisterRIF(String operationName, String productName, RenderedImageFactory RIF)
     Registers a RIF with a particular product and operation.
public  voidregisterServices(ClassLoader cl)
     Load all the "META-INF/registryFile.jai" files and then called the updateRegistry() of the registered service provider of OperationRegistrySpi found in the classpath corresponding to this class loader.
public  voidremovePropertyGenerator(String modeName, String descriptorName, PropertyGenerator generator)
     Removes a PropertyGenerator from its association with a particular descriptor/registry-mode in the registry.
public  voidremovePropertyGenerator(String operationName, PropertyGenerator generator)
     Removes a PropertyGenerator from its association with a particular OperationDescriptor in the registry.
public  voidremoveRegistryMode(String modeName)
     Remove a registry mode (including pre-defined JAI modes) from the OperationRegistry.
public  voidsetCIFPreference(String operationName, String productName, CollectionImageFactory preferredCIF, CollectionImageFactory otherCIF)
     Sets a preference between two CIFs within the same product.
public  voidsetFactoryPreference(String modeName, String descriptorName, String productName, Object preferredOp, Object otherOp)
     Sets a preference between two factory instances for a given operation under a specified product.
public  voidsetProductPreference(String modeName, String descriptorName, String preferredProductName, String otherProductName)
     Set the preference between two products for a descriptor registered under a registry mode.
public  voidsetProductPreference(String operationName, String preferredProductName, String otherProductName)
     Sets a preference between two products registered under a common OperationDescriptor.
public  voidsetRIFPreference(String operationName, String productName, RenderedImageFactory preferredRIF, RenderedImageFactory otherRIF)
     Sets a preference between two RIFs within the same product.
public  voidsuppressAllProperties(String modeName, String descriptorName)
     Forces all properties to be suppressed by nodes performing a particular operation.
public  voidsuppressAllProperties(String operationName)
     Forces all properties to be suppressed by nodes performing a particular operation.
public  voidsuppressProperty(String modeName, String descriptorName, String propertyName)
     Forces a particular property to be suppressed by nodes performing a particular operation.
public  voidsuppressProperty(String operationName, String propertyName)
     Forces a particular property to be suppressed by nodes performing a particular operation.
public  StringtoString()
     Returns a String representation of the registry.
public  voidunregisterCIF(String operationName, String productName, CollectionImageFactory CIF)
     Unregisters a CIF from a particular product and operation.
public  voidunregisterCRIF(String operationName, ContextualRenderedImageFactory CRIF)
     Unregisters a CRIF from a particular operation.
public  voidunregisterDescriptor(RegistryElementDescriptor descriptor)
     Unregister a descriptor against all its supported modes from the operation registry.
public  voidunregisterFactory(String modeName, String descriptorName, String productName, Object factory)
     Unregister a factory object previously registered with a product and descriptor against the specified mode.
public  voidunregisterOperationDescriptor(String operationName)
     Unregisters an OperationDescriptor from the registry.
public  voidunregisterRIF(String operationName, String productName, RenderedImageFactory RIF)
     Unregisters a RIF from a particular product and operation.
public  voidunsetCIFPreference(String operationName, String productName, CollectionImageFactory preferredCIF, CollectionImageFactory otherCIF)
     Removes a preference between two CIFs within the same product.
public  voidunsetFactoryPreference(String modeName, String descriptorName, String productName, Object preferredOp, Object otherOp)
     Unsets a preference between two factory instances for a given operation under a specified product.
public  voidunsetProductPreference(String modeName, String descriptorName, String preferredProductName, String otherProductName)
     Remove the preference between two products for a descriptor registered under a registry mode.
public  voidunsetProductPreference(String operationName, String preferredProductName, String otherProductName)
     Removes a preference between two products registered under a common OperationDescriptor.
public  voidunsetRIFPreference(String operationName, String productName, RenderedImageFactory preferredRIF, RenderedImageFactory otherRIF)
     Removes a preference between two RIFs within the same product.
public  voidupdateFromStream(InputStream in)
     Updates the current OperationRegistry with the operations specified by the given InputStream. All non-IO exceptions encountered while parsing the registry files are caught and their error messages are redirected to System.err.
public  voidwriteExternal(ObjectOutput out)
     Saves the contents of the registry as described in the serialized form.
public  voidwriteToStream(OutputStream out)
     Writes out the contents of the OperationRegistry to a stream as specified in the writeExternal method.

Field Detail
JAI_REGISTRY_FILE
static String JAI_REGISTRY_FILE(Code)
The JAI packaged registry file



USR_REGISTRY_FILE
static String USR_REGISTRY_FILE(Code)
The user defined registry files that are automatically loaded




Constructor Detail
OperationRegistry
public OperationRegistry()(Code)
Default Constructor. The OperationRegistry created is not thread-safe. Note that none of the automatic loading of registry files or services happens here.
See Also:   OperationRegistry.getThreadSafeOperationRegistry




Method Detail
addPropertyGenerator
public void addPropertyGenerator(String modeName, String descriptorName, PropertyGenerator generator)(Code)
Adds a PropertyGenerator to the registry, associating it with a particular descriptor registered against a registry mode.
Parameters:
  modeName - the registry mode name as a String
Parameters:
  descriptorName - the descriptor name as a String
Parameters:
  generator - the PropertyGenerator to be added.
throws:
  IllegalArgumentException - if any of the argumentsis null
throws:
  IllegalArgumentException - if modeName is not one ofthose returned by RegistryMode.getModes()
throws:
  IllegalArgumentException - if there is no RegistryElementDescriptor registered againstthe descriptorName
throws:
  IllegalArgumentException - if the specified mode does notsupport properties.
since:
   JAI 1.1



addPropertyGenerator
public void addPropertyGenerator(String operationName, PropertyGenerator generator)(Code)
Adds a PropertyGenerator to the registry, associating it with a particular OperationDescriptor.
Parameters:
  operationName - the operation name as a String.
Parameters:
  generator - the PropertyGenerator to be added.
See Also:   OperationRegistry.addPropertyGenerator
See Also:    addPropertyGenerator - for list of exceptions thrown.



clearCIFPreferences
public void clearCIFPreferences(String operationName, String productName)(Code)
Removes all preferences between CIFs within a product registered under a particular OperationDescriptor.
Parameters:
  operationName - the operation name as a String.
Parameters:
  productName - the name of the product.
See Also:   OperationRegistry.clearFactoryPreferences
See Also:    clearFactoryPreferences - for list of exceptions thrown.
See Also:   CIFRegistry.clearPreferences



clearFactoryPreferences
public void clearFactoryPreferences(String modeName, String descriptorName, String productName)(Code)
Removes all preferences between instances of a factory within a product registered under a particular OperationDescriptor.
Parameters:
  modeName - the registry mode name as a String
Parameters:
  descriptorName - the descriptor name as a String
Parameters:
  productName - the product name as a String
throws:
  IllegalArgumentException - if any of the argumentsis null
throws:
  IllegalArgumentException - if modeName is not one ofthose returned by RegistryMode.getModes()
throws:
  IllegalArgumentException - if there is no RegistryElementDescriptor registered againstthe descriptorName
since:
   JAI 1.1



clearOperationPreferences
public void clearOperationPreferences(String operationName, String productName)(Code)
Removes all RIF and CIF preferences within a product registered under a particular OperationDescriptor.
Parameters:
  operationName - the operation name as a String.
Parameters:
  productName - the name of the product.
See Also:   OperationRegistry.clearFactoryPreferences
See Also:    clearFactoryPreferences - for list of exceptions thrown.
See Also:   RIFRegistry.clearPreferences
See Also:   CIFRegistry.clearPreferences



clearProductPreferences
public void clearProductPreferences(String modeName, String descriptorName)(Code)
Remove all the preferences between products for a descriptor registered under a registry mode.
Parameters:
  modeName - the registry mode name as a String
Parameters:
  descriptorName - the descriptor name as a String
throws:
  IllegalArgumentException - if modeName is nullor if the modeName is not one of the modes returnedRegistryMode.getModes()
throws:
  IllegalArgumentException - if descriptorName is null
throws:
  IllegalArgumentException - if the registry mode does notsupport preferences
since:
   JAI 1.1



clearProductPreferences
public void clearProductPreferences(String operationName)(Code)
Removes all preferences between products registered under a common OperationDescriptor.
Parameters:
  operationName - the operation name as a String.
See Also:   OperationRegistry.clearProductPreferences
See Also:    clearProductPreferences - for list of exceptions thrown.



clearPropertyState
public void clearPropertyState(String modeName)(Code)
Removes all property associated information for this registry mode from this OperationRegistry.
Parameters:
  modeName - the registry mode name as a String
throws:
  IllegalArgumentException - if modeName is null or is not one ofthose returned by RegistryMode.getModes()
throws:
  IllegalArgumentException - if the specified mode does notsupport properties.
since:
   JAI 1.1



clearPropertyState
public void clearPropertyState()(Code)
Removes all property associated information from this OperationRegistry.
See Also:   OperationRegistry.clearPropertyState



clearRIFPreferences
public void clearRIFPreferences(String operationName, String productName)(Code)
Removes all preferences between RIFs within a product registered under a particular OperationDescriptor.
Parameters:
  operationName - the operation name as a String.
Parameters:
  productName - the name of the product.
See Also:   OperationRegistry.clearFactoryPreferences
See Also:    clearFactoryPreferences - for list of exceptions thrown.
See Also:   RIFRegistry.clearPreferences



copyPropertyFromSource
public void copyPropertyFromSource(String modeName, String descriptorName, String propertyName, int sourceIndex)(Code)
Forces a property to be copied from the specified source by nodes performing a particular operation. By default, a property is copied from the first source node that emits it. The result of specifying an invalid source is undefined.
Parameters:
  modeName - the registry mode name as a String
Parameters:
  descriptorName - the descriptor name as a String
Parameters:
  propertyName - the name of the property to be copied.
Parameters:
  sourceIndex - the index of the source to copy the property from.
throws:
  IllegalArgumentException - if any of the Stringarguments is null
throws:
  IllegalArgumentException - if modeName is not one ofthose returned by RegistryMode.getModes()
throws:
  IllegalArgumentException - if there is no RegistryElementDescriptor registered againstthe descriptorName
throws:
  IllegalArgumentException - if the specified mode does notsupport properties.
since:
   JAI 1.1



copyPropertyFromSource
public void copyPropertyFromSource(String operationName, String propertyName, int sourceIndex)(Code)
Forces a property to be copied from the specified source image by RenderedOp nodes performing a particular operation. By default, a property is copied from the first source node that emits it. The result of specifying an invalid source is undefined.
Parameters:
  operationName - the operation name as a String.
Parameters:
  propertyName - the name of the property to be copied.
Parameters:
  sourceIndex - the index of the source to copy the property from.
See Also:   OperationRegistry.copyPropertyFromSource
See Also:    copyPropertyFromSource - for list of exceptions thrown.



create
public PlanarImage create(String operationName, ParameterBlock paramBlock, RenderingHints renderHints)(Code)
Constructs a PlanarImage (usually a RenderedOp) representing the results of applying a given operation to a particular ParameterBlock and rendering hints. The registry is used to determine the RIF to be used to instantiate the operation.

If none of the RIFs registered with this OperationRegistry returns a non-null value, null is returned. Exceptions thrown by the RIFs will be caught by this method and will not be propagated.
Parameters:
  operationName - the operation name as a String.
Parameters:
  paramBlock - the operation's ParameterBlock.
Parameters:
  renderHints - a RenderingHints object containing rendering hints.
throws:
  IllegalArgumentException - if operationName is null.
See Also:   RIFRegistry.create




createCollection
public CollectionImage createCollection(String operationName, ParameterBlock args, RenderingHints hints)(Code)
Constructs a CollectionImage (usually a CollectionOp) representing the results of applying a given operation to a particular ParameterBlock and rendering hints. The registry is used to determine the CIF to be used to instantiate the operation.

If none of the CIFs registered with this OperationRegistry returns a non-null value, null is returned. Exceptions thrown by the CIFs will be caught by this method and will not be propagated.
Parameters:
  operationName - The operation name as a String.
Parameters:
  args - The operation's input parameters.
Parameters:
  hints - A RenderingHints object containing rendering hints.
throws:
  IllegalArgumentException - if operationName is null.
See Also:   CIFRegistry.create




createRenderable
public ContextualRenderedImageFactory createRenderable(String operationName, ParameterBlock paramBlock)(Code)
Constructs the CRIF to be used to instantiate the operation. Returns null, if no CRIF is registered with the given operation name.
Parameters:
  operationName - the operation name as a String.
Parameters:
  paramBlock - the operation's ParameterBlock.
throws:
  IllegalArgumentException - if operationName is null.
See Also:   CRIFRegistry.get



getDescriptor
public RegistryElementDescriptor getDescriptor(Class descriptorClass, String descriptorName)(Code)
Get the RegistryElementDescriptor corresponding to a descriptorClass and a descriptorName. For example, getDescriptor(OperationDescriptor.class, "add") would get the operation descriptor for the "add" image operation. Note that different descriptors might have been registered against each mode associated with the descriptorClass. In this case this methods will arbitrarily return the first descriptor it encounters with a matching descriptorName and descriptorClass.
Parameters:
  descriptorClass - the descriptor Class
Parameters:
  descriptorName - the descriptor name as a String
throws:
  IllegalArgumentException - if descriptorClass isnull or if the descriptorClass isnot associated with any of the modes returnedRegistryMode.getModes()
throws:
  IllegalArgumentException - if descriptorName is null
since:
   JAI 1.1



getDescriptor
public RegistryElementDescriptor getDescriptor(String modeName, String descriptorName)(Code)
Get the RegistryElementDescriptor corresponding to descriptorName which supports the specified mode. This is done by matching up the descriptorName against RegistryElementDescriptor.getName in a case-insensitive manner. This returns null if there no RegistryElementDescriptor corresponding to descriptorName that supports the specified mode.
Parameters:
  modeName - the registry mode name as a String
Parameters:
  descriptorName - the descriptor name as a String
throws:
  IllegalArgumentException - if modeName is nullor if the modeName is not one of the modes returnedRegistryMode.getModes()
throws:
  IllegalArgumentException - if descriptorName is null
since:
   JAI 1.1



getDescriptorNames
public String[] getDescriptorNames(Class descriptorClass)(Code)
Get an array of all the descriptor names corresponding to the descriptorClass. For example, getDescriptorNames(OperationDescriptor.class) would get an array of all image operation descriptor names.
Parameters:
  descriptorClass - the descriptor Class
throws:
  IllegalArgumentException - if descriptorClass isnull or if the descriptorClass isnot associated with any of the modes returnedRegistryMode.getModes()
since:
   JAI 1.1



getDescriptorNames
public String[] getDescriptorNames(String modeName)(Code)
Get an array of all descriptor-names of descriptors registered under a given registry mode.
Parameters:
  modeName - the registry mode name as a String
throws:
  IllegalArgumentException - if modeName is nullor if the modeName is not one of the modes returnedRegistryMode.getModes()
since:
   JAI 1.1



getDescriptors
public List getDescriptors(Class descriptorClass)(Code)
Get a List of all RegistryElementDescriptor corresponding to the descriptorClass. For example, getDescriptors(OperationDescriptor.class) would get a list of all image operation descriptors.
Parameters:
  descriptorClass - the descriptor Class
throws:
  IllegalArgumentException - if descriptorClass isnull or if the descriptorClass isnot associated with any of the modes returnedRegistryMode.getModes()
since:
   JAI 1.1



getDescriptors
public List getDescriptors(String modeName)(Code)
Get a list of all RegistryElementDescriptors registered under a given registry mode.
Parameters:
  modeName - the registry mode name as a String
throws:
  IllegalArgumentException - if modeName is nullor if the modeName is not one of the modes returnedRegistryMode.getModes()
since:
   JAI 1.1



getFactory
public Object getFactory(String modeName, String descriptorName)(Code)
Returns the factory of the specified type for the named operation. This method will return the first factory that would be encountered by the Iterator returned by the getFactoryIterator() method.
Parameters:
  modeName - the registry mode name as a String
Parameters:
  descriptorName - the descriptor name as a String a registered factory object
throws:
  IllegalArgumentException - if any of the argumentsis null
throws:
  IllegalArgumentException - if modeName is not one ofthose returned by RegistryMode.getModes()
throws:
  IllegalArgumentException - if there is no RegistryElementDescriptor registered againstthe descriptorName
since:
   JAI 1.1



getFactoryIterator
public Iterator getFactoryIterator(String modeName, String descriptorName)(Code)
Returns an Iterator over all factory objects registered with the specified factory and operation names over all products. The order of objects in the iteration will be according to the pairwise preferences among products and image factories within a product. The remove() method of the Iterator may not be implemented. If the particular factory does not have preferences then the returned Iterator will traverse a collection containing the single factory.
Parameters:
  modeName - the registry mode name as a String
Parameters:
  descriptorName - the descriptor name as a String an Iterator over factory objects
throws:
  IllegalArgumentException - if any of the argumentsis null
throws:
  IllegalArgumentException - if modeName is not one ofthose returned by RegistryMode.getModes()
throws:
  IllegalArgumentException - if there is no RegistryElementDescriptor registered againstthe descriptorName
since:
   JAI 1.1



getFactoryPreferences
public Object[][] getFactoryPreferences(String modeName, String descriptorName, String productName)(Code)
Get all pairwise preferences between instances of a factory within a product registered under a particular OperationDescriptor.
Parameters:
  modeName - the registry mode name as a String
Parameters:
  descriptorName - the descriptor name as a String
Parameters:
  productName - the product name as a String
throws:
  IllegalArgumentException - if any of the argumentsis null
throws:
  IllegalArgumentException - if modeName is not one ofthose returned by RegistryMode.getModes()
throws:
  IllegalArgumentException - if there is no RegistryElementDescriptor registered againstthe descriptorName
since:
   JAI 1.1



getGeneratedPropertyNames
public String[] getGeneratedPropertyNames(String modeName, String descriptorName)(Code)
Returns a list of the properties generated by nodes implementing the descriptor associated with a particular descriptor Name. Returns null if no properties are generated.
Parameters:
  modeName - the registry mode name as a String
Parameters:
  descriptorName - the descriptor name as a String
throws:
  IllegalArgumentException - if any of the argumentsis null
throws:
  IllegalArgumentException - if modeName is not one ofthose returned by RegistryMode.getModes()
throws:
  IllegalArgumentException - if there is no RegistryElementDescriptor registered againstthe descriptorName
throws:
  IllegalArgumentException - if the specified mode does notsupport properties.
since:
   JAI 1.1



getGeneratedPropertyNames
public String[] getGeneratedPropertyNames(String operationName)(Code)
Returns a list of the properties generated by nodes implementing the operation associated with a particular Operation Name. Returns null if no properties are generated.
Parameters:
  operationName - the operation name as a String. an array of Strings.
See Also:   OperationRegistry.getGeneratedPropertyNames
See Also:    getGeneratedPropertyNames - for list of exceptions thrown.



getLocalName
String getLocalName(String modeName, Object factoryInstance)(Code)
Get the local name for a factory instance used in the DescriptorCache (to be used in writing out the registry file).



getOperationDescriptor
public OperationDescriptor getOperationDescriptor(String operationName)(Code)
Returns the OperationDescriptor that is currently registered under the given name, or null if none exists. Though unlikely, it is possible to have different descriptors registered under different modes. In this case this will arbitrarily return the first operation descriptor found.
Parameters:
  operationName - the String to be queried. an OperationDescriptor.
throws:
  IllegalArgumentException - if operationName is null.
See Also:   OperationRegistry.getDescriptor(Class,String)



getOperationDescriptors
public Vector getOperationDescriptors()(Code)
Returns a Vector of all currently registered OperationDescriptors. a Vector of OperationDescriptors.
See Also:   OperationRegistry.getDescriptors(Class)



getOperationNames
public String[] getOperationNames()(Code)
Returns a list of names under which all the OperationDescriptors in the registry are registered. a list of currently existing operation names.
See Also:   OperationRegistry.getDescriptorNames(Class)



getOrderedCIFList
public Vector getOrderedCIFList(String operationName, String productName)(Code)
Returns a list of the CIFs of a product registered under a particular OperationDescriptor, in an ordering that satisfies all of the pairwise preferences that have been set. Returns null if cycles exist. Returns null, if the product does not exist under this operationName.
Parameters:
  operationName - the operation name as a String.
Parameters:
  productName - the name of the product. a Vector of CIFs.
See Also:   OperationRegistry.getOrderedFactoryList
See Also:    getOrderedFactoryList - for list of exceptions thrown.
See Also:   CIFRegistry.getOrderedList



getOrderedFactoryList
public List getOrderedFactoryList(String modeName, String descriptorName, String productName)(Code)
Returns a list of the factory instances of a product registered under a particular OperationDescriptor, in an ordering that satisfies all of the pairwise preferences that have been set. Returns null if cycles exist. Returns null, if the product does not exist under this descriptorName. If the particular registry mode does not support preferences then the returned List will contain a single factory.
Parameters:
  modeName - the registry mode name as a String
Parameters:
  descriptorName - the descriptor name as a String
Parameters:
  productName - the product name as a String an ordered List of factory instances
throws:
  IllegalArgumentException - if any of the argumentsis null (productName can be nullfor modes that do not support preferences).
throws:
  IllegalArgumentException - if modeName is not one ofthose returned by RegistryMode.getModes()
throws:
  IllegalArgumentException - if there is no RegistryElementDescriptor registered againstthe descriptorName
since:
   JAI 1.1



getOrderedProductList
public Vector getOrderedProductList(String modeName, String descriptorName)(Code)
Returns a list of the products registered under a particular descriptor in an ordering that satisfies all of the pairwise preferences that have been set. Returns null if cycles exist. Returns null if no descriptor has been registered under this descriptorName, or if no products exist for this operation.
Parameters:
  modeName - the registry mode name as a String
Parameters:
  descriptorName - the descriptor name as a String a Vector of Strings representing product names.
throws:
  IllegalArgumentException - if modeName is nullor if the modeName is not one of the modes returnedRegistryMode.getModes()
throws:
  IllegalArgumentException - if descriptorName is null
throws:
  IllegalArgumentException - if the registry mode does notsupport preferences
since:
   JAI 1.1



getOrderedProductList
public Vector getOrderedProductList(String operationName)(Code)
Returns a list of the products registered under a particular OperationDescriptor, in an ordering that satisfies all of the pairwise preferences that have been set. Returns null if cycles exist. Returns null if no OperationDescriptor has been registered under this operationName, or if no products exist for this operation.
Parameters:
  operationName - the operation name as a String. a Vector of Strings representing product names.
See Also:   OperationRegistry.getOrderedProductList
See Also:    getOrderedProductList - for list of exceptions thrown.



getOrderedRIFList
public Vector getOrderedRIFList(String operationName, String productName)(Code)
Returns a list of the RIFs of a product registered under a particular OperationDescriptor, in an ordering that satisfies all of the pairwise preferences that have been set. Returns null if cycles exist. Returns null, if the product does not exist under this operationName.
Parameters:
  operationName - the operation name as a String.
Parameters:
  productName - the name of the product. a Vector of RIFs.
See Also:   OperationRegistry.getOrderedFactoryList
See Also:    getOrderedFactoryList - for list of exceptions thrown.
See Also:   RIFRegistry.getOrderedList



getProductPreferences
public String[][] getProductPreferences(String modeName, String descriptorName)(Code)
Returns a list of the pairwise product preferences under a particular descriptor registered against a registry mode.
Parameters:
  modeName - the registry mode name as a String
Parameters:
  descriptorName - the descriptor name as a String an array of 2-element arrays of Strings.
throws:
  IllegalArgumentException - if modeName is nullor if the modeName is not one of the modes returnedRegistryMode.getModes()
throws:
  IllegalArgumentException - if descriptorName is null
throws:
  IllegalArgumentException - if the registry mode does notsupport preferences
since:
   JAI 1.1



getProductPreferences
public String[][] getProductPreferences(String operationName)(Code)
Returns a list of the pairwise product preferences under a particular OperationDescriptor. If no product preferences have been set, returns null.
Parameters:
  operationName - the operation name as a String. an array of 2-element arrays of Strings.
See Also:   OperationRegistry.getProductPreferences
See Also:    getProductPreferences - for list of exceptions thrown.



getPropertySource
public PropertySource getPropertySource(String modeName, String descriptorName, Object op, Vector sources)(Code)
Merge mode-specific property environment with mode-independent property environment of the descriptor. Array elements of "sources" are expected to be in the same ordering as referenced by the "sourceIndex" parameter of copyPropertyFromSource().
Parameters:
  modeName - the registry mode name as a String
Parameters:
  descriptorName - the descriptor name as a String
Parameters:
  op - the Object from which properties willbe generated.
Parameters:
  sources - the PropertySources corresponding tothe sources of the object representing the named descriptorin the indicated mode. The supplied Vector maybe empty to indicate that there are no sources. A PropertySource which encapsulatesthe global property environment for the object representingthe named descriptor in the indicated mode.
throws:
  IllegalArgumentException - if any of the argumentsis null
throws:
  IllegalArgumentException - if modeName is not one ofthose returned by RegistryMode.getModes()
throws:
  IllegalArgumentException - if there is no RegistryElementDescriptor registered againstthe descriptorName
throws:
  IllegalArgumentException - if the specified mode does notsupport properties.
since:
   JAI 1.1



getPropertySource
public PropertySource getPropertySource(OperationNode op)(Code)
Constructs and returns a PropertySource suitable for use by a given OperationNode. The PropertySource includes properties copied from prior nodes as well as those generated at the node itself. Additionally, property suppression is taken into account. The actual implementation of getPropertySource() may make use of deferred execution and caching.
Parameters:
  op - the OperationNode requesting itsPropertySource.
throws:
  IllegalArgumentException - if op is null.
since:
   JAI 1.1



getPropertySource
public PropertySource getPropertySource(RenderedOp op)(Code)
Constructs and returns a PropertySource suitable for use by a given RenderedOp. The PropertySource includes properties copied from prior nodes as well as those generated at the node itself. Additionally, property suppression is taken into account. The actual implementation of getPropertySource() may make use of deferred execution and caching.
Parameters:
  op - the RenderedOp requesting itsPropertySource.
See Also:   RIFRegistry.getPropertySource
See Also:    #getPropertySource - for list of exceptions thrown.



getPropertySource
public PropertySource getPropertySource(RenderableOp op)(Code)
Constructs and returns a PropertySource suitable for use by a given RenderableOp. The PropertySource includes properties copied from prior nodes as well as those generated at the node itself. Additionally, property suppression is taken into account. The actual implementation of getPropertySource() may make use of deferred execution and caching.
Parameters:
  op - the RenderableOp requesting itsPropertySource.
See Also:   CRIFRegistry.getPropertySource



getRegistryModes
public String[] getRegistryModes()(Code)
Get's the list of known registry modes known to the OperationRegistry. This might not be all modes listed in RegistryMode.getModeNames().
since:
   JAI 1.1



getThreadSafeOperationRegistry
public static OperationRegistry getThreadSafeOperationRegistry()(Code)
Creates and returns a new thread-safe version of the OperationRegistry which uses reader-writer locks to wrap every method with a read or a write lock as appropriate. Note that none of the automatic loading of registry files or services is done on this OperationRegistry.
since:
   JAI 1.1



initializeFromStream
public void initializeFromStream(InputStream in) throws IOException(Code)
Initializes the OperationRegistry from an InputStream. All non-IO exceptions encountered while parsing the registry files are caught and their error messages are redirected to System.err. If System.err is null the error messages will never be seen.

The InputStream passed in will not be closed by this method, the caller should close the InputStream when it is no longer needed.

The format of the data from the InputStream is expected to be the same as that of the writeExternal method as specified in the serialized form.
Parameters:
  in - The InputStream from which to read the data.
throws:
  IllegalArgumentException - if in is null.
See Also:   OperationRegistry.writeExternal




initializeRegistry
static OperationRegistry initializeRegistry()(Code)
Creates a new thread-safe OperationRegistry. It is initialized by first reading in the system distributed registry file (JAI_REGISTRY_FILE), then the user installed registry files (USR_REGISTRY_FILE) and then by calling the updateRegistry() method of all registered service providers. a properly initialized thread-safeOperationRegistry



invokeFactory
public Object invokeFactory(String modeName, String descriptorName, Object[] args)(Code)
Finds the factory of the specified type for the named operation and invokes its default factory method with the supplied parameters. The class of the returned object is that of the object returned by the factory's object creation method.
Parameters:
  modeName - the registry mode name as a String
Parameters:
  descriptorName - the descriptor name as a String an object created by the factory method
throws:
  IllegalArgumentException - if modeName or descriptorNameis null
throws:
  IllegalArgumentException - if modeName is not one ofthose returned by RegistryMode.getModes()
throws:
  IllegalArgumentException - if there is no RegistryElementDescriptor registered againstthe descriptorName
since:
   JAI 1.1



readExternal
public void readExternal(ObjectInput in) throws IOException, ClassNotFoundException(Code)
Restores the contents of the registry from an ObjectInput which was previously written using the writeExternal method.

All non-IO exceptions encountered while parsing the registry files are caught and their error messages are redirected to System.err. If System.err is null the error messages will never be seen.
Parameters:
  in - An ObjectInput from which to read the data.
throws:
  IllegalArgumentException - if in is null.
See Also:   OperationRegistry.writeExternal




registerCIF
public void registerCIF(String operationName, String productName, CollectionImageFactory CIF)(Code)
Registers a CIF with a particular product and operation.
Parameters:
  operationName - the operation name as a String.
Parameters:
  productName - the product name, as a String.
Parameters:
  CIF - the CollectionImageFactory to be registered.
See Also:   OperationRegistry.registerFactory
See Also:    registerFactory - for list of exceptions thrown.
See Also:   CIFRegistry.register



registerCRIF
public void registerCRIF(String operationName, ContextualRenderedImageFactory CRIF)(Code)
Registers a CRIF under a particular operation.
Parameters:
  operationName - the operation name as a String.
Parameters:
  CRIF - the ContextualRenderedImageFactory to beregistered.
See Also:   OperationRegistry.registerFactory
See Also:    registerFactory - for list of exceptions thrown.
See Also:   CRIFRegistry.register



registerDescriptor
public void registerDescriptor(RegistryElementDescriptor descriptor)(Code)
Register a descriptor against all the registry modes it supports. The "descriptor" must be an instance of the RegistryMode.getDescriptorClass() The "descriptor" is keyed on descriptor.getName(). Only one descriptor can be registered against a descriptor name for a given mode.
Parameters:
  descriptor - an instance of a concrete sub-class of RegistryElementDescriptor
throws:
  IllegalArgumentException - is descriptor is null
throws:
  IllegalArgumentException - if any of the modes returnedby descriptor.getSupportedModes() is not oneof those returned by RegistryMode.getModes()
throws:
  IllegalArgumentException - if another descriptor with thesame name has already been registered against any of themodes supported by this descriptor.
since:
   JAI 1.1



registerFactory
public void registerFactory(String modeName, String descriptorName, String productName, Object factory)(Code)
Register a factory object with a particular product and descriptor against a specified mode. For modes that do not support preferences the productName is ignored (can be null)
Parameters:
  modeName - the registry mode name as a String
Parameters:
  descriptorName - the descriptor name as a String
Parameters:
  productName - the product name as a String
Parameters:
  factory - the object to be registered.
throws:
  IllegalArgumentException - if any of the argumentsis null (productName can be nullfor modes that do not support preferences).
throws:
  IllegalArgumentException - if modeName is not one ofthose returned by RegistryMode.getModes()
throws:
  IllegalArgumentException - if there is no RegistryElementDescriptor registered againstthe descriptorName
since:
   JAI 1.1



registerOperationDescriptor
public void registerOperationDescriptor(OperationDescriptor odesc, String operationName)(Code)
Registers an OperationDescriptor with the registry. Each operation must have an OperationDescriptor before registerRIF() may be called to add RIFs to the operation.
Parameters:
  odesc - an OperationDescriptor containing informationabout the operation.
Parameters:
  operationName - the operation name as a String.
See Also:   OperationRegistry.registerDescriptor(RegistryElementDescriptor)
See Also:   registerDescriptor - for list of exceptions thrown.



registerRIF
public void registerRIF(String operationName, String productName, RenderedImageFactory RIF)(Code)
Registers a RIF with a particular product and operation.
Parameters:
  operationName - the operation name as a String.
Parameters:
  productName - the product name, as a String.
Parameters:
  RIF - the RenderedImageFactory to be registered.
See Also:   OperationRegistry.registerFactory
See Also:    registerFactory - for list of exceptions thrown.
See Also:   RIFRegistry.register



registerServices
public void registerServices(ClassLoader cl) throws IOException(Code)
Load all the "META-INF/registryFile.jai" files and then called the updateRegistry() of the registered service provider of OperationRegistrySpi found in the classpath corresponding to this class loader. All non-IO exceptions encountered while parsing the registry files are caught and their error messages are redirected to System.err. If System.err is null the error messages will never be seen.

This is a convenience method to do automatic detection in runtime loaded jar files

Note that the JAI does not keep track of which JAR files have their registry files loaded and/or services initialized. Hence if registerServices is called twice with the same ClassLoader, the loading of the registry files and/or initialization of the services will happen twice.
since:
   JAI 1.1




removePropertyGenerator
public void removePropertyGenerator(String modeName, String descriptorName, PropertyGenerator generator)(Code)
Removes a PropertyGenerator from its association with a particular descriptor/registry-mode in the registry. If the generator was not associated with the operation, nothing happens.
Parameters:
  modeName - the registry mode name as a String
Parameters:
  descriptorName - the descriptor name as a String
Parameters:
  generator - the PropertyGenerator to be removed.
throws:
  IllegalArgumentException - if any of the argumentsis null
throws:
  IllegalArgumentException - if modeName is not one ofthose returned by RegistryMode.getModes()
throws:
  IllegalArgumentException - if there is no RegistryElementDescriptor registered againstthe descriptorName
throws:
  IllegalArgumentException - if the specified mode does notsupport properties.
since:
   JAI 1.1



removePropertyGenerator
public void removePropertyGenerator(String operationName, PropertyGenerator generator)(Code)
Removes a PropertyGenerator from its association with a particular OperationDescriptor in the registry. If the generator was not associated with the operation, nothing happens.
Parameters:
  operationName - the operation name as a String.
Parameters:
  generator - the PropertyGenerator to be removed.
See Also:   OperationRegistry.removePropertyGenerator
See Also:    removePropertyGenerator - for list of exceptions thrown.



removeRegistryMode
public void removeRegistryMode(String modeName)(Code)
Remove a registry mode (including pre-defined JAI modes) from the OperationRegistry. When a mode is removed, all associated descriptors are also removed unless associated with another mode. Note that this does not unregister or remove this mode from RegistryMode Also note that a registry mode need not be explicitly added to the OperationRegistry. All modes registered under RegistryMode are automatically recognized by the OperationRegistry.
throws:
  IllegalArgumentException - if modeName is nullor if the modeName is not one of the modes returnedRegistryMode.getModes()
since:
   JAI 1.1



setCIFPreference
public void setCIFPreference(String operationName, String productName, CollectionImageFactory preferredCIF, CollectionImageFactory otherCIF)(Code)
Sets a preference between two CIFs within the same product. Any attempt to set a preference between a CIF and itself will be ignored.
Parameters:
  operationName - the operation name as a String.
Parameters:
  productName - the name of the product.
Parameters:
  preferredCIF - the preferred CollectionRenderedImageFactory.
Parameters:
  otherCIF - the other CollectionRenderedImageFactory.
See Also:   OperationRegistry.setFactoryPreference
See Also:    setFactoryPreference - for list of exceptions thrown.
See Also:   CIFRegistry.setPreference



setFactoryPreference
public void setFactoryPreference(String modeName, String descriptorName, String productName, Object preferredOp, Object otherOp)(Code)
Sets a preference between two factory instances for a given operation under a specified product.
Parameters:
  modeName - the registry mode name as a String
Parameters:
  descriptorName - the descriptor name as a String
Parameters:
  productName - the product name as a String
Parameters:
  preferredOp - the preferred factory object
Parameters:
  otherOp - the other factory object
throws:
  IllegalArgumentException - if any of the argumentsis null
throws:
  IllegalArgumentException - if modeName is not one ofthose returned by RegistryMode.getModes()
throws:
  IllegalArgumentException - if there is no RegistryElementDescriptor registered againstthe descriptorName
throws:
  IllegalArgumentException - if either of the factory objectswere not previously registered againstdescriptorName and productName
throws:
  IllegalArgumentException - if the registry mode does notsupport preferences
since:
   JAI 1.1



setProductPreference
public void setProductPreference(String modeName, String descriptorName, String preferredProductName, String otherProductName)(Code)
Set the preference between two products for a descriptor registered under a registry mode.
Parameters:
  modeName - the registry mode name as a String
Parameters:
  descriptorName - the descriptor name as a String
Parameters:
  preferredProductName - the product to be preferred.
Parameters:
  otherProductName - the other product.
throws:
  IllegalArgumentException - if any of the argumentsis null
throws:
  IllegalArgumentException - if modeName is not one ofthose returned by RegistryMode.getModes()
throws:
  IllegalArgumentException - if the registry mode does notsupport preferences
throws:
  IllegalArgumentException - if there is no RegistryElementDescriptor registered againstthe descriptorName under modeName.
throws:
  IllegalArgumentException - if either of the products arenot registered against descriptorNameunder productName.
since:
   JAI 1.1



setProductPreference
public void setProductPreference(String operationName, String preferredProductName, String otherProductName)(Code)
Sets a preference between two products registered under a common OperationDescriptor. Any attempt to set a preference between a product and itself will be ignored.
Parameters:
  operationName - the operation name as a String.
Parameters:
  preferredProductName - the product to be preferred.
Parameters:
  otherProductName - the other product.
See Also:   OperationRegistry.setProductPreference
See Also:    setProductPreference - for list of exceptions thrown.



setRIFPreference
public void setRIFPreference(String operationName, String productName, RenderedImageFactory preferredRIF, RenderedImageFactory otherRIF)(Code)
Sets a preference between two RIFs within the same product. Any attempt to set a preference between a RIF and itself will be ignored.
Parameters:
  operationName - the operation name as a String.
Parameters:
  productName - the name of the product.
Parameters:
  preferredRIF - the preferred RenderedImageFactory.
Parameters:
  otherRIF - the other RenderedImageFactory.
See Also:   OperationRegistry.setFactoryPreference
See Also:    setFactoryPreference - for list of exceptions thrown.
See Also:   RIFRegistry.setPreference



suppressAllProperties
public void suppressAllProperties(String modeName, String descriptorName)(Code)
Forces all properties to be suppressed by nodes performing a particular operation. By default, properties are passed through operations unchanged.
Parameters:
  modeName - the registry mode name as a String
Parameters:
  descriptorName - the descriptor name as a String
throws:
  IllegalArgumentException - if any of the argumentsis null
throws:
  IllegalArgumentException - if modeName is not one ofthose returned by RegistryMode.getModes()
throws:
  IllegalArgumentException - if there is no RegistryElementDescriptor registered againstthe descriptorName
throws:
  IllegalArgumentException - if the specified mode does notsupport properties.
since:
   JAI 1.1



suppressAllProperties
public void suppressAllProperties(String operationName)(Code)
Forces all properties to be suppressed by nodes performing a particular operation. By default, properties are passed through operations unchanged.
Parameters:
  operationName - the operation name as a String.
See Also:   OperationRegistry.suppressAllProperties
See Also:    suppressAllProperties - for list of exceptions thrown.



suppressProperty
public void suppressProperty(String modeName, String descriptorName, String propertyName)(Code)
Forces a particular property to be suppressed by nodes performing a particular operation. By default, properties are passed through operations unchanged.
Parameters:
  modeName - the registry mode name as a String
Parameters:
  descriptorName - the descriptor name as a String
Parameters:
  propertyName - the name of the property to be suppressed.
throws:
  IllegalArgumentException - if any of the argumentsis null
throws:
  IllegalArgumentException - if modeName is not one ofthose returned by RegistryMode.getModes()
throws:
  IllegalArgumentException - if there is no RegistryElementDescriptor registered againstthe descriptorName
throws:
  IllegalArgumentException - if the specified mode does notsupport properties.
since:
   JAI 1.1



suppressProperty
public void suppressProperty(String operationName, String propertyName)(Code)
Forces a particular property to be suppressed by nodes performing a particular operation. By default, properties are passed through operations unchanged.
Parameters:
  operationName - the operation name as a String.
Parameters:
  propertyName - the name of the property to be suppressed.
See Also:   OperationRegistry.suppressProperty
See Also:    suppressProperty - for list of exceptions thrown.



toString
public String toString()(Code)
Returns a String representation of the registry. the string representation of this OperationRegistry.



unregisterCIF
public void unregisterCIF(String operationName, String productName, CollectionImageFactory CIF)(Code)
Unregisters a CIF from a particular product and operation.
Parameters:
  operationName - the operation name as a String.
Parameters:
  productName - the product name, as a String.
Parameters:
  CIF - the CollectionImageFactory to be unregistered.
See Also:   OperationRegistry.unregisterFactory
See Also:    unregisterFactory - for list of exceptions thrown.
See Also:   CIFRegistry.unregister



unregisterCRIF
public void unregisterCRIF(String operationName, ContextualRenderedImageFactory CRIF)(Code)
Unregisters a CRIF from a particular operation.
Parameters:
  operationName - the operation name as a String.
Parameters:
  CRIF - the ContextualRenderedImageFactory to beunregistered.
See Also:   OperationRegistry.unregisterFactory
See Also:    unregisterFactory - for list of exceptions thrown.
See Also:   CRIFRegistry.unregister



unregisterDescriptor
public void unregisterDescriptor(RegistryElementDescriptor descriptor)(Code)
Unregister a descriptor against all its supported modes from the operation registry.
Parameters:
  descriptor - an instance of a concrete sub-class of RegistryElementDescriptor
throws:
  IllegalArgumentException - is descriptor is null
throws:
  IllegalArgumentException - if any of the modes returnedby descriptor.getSupportedModes() is not oneof those returned by RegistryMode.getModes()
throws:
  IllegalArgumentException - if any of thePropertyGenerators associated with theRegistryElementDescriptor to be unregistered is null.
since:
   JAI 1.1



unregisterFactory
public void unregisterFactory(String modeName, String descriptorName, String productName, Object factory)(Code)
Unregister a factory object previously registered with a product and descriptor against the specified mode. For modes that do not support preferences the productName is ignored (can be null)
Parameters:
  modeName - the registry mode name as a String
Parameters:
  descriptorName - the descriptor name as a String
Parameters:
  productName - the product name as a String
Parameters:
  factory - the object to be unregistered.
throws:
  IllegalArgumentException - if any of the argumentsis null (productName can be nullfor modes that do not support preferences).
throws:
  IllegalArgumentException - if modeName is not one ofthose returned by RegistryMode.getModes()
throws:
  IllegalArgumentException - if there is no RegistryElementDescriptor registered againstthe descriptorName
throws:
  IllegalArgumentException - if the factory object was not previouslyregistered against descriptorName and productName
since:
   JAI 1.1



unregisterOperationDescriptor
public void unregisterOperationDescriptor(String operationName)(Code)
Unregisters an OperationDescriptor from the registry.
Parameters:
  operationName - the operation name as a String.
See Also:   OperationRegistry.unregisterDescriptor(RegistryElementDescriptor)
See Also:   unregisterDescriptor - for list of exceptions thrown.



unregisterRIF
public void unregisterRIF(String operationName, String productName, RenderedImageFactory RIF)(Code)
Unregisters a RIF from a particular product and operation.
Parameters:
  operationName - the operation name as a String.
Parameters:
  productName - the product name, as a String.
Parameters:
  RIF - the RenderedImageFactory to be unregistered.
See Also:   OperationRegistry.unregisterFactory
See Also:    unregisterFactory - for list of exceptions thrown.
See Also:   RIFRegistry.unregister



unsetCIFPreference
public void unsetCIFPreference(String operationName, String productName, CollectionImageFactory preferredCIF, CollectionImageFactory otherCIF)(Code)
Removes a preference between two CIFs within the same product.
Parameters:
  operationName - the operation name as a String.
Parameters:
  productName - the name of the product.
Parameters:
  preferredCIF - the formerly preferredCollectionImageFactory.
Parameters:
  otherCIF - the other CollectionImageFactory.
See Also:   OperationRegistry.unsetFactoryPreference
See Also:    unsetFactoryPreference - for list of exceptions thrown.
See Also:   CIFRegistry.unsetPreference



unsetFactoryPreference
public void unsetFactoryPreference(String modeName, String descriptorName, String productName, Object preferredOp, Object otherOp)(Code)
Unsets a preference between two factory instances for a given operation under a specified product.
Parameters:
  modeName - the registry mode name as a String
Parameters:
  descriptorName - the descriptor name as a String
Parameters:
  productName - the product name as a String
Parameters:
  preferredOp - the factory object formerly preferred
Parameters:
  otherOp - the other factory object
throws:
  IllegalArgumentException - if any of the argumentsis null
throws:
  IllegalArgumentException - if modeName is not one ofthose returned by RegistryMode.getModes()
throws:
  IllegalArgumentException - if there is no RegistryElementDescriptor registered againstthe descriptorName
throws:
  IllegalArgumentException - if either of the factory objectswere not previously registered againstdescriptorName and productName
throws:
  IllegalArgumentException - if the registry mode does notsupport preferences
since:
   JAI 1.1



unsetProductPreference
public void unsetProductPreference(String modeName, String descriptorName, String preferredProductName, String otherProductName)(Code)
Remove the preference between two products for a descriptor registered under a registry mode.
Parameters:
  modeName - the registry mode name as a String
Parameters:
  descriptorName - the descriptor name as a String
Parameters:
  preferredProductName - the product formerly preferred.
Parameters:
  otherProductName - the other product.
throws:
  IllegalArgumentException - if any of the argumentsis null
throws:
  IllegalArgumentException - if modeName is not one ofthose returned by RegistryMode.getModes()
throws:
  IllegalArgumentException - if the registry mode does notsupport preferences
throws:
  IllegalArgumentException - if there is no RegistryElementDescriptor registered againstthe descriptorName under modeName.
throws:
  IllegalArgumentException - if either of the products arenot registered against descriptorNameunder productName.
since:
   JAI 1.1



unsetProductPreference
public void unsetProductPreference(String operationName, String preferredProductName, String otherProductName)(Code)
Removes a preference between two products registered under a common OperationDescriptor.
Parameters:
  operationName - the operation name as a String.
Parameters:
  preferredProductName - the product formerly preferred.
Parameters:
  otherProductName - the other product.
See Also:   OperationRegistry.unsetProductPreference
See Also:    unsetProductPreference - for list of exceptions thrown.



unsetRIFPreference
public void unsetRIFPreference(String operationName, String productName, RenderedImageFactory preferredRIF, RenderedImageFactory otherRIF)(Code)
Removes a preference between two RIFs within the same product.
Parameters:
  operationName - the operation name as a String.
Parameters:
  productName - the name of the product.
Parameters:
  preferredRIF - the formerly preferredRenderedImageFactory.
Parameters:
  otherRIF - the other RenderedImageFactory.
See Also:   OperationRegistry.unsetFactoryPreference
See Also:    unsetFactoryPreference - for list of exceptions thrown.
See Also:   RIFRegistry.unsetPreference



updateFromStream
public void updateFromStream(InputStream in) throws IOException(Code)
Updates the current OperationRegistry with the operations specified by the given InputStream. All non-IO exceptions encountered while parsing the registry files are caught and their error messages are redirected to System.err. If System.err is null the error messages will never be seen.

The InputStream passed in will not be closed by this method, the caller should close the InputStream when it is no longer needed.

The format of the data from the InputStream is expected to be the same as that of the writeExternal method as specified in the serialized form.
Parameters:
  in - The InputStream from which to read the data.
throws:
  IllegalArgumentException - if in is null.
See Also:   OperationRegistry.writeExternal
since:
   JAI 1.1




writeExternal
public void writeExternal(ObjectOutput out) throws IOException(Code)
Saves the contents of the registry as described in the serialized form.
Parameters:
  out - An ObjectOutput to which to write the data.
throws:
  IllegalArgumentException - if out is null.OperationRegistry



writeToStream
public void writeToStream(OutputStream out) throws IOException(Code)
Writes out the contents of the OperationRegistry to a stream as specified in the writeExternal method. For more information see the serialized form.
Parameters:
  out - The OutputStream to which the OperationRegistrystate is written.
throws:
  IllegalArgumentException - if out is null.
See Also:   OperationRegistry.writeExternal



Methods inherited from java.lang.Object
native protected Object clone() throws CloneNotSupportedException(Code)(Java Doc)
public boolean equals(Object obj)(Code)(Java Doc)
protected void finalize() throws Throwable(Code)(Java Doc)
final native public Class getClass()(Code)(Java Doc)
native public int hashCode()(Code)(Java Doc)
final native public void notify()(Code)(Java Doc)
final native public void notifyAll()(Code)(Java Doc)
public String toString()(Code)(Java Doc)
final native public void wait(long timeout) throws InterruptedException(Code)(Java Doc)
final public void wait(long timeout, int nanos) throws InterruptedException(Code)(Java Doc)
final public void wait() throws InterruptedException(Code)(Java Doc)

www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.