public abstract class AbstractModule extends DefaultAdaptable implements IModule
Modifier and Type | Field and Description |
---|---|
static org.apache.commons.logging.Log |
LOGGER
logger definition
|
Constructor and Description |
---|
AbstractModule(java.lang.String name) |
Modifier and Type | Method and Description |
---|---|
protected java.util.Collection<IActivationBuffer> |
createBuffers()
called to create any buffers used by this buffer.
|
static <T> java.util.concurrent.CompletableFuture<T> |
delayedFuture(java.util.concurrent.Callable<T> caller,
java.util.concurrent.Executor executor)
create a future task and execute it on the exector
|
static <T> java.util.concurrent.CompletableFuture<T> |
delayedFuture(java.util.function.Supplier<T> supplier,
java.util.concurrent.Executor executor) |
void |
dispose()
release any resources.
|
java.util.concurrent.Executor |
getExecutor()
default executor INLINE_EXECUTOR is used
|
IModel |
getModel()
return the model this module is installed into
|
java.lang.String |
getName()
the name of the module
|
protected java.lang.String |
getSafeName(java.lang.String name,
java.util.Map<java.lang.String,?> mapping)
return a safe, noncolliding name - calls to this should make sure that the
map is readlocked
|
static <T> java.util.concurrent.CompletableFuture<T> |
immediateFuture(java.util.concurrent.Callable<T> caller)
create a future task and execute it immediately using the INLINE_EXECUTOR
|
static <T> java.util.concurrent.CompletableFuture<T> |
immediateReturn(T value) |
abstract void |
initialize()
this will be called after all the modules have been installed permitting
the module to attach listeners to other modules.
|
void |
install(IModel model)
called from the model during IModel.install(IModule).
|
protected void |
setExecutor(java.util.concurrent.Executor executor) |
void |
uninstall(IModel model)
remove the element from this model.
|
addAdapterFactory, getAdapter, removeAdapterFactory
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getAdapter
protected void setExecutor(java.util.concurrent.Executor executor)
executor
- public java.util.concurrent.Executor getExecutor()
public void dispose()
IModule
public IModel getModel()
IModule
public java.lang.String getName()
IModule
public void install(IModel model)
IModule
install
in interface IModule
install
in interface IInstallable
IInstallable.install(org.jactr.core.model.IModel)
protected java.util.Collection<IActivationBuffer> createBuffers()
public void uninstall(IModel model)
IInstallable
uninstall
in interface IInstallable
public abstract void initialize()
IModule
initialize
in interface IModule
initialize
in interface IInitializable
protected java.lang.String getSafeName(java.lang.String name, java.util.Map<java.lang.String,?> mapping)
name
- mapping
- public static <T> java.util.concurrent.CompletableFuture<T> immediateReturn(T value)
public static <T> java.util.concurrent.CompletableFuture<T> immediateFuture(java.util.concurrent.Callable<T> caller)
T
- caller
- public static <T> java.util.concurrent.CompletableFuture<T> delayedFuture(java.util.concurrent.Callable<T> caller, java.util.concurrent.Executor executor)
T
- caller
- executor
- public static <T> java.util.concurrent.CompletableFuture<T> delayedFuture(java.util.function.Supplier<T> supplier, java.util.concurrent.Executor executor)