saker.rmi Documentation TaskDoc JavaDoc Packages
public final class ClassTransferProperties<C>
Properties class for specifying the transfer mechanism of a given type over RMI.

This class can be used to specify the write handler for a given type if it is encountered during RMI object transfer. The specified write handler will be used if an instance of the given type is getting transferred.

By using these properties you can avoid annotating every method that handles instances of a given type and can specify a generic write handler for every occurrence.

These properties are only used if the transferred object is exactly the same type as the specified type. If you specify transfer properties for a class that is an interface or annotation, that is most likely an error and the properties will not be used.

If transfer properties for a type is set, and it is getting transferred over a method which also has write handler set for the given transfer point, then the write handler for the type properties will be used instead of the one specified for the method.

You can use RMIWriter annotation to specify the write handler for the annotated class.

CThe type of the class.
Constructors
public
Creates a new instance with the given class and write handler.
Methods
public static <C> ClassTransferProperties<C>
Creates class transfer properties based on annotations for the given class.
public Class<C>
Gets the type the properties apply to.
public RMIObjectWriteHandler
Gets the write handler to use when an instance of the type is encountered.
public String
Returns a string representation of the object.
Creates a new instance with the given class and write handler.
typeThe type the properties apply to.
writeHandlerThe write handler to use when an instance of the type is encountered.
public static <C> ClassTransferProperties<C> createForAnnotations(Class<C> clazz)
Creates class transfer properties based on annotations for the given class.

The annotations on the parameter class are examined and a transfer configuration is created based on them.

CThe type of the class.
clazzThe class to generate the properties for.
The parsed properties or null if there are no related annotations.
public Class<C> getType()
Gets the type the properties apply to.
The type.
Gets the write handler to use when an instance of the type is encountered.
The write handler.
public String toString()
Overridden from: Object
Returns a string representation of the object. In general, the toString method returns a string that "textually represents" this object. The result should be a concise but informative representation that is easy for a person to read. It is recommended that all subclasses override this method.

The toString method for class Object returns a string consisting of the name of the class of which the object is an instance, the at-sign character `@', and the unsigned hexadecimal representation of the hash code of the object. In other words, this method returns a string equal to the value of:

 getClass().getName() + '@' + Integer.toHexString(hashCode())
 
a string representation of the object.