com.google.gwt.user.server.rpc.impl
Interface TypeNameObfuscator

All Known Implementing Classes:
LegacySerializationPolicy, StandardSerializationPolicy

public interface TypeNameObfuscator

This is a private interface that allows ProxyCreator to provide obfuscated type names to the server components via StandardSerializationPolicy.

The particulars of the implementation are deeply tied to the specifics of the RPC wire format and the code generated by TypeSerializerCreator.

This interface is not public in order to allow the API to be switched from Strings to ints in a future revision.


Field Summary
static java.lang.String SERVICE_INTERFACE_ID
          A reserved ID for specifying the identifier for the service interface itself.
 
Method Summary
 java.lang.String getClassNameForTypeId(java.lang.String id)
          Returns the name of the class that should be instantiated based on an obfuscated identifier.
 java.lang.String getTypeIdForClass(java.lang.Class<?> clazz)
          Returns the obfuscated identifier to be used to encode a class in the RPC wire format.
 

Field Detail

SERVICE_INTERFACE_ID

static final java.lang.String SERVICE_INTERFACE_ID
A reserved ID for specifying the identifier for the service interface itself.

See Also:
Constant Field Values
Method Detail

getClassNameForTypeId

java.lang.String getClassNameForTypeId(java.lang.String id)
                                       throws SerializationException
Returns the name of the class that should be instantiated based on an obfuscated identifier.

Parameters:
id - the type id that was present in the RPC payload
Returns:
the name of the class, suitable for use by Class.forName(java.lang.String), to be instantiated
Throws:
SerializationException - if there is no class that corresponds to the obfuscated id

getTypeIdForClass

java.lang.String getTypeIdForClass(java.lang.Class<?> clazz)
                                   throws SerializationException
Returns the obfuscated identifier to be used to encode a class in the RPC wire format.

Parameters:
clazz - the class to be transmitted
Returns:
the obfuscated type identifier.
Throws:
SerializationException