Package net.simplace.sim.io.resources
Class FWSimResourceManager
java.lang.Object
net.simplace.sim.io.resources.FWSimResourceManager
With the resources part of the main configuration xml the resources are instantiated
Singleton implementation
Holds different resources for the model threads as
FWSimResourceCache
Ensures the efficient use of the resources
Presents data via Objects
Able to abstract data access format as
Database via SQL
Excel (csv)
XML
Uses File Access Pool and Connection Pool via IO Interfaces- Author:
- Andreas Enders
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionaddAlias
(FWSimSession aSession, org.jdom2.Element aAlias) addResource
(FWSimSession aSession, org.jdom2.Element aResource) adds a Resource with given configuration in XML (jdom)void
addResourceCreator
(FWSimInputAdapter aAdapter) Resources and Transformers can be added by this method passing theaddTransform
(FWSimSession aSession, org.jdom2.Element aTransform) calls all createVariable methods on all resourceCreators andgetResourceCache
(String aSourceName) getResourceCreator
(String aName) Resources and Transformers can be got by this getter method passing thereferenceKeys
(LinkedHashMap<String, FWSimVariable<?>> aHeaderVariables, FWSimSolution aSolution) void
reset()
boolean
updateInterface
(FWSimInterface<?> aInterface, FWSimVarMap aVarMap) boolean
updateResources
(FWSimVarMap aVarMap) resources are updated only for new projectsvoid
updateVarMap
(FWSimVarMap aVarMap, boolean aForceUpdate) updates theFWSimVarMap
in all storedFWSimResourceCache
-
Constructor Details
-
FWSimResourceManager
public FWSimResourceManager()
-
-
Method Details
-
addResource
public String addResource(FWSimSession aSession, org.jdom2.Element aResource) throws MissingSimResourceException, DuplicateSimFieldException adds a Resource with given configuration in XML (jdom)- Parameters:
aSession
-aResource
-- Returns:
- Name of the Resource
- Throws:
MissingSimResourceException
DuplicateSimFieldException
-
addTransform
public String addTransform(FWSimSession aSession, org.jdom2.Element aTransform) throws MissingSimResourceException, DuplicateSimFieldException - Parameters:
aSession
-aTransform
-- Returns:
- Name of the Transform
- Throws:
MissingSimResourceException
DuplicateSimFieldException
-
addAlias
public String addAlias(FWSimSession aSession, org.jdom2.Element aAlias) throws MissingSimResourceException, DuplicateSimFieldException - Parameters:
aSession
-aAlias
-- Returns:
- Name of the Alias
- Throws:
MissingSimResourceException
DuplicateSimFieldException
-
updateResources
resources are updated only for new projects- Parameters:
aVarMap
-- Returns:
- boolean success
- Throws:
MissingSimResourceException
-
getResourceCreator
Resources and Transformers can be got by this getter method passing the- Parameters:
aName
- to the method- Returns:
FWSimResourceAdapter
orFWSimResourceTransformer
-
addResourceCreator
Resources and Transformers can be added by this method passing the- Parameters:
aAdapter
- to add to the Collection of creators the method
-
updateInterface
- Parameters:
aInterface
-aVarMap
-- Returns:
- if update found an adaptor to update
-
createVariables
calls all createVariable methods on all resourceCreators and- Returns:
- the field map of all these
-
getResourceCache
- Parameters:
aSourceName
-- Returns:
- the selected
FWSimResourceCache
- Throws:
MissingSimResourceException
-
updateVarMap
updates theFWSimVarMap
in all storedFWSimResourceCache
- Parameters:
aVarMap
-aForceUpdate
-
-
getResourceAdapters
- Returns:
- all the resource creators
-
referenceKeys
public static Map<String,String> referenceKeys(LinkedHashMap<String, FWSimVariable<?>> aHeaderVariables, FWSimSolution aSolution) - Parameters:
aHeaderVariables
-aSolution
-- Returns:
- Map of referenced keys
-
reset
- Throws:
Exception
- See Also:
-