javax.media.jai.remote
Class RemoteDescriptorImpl

java.lang.Object
  extended byjavax.media.jai.remote.RemoteDescriptorImpl
All Implemented Interfaces:
RegistryElementDescriptor, RemoteDescriptor
Direct Known Subclasses:
JAIRMIDescriptor

public abstract class RemoteDescriptorImpl
extends Object
implements RemoteDescriptor

This abstract class provides a partial implementation of the RemoteDescriptor interface, and is suitable for subclassing.

Since:
JAI 1.1
See Also:
RemoteDescriptor

Field Summary
protected  String protocolName
          The name of the protocol that this descriptor describes.
protected  URL serverNameDocURL
          The URL pointing to the documentation regarding the format of the server name String.
 
Constructor Summary
RemoteDescriptorImpl(String protocolName, URL serverNameDocURL)
          Creates a RemoteDescriptorImpl given the protocol name and the URL that points to documentation regarding the format of the server name String.
 
Method Summary
 boolean arePropertiesSupported()
          Returns true, if the implementation of this descriptor supports properties, false otherwise.
 Object getInvalidRegion(String registryModeName, String oldServerName, ParameterBlock oldParamBlock, RenderingHints oldHints, String newServerName, ParameterBlock newParamBlock, RenderingHints newHints, OperationNode node)
          Calculates the region over which two distinct remote renderings of an operation may be expected to differ.
 String getName()
          Returns the name of the remote imaging protocol under which this RemoteDescriptor will be registered in the OperationRegistry.
 ParameterListDescriptor getParameterListDescriptor(String modeName)
          The two modes supported by this descriptor are "remoteRendered" and "remoteRenderable".
 PropertyGenerator[] getPropertyGenerators(String modeName)
          Returns an array of PropertyGenerators implementing the property inheritance for this descriptor.
 URL getServerNameDocs()
          Returns a URL that points to an HTML page containing instructions on constructing a server name string for the protocol with which this class is associated.
 String[] getSupportedModes()
          The registry modes supported by this descriptor.
 boolean isModeSupported(String modeName)
          Returns true if the supplied modeName is supported by this descriptor.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface javax.media.jai.remote.RemoteDescriptor
getServerCapabilities, getServerSupportedOperationList
 

Field Detail

protocolName

protected String protocolName
The name of the protocol that this descriptor describes.


serverNameDocURL

protected URL serverNameDocURL
The URL pointing to the documentation regarding the format of the server name String.

Constructor Detail

RemoteDescriptorImpl

public RemoteDescriptorImpl(String protocolName,
                            URL serverNameDocURL)
Creates a RemoteDescriptorImpl given the protocol name and the URL that points to documentation regarding the format of the server name String.

While the serverNameDocURL argument is allowed to be null, this is strongly discouraged, since this URL is the only description available to the user to help with creating a serverName String correctly.

Parameters:
protocolName - The name of the protocol.
serverNameDocURL - The URL pointing to server name format documentation.
Throws:
IllegalArgumentException - if protocolName is null.
Method Detail

getName

public String getName()
Returns the name of the remote imaging protocol under which this RemoteDescriptor will be registered in the OperationRegistry.

Specified by:
getName in interface RegistryElementDescriptor

getSupportedModes

public String[] getSupportedModes()
The registry modes supported by this descriptor. The default implementation in this class returns two modes - "remoteRendered" and "remoteRenderable". If the subclass does not support both these modes it should override this method to reflect that.

Specified by:
getSupportedModes in interface RegistryElementDescriptor
Returns:
an array of Strings specifying the supported modes.
See Also:
RegistryMode

isModeSupported

public boolean isModeSupported(String modeName)
Returns true if the supplied modeName is supported by this descriptor. The default implementation in this class returns true only if the supplied modeName is one of either "remoteRendered" or "remoteRenderable".

Specified by:
isModeSupported in interface RegistryElementDescriptor
Parameters:
modeName - The mode name to check support for.
Returns:
true, if the implementation of this descriptor supports the specified mode. false otherwise.
Throws:
IllegalArgumentException - if modeName is null.

arePropertiesSupported

public boolean arePropertiesSupported()
Returns true, if the implementation of this descriptor supports properties, false otherwise. The default implementation in this class returns false, signifying that no properties are supported independent of the operations themselves.

Specified by:
arePropertiesSupported in interface RegistryElementDescriptor
Returns:
true, if the implementation of this descriptor supports JAI properties. false otherwise.
See Also:
PropertyGenerator

getPropertyGenerators

public PropertyGenerator[] getPropertyGenerators(String modeName)
Returns an array of PropertyGenerators implementing the property inheritance for this descriptor. Since neither the "remoteRendered" or "remoteRendered" modes support properties independent of the operations themselves, the default implementation throws an UnsupportedOperationException. Subclasses should override this method if they wish to produce inherited properties.

Specified by:
getPropertyGenerators in interface RegistryElementDescriptor
Parameters:
modeName - The mode name to get PropertyGenerators for.
Returns:
An array of PropertyGenerators, or null if this operation does not have any of its own PropertyGenerators.
Throws:
IllegalArgumentException - if modeName is null.
UnsupportedOperationException - if arePropertiesSupported() returns false

getServerNameDocs

public URL getServerNameDocs()
Returns a URL that points to an HTML page containing instructions on constructing a server name string for the protocol with which this class is associated.

Specified by:
getServerNameDocs in interface RemoteDescriptor

getInvalidRegion

public Object getInvalidRegion(String registryModeName,
                               String oldServerName,
                               ParameterBlock oldParamBlock,
                               RenderingHints oldHints,
                               String newServerName,
                               ParameterBlock newParamBlock,
                               RenderingHints newHints,
                               OperationNode node)
                        throws RemoteImagingException
Calculates the region over which two distinct remote renderings of an operation may be expected to differ. The operation is represented by the OperationNode argument to this method. The String that identifies the operation can be retrieved via the OperationNode's getOperationName() method.

The class of the returned object will vary as a function of the nature of the operation. For rendered and renderable two- dimensional images this should be an instance of a class which implements java.awt.Shape.

The implementation in this class always returns null as the invalid region signifying that there is no common region of validity. Since null is always returned, in the interests of efficiency, none of the checks for ensuring that the ParameterBlock arguments passed to this method contain the correct number and Class of sources and parameters are performed in this implementation.

Specified by:
getInvalidRegion in interface RemoteDescriptor
Parameters:
registryModeName - The name of the mode.
oldServerName - The previous server name.
oldParamBlock - The previous sources and parameters.
oldHints - The previous hints.
newServerName - The current server name.
newParamBlock - The current sources and parameters.
newHints - The current hints.
node - The affected node in the processing chain.
Returns:
The region over which the data of two renderings of this operation may be expected to be invalid or null if there is no common region of validity. If an empty java.awt.Shape is returned, this indicates that all pixels within the bounds of the old rendering remain valid.
Throws:
IllegalArgumentException - if registryModeName is null or if the operation requires either sources or parameters and either oldParamBlock or newParamBlock is null.
IllegalArgumentException - if there is no OperationDescriptor for the specified operationName on any one or both of the servers identified by oldServerName and newServerName, or if the number of sources or the name, number and Class of the operation's parameters is not the same on both the servers.
IllegalArgumentException - if oldParamBlock or newParamBlock do not contain sufficient sources or parameters for the operation in question.
RemoteImagingException

getParameterListDescriptor

public ParameterListDescriptor getParameterListDescriptor(String modeName)
The two modes supported by this descriptor are "remoteRendered" and "remoteRenderable". Since neither of these modes supports any parameters, this default implementation always returns null.

Specified by:
getParameterListDescriptor in interface RegistryElementDescriptor
Parameters:
modeName - The mode name to get the ParameterListDescriptor for.
Throws:
IllegalArgumentException - if modeName is null.