Class PrefabLoaderImpl

  • All Implemented Interfaces:
    PrefabLoader, java.util.EventListener, org.springframework.context.ApplicationListener<org.springframework.context.ApplicationEvent>

    @Service
    public class PrefabLoaderImpl
    extends java.lang.Object
    implements PrefabLoader, org.springframework.context.ApplicationListener<org.springframework.context.ApplicationEvent>
    Default implementation for PrefabLoader. All available prefabs are (re)loaded on ContextRefreshedEvent.
    • Constructor Detail

      • PrefabLoaderImpl

        public PrefabLoaderImpl()
    • Method Detail

      • getPrefabManager

        public PrefabManager getPrefabManager()
        Returns:
        the prefabManager
      • getPrefabFactory

        public PrefabFactory getPrefabFactory()
        Returns:
        the prefabFactory
      • loadPrefabs

        public void loadPrefabs()
        Description copied from interface: PrefabLoader
        Loads all prefabs. This involves reading the source files/streams and creating their equivalent Prefabs. Possible RuntimeExceptions should be logged and not thrown to the caller.
        Specified by:
        loadPrefabs in interface PrefabLoader
      • loadPrefab

        public void loadPrefab​(java.io.File prefabDir)
                        throws java.lang.Exception
        Description copied from interface: PrefabLoader
        Loads Prefab from the given jar file.
        Specified by:
        loadPrefab in interface PrefabLoader
        Parameters:
        prefabDir - prefab jar file
        Throws:
        java.lang.Exception - if the jar file is invalid
      • onApplicationEvent

        public void onApplicationEvent​(org.springframework.context.ApplicationEvent event)
        Specified by:
        onApplicationEvent in interface org.springframework.context.ApplicationListener<org.springframework.context.ApplicationEvent>
      • readPrefabDirs

        protected java.io.File[] readPrefabDirs()