Class Registry

java.lang.Object
com.vividsolutions.jump.workbench.registry.Registry

public class Registry extends Object
While a Registry is similar to a Blackboard in that they are both flexible repositories of information, there are some subtle differences:
  • The Registry is a bit more structured (values are Lists as opposed to general Objects).
  • There is only one Registry, whereas there are Blackboards on several different levels (the Workbench Blackboard, the Task Blackboard, the Layer Blackboard, the LayerViewPanel Blackboard), thus representing varying degrees of scope.
  • Registry keys are in general "well known" to a greater degree than Blackboard keys, which plugins tend to create as needed. Thus the Registry can be thought of as being more static, and the Blackboard more fluid.
  • Registry entries are intended to be much more static than Blackboard entries. You might well think about persisting a Registry, but probably never a Blackboard
  • In the bigger world, Registries have all kinds of security, classification and lifecyle features that probably would not appear on a Blackboard.
Author:
jaquino, dzwiers
  • Constructor Details

    • Registry

      public Registry()
  • Method Details

    • createEntry

      public Registry createEntry(String classification, Object entry) throws ClassCastException
      Creating an entry in a registry classification means adding the entry to the Collection associated to this classification. If the classification doesn't exist yet, it is created. The entry must be an instance of the class defined by typeMap for this classification.
      Parameters:
      classification - the string to be used as a key of the registry
      entry - a new entry
      Returns:
      The current Registry
      Throws:
      ClassCastException - When the entry does not match a registered Classification Type
      See Also:
    • createEntries

      public Registry createEntries(String classification, Collection<?> entries) throws ClassCastException
      Parameters:
      classification - the string to be used as a key of the registry
      entries - entry collection to associate to this classification
      Returns:
      The current Registry
      Throws:
      ClassCastException - When the entries do not match a registered Classification Type
      See Also:
    • getEntries

      public List getEntries(String classification)
    • createClassification

      public Registry createClassification(String classification, Class<?> type) throws ClassCastException
      Sets up the registry to be type-safe for a particular classification. Should the user not specify a type mappingthrough this method, no checks will be performed.
      Parameters:
      classification - the string to be used as a key of the registry
      type - type of entries in the collection ossociated to this classification
      Returns:
      The current Registry
      Throws:
      ClassCastException - When the existing entries do not match Classification Type being registered.