Interface ComponentLoader

All Known Implementing Classes:
AppComponentLoader

public interface ComponentLoader
An interface to load resources and configurations for components in a component manager.
  • Method Details

    • load

      int load(ComponentManager mng, Component fragment, Runnable markReady)
      Load the component in the given component manager. This method is called after the component is initialized
      Parameters:
      mng - the component manager
      fragment - the component to load
      markReady - a runnable that should be called when the loading is complete
      Returns:
      how many times the markReady callback is expected to be called to mark the complete loading.
    • unload

      void unload(ComponentManager mng, Component fragment)
      Frees up resources and configurations for the component in the given component manager.
      Parameters:
      mng - the component manager
      fragment - the component to cleanup
    • canLoad

      boolean canLoad(ComponentManager mng, Component fragment)
      Check if the component can be loaded by this loader. This is used to determine if the component is compatible with this loader and can be initialized without issues. If the component is not compatible, the next available loader in the chain.
      Parameters:
      mng - the component manager
      fragment - the component to check
      Returns:
      true if the component can be initialized, false otherwise