use of org.apache.struts2.dispatcher.Dispatcher in project dhis2-core by dhis2.
the class DetectingSystemAuthoritiesProvider method getSystemAuthorities.
// -------------------------------------------------------------------------
// SystemAuthoritiesProvider implementation
// -------------------------------------------------------------------------
@Override
public Collection<String> getSystemAuthorities() {
Dispatcher instance = Dispatcher.getInstance();
if (instance == null) {
return emptyList();
}
HashSet<String> authorities = new HashSet<>();
Configuration configuration = instance.getConfigurationManager().getConfiguration();
for (PackageConfig packageConfig : configuration.getPackageConfigs().values()) {
for (ActionConfig actionConfig : packageConfig.getActionConfigs().values()) {
authorities.addAll(requiredAuthoritiesProvider.getAllAuthorities(actionConfig));
}
}
return authorities;
}
use of org.apache.struts2.dispatcher.Dispatcher in project entando-core by entando.
the class InitOperations method initDispatcher.
@Override
public Dispatcher initDispatcher(HostConfig filterConfig) {
Map<String, String> params = new HashMap<String, String>();
for (Iterator<String> e = filterConfig.getInitParameterNames(); e.hasNext(); ) {
String name = (String) e.next();
String value = filterConfig.getInitParameter(name);
params.put(name, value);
}
String struts2Config = filterConfig.getServletContext().getInitParameter(ApsAdminSystemConstants.STRUTS2_CONFIG_INIT_PARAM_NAME);
if (null != struts2Config) {
params.put("config", struts2Config);
}
Dispatcher dispatcher = new Dispatcher(filterConfig.getServletContext(), params);
dispatcher.init();
return dispatcher;
}
use of org.apache.struts2.dispatcher.Dispatcher in project entando-core by entando.
the class StrutsPrepareAndExecuteFilter method init.
@Override
public void init(FilterConfig filterConfig) throws ServletException {
InitOperations init = new InitOperations();
Dispatcher dispatcher = null;
try {
FilterHostConfig config = new FilterHostConfig(filterConfig);
init.initLogging(config);
dispatcher = init.initDispatcher(config);
init.initStaticContentLoader(config, dispatcher);
this.prepare = new PrepareOperations(dispatcher);
this.execute = new ExecuteOperations(dispatcher);
this.excludedPatterns = init.buildExcludedPatternsList(dispatcher);
this.postInit(dispatcher, filterConfig);
} finally {
if (dispatcher != null) {
dispatcher.cleanUpAfterInit();
}
init.cleanup();
}
}
use of org.apache.struts2.dispatcher.Dispatcher in project onebusaway-application-modules by camsys.
the class ConfigurationValueFunction method configValue.
public static String configValue(String key) {
Dispatcher instance = Dispatcher.getInstance();
if (instance == null)
return null;
Container container = instance.getContainer();
ConfigurationValueFunction cv = new ConfigurationValueFunction();
container.inject(cv);
return cv.lookup(key);
}
use of org.apache.struts2.dispatcher.Dispatcher in project qi4j-sdk by Qi4j.
the class Qi4jFilterDispatcher method createDispatcher.
@Override
protected Dispatcher createDispatcher(final FilterConfig filterConfig) {
Dispatcher dispatcher = super.createDispatcher(filterConfig);
ConfigurationManager configurationManager = createConfigurationManager(filterConfig);
dispatcher.setConfigurationManager(configurationManager);
return dispatcher;
}
Aggregations