|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.crsh.plugin.PluginContext
public class PluginContext
The plugin context.
| Field Summary | |
|---|---|
private List<File> |
dirs
. |
private ScheduledExecutorService |
executor
. |
private ClassLoader |
loader
. |
private static org.slf4j.Logger |
log
. |
(package private) PluginManager |
manager
. |
private static Pattern |
p
. |
private Map<PropertyDescriptor<?>,Property<?>> |
properties
. |
private boolean |
started
. |
private String |
version
. |
private FS |
vfs
. |
| Constructor Summary | |
|---|---|
PluginContext(PluginDiscovery discovery,
FS fs,
ClassLoader loader)
Create a new plugin context. |
|
| Method Summary | ||
|---|---|---|
Collection<Property<?>> |
getFoo()
Returns the list of properties. |
|
ClassLoader |
getLoader()
|
|
Iterable<CRaSHPlugin<?>> |
getPlugins()
|
|
|
getPlugins(Class<T> pluginType)
|
|
|
getProperty(PropertyDescriptor<T> desc)
Returns a context property or null if it cannot be found. |
|
|
getProperty(String propertyName,
Class<T> type)
Returns a context property or null if it cannot be found. |
|
String |
getVersion()
|
|
List<String> |
listResourceId(ResourceKind kind)
|
|
Resource |
loadResource(String resourceId,
ResourceKind resourceKind)
|
|
void |
refresh()
Refresh the fs system view. |
|
|
setProperty(PropertyDescriptor<T> desc,
String value)
Set a context property to a new value. |
|
|
setProperty(PropertyDescriptor<T> desc,
T value)
Set a context property to a new value. |
|
void |
start()
|
|
void |
stop()
|
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
private static final Pattern p
private static final org.slf4j.Logger log
final PluginManager manager
private final ClassLoader loader
private final String version
private ScheduledExecutorService executor
private volatile List<File> dirs
private final Map<PropertyDescriptor<?>,Property<?>> properties
private final FS vfs
private boolean started
| Constructor Detail |
|---|
public PluginContext(PluginDiscovery discovery,
FS fs,
ClassLoader loader)
throws NullPointerException
discovery - the plugin discoveryfs - the file systemloader - the loader
NullPointerException - if any parameter argument is null| Method Detail |
|---|
public Iterable<CRaSHPlugin<?>> getPlugins()
public final String getVersion()
public final Collection<Property<?>> getFoo()
public final <T> T getProperty(PropertyDescriptor<T> desc)
throws NullPointerException
T - the property parameter typedesc - the property descriptor
NullPointerException - if the descriptor argument is null
public final <T> T getProperty(String propertyName,
Class<T> type)
throws NullPointerException
T - the property parameter typepropertyName - the name of the propertytype - the property type
NullPointerException - if the descriptor argument is null
public final <T> void setProperty(PropertyDescriptor<T> desc,
T value)
throws NullPointerException
T - the property parameter typedesc - the property descriptorvalue - the property value
NullPointerException - if the descriptor argument is null
public final <T> void setProperty(PropertyDescriptor<T> desc,
String value)
throws NullPointerException,
IllegalArgumentException
T - the property parameter typedesc - the property descriptorvalue - the property value
NullPointerException - if the descriptor argument is null
IllegalArgumentException - if the string value cannot be converted to the property type
public final Resource loadResource(String resourceId,
ResourceKind resourceKind)
public final List<String> listResourceId(ResourceKind kind)
public final ClassLoader getLoader()
public final void refresh()
public final void start()
public final void stop()
public <T> Iterable<T> getPlugins(Class<T> pluginType)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||