Class DefaultApplicationContext<Config extends ApplicationConfiguration,Context extends DefaultApplicationContext<Config,Context>>
- java.lang.Object
-
- org.nuiton.jaxx.runtime.application.DefaultApplicationContext<Config,Context>
-
- All Implemented Interfaces:
Closeable,AutoCloseable,ApplicationContext<Config,Context>,JAXXContext
public abstract class DefaultApplicationContext<Config extends ApplicationConfiguration,Context extends DefaultApplicationContext<Config,Context>> extends Object implements ApplicationContext<Config,Context>
Application context (only one instance should exists and it is initialized by theApplicationBoot.Created by tchemit on 26/01/2018.
- Author:
- Tony Chemit - dev@tchemit.fr
-
-
Constructor Summary
Constructors Modifier Constructor Description protectedDefaultApplicationContext(ApplicationBoot<Config,Context> boot, Config config, List<ApplicationContextComponent<Config,Context,?>> components, List<ApplicationContextComponent<Config,Context,?>> variables)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddAction(String actionLabel, Runnable action)voidclose()List<ApplicationContextComponent<Config,Context,?>>components()ApplicationBoot<Config,Context>getBoot()ConfiggetConfig()<T> TgetContextValue(Class<T> aClass)<T> TgetContextValue(Class<T> aClass, String s)voidinstall(JAXXContext context)Install the application into the givencontext.booleanisClosed()voidlock()<T> voidremoveContextValue(Class<T> aClass)<T> voidremoveContextValue(Class<T> aClass, String s)<T> voidsetContextValue(T t)<T> voidsetContextValue(T t, String s)protected static <Config extends ApplicationConfiguration,Context extends DefaultApplicationContext<Config,Context>>
ApplicationContextComponent<Config,Context,SwingSessionHelper>SWING_SESSION_HELPER()JAXXInitialContexttoInitialContext()voidunlock()List<ApplicationContextComponent<Config,Context,?>>variables()-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.nuiton.jaxx.runtime.application.ApplicationContext
busy, displayInfo, getMainUI, getSwingSessionHelper, handlingError, handlingError, isClosing, newMainUI, notBusy, removeMainUI, setMainUIVisible
-
-
-
-
Constructor Detail
-
DefaultApplicationContext
protected DefaultApplicationContext(ApplicationBoot<Config,Context> boot, Config config, List<ApplicationContextComponent<Config,Context,?>> components, List<ApplicationContextComponent<Config,Context,?>> variables)
-
-
Method Detail
-
SWING_SESSION_HELPER
protected static <Config extends ApplicationConfiguration,Context extends DefaultApplicationContext<Config,Context>> ApplicationContextComponent<Config,Context,SwingSessionHelper> SWING_SESSION_HELPER()
-
install
public final void install(JAXXContext context)
Install the application into the givencontext.- Specified by:
installin interfaceApplicationContext<Config extends ApplicationConfiguration,Context extends DefaultApplicationContext<Config,Context>>- Parameters:
context- where to install application context
-
toInitialContext
public final JAXXInitialContext toInitialContext()
- Specified by:
toInitialContextin interfaceApplicationContext<Config extends ApplicationConfiguration,Context extends DefaultApplicationContext<Config,Context>>- Returns:
- a new initial context within this application context.
-
getBoot
public final ApplicationBoot<Config,Context> getBoot()
- Specified by:
getBootin interfaceApplicationContext<Config extends ApplicationConfiguration,Context extends DefaultApplicationContext<Config,Context>>- Returns:
- application boot
-
getConfig
public final Config getConfig()
- Specified by:
getConfigin interfaceApplicationContext<Config extends ApplicationConfiguration,Context extends DefaultApplicationContext<Config,Context>>- Returns:
- application config
-
isClosed
public final boolean isClosed()
- Specified by:
isClosedin interfaceApplicationContext<Config extends ApplicationConfiguration,Context extends DefaultApplicationContext<Config,Context>>- Returns:
trueif context is closed.- See Also:
ApplicationBoot.isClosed()
-
setContextValue
public final <T> void setContextValue(T t)
- Specified by:
setContextValuein interfaceJAXXContext
-
setContextValue
public final <T> void setContextValue(T t, String s)- Specified by:
setContextValuein interfaceJAXXContext
-
removeContextValue
public final <T> void removeContextValue(Class<T> aClass)
- Specified by:
removeContextValuein interfaceJAXXContext
-
removeContextValue
public final <T> void removeContextValue(Class<T> aClass, String s)
- Specified by:
removeContextValuein interfaceJAXXContext
-
getContextValue
public final <T> T getContextValue(Class<T> aClass)
- Specified by:
getContextValuein interfaceJAXXContext
-
getContextValue
public final <T> T getContextValue(Class<T> aClass, String s)
- Specified by:
getContextValuein interfaceJAXXContext
-
lock
public final void lock() throws InterruptedException- Specified by:
lockin interfaceApplicationContext<Config extends ApplicationConfiguration,Context extends DefaultApplicationContext<Config,Context>>- Throws:
InterruptedException
-
unlock
public final void unlock()
- Specified by:
unlockin interfaceApplicationContext<Config extends ApplicationConfiguration,Context extends DefaultApplicationContext<Config,Context>>
-
components
public final List<ApplicationContextComponent<Config,Context,?>> components()
- Specified by:
componentsin interfaceApplicationContext<Config extends ApplicationConfiguration,Context extends DefaultApplicationContext<Config,Context>>
-
variables
public final List<ApplicationContextComponent<Config,Context,?>> variables()
- Specified by:
variablesin interfaceApplicationContext<Config extends ApplicationConfiguration,Context extends DefaultApplicationContext<Config,Context>>
-
close
public final void close()
- Specified by:
closein interfaceApplicationContext<Config extends ApplicationConfiguration,Context extends DefaultApplicationContext<Config,Context>>- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable
-
addAction
public final void addAction(String actionLabel, Runnable action)
- Specified by:
addActionin interfaceApplicationContext<Config extends ApplicationConfiguration,Context extends DefaultApplicationContext<Config,Context>>
-
-