Class ContainerInstantiator

    • Constructor Detail

      • ContainerInstantiator

        public ContainerInstantiator()
    • Method Detail

      • createInstance

        public IContainer createInstance​(ContainerTypeDescription description,
                                         Object[] parameters)
                                  throws ContainerCreateException
        Description copied from interface: IContainerInstantiator
        Create instance of IContainer. This is the interface that container provider implementations must implement for the containerFactory extension point. The caller may optionally specify both argument types and arguments that will be passed into this method (and therefore to the provider implementation implementing this method). For example:

        ContainerFactory.getDefault().createContainer("foocontainer",new Object { "hello" });

        Specified by:
        createInstance in interface IContainerInstantiator
        description - the ContainerTypeDescription associated with the registered container provider implementation
        parameters - parameters specified by the caller. May be null if no parameters are passed in by caller to ContainerFactory.getDefault().createContainer(...)
        IContainer instance. The provider implementation must return a valid object implementing IContainer OR throw a ContainerCreateException. Null will not be returned.
        ContainerCreateException - thrown if instance cannot be created
      • getSupportedAdapterTypes

        public String[] getSupportedAdapterTypes​(ContainerTypeDescription description)
        Description copied from interface: IContainerInstantiator
        Get array of supported adapters for the given container type description. Providers implement this method to allow clients to inspect the adapter types exposed by the container described by the given description. The returned array entries will be the fully qualified names of the adapter classes. Note that the returned types do not guarantee that a subsequent call to IContainer.getAdapter(Class) with the same type name as a returned value will return a non-null result. In other words, even if the class name is in the returned array, subsequent calls to IContainer.getAdapter(Class) may still return null.
        Specified by:
        getSupportedAdapterTypes in interface IContainerInstantiator
        description - the ContainerTypeDescription to report adapters for. Must not be null.
        String[] of supported adapters. The entries in the returned array will be the fully qualified class names of adapters supported by the given description. null may be returned by the provider if no adapters are supported for this description.