Class MultiverseManager
java.lang.Object
it.uniroma2.art.semanticturkey.multiverse.MultiverseManager
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 Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
createWorld
(String name) Creates a new world.void
destroyWorld
(String name) Destroys a world.protected void
executeInAllWorlds
(org.apache.commons.lang3.function.FailableRunnable<Throwable> runnable) Executes the provided @Runnable
in each world in the multiverse.static World
Returns a reference to the current world.protected WorldScopedObjects
getWorldScopedObjects
(World world) Returns the objects scoped to a given worldReturns concise information about the alternative worlds (i.e. the default world is excluded)Overload oflistWorldNames(boolean)
with the parameter set to falselistWorldNames
(boolean mainIncluded) Lists the names of the worlds that make up the multiverse.protected void
onProjectEvent
(ProjectEvent event)
-
Constructor Details
-
MultiverseManager
public MultiverseManager()
-
-
Method Details
-
getCurrentWorld
Returns a reference to the current world.- Returns:
-
createWorld
Creates a new world.- Parameters:
name
- name of the world to create- Throws:
IOException
WorldAlreadyExistingException
-
destroyWorld
Destroys a world.- Parameters:
name
- name of the world to destroy.
-
listWorldNames
Lists the names of the worlds that make up the multiverse. Optionally, include the default one.- Parameters:
mainIncluded
-- Returns:
-
listWorldNames
Overload oflistWorldNames(boolean)
with the parameter set to false- Returns:
-
listAlternativeWorldInfos
Returns concise information about the alternative worlds (i.e. the default world is excluded)- Returns:
-
getWorldScopedObjects
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
-