Search in sources :

Example 1 with ServerTimingFilter

use of com.canoo.dp.impl.server.servlet.ServerTimingFilter in project dolphin-platform by canoo.

the class ServerTimingModule method initialize.

@Override
public void initialize(final ServerCoreComponents coreComponents) throws ModuleInitializationException {
    Assert.requireNonNull(coreComponents, "coreComponents");
    final ServletContext servletContext = coreComponents.getInstance(ServletContext.class);
    final PlatformConfiguration configuration = coreComponents.getConfiguration();
    final Filter filter = new ServerTimingFilter(true);
    final FilterRegistration.Dynamic createdFilter = servletContext.addFilter(FILTER_NAME, filter);
    createdFilter.addMappingForUrlPatterns(EnumSet.allOf(DispatcherType.class), true, "/*");
}
Also used : PlatformConfiguration(com.canoo.platform.core.PlatformConfiguration) ServerTimingFilter(com.canoo.dp.impl.server.servlet.ServerTimingFilter) ServerTimingFilter(com.canoo.dp.impl.server.servlet.ServerTimingFilter) Filter(javax.servlet.Filter) ServletContext(javax.servlet.ServletContext) DispatcherType(javax.servlet.DispatcherType) FilterRegistration(javax.servlet.FilterRegistration)

Aggregations

ServerTimingFilter (com.canoo.dp.impl.server.servlet.ServerTimingFilter)1 PlatformConfiguration (com.canoo.platform.core.PlatformConfiguration)1 DispatcherType (javax.servlet.DispatcherType)1 Filter (javax.servlet.Filter)1 FilterRegistration (javax.servlet.FilterRegistration)1 ServletContext (javax.servlet.ServletContext)1