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

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

Static Private Attributes

Object lock
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 59 of file PickleRegistry.d.


Member Typedef Documentation

typedef Object function(IReader reader) SimpleProxyFnc
 

Definition at line 68 of file PickleRegistry.d.

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

Definition at line 69 of file PickleRegistry.d.


Member Function Documentation

this  )  [inline, private]
 

This is a singleton: the constructor should not be exposed

Definition at line 177 of file PickleRegistry.d.

this  )  [inline, static, private]
 

Initialize the environment

Definition at line 187 of file PickleRegistry.d.

References lock.

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 207 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 221 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 242 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 261 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 280 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 296 of file PickleRegistry.d.

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


Member Data Documentation

Object lock [static, private]
 

Definition at line 61 of file PickleRegistry.d.

Referenced by this().

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

Definition at line 62 of file PickleRegistry.d.

Referenced by enroll(), and lookup().


The documentation for this class was generated from the following file:
Generated on Sun Nov 7 19:07:08 2004 for Mango by doxygen 1.3.6