jodd.madvoc
Class WebApplication

java.lang.Object
  extended by jodd.madvoc.WebApplication
Direct Known Subclasses:
PetiteWebApplication

public class WebApplication
extends java.lang.Object

Web application contains all configurations and holds all managers and controllers of one web application. Custom implementations may override this class to enhance several different functionality.


Field Summary
protected  PetiteContainer madpc
           
static java.lang.String MADVOC_CONTAINER_NAME
           
 
Constructor Summary
WebApplication()
          Creates web application.
WebApplication(boolean init)
          Creates web application and optionally initializes it.
 
Method Summary
 void configure(MadvocConfigurator configurator)
          Wires configurator in the the Madvoc container and invokes configuration.
protected  void defineParams(java.util.Properties properties)
          Initialized web application parameters.
protected  void defineParams(jodd.props.Props props)
           
protected  void destroy(MadvocConfig madvocConfig)
          Invoked on web application destroy.
<T> T
getComponent(java.lang.Class<T> component)
          Returns registered component.
 java.lang.Object getComponent(java.lang.String componentName)
          Returns registered component.
protected  void init(MadvocConfig madvocConfig, javax.servlet.ServletContext context)
          Initializes web application custom configuration.
protected  void initActions(ActionsManager actionManager)
          Hook for manually registered actions.
protected  void initResults(ResultsManager actionManager)
          Hook for manually registered results.
protected  void initWebApplication()
          Initializes web application.
 void registerComponent(java.lang.Class component)
          Registers component using its base name.
 void registerComponent(java.lang.Object componentInstance)
          Registers component instance using its base name.
 void registerComponent(java.lang.String name, java.lang.Class component)
           
 void registerComponent(java.lang.String name, java.lang.Object componentInstance)
          Registers component instance and wires it with internal container.
 void registerMadvocComponents()
          Registers default Madvoc components.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

MADVOC_CONTAINER_NAME

public static final java.lang.String MADVOC_CONTAINER_NAME
See Also:
Constant Field Values

madpc

protected PetiteContainer madpc
Constructor Detail

WebApplication

public WebApplication()
Creates web application. Application is not initialized.

See Also:
WebApplication(boolean)

WebApplication

public WebApplication(boolean init)
Creates web application and optionally initializes it.

Method Detail

initWebApplication

protected void initWebApplication()
Initializes web application. Invoked very first. By default, it creates a Logger and creates internal Petite container. Also adds itself into it.


registerComponent

public final void registerComponent(java.lang.Class component)
Registers component using its base name. Previously defined component will be removed.

See Also:
registerComponent(Object)

registerComponent

public final void registerComponent(java.lang.String name,
                                    java.lang.Class component)

registerComponent

public final void registerComponent(java.lang.Object componentInstance)
Registers component instance using its base name. Previously defined component will be removed.

See Also:
registerComponent(Class)

registerComponent

public final void registerComponent(java.lang.String name,
                                    java.lang.Object componentInstance)
Registers component instance and wires it with internal container.


getComponent

public <T> T getComponent(java.lang.Class<T> component)
Returns registered component. Should be used only in special cases.


getComponent

public java.lang.Object getComponent(java.lang.String componentName)
Returns registered component.


registerMadvocComponents

public void registerMadvocComponents()
Registers default Madvoc components. Invoked before madvoc initialization.


defineParams

protected void defineParams(java.util.Properties properties)
Initialized web application parameters. Provided properties object is always non-null. Simple defines parameters for internal container.


defineParams

protected void defineParams(jodd.props.Props props)

init

protected void init(MadvocConfig madvocConfig,
                    javax.servlet.ServletContext context)
Initializes web application custom configuration.


initActions

protected void initActions(ActionsManager actionManager)
Hook for manually registered actions.


initResults

protected void initResults(ResultsManager actionManager)
Hook for manually registered results.


destroy

protected void destroy(MadvocConfig madvocConfig)
Invoked on web application destroy.


configure

public void configure(MadvocConfigurator configurator)
Wires configurator in the the Madvoc container and invokes configuration.



Copyright © 2003-2011 Jodd Team