Main Page | Class Hierarchy | Alphabetical List | Class List | File List | Class Members | File Members | Related Pages

PickleRegistry Class Reference

List of all members.

Public Types

typedef Object function (IReader reader) SimpleProxyFnc
typedef Object function (IReader reader, char[] guid) GuidProxyFnc

Static Public Member Functions

void enroll (IPickleFactory object)
void enroll (SimpleProxyFnc sp, char[] guid)
void enroll (GuidProxyFnc gp, char[] guid)
Object create (IReader reader, char[] guid)

Private Member Functions

 this ()

Static Private Member Functions

synchronized void enroll (Proxy proxy, char[] guid)
final synchronized Proxy lookup (char[] guid)

Static Private Attributes

Proxy[char[]] registry

Detailed Description

Bare framework for registering and creating serializable objects. Such objects are intended to be transported across a local network and re-instantiated at some destination node.

Each IPickle exposes the means to write, or freeze, its content. An IPickleFactory provides the means to create a new instance of itself populated with thawed data. Frozen objects are uniquely identified by a guid exposed via the interface. Responsibility of maintaining uniqueness across said identifiers lies in the hands of the developer.

See PickleReader for an example of how this is expected to operate.

Definition at line 62 of file PickleRegistry.d.


Member Typedef Documentation

typedef Object function(IReader reader) SimpleProxyFnc
 

Definition at line 70 of file PickleRegistry.d.

typedef Object function(IReader reader, char[] guid) GuidProxyFnc
 

Definition at line 71 of file PickleRegistry.d.


Member Function Documentation

this  )  [inline, private]
 

This is a singleton: the constructor should not be exposed

Definition at line 79 of file PickleRegistry.d.

synchronized void enroll Proxy  proxy,
char[]  guid
[inline, static, private]
 

Add the provided class to the registry. Note that one cannot change a registration once it is placed. Neither can one remove registered item. This is done to avoid major issues when trying to synchronize servers across a farm, which may still have live instances of "old" objects waiting to be passed around the cluster. New versions of an object should be given a distinct guid from the prior version; appending an incremental number may well be sufficient for your needs.

Definition at line 197 of file PickleRegistry.d.

References registry.

Referenced by enroll().

final synchronized Proxy lookup char[]  guid  )  [inline, static, private]
 

do a synchronized Proxy lookup of the guid

Definition at line 211 of file PickleRegistry.d.

References registry.

Referenced by create().

void enroll IPickleFactory  object  )  [inline, static]
 

Add the provided object to the registry. Note that one cannot change a registration once it is placed. Neither can one remove registered item. This is done to avoid major issues when trying to synchronize servers across a farm, which may still have live instances of "old" objects waiting to be passed around the cluster. New versions of an object should be given a distinct guid from the prior version; appending an incremental number may well be sufficient for your needs.

Definition at line 232 of file PickleRegistry.d.

References enroll().

void enroll SimpleProxyFnc  sp,
char[]  guid
[inline, static]
 

Add the provided function to the registry. Note that one cannot change a registration once it is placed. Neither can one remove registered item. This is done to avoid major issues when trying to synchronize servers across a farm, which may still have live instances of "old" objects waiting to be passed around the cluster. New versions of an object should be given a distinct guid from the prior version; appending an incremental number may well be sufficient for your needs.

Definition at line 251 of file PickleRegistry.d.

References enroll().

void enroll GuidProxyFnc  gp,
char[]  guid
[inline, static]
 

Add the provided function to the registry. Note that one cannot change a registration once it is placed. Neither can one remove registered item. This is done to avoid major issues when trying to synchronize servers across a farm, which may still have live instances of "old" objects waiting to be passed around the cluster. New versions of an object should be given a distinct guid from the prior version; appending an incremental number may well be sufficient for your needs.

Definition at line 270 of file PickleRegistry.d.

References enroll().

Object create IReader  reader,
char[]  guid
[inline, static]
 

Create a new instance of a registered class from the content made available via the given reader. The factory is located using the provided guid, which must match an enrolled class.

Note that only the factory lookup is synchronized, and not the instance construction itself.

Definition at line 286 of file PickleRegistry.d.

References PickleRegistry::Proxy::create(), and lookup().


Member Data Documentation

Proxy [char[]] registry [static, private]
 

Definition at line 64 of file PickleRegistry.d.

Referenced by enroll(), and lookup().


The documentation for this class was generated from the following file:
Generated on Sat Apr 9 20:11:42 2005 for Mango by doxygen 1.3.6