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

java.lang.Object
  extended by org.abstracthorizon.extend.server.deployment.support.AbstractModule
All Implemented Interfaces:
Module
Direct Known Subclasses:
DirectoryModule, JarModule

public abstract class AbstractModule
extends Object
implements Module

Jar file module

Author:
Daniel Sendula

Field Summary
protected  ClassLoader classLoader
          Module's class loader
protected  Set<Module> dependOnThis
          List of modules depending on this module
protected  Set<Module> dependsOn
          List of modules this module depends on
protected  ModuleId moduleId
          Module's name
protected  URL originalUrl
          Location it was originally expected on
protected  int state
          State
protected  URL workingUrl
          Real location
 
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
protected AbstractModule()
          Caution - use with care as every module must have module id defined!
  AbstractModule(ModuleId moduleId)
          Constructor
 
Method Summary
 void create()
          Creates the module.
protected  void createClassLoader()
          This method creates the class loader.
 void destroy()
          Destroys the module.
 boolean equals(Object o)
          Compares two modules and returns true if names are the same
 ClassLoader getClassLoader()
          Returns module's classloader
 Set<Module> getDependOnThis()
          Returns a set of modules that depend on this
 Set<Module> getDependsOn()
          Returns a set of modules this module depends on
 ModuleId getModuleId()
          Returns module's module id
 URL getOriginalLocation()
          Returns original location
 int getState()
          Returns state
 URL getWorkingLocation()
          Returns real location
 void setLocation(URL url)
          Sets the location
 void setModuleId(ModuleId moduleId)
          Sets module's module id
 void setState(int state)
          Changes the state
 void start()
          This method does nothing
 void stop()
          This method does nothing
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

classLoader

protected ClassLoader classLoader
Module's class loader


dependsOn

protected Set<Module> dependsOn
List of modules this module depends on


dependOnThis

protected Set<Module> dependOnThis
List of modules depending on this module


workingUrl

protected URL workingUrl
Real location


originalUrl

protected URL originalUrl
Location it was originally expected on


moduleId

protected ModuleId moduleId
Module's name


state

protected int state
State

Constructor Detail

AbstractModule

protected AbstractModule()
Caution - use with care as every module must have module id defined!


AbstractModule

public AbstractModule(ModuleId moduleId)
Constructor

Parameters:
moduleId - module id
Method Detail

setLocation

public void setLocation(URL url)
Sets the location

Parameters:
url - url of the module

create

public void create()
Creates the module. It sets up the classloader

Specified by:
create in interface Module

start

public void start()
This method does nothing

Specified by:
start in interface Module

stop

public void stop()
This method does nothing

Specified by:
stop in interface Module

destroy

public void destroy()
Destroys the module. It removes classloader

Specified by:
destroy in interface Module

getClassLoader

public ClassLoader getClassLoader()
Returns module's classloader

Specified by:
getClassLoader in interface Module
Returns:
classloader

getDependOnThis

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

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

getDependsOn

public Set<Module> getDependsOn()
Returns a set of modules this module depends on

Specified by:
getDependsOn in interface Module
Returns:
a set of modules this module depends on

getModuleId

public ModuleId getModuleId()
Returns module's module id

Specified by:
getModuleId in interface Module
Returns:
module id

setModuleId

public void setModuleId(ModuleId moduleId)
Sets module's module id

Parameters:
moduleId - module id

getOriginalLocation

public URL getOriginalLocation()
Returns original location

Specified by:
getOriginalLocation in interface Module
Returns:
original location

getWorkingLocation

public URL getWorkingLocation()
Returns real location

Specified by:
getWorkingLocation in interface Module
Returns:
real location

getState

public int getState()
Returns state

Specified by:
getState in interface Module
Returns:
state

setState

public void setState(int state)
Changes the state

Specified by:
setState in interface Module
Parameters:
state - state

createClassLoader

protected void createClassLoader()
This method creates the class loader. Current implementation does nothing.


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.