org.abstracthorizon.extend.server.deployment.support
Class ProvisionalModule

java.lang.Object
  extended by org.abstracthorizon.extend.server.deployment.support.ProvisionalModule
All Implemented Interfaces:
Module

public class ProvisionalModule
extends Object
implements Module

This class is used as a placeholder for a module that is to be deployed in near future. It is needed for DeploymentManagerImpl.

Author:
Daniel Sendula

Field Summary
protected  LinkedHashSet<Module> dependOnThis
          List of modules that depend on this module
protected  ModuleId moduleId
          Modules name
protected  URI uri
          URI
 
Fields inherited from interface org.abstracthorizon.extend.server.deployment.Module
CREATED, DEFINED, STARTED, UNDEFINED, WAITING_ON_CREATE, WAITING_ON_CREATE_TO_START, WAITING_ON_START
 
Constructor Summary
ProvisionalModule(URI uri, ModuleId moduleId)
          Constructor.
 
Method Summary
 void create()
          Creates the module.
 void destroy()
          Empty implementation
 boolean equals(Object o)
          Compares two modules and returns true if names are the same
 ClassLoader getClassLoader()
          Returns null
 Set<Module> getDependOnThis()
          Returns a list of modules that depend on this module
 Set<Module> getDependsOn()
          Returns an empty set
 ModuleId getModuleId()
          Returns module's id
 URL getOriginalLocation()
          Returns null
 int getState()
          Returns Module.UNDEFINED
 String getStateAsString()
          Returns Module.UNDEFINED as string
 URI getURI()
          Returns uri
 URL getWorkingLocation()
          Returns null
 void setState(int state)
          Sets the moduile's state.
 void start()
          Starts the module.
 void stop()
          Stops the module.
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

uri

protected URI uri
URI


moduleId

protected ModuleId moduleId
Modules name


dependOnThis

protected LinkedHashSet<Module> dependOnThis
List of modules that depend on this module

Constructor Detail

ProvisionalModule

public ProvisionalModule(URI uri,
                         ModuleId moduleId)
Constructor. It sets name as last part of url's file

Parameters:
uri - URI it came from so it can be tried to be re-deployed
moduleId - module id
Method Detail

getClassLoader

public ClassLoader getClassLoader()
Returns null

Specified by:
getClassLoader in interface Module
Returns:
null

getDependOnThis

public Set<Module> getDependOnThis()
Returns a list of modules that depend on this module

Specified by:
getDependOnThis in interface Module
Returns:
a list of modules that depend on this module

getDependsOn

public Set<Module> getDependsOn()
Returns an empty set

Specified by:
getDependsOn in interface Module
Returns:
an empty set

getOriginalLocation

public URL getOriginalLocation()
Returns null

Specified by:
getOriginalLocation in interface Module
Returns:
null

getWorkingLocation

public URL getWorkingLocation()
Returns null

Specified by:
getWorkingLocation in interface Module
Returns:
null

getModuleId

public ModuleId getModuleId()
Returns module's id

Specified by:
getModuleId in interface Module
Returns:
module's id

create

public void create()
Description copied from interface: Module
Creates the module.

Note: Not to be called directly. Use DeploymentManager.create(Module) method instead.

Specified by:
create in interface Module
Throws:
RuntimeException

start

public void start()
Description copied from interface: Module
Starts the module.

Note: Not to be called directly. Use DeploymentManager.start(Module) method instead.

Specified by:
start in interface Module
Throws:
RuntimeException

stop

public void stop()
Description copied from interface: Module
Stops the module.

Note: Not to be called directly. Use DeploymentManager.stop(Module) method instead.

Specified by:
stop in interface Module
Throws:
RuntimeException

destroy

public void destroy()
Empty implementation

Specified by:
destroy in interface Module

setState

public void setState(int state)
Description copied from interface: Module
Sets the moduile's state.

Note: Not to be called directly!

Specified by:
setState in interface Module
Parameters:
state - module's state

getState

public int getState()
Returns Module.UNDEFINED

Specified by:
getState in interface Module
Returns:
Module.UNDEFINED

getStateAsString

public String getStateAsString()
Returns Module.UNDEFINED as string

Returns:
Module.UNDEFINED as string

getURI

public URI getURI()
Returns uri

Returns:
uri

equals

public boolean equals(Object o)
Compares two modules and returns true if names are the same

Overrides:
equals in class Object
Parameters:
o - other object
Returns:
true if names are the same

toString

public String toString()
Overrides:
toString in class Object


Copyright © 2005-2009 Abstract Horizon. All Rights Reserved.