Method from org.apache.struts.config.impl.ModuleConfigImpl Detail: |
public void addActionConfig(ActionConfig config) {
if (configured) {
throw new IllegalStateException("Configuration is frozen");
}
config.setModuleConfig(this);
actionConfigs.put(config.getPath(), config);
actionConfigList.add(config);
}
Add a new ActionConfig instance to the set associated
with this module. |
public void addDataSourceConfig(DataSourceConfig config) {
if (configured) {
throw new IllegalStateException("Configuration is frozen");
}
dataSources.put(config.getKey(), config);
}
Add a new DataSourceConfig instance to the set associated
with this module. |
public void addExceptionConfig(ExceptionConfig config) {
if (configured) {
throw new IllegalStateException("Configuration is frozen");
}
exceptions.put(config.getType(), config);
}
Add a new ExceptionConfig instance to the set associated
with this module. |
public void addFormBeanConfig(FormBeanConfig config) {
if (configured) {
throw new IllegalStateException("Configuration is frozen");
}
formBeans.put(config.getName(), config);
}
Add a new FormBeanConfig instance to the set associated
with this module. |
public void addForwardConfig(ForwardConfig config) {
if (configured) {
throw new IllegalStateException("Configuration is frozen");
}
forwards.put(config.getName(), config);
}
Add a new ForwardConfig instance to the set of global
forwards associated with this module. |
public void addMessageResourcesConfig(MessageResourcesConfig config) {
if (configured) {
throw new IllegalStateException("Configuration is frozen");
}
messageResources.put(config.getKey(), config);
}
Add a new MessageResourcesConfig instance to the set
associated with this module. |
public void addPlugInConfig(PlugInConfig plugInConfig) {
if (configured) {
throw new IllegalStateException("Configuration is frozen");
}
plugIns.add(plugInConfig);
}
|
public ActionConfig findActionConfig(String path) {
ActionConfig config = (ActionConfig) actionConfigs.get(path);
// If a direct match cannot be found, try to match action configs
// containing wildcard patterns
if (config == null) {
config = matcher.match(path);
}
return config;
}
Return the action configuration for the specified path, first looking
a direct match, then if none found, a wildcard pattern match;
otherwise return null . |
public ActionConfig[] findActionConfigs() {
ActionConfig results[] = new ActionConfig[actionConfigList.size()];
return ((ActionConfig[]) actionConfigList.toArray(results));
}
Return the action configurations for this module. If there are
none, a zero-length array is returned. |
public DataSourceConfig findDataSourceConfig(String key) {
return ((DataSourceConfig) dataSources.get(key));
}
Return the data source configuration for the specified key, if any;
otherwise return null . |
public DataSourceConfig[] findDataSourceConfigs() {
DataSourceConfig results[] = new DataSourceConfig[dataSources.size()];
return ((DataSourceConfig[]) dataSources.values().toArray(results));
}
Return the data source configurations for this module. If there
are none, a zero-length array is returned. |
public ExceptionConfig findExceptionConfig(String type) {
return ((ExceptionConfig) exceptions.get(type));
}
Return the exception configuration for the specified type, if any;
otherwise return null . |
public ExceptionConfig[] findExceptionConfigs() {
ExceptionConfig results[] = new ExceptionConfig[exceptions.size()];
return ((ExceptionConfig[]) exceptions.values().toArray(results));
}
Return the exception configurations for this module. If there
are none, a zero-length array is returned. |
public FormBeanConfig findFormBeanConfig(String name) {
return ((FormBeanConfig) formBeans.get(name));
}
Return the form bean configuration for the specified key, if any;
otherwise return null . |
public FormBeanConfig[] findFormBeanConfigs() {
FormBeanConfig results[] = new FormBeanConfig[formBeans.size()];
return ((FormBeanConfig[]) formBeans.values().toArray(results));
}
Return the form bean configurations for this module. If there
are none, a zero-length array is returned. |
public ForwardConfig findForwardConfig(String name) {
return ((ForwardConfig) forwards.get(name));
}
Return the forward configuration for the specified key, if any;
otherwise return null . |
public ForwardConfig[] findForwardConfigs() {
ForwardConfig results[] = new ForwardConfig[forwards.size()];
return ((ForwardConfig[]) forwards.values().toArray(results));
}
Return the form bean configurations for this module. If there
are none, a zero-length array is returned. |
public MessageResourcesConfig findMessageResourcesConfig(String key) {
return ((MessageResourcesConfig) messageResources.get(key));
}
Return the message resources configuration for the specified key,
if any; otherwise return null . |
public MessageResourcesConfig[] findMessageResourcesConfigs() {
MessageResourcesConfig results[] =
new MessageResourcesConfig[messageResources.size()];
return ((MessageResourcesConfig[])
messageResources.values().toArray(results));
}
Return the message resources configurations for this module.
If there are none, a zero-length array is returned. |
public PlugInConfig[] findPlugInConfigs() {
PlugInConfig results[] = new PlugInConfig[plugIns.size()];
return ((PlugInConfig[]) plugIns.toArray(results));
}
Return the configured plug-in actions for this module. If there
are none, a zero-length array is returned. |
public void freeze() {
this.configured = true;
ActionConfig[] aconfigs = findActionConfigs();
for (int i = 0; i < aconfigs.length; i++) {
aconfigs[i].freeze();
}
matcher = new ActionConfigMatcher(aconfigs);
getControllerConfig().freeze();
DataSourceConfig[] dsconfigs = findDataSourceConfigs();
for (int i = 0; i < dsconfigs.length; i++) {
dsconfigs[i].freeze();
}
ExceptionConfig[] econfigs = findExceptionConfigs();
for (int i = 0; i < econfigs.length; i++) {
econfigs[i].freeze();
}
FormBeanConfig[] fbconfigs = findFormBeanConfigs();
for (int i = 0; i < fbconfigs.length; i++) {
fbconfigs[i].freeze();
}
ForwardConfig[] fconfigs = findForwardConfigs();
for (int i = 0; i < fconfigs.length; i++) {
fconfigs[i].freeze();
}
MessageResourcesConfig[] mrconfigs = findMessageResourcesConfigs();
for (int i = 0; i < mrconfigs.length; i++) {
mrconfigs[i].freeze();
}
PlugInConfig[] piconfigs = findPlugInConfigs();
for (int i = 0; i < piconfigs.length; i++) {
piconfigs[i].freeze();
}
}
Freeze the configuration of this module. After this method
returns, any attempt to modify the configuration will return
an IllegalStateException. |
public String getActionFormBeanClass() {
return this.actionFormBeanClass;
}
The default class name to be used when creating action form bean
instances. |
public String getActionForwardClass() {
return this.actionForwardClass;
}
The default class name to be used when creating action forward instances. |
public String getActionMappingClass() {
return this.actionMappingClass;
}
The default class name to be used when creating action mapping instances. |
public boolean getConfigured() {
return (this.configured);
}
Has this module been completely configured yet. Once this flag
has been set, any attempt to modify the configuration will return an
IllegalStateException. |
public ControllerConfig getControllerConfig() {
if (this.controllerConfig == null) {
this.controllerConfig = new ControllerConfig();
}
return (this.controllerConfig);
}
The controller configuration object for this module. |
public String getPrefix() {
return (this.prefix);
}
The prefix of the context-relative portion of the request URI, used to
select this configuration versus others supported by the controller
servlet. A configuration with a prefix of a zero-length String is the
default configuration for this web module. |
public void removeActionConfig(ActionConfig config) {
if (configured) {
throw new IllegalStateException("Configuration is frozen");
}
config.setModuleConfig(null);
actionConfigs.remove(config.getPath());
actionConfigList.remove(config);
}
Remove the specified action configuration instance. |
public void removeDataSourceConfig(DataSourceConfig config) {
if (configured) {
throw new IllegalStateException("Configuration is frozen");
}
dataSources.remove(config.getKey());
}
Remove the specified data source configuration instance. |
public void removeExceptionConfig(ExceptionConfig config) {
if (configured) {
throw new IllegalStateException("Configuration is frozen");
}
exceptions.remove(config.getType());
}
Remove the specified exception configuration instance. |
public void removeFormBeanConfig(FormBeanConfig config) {
if (configured) {
throw new IllegalStateException("Configuration is frozen");
}
formBeans.remove(config.getName());
}
Remove the specified form bean configuration instance. |
public void removeForwardConfig(ForwardConfig config) {
if (configured) {
throw new IllegalStateException("Configuration is frozen");
}
forwards.remove(config.getName());
}
Remove the specified forward configuration instance. |
public void removeMessageResourcesConfig(MessageResourcesConfig config) {
if (configured) {
throw new IllegalStateException("Configuration is frozen");
}
messageResources.remove(config.getKey());
}
Remove the specified message resources configuration instance. |
public void setActionFormBeanClass(String actionFormBeanClass) {
this.actionFormBeanClass = actionFormBeanClass;
}
The default class name to be used when creating action form bean
instances. |
public void setActionForwardClass(String actionForwardClass) {
this.actionForwardClass= actionForwardClass;
}
The default class name to be used when creating action forward instances. |
public void setActionMappingClass(String actionMappingClass) {
this.actionMappingClass = actionMappingClass;
}
The default class name to be used when creating action mapping instances. |
public void setControllerConfig(ControllerConfig cc) {
if (configured) {
throw new IllegalStateException("Configuration is frozen");
}
this.controllerConfig = cc;
}
The controller configuration object for this module. |
public void setPrefix(String prefix) {
if (configured) {
throw new IllegalStateException("Configuration is frozen");
}
this.prefix = prefix;
}
The prefix of the context-relative portion of the request URI, used to
select this configuration versus others supported by the controller
servlet. A configuration with a prefix of a zero-length String is the
default configuration for this web module. |