|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.abstracthorizon.extend.server.deployment.DeploymentManagerImpl
public class DeploymentManagerImpl
Implementation of DeploymentManager
.
Nested Class Summary | |
---|---|
protected class |
DeploymentManagerImpl.DeployedModules<KeyType,ValueType>
This class keeps deployed modules. |
protected class |
DeploymentManagerImpl.ModuleLoaders<E>
This class is extension of LinkedHashSet that
on adding new element calls tryToDeployUnknown() method. |
Field Summary | |
---|---|
protected DeploymentManagerImpl.DeployedModules<ModuleId,Module> |
deployedModules
Map of deployed modules |
protected DeploymentManagerImpl.ModuleLoaders<ModuleLoader> |
moduleLoaders
List of module loaders |
Fields inherited from interface org.abstracthorizon.extend.server.deployment.DeploymentManager |
---|
DEPLOYMENT_MANAGER_DEFAULT_NAME |
Constructor Summary | |
---|---|
DeploymentManagerImpl()
Empty constructor |
Method Summary | |
---|---|
boolean |
canLoad(URI url)
Returns true if any of registered module loaders knows how to load (create) module from given url. |
void |
create(Module module)
Calls Module.create() method. |
void |
deploy(ModuleId moduleId,
Module module)
Deploys given module. |
void |
destroy(Module module)
Calls Module.destroy() method. |
Set<ModuleId> |
findAliases(Module module)
Returns all aliases module is known under |
EnhancedMap<ModuleId,Module> |
getDeployedModules()
Returns map of deployed modules. |
Set<ModuleLoader> |
getModuleLoaders()
Returns set of module loaders |
protected static String |
getUnsatisfiedDependenciesAsAList(Module module)
|
boolean |
isDeployed(Module module)
Checks if module is deployed. |
Module |
load(URI uri)
Loads module from given URI. |
Module |
loadAndDeploy(URI uri)
Utility method that loads and deploys module in one go. |
Module |
loadAs(URI uri,
ModuleId moduleId)
Loads module from given URI. |
void |
redeploy(Module module)
Re-deploys given module. |
void |
redeploy(ModuleId moduleId)
Utility method |
void |
setModuleLoaders(Set<ModuleLoader> moduleLoaders)
Sets module loaders. |
void |
start(Module module)
Calls Module.start() method. |
void |
stop(Module module)
Calls Module.stop() method. |
ModuleId |
toModuleId(URI uri)
Translates URI to moduleId |
protected void |
tryToDeployUnknown()
This method goes through all modules with unknown loaders and tries to load them again (using all registered module loaders) |
void |
undeploy(Module module)
Undeploys given module. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected DeploymentManagerImpl.ModuleLoaders<ModuleLoader> moduleLoaders
protected DeploymentManagerImpl.DeployedModules<ModuleId,Module> deployedModules
Constructor Detail |
---|
public DeploymentManagerImpl()
Method Detail |
---|
public boolean isDeployed(Module module)
module
- module
true
if given module is deployedpublic void deploy(ModuleId moduleId, Module module)
Module.create()
and Module.start()
methods.
deploy
in interface DeploymentManager
module
- module
RuntimeException
- if module with the same name is already deployed (and is not ProvisionalModule
public void undeploy(Module module)
Module.stop()
and
Module.destroy()
methods.
undeploy
in interface DeploymentManager
module
- modulepublic void redeploy(Module module)
undeploy(Module)
and
#deploy(Module)
methods.
redeploy
in interface DeploymentManager
module
- modulepublic Set<ModuleId> findAliases(Module module)
module
- module
public void create(Module module)
Module.create()
method.
create
in interface DeploymentManager
module
- module whose create method is to be calledpublic void start(Module module)
Module.start()
method.
start
in interface DeploymentManager
module
- module whose start method is to be calledpublic void stop(Module module)
Module.stop()
method.
stop
in interface DeploymentManager
module
- module whose stop method is to be calledpublic void destroy(Module module)
Module.destroy()
method.
destroy
in interface DeploymentManager
module
- module whose destroy method is to be calledpublic EnhancedMap<ModuleId,Module> getDeployedModules()
getDeployedModules
in interface DeploymentManager
public boolean canLoad(URI url)
true
if any of registered module loaders knows how to load (create) module from given url.
canLoad
in interface ModuleLoader
url
- url
true
if module knows how to load (create) module from given urlpublic ModuleId toModuleId(URI uri)
toModuleId
in interface ModuleLoader
uri
- uri
null
public Module load(URI uri)
ProvisionalModule
is created with the name of last part of the URI.
will return null
.
load
in interface ModuleLoader
uri
- URI for module to be loaded from
public Module loadAs(URI uri, ModuleId moduleId)
ProvisionalModule
is created with the name of last part of the URI.
will return null
.
loadAs
in interface ModuleLoader
uri
- URI for module to be loaded frommoduleId
- module id to be used in final module
public Module loadAndDeploy(URI uri)
loadAndDeploy
in interface DeploymentManager
uri
- module's URI
null
if module cannot be loaded
TODO check return statementpublic void redeploy(ModuleId moduleId)
uri
- URIpublic Set<ModuleLoader> getModuleLoaders()
getModuleLoaders
in interface DeploymentManager
public void setModuleLoaders(Set<ModuleLoader> moduleLoaders)
setModuleLoaders
in interface DeploymentManager
moduleLoaders
- module loadersprotected void tryToDeployUnknown()
protected static String getUnsatisfiedDependenciesAsAList(Module module)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |