C
- the generic type. Not necessary implements ExtensionModule but usually does.public abstract class Unit<C>
extends Object
UnitLoader
,
ExtensionModule
Constructor and Description |
---|
Unit()
Instantiates a new Unit using default parameters.
|
Unit(String classPath,
Class<C> objClass,
boolean singleton)
Instantiates a new Unit.
|
Unit(String path,
String jarPath,
String classPath,
Class<C> objClass,
boolean singleton)
Instantiates a new Unit.
|
Modifier and Type | Method and Description |
---|---|
abstract void |
add(String name,
Object object)
Adds loaded object using name as a key.
|
abstract void |
addWithoutLicense(String name,
Object object)
Adds loaded object which doesn't have license using name as a key.
|
abstract boolean |
allowLoadAll()
Checks if loader allowed to to load all objects regardless of license.
|
abstract boolean |
canBeLoadedAgain()
Checks if module can be loaded again.
|
abstract void |
finishLoad(UnitLoader loader)
Executed when UnitLoader finishes load.
|
abstract void |
free()
Executed when there is a need to free memory.
|
String |
getClassPath()
Gets the root class path to the modules.
|
String |
getJarPath()
Gets the jar path.
|
abstract List<C> |
getList()
Gets the list of loaded modules.
|
Class<C> |
getObjClass()
Gets the module class.
|
String |
getPath()
Gets the path.
|
boolean |
isSingleton()
Checks if module should be a singleton.
|
abstract boolean |
loadsConfigurableExtensions()
Returns true if Unit is indented to load configurable extensions.
|
void |
setClassPath(String value)
Sets the class path.
|
void |
setJarPath(String value)
Sets the jar path.
|
void |
setObjClass(Class<?> value)
Sets the module class.
|
void |
setPath(String value)
Sets the path.
|
void |
setSingleton(boolean value)
Sets the singleton flag.
|
abstract boolean |
startLoad()
Executed when UnitLoader starts loading.
|
public Unit()
public Unit(String classPath, Class<C> objClass, boolean singleton)
classPath
- the root class pathobjClass
- the class of object. All loaded modules will be casted to objClass.singleton
- the singleton == true all modules will be loaded as singletonspublic Unit(String path, String jarPath, String classPath, Class<C> objClass, boolean singleton)
path
- the path. UnitLoader will use it first to load modules.jarPath
- the path the jar path. UnitLoader will use it second path to load modules.classPath
- the root class pathobjClass
- the class of object. All loaded modules will be casted to objClass.singleton
- if singleton == true all modules will be loaded as singletonspublic abstract void add(String name, Object object)
name
- the unique name of the objectobject
- the objectpublic abstract void addWithoutLicense(String name, Object object)
name
- the unique name of the objectobject
- the objectpublic abstract boolean allowLoadAll()
public abstract boolean canBeLoadedAgain()
public abstract void finishLoad(UnitLoader loader)
loader
- the UnitLoaderpublic abstract void free()
public String getClassPath()
public String getJarPath()
public abstract List<C> getList()
public Class<C> getObjClass()
public String getPath()
public boolean isSingleton()
public abstract boolean loadsConfigurableExtensions()
public void setClassPath(String value)
value
- the new class pathpublic void setJarPath(String value)
value
- the new jar pathpublic void setObjClass(Class<?> value)
value
- the new module classpublic void setPath(String value)
value
- the new pathpublic void setSingleton(boolean value)
value
- the new singleton flagpublic abstract boolean startLoad()
Copyright © 2010-2020 Toolsverse. All Rights Reserved.