|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.jboss.dna.common.component.ComponentLibrary<ComponentType,ConfigType>
ComponentType
- the type of component being managed, which may be a subclass of Component
ConfigType
- the configuration type describing the components@ThreadSafe public class ComponentLibrary<ComponentType,ConfigType extends ComponentConfig>
Maintains the list of component instances for the system. This class does not actively update the component configurations, but
is designed to properly maintain the sequencer instances when those configurations are changed by other callers. If the
components are subclasses of Component
, then they will be configured
with the appropriate configuration.
Therefore, this library does guarantee that the instances
at the time they are obtained
are always reflected by the configurations.
Field Summary | |
---|---|
static ClassLoaderFactory |
DEFAULT
Class loader factory instance that always returns the current thread's context class
loader (if not null) or component library's class loader. |
Constructor Summary | |
---|---|
ComponentLibrary()
Create a new library of components. |
|
ComponentLibrary(boolean addBeforeExistingConfigs)
Create a new library of components. |
Method Summary | |
---|---|
boolean |
add(ConfigType config)
Add the configuration for a sequencer, or update any existing one that represents the same
configuration |
ClassLoaderFactory |
getClassLoaderFactory()
Get the class loader factory that should be used to load the component classes. |
List<ComponentType> |
getInstances()
Return the list of sequencers. |
boolean |
refreshInstances()
Refresh the instances by attempting to re-instantiate each registered configuration. |
boolean |
remove(ConfigType config)
Remove the configuration for a sequencer. |
void |
setClassLoaderFactory(ClassLoaderFactory classLoaderFactory)
Set the Maven Repository that should be used to load the sequencer classes. |
boolean |
update(ConfigType config)
Update the configuration for a sequencer, or add it if there is no matching configuration
. |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final ClassLoaderFactory DEFAULT
current thread's context class
loader
(if not null) or component library's class loader.
Constructor Detail |
---|
public ComponentLibrary()
public ComponentLibrary(boolean addBeforeExistingConfigs)
addBeforeExistingConfigs
- true
if configurations should be added
before
previously added configurations.Method Detail |
---|
public ClassLoaderFactory getClassLoaderFactory()
default
class loader factory, which uses the current thread's
context class loader
if not null or the class loader that loaded the library class.
setClassLoaderFactory(ClassLoaderFactory)
public void setClassLoaderFactory(ClassLoaderFactory classLoaderFactory)
default
class loader factory, which uses the current thread's
context class loader
if not null or the class loader that loaded the library class.
classLoaderFactory
- the class loader factory reference, or null if the default class loader factory
should be usedgetClassLoaderFactory()
public boolean add(ConfigType config)
same
configuration
config
- the new configuration
unchanged
component configuration
IllegalArgumentException
- if config
is nullupdate(ComponentConfig)
,
remove(ComponentConfig)
public boolean update(ConfigType config)
matching configuration
.
config
- the updated (or new) configuration
unchanged
component configuration
IllegalArgumentException
- if config
is nulladd(ComponentConfig)
,
remove(ComponentConfig)
public boolean remove(ConfigType config)
config
- the configuration to be removed
IllegalArgumentException
- if config
is nulladd(ComponentConfig)
,
update(ComponentConfig)
public boolean refreshInstances()
public List<ComponentType> getInstances()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |