public class WebApp
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
protected Consumers<MadvocContainer> |
componentConfigs |
protected MadvocContainer |
madvocContainer |
protected javax.servlet.ServletContext |
servletContext |
Constructor and Description |
---|
WebApp() |
Modifier and Type | Method and Description |
---|---|
WebApp |
bindServletContext(javax.servlet.ServletContext servletContext)
Defines servlet context.
|
protected void |
configureDefaults()
Configure defaults.
|
static WebApp |
createWebApp() |
static WebApp |
get(javax.servlet.ServletContext servletContext)
Returns
WebApp instance from servlet context. |
protected void |
initialized()
Called when Madvoc is initialized, at the end of the
INIT phase. |
MadvocContainer |
madvocContainer()
Returns
Madvoc container that maintain all Madvoc components. |
protected void |
ready()
Called when Madvoc is ready, at the end of the
READY phase. |
WebApp |
registerComponent(java.lang.Class<?> madvocComponent)
Registers additional Madvoc components after the registration of default components.
|
<T> WebApp |
registerComponent(java.lang.Class<T> madvocComponent,
java.util.function.Consumer<T> componentConsumer) |
WebApp |
registerComponent(java.lang.Object madvocComponent)
Registers Madvoc component instance.
|
protected void |
registerMadvocComponents()
Registers default Madvoc components.
|
WebApp |
router(java.util.function.Consumer<MadvocRouter> madvocAppConsumer)
Defines a route manually using
MadvocRouter . |
void |
shutdown()
Shutdows the web application.
|
WebApp |
start()
Initializes and starts web application.
|
WebApp |
start(java.util.function.Consumer<MadvocRouter> madvocRouterConsumer)
Initializes and starts web application.
|
protected void |
started()
Called when Madvoc is started, at the end of the
START phase. |
<A extends ActionConfig> |
withActionConfig(java.lang.Class<A> actionConfigType,
java.util.function.Consumer<A> actionConfigConsumer)
Configures the action configurations.
|
WebApp |
withParams(java.util.Map<java.lang.String,java.lang.Object> params) |
WebApp |
withParams(Props props)
Defines params to load.
|
<T> WebApp |
withRegisteredComponent(java.lang.Class<T> madvocComponent,
java.util.function.Consumer<T> componentConsumer)
Configures a component.
|
protected javax.servlet.ServletContext servletContext
protected final MadvocContainer madvocContainer
protected Consumers<MadvocContainer> componentConfigs
public static WebApp createWebApp()
public static WebApp get(javax.servlet.ServletContext servletContext)
WebApp
instance from servlet context.
May return null
indicating WebApp
is not yet initialized.public WebApp withParams(java.util.Map<java.lang.String,java.lang.Object> params)
public WebApp bindServletContext(javax.servlet.ServletContext servletContext)
public WebApp registerComponent(java.lang.Class<?> madvocComponent)
public <T> WebApp registerComponent(java.lang.Class<T> madvocComponent, java.util.function.Consumer<T> componentConsumer)
public WebApp registerComponent(java.lang.Object madvocComponent)
public <A extends ActionConfig> WebApp withActionConfig(java.lang.Class<A> actionConfigType, java.util.function.Consumer<A> actionConfigConsumer)
public MadvocContainer madvocContainer()
Madvoc container
that maintain all Madvoc components.public <T> WebApp withRegisteredComponent(java.lang.Class<T> madvocComponent, java.util.function.Consumer<T> componentConsumer)
registerComponent(Class, Consumer)
this method does not register component, just operates on an already registered one.public WebApp router(java.util.function.Consumer<MadvocRouter> madvocAppConsumer)
MadvocRouter
.public WebApp start(java.util.function.Consumer<MadvocRouter> madvocRouterConsumer)
public WebApp start()
protected void configureDefaults()
protected void registerMadvocComponents()
protected void initialized()
INIT
phase.MadvocComponentLifecycle
protected void started()
START
phase.MadvocComponentLifecycle
protected void ready()
READY
phase.MadvocComponentLifecycle
public void shutdown()
MadvocComponentLifecycle
Copyright © 2003-present Jodd Team