NCache 4.6 - Online Documentation

Registering Non-Generic Classes

 
You can use either of the two ways described below to register your generic classes for Compact Serialization.
 
Using NCache Manager
 
  • Click on the cache name in Cache Explorer to open cache settings.
 
  • Go to the Compact Serialization tab.
 
 
  • Click Add Types button.
 
  • A new Select Compact Classes dialogue box will open up.
 
 
  • Click on Browse button. It will open a windows Open dialog. Using this dialog you can select .exe, .dll or .jar file.
 
  • Select your required file (.exe, .dll or .jar) and click on Open. It lists classes from the selected assembly in Loaded Classes list box.
 
  • Select the desired classes which you want to register with NCache for Compact Serialization.
 
  • Click Add Class.
 
 
  • Compact Serialization works on attribute level. In the lower pane, attributes of all your selected classes get listed; from here you can select attributes which you do not want to be compact serialized.
 
 
  • Click OK to add classes. It lists fully qualified names of all selected classes in Compact Serialization tab.
 
 
  • Right click on the cache in Cache Explorer and select Apply Configuration option.
 
 
Using Command Line Tool
 
  • Open the command prompt.
 
  • Go to the NCache tools directory: cd %NCHOME%/bin/tools
 
  • Use addcompacttype.exe tool, provide the required information: 
addcompacttype.exe /id demoLocalCache /a C:\Data.dll /c NCache.Sample.Data.Compact.Engineer
 
addcompacttype.exe /id demoLocalCache /a C:\Data.dll /c NCache.Sample.Data.Compact.Manager /al hireDate
 
  • Press ENTER, it defines a compact type for demoLocalCache. You can define further types one by one repeating the step for other types.
 
 
See Also