Class MultiverseManager

java.lang.Object
it.uniroma2.art.semanticturkey.multiverse.MultiverseManager

public class MultiverseManager extends Object
Multiverse management. The multiverse consists of multiple worlds (including the default one, called main [World.MAIN]), each with its own view over the settings (and their defaults). System settings are currently shared by all worlds, but system-level defaults are not: different worlds can have different system defaults.
Author:
Manuel Fiorelli
  • Constructor Details

    • MultiverseManager

      public MultiverseManager()
  • Method Details

    • getCurrentWorld

      public static World getCurrentWorld()
      Returns a reference to the current world.
      Returns:
    • createWorld

      public void createWorld(String name) throws IOException, WorldAlreadyExistingException
      Creates a new world.
      Parameters:
      name - name of the world to create
      Throws:
      IOException
      WorldAlreadyExistingException
    • destroyWorld

      public void destroyWorld(String name)
      Destroys a world.
      Parameters:
      name - name of the world to destroy.
    • listWorldNames

      public Set<String> listWorldNames(boolean mainIncluded)
      Lists the names of the worlds that make up the multiverse. Optionally, include the default one.
      Parameters:
      mainIncluded -
      Returns:
    • listWorldNames

      public Set<String> listWorldNames()
      Overload of listWorldNames(boolean) with the parameter set to false
      Returns:
    • listAlternativeWorldInfos

      public Collection<WorldInfo> listAlternativeWorldInfos()
      Returns concise information about the alternative worlds (i.e. the default world is excluded)
      Returns:
    • getWorldScopedObjects

      protected WorldScopedObjects getWorldScopedObjects(World world)
      Returns the objects scoped to a given world
      Parameters:
      world -
      Returns:
    • executeInAllWorlds

      protected void executeInAllWorlds(org.apache.commons.lang3.function.FailableRunnable<Throwable> runnable) throws Throwable
      Executes the provided @Runnable in each world in the multiverse.
      Parameters:
      runnable -
      Throws:
      Throwable
    • onProjectEvent

      protected void onProjectEvent(ProjectEvent event)