Package com.xebialabs.deployit.plugin.api.reflect

# Class DescriptorRegistry

java.lang.Object
com.xebialabs.deployit.plugin.api.reflect.DescriptorRegistry

public class DescriptorRegistry extends Object
A registry for the `ConfigurationItem`s the XL Deploy system should know about. Every CI registry must extend this class, and it can be added to the collection of known registries, which is kept in this class.

One special descriptor registry is the LocalDescriptorRegistry, which is usually the default one. Another descriptor registry is the RemoteDescriptorRegistry.

- ## Method Summary

  Modifier and Type
  Method
  Description
  `static void`
  `add(IDescriptorRegistry registry)`
  Registers a DescriptorRegistry to a global map.
  `static boolean`
  `exists(Type type)`
  `static Descriptor`
  `getDescriptor(Type type)`
  `static Descriptor`
  `getDescriptor(String prefixedName)`
  `static Descriptor`
  `getDescriptor(String prefix, String name)`
  `static IDescriptorRegistry`
  `getDescriptorRegistry(DescriptorRegistryId id)`
  Gets a DescriptorRegistry by id.
  `static Collection<Descriptor>`
  `getDescriptors()`
  `static Collection<Descriptor>`
  `getDescriptors(DescriptorRegistryId registryId)`
  `protected static IDescriptorRegistry`
  `getInstance()`
  `static Collection<Type>`
  `getSubtypes(Type supertype)`
  `static void`
  `remove(DescriptorRegistryId id)`
  Unregisters the descriptor registry with the specified id.
  `static void`
  `replaceRegistry(IDescriptorRegistry registry)`
  `static <T> T`
  `withWriteLock(Callable<T> callable)`

  ### Methods inherited from class java.lang.Object

  `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- ## Method Details

  - ### getInstance

    protected static IDescriptorRegistry getInstance()

  - ### withWriteLock

    public static <T> T withWriteLock(Callable<T> callable)

  - ### add

    public static void add(IDescriptorRegistry registry)
    Registers a DescriptorRegistry to a global map.

  - ### remove

    public static void remove(DescriptorRegistryId id)
    Unregisters the descriptor registry with the specified id.

  - ### replaceRegistry

    public static void replaceRegistry(IDescriptorRegistry registry)

  - ### getDescriptorRegistry

    public static IDescriptorRegistry getDescriptorRegistry(DescriptorRegistryId id)
    Gets a DescriptorRegistry by id.

  - ### getDescriptor

    public static Descriptor getDescriptor(Type type)
    Parameters:
      `type` - The type of a CI.
    Returns:
      The descriptor of the specified CI type.

  - ### getDescriptor

    public static Descriptor getDescriptor(String prefixedName)
    Parameters:
      `prefixedName` - The prefixed type name of a CI.
    Returns:
      The descriptor of the specified CI type.

  - ### getDescriptor

    public static Descriptor getDescriptor(String prefix, String name)
    Parameters:
      `prefix` - The prefix of a CI.
      `name` - The simple name of a CI.
    Returns:
      The descriptor of the specified CI type.

  - ### getDescriptors

    public static Collection<Descriptor> getDescriptors()
    Returns:
      A collection of all the registered type descriptors.

  - ### getDescriptors

    public static Collection<Descriptor> getDescriptors(DescriptorRegistryId registryId)

  - ### exists

    public static boolean exists(Type type)
    Parameters:
      `type` - The type of a CI.
    Returns:
      Whether the given type can be found in the registry.

  - ### getSubtypes

    public static Collection<Type> getSubtypes(Type supertype)
    Parameters:
      `supertype` - The super type to search against.
    Returns:
      A collection of subtypes of the given super type.