Class ScriptGraph
java.lang.Object
org.gatein.portal.controller.resource.script.ScriptGraph
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionaddResource(ResourceId id, FetchMode fetchMode) addResource(ResourceId id, FetchMode fetchMode, String alias, String groupName, String contextPath) Add a resource to the graph if available.getLoadGroup(String groupName) getResource(ResourceScope scope, String name) getResources(ResourceScope scope) removeResource(ResourceId id, String contextPath) resolve(Map<ResourceId, FetchMode> pairs) Resolve a collection of pair of resource id and fetch mode, each entry of the map will be processed in the order specified by the iteration of theMap.entrySet().
-
Field Details
-
LOAD_GROUPS
-
-
Constructor Details
-
ScriptGraph
public ScriptGraph()
-
-
Method Details
-
resolve
Resolve a collection of pair of resource id and fetch mode, each entry of the map will be processed in the order specified by the iteration of the
Map.entrySet(). For a given pair the fetch mode may be null or not. When the fetch mode is null, the default fetch mode of the resource is used. When the fetch mode is not null, this fetch mode may override the resource fetch mode if it implies this particular fetch mode. This algorithm tolerates the absence of resources, for instance if a resource is specified (among the pairs or by a transitive dependency) and does not exist, the resource will be skipped.- Parameters:
pairs- the pairs to resolve- Returns:
- the resources sorted
-
getResource
-
getResource
-
getResources
-
addResource
-
addResource
- Throws:
NullPointerException
-
addResource
public ScriptResource addResource(ResourceId id, FetchMode fetchMode, String alias, String groupName, String contextPath) throws NullPointerException Add a resource to the graph if available. return null if ResourceID is duplicated- Parameters:
id- the resource idfetchMode- the resource fetch modealias- default alias- Returns:
- the resource
- Throws:
NullPointerException- if id or fetchMode is null
-
removeResource
-
removeResource
-
getLoadGroup
-