Class AbstractAllocationStorage
- java.lang.Object
-
- org.palladiosimulator.protocom.framework.java.se.AbstractAllocationStorage
-
public abstract class AbstractAllocationStorage extends Object
Manages the sets of container ID, name and allocated components
-
-
Field Summary
Fields Modifier and Type Field Description protected static AbstractAllocationStorage
singleton
-
Constructor Summary
Constructors Constructor Description AbstractAllocationStorage()
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description static String
getActiveContainer()
Returns the container of this current component.static Collection<ComponentAllocation>
getComponents(String containerId)
Returns a collection of components to a given container idstatic String
getContainerID(String container)
FIXME: Possible source of errors if two container have the same name?static Collection<String>
getContainerIds()
Returns a set of all container idsstatic String
getContainerName(String containerId)
static Collection<String>
getContainerNames()
Returns a set of all container namesstatic void
initContainer()
protected abstract void
initContainerTemplate()
static void
initSingleton(AbstractAllocationStorage instance)
static boolean
isLocalMode()
protected static void
saveContainerComponent(String containerId, String containerName, Class<?> component, String assemblyContext)
Stores a tuple of container ID, name and one component, as well as the assembly context of the component.static void
setActiveContainer(String containerId)
static void
setLocalMode(boolean localMode)
-
-
-
Field Detail
-
singleton
protected static AbstractAllocationStorage singleton
-
-
Method Detail
-
saveContainerComponent
protected static void saveContainerComponent(String containerId, String containerName, Class<?> component, String assemblyContext)
Stores a tuple of container ID, name and one component, as well as the assembly context of the component.- Parameters:
containerId
- key, can be used multiple timescontainerName
- valuecomponent
- valueassemblyContext
- ID of the assembly context
-
getContainerID
public static String getContainerID(String container)
FIXME: Possible source of errors if two container have the same name?- Parameters:
container
-- Returns:
-
getContainerIds
public static Collection<String> getContainerIds()
Returns a set of all container ids- Returns:
- Set of container ids
-
getContainerNames
public static Collection<String> getContainerNames()
Returns a set of all container names- Returns:
- Set of container names
-
getComponents
public static Collection<ComponentAllocation> getComponents(String containerId)
Returns a collection of components to a given container id- Parameters:
containerId
-- Returns:
- collection of components
-
initContainerTemplate
protected abstract void initContainerTemplate()
-
initContainer
public static void initContainer()
-
initSingleton
public static void initSingleton(AbstractAllocationStorage instance)
-
setActiveContainer
public static void setActiveContainer(String containerId)
-
getActiveContainer
public static String getActiveContainer()
Returns the container of this current component. FIXME: Also returns the FIRST container if local mode is active, since no container has been (and can not be) chosen for this hardware node.- Returns:
-
setLocalMode
public static void setLocalMode(boolean localMode)
-
isLocalMode
public static boolean isLocalMode()
-
-