Class SComponentFactory


  • public class SComponentFactory
    extends java.lang.Object
    Standard meta component factory. Uses several sub factories and uses them according to their order and isLoadable() method.
    • Field Detail

      • DEFAULT_FEATURES

        public static final java.util.Collection<IComponentFeatureFactory> DEFAULT_FEATURES
        The default component features.
      • ffilter

        protected static FileFilter ffilter
        Filter for scanning for kernel agent class files.
    • Constructor Detail

      • SComponentFactory

        public SComponentFactory()
    • Method Detail

      • orderComponentFeatures

        public static java.util.Collection<IComponentFeatureFactory> orderComponentFeatures​(java.lang.String name,
                                                                                            java.util.Collection<java.util.Collection<IComponentFeatureFactory>> facss)
        Build an ordered list of component features.
        Parameters:
        facss - A list of component feature lists.
        Returns:
        An ordered list of component features.
      • isComponentStepNecessary

        public static boolean isComponentStepNecessary​(IComponentIdentifier target)
        Check if a component is necessary.
        Parameters:
        target - The target component identifier.
        Returns:
        The
      • createResultListener

        public static <T> IResultListener<T> createResultListener​(IResultListener<T> listener,
                                                                  IExternalAccess ea)
        Create a result listener which is executed as an component step.
        Parameters:
        The - original listener to be called.
        Returns:
        The listener.
      • isLoadable

        public static IFuture<java.lang.Boolean> isLoadable​(IExternalAccess exta,
                                                            java.lang.String model,
                                                            IResourceIdentifier rid)
        Test if a model can be loaded by the factory.
        Parameters:
        model - The model.
        Returns:
        True, if model can be loaded.
      • isModelType

        public static IFuture<java.lang.Boolean> isModelType​(IExternalAccess exta,
                                                             java.lang.String model,
                                                             IResourceIdentifier rid)
        Test if a model can be loaded by the factory.
        Parameters:
        model - The model.
        Returns:
        True, if model can be loaded.
      • isStartable

        public static IFuture<java.lang.Boolean> isStartable​(IExternalAccess exta,
                                                             java.lang.String model,
                                                             IResourceIdentifier rid)
        Test if a model is startable (e.g. a component).
        Parameters:
        model - The model.
        Returns:
        True, if startable (and should therefore also be loadable).
      • getFileTypeIcon

        public static IFuture<byte[]> getFileTypeIcon​(IExternalAccess exta,
                                                      java.lang.String type)
        Get a default icon for a file type.
      • getProperty

        public static IFuture<java.lang.Object> getProperty​(IExternalAccess exta,
                                                            java.lang.String type,
                                                            java.lang.String key)
        Get a default icon for a file type.
      • reorderMultiFactory

        protected static java.util.Collection<IComponentFactory> reorderMultiFactory​(java.util.Collection<IComponentFactory> facs)
        Exclude the multifactory from a collection.
        Parameters:
        facs - The factories.
        Returns:
        cleaned collection.
      • scanForKernelFilters

        public static java.util.Collection<IFilter<java.lang.Object>> scanForKernelFilters​(java.util.List<java.net.URL> urls)
        Scan files for kernel components.
        Returns:
        (suffix -> classname)
      • getComponentModelsAsStream

        public static ISubscriptionIntermediateFuture<java.util.Collection<java.lang.String[]>> getComponentModelsAsStream​(IInternalAccess component)
        Scans for component models and returns them as stream.
        Returns:
        Collection
      • getComponentModelsAsStream

        public static ISubscriptionIntermediateFuture<java.util.Collection<java.lang.String[]>> getComponentModelsAsStream​(IInternalAccess component,
                                                                                                                           java.net.URL[] urls)
        Scans for component models and returns them as stream.
        Returns:
        Collection
      • getKernelFilters

        public static java.util.Collection<IFilter<java.lang.Object>> getKernelFilters​(IInternalAccess component,
                                                                                       java.util.List<java.net.URL> urls)
        Get all kernel files, i.e. specs to start a kernel.