Package org.analogweb.core
Class WebApplication
- java.lang.Object
-
- org.analogweb.core.WebApplication
-
- All Implemented Interfaces:
Application
,Disposable
public class WebApplication extends Object implements Application
- Author:
- y2k2mt
-
-
Field Summary
-
Fields inherited from interface org.analogweb.Application
DEFAULT_PACKAGE_NAME, NOT_FOUND
-
-
Constructor Summary
Constructors Constructor Description WebApplication()
WebApplication(List<ModulesConfig> modulesConfigs)
-
Method Summary
-
-
-
Constructor Detail
-
WebApplication
public WebApplication()
-
WebApplication
public WebApplication(List<ModulesConfig> modulesConfigs)
-
-
Method Detail
-
run
public void run(ApplicationContext resolver, ApplicationProperties props, Collection<ClassCollector> collectors, ClassLoader classLoader)
Description copied from interface:Application
Run application.- Specified by:
run
in interfaceApplication
- Parameters:
resolver
-ApplicationContext
props
-ApplicationProperties
collectors
-ClassCollector
classLoader
-ClassLoader
-
processRequest
public Response processRequest(RequestPath requestedPath, RequestContext requestContext, ResponseContext responseContext) throws IOException, WebApplicationException
Description copied from interface:Application
Process request. Before thenApplication
should be running.- Specified by:
processRequest
in interfaceApplication
- Parameters:
requestedPath
-RequestPath
requestContext
-RequestContext
responseContext
-ResponseContext
- Throws:
IOException
WebApplicationException
-
preMatching
protected void preMatching(List<ApplicationProcessor> processors, MutableRequestContext request, RequestPath requestedPath)
-
prepareInvoke
protected void prepareInvoke(List<ApplicationProcessor> processors, InvocationArguments args, InvocationMetadata metadata, RequestContext request, RequestValueResolvers attributesHandlers, TypeMapperContext typeMapperContext)
-
postInvoke
protected void postInvoke(List<ApplicationProcessor> processors, Object invocationResult, InvocationArguments args, InvocationMetadata metadata, RequestContext request, RequestValueResolvers attributesHandlers)
-
onException
protected void onException(List<ApplicationProcessor> processors, Exception thrown, InvocationArguments args, InvocationMetadata metadata, RequestContext request)
-
afterCompletion
protected void afterCompletion(List<ApplicationProcessor> processors, RequestContext context, ResponseContext responseContext, Exception e)
-
handleResponse
protected Response handleResponse(Modules modules, Object result, InvocationMetadata metadata, RequestContext context, ResponseContext responseContext) throws IOException, WebApplicationException
- Throws:
IOException
WebApplicationException
-
initApplication
protected void initApplication(Collection<ClassCollector> collectors, Set<String> modulePackageNames, ApplicationProperties properties)
-
processConfigPreparation
protected ModulesBuilder processConfigPreparation(Collection<Class<?>> moduleClasses)
-
getModulesConfigComparator
protected Comparator<ModulesConfig> getModulesConfigComparator()
-
setUpDefaultContainer
protected ContainerAdaptor setUpDefaultContainer(ApplicationContext resolver, Collection<Class<?>> rootModuleClasses)
-
createRouteRegistry
protected RouteRegistry createRouteRegistry(List<InvocationMetadataFactory> factories, ApplicationProperties properties, ContainerAdaptor instanceProvider)
-
collectAllClasses
protected Collection<Class<?>> collectAllClasses(Collection<ClassCollector> collectors)
-
collectClasses
protected Collection<Class<?>> collectClasses(Collection<String> rootPackageNames, Collection<ClassCollector> collectors)
-
getRouteRegistry
public RouteRegistry getRouteRegistry()
Description copied from interface:Application
ObtainRouteRegistry
.- Specified by:
getRouteRegistry
in interfaceApplication
- Returns:
RouteRegistry
-
setRouteRegistry
protected void setRouteRegistry(RouteRegistry registry)
-
getModulesConfigs
protected List<ModulesConfig> getModulesConfigs()
-
getModules
public Modules getModules()
Description copied from interface:Application
ObtainModules
.- Specified by:
getModules
in interfaceApplication
- Returns:
Modules
-
setModules
protected void setModules(Modules modules)
-
getApplicationContextResolver
protected final ApplicationContext getApplicationContextResolver()
-
dispose
public void dispose()
Description copied from interface:Disposable
Dispose all the states.- Specified by:
dispose
in interfaceDisposable
-
-