| Method from org.apache.axis2.description.AxisDescription Detail: |
public void addChild(AxisDescription child) {
if (child.getKey() == null) {
// FIXME: Several classes that extend AxisDescription pass null in their getKey method.
// throw new IllegalArgumentException("Please specify a key in the child");
} else {
children.put(child.getKey(), child);
}
}
|
public void addChild(Object key,
AxisDescription child) {
children.put(key, child);
}
|
public void addParameter(Parameter param) throws AxisFault {
if (param == null) {
return;
}
if (isParameterLocked(param.getName())) {
throw new AxisFault(Messages.getMessage("paramterlockedbyparent",
param.getName()));
}
parameterInclude.addParameter(param);
// Tell anyone who wants to know
if (parameterObservers != null) {
for (Object parameterObserver : parameterObservers) {
ParameterObserver observer = (ParameterObserver)parameterObserver;
observer.parameterChanged(param.getName(), param.getValue());
}
}
}
|
public void addParameter(String name,
Object value) throws AxisFault {
addParameter(new Parameter(name, value));
}
|
public void addParameterObserver(ParameterObserver observer) {
if (parameterObservers == null)
parameterObservers = new ArrayList< ParameterObserver >();
parameterObservers.add(observer);
}
|
public void applyPolicy() throws AxisFault {
AxisConfiguration configuration = getAxisConfiguration();
if (configuration == null) {
return;
}
Policy applicablePolicy = getApplicablePolicy(this);
if (applicablePolicy != null) {
engageModulesForPolicy(applicablePolicy, configuration);
}
for (Iterator< ? extends AxisDescription > children = getChildren(); children.hasNext();) {
AxisDescription child = children.next();
child.applyPolicy();
}
}
Applies the policies on the Description Hierarchy recursively. |
public void applyPolicy(Policy policy) throws AxisFault {
// sets AxisDescription policy
getPolicySubject().clear();
getPolicySubject().attachPolicy(policy);
/*
* now we try to engage appropriate modules based on the merged policy
* of axis description object and the corresponding axis binding
* description object.
*/
applyPolicy();
}
This method sets the policy as the default of this AxisDescription instance. Further more
this method does the followings. (1) Engage whatever modules necessary to execute new
the effective policy of this AxisDescription instance. (2) Disengage whatever modules that
are not necessary to execute the new effective policy of this AxisDescription instance. (3)
Check whether each module can execute the new effective policy of this AxisDescription
instance. (4) If not throw an AxisFault to notify the user. (5) Else notify each module about
the new effective policy. |
public void deserializeParameters(OMElement parameterElement) throws AxisFault {
parameterInclude.deserializeParameters(parameterElement);
}
|
public void disengageModule(AxisModule module) throws AxisFault {
if (module == null || engagedModules == null)
return;
// String id = Utils.getModuleName(module.getName(),
// module.getVersion());
if (isEngaged(module)) {
onDisengage(module);
engagedModules.remove(Utils.getModuleName(module.getName(), module
.getVersion()));
}
}
|
public void engageModule(AxisModule axisModule) throws AxisFault {
engageModule(axisModule, this);
}
Engage a Module at this level |
public void engageModule(AxisModule axisModule,
AxisDescription source) throws AxisFault {
if (engagedModules == null) engagedModules = new ConcurrentHashMap< String, AxisModule >();
String moduleName = axisModule.getName();
for (Object o : engagedModules.values()) {
AxisModule tempAxisModule = ((AxisModule)o);
String tempModuleName = tempAxisModule.getName();
if (moduleName.equals(tempModuleName)) {
String existing = tempAxisModule.getVersion();
if (!Utils.checkVersion(axisModule.getVersion(), existing)) {
throw new AxisFault(Messages.getMessage("mismatchedModuleVersions",
getClass().getName(),
moduleName,
existing));
}
}
}
// Let the Module know it's being engaged. If it's not happy about it, it can throw.
Module module = axisModule.getModule();
if (module != null) {
module.engageNotify(this);
}
// If we have anything specific to do, let that happen
onEngage(axisModule, source);
engagedModules.put(Utils.getModuleName(axisModule.getName(), axisModule.getVersion()),
axisModule);
}
Engage a Module at this level, keeping track of which level the engage was originally called
from. This is meant for internal use only. |
public AxisConfiguration getAxisConfiguration() {
if (this instanceof AxisConfiguration) {
return (AxisConfiguration)this;
}
if (this.parent != null) {
return this.parent.getAxisConfiguration();
}
return null;
}
|
public AxisDescription getChild(Object key) {
if (key == null) {
// FIXME: Why are folks sending in null?
return null;
}
return (AxisDescription)children.get(key);
}
|
public Iterator getChildren() {
return children.values().iterator();
}
|
public String getDocumentation() {
if (documentation != null) {
if (documentation.getType() == OMNode.TEXT_NODE) {
return ((OMText)documentation).getText();
} else {
StringWriter writer = new StringWriter();
documentation.build();
try {
documentation.serialize(writer);
} catch (XMLStreamException e) {
log.error(e);
}
writer.flush();
return writer.toString();
}
}
return null;
}
|
public OMNode getDocumentationNode() {
return documentation;
}
|
public Collection getEngagedModules() {
return engagedModules == null ? NULL_MODULES : engagedModules.values();
}
|
abstract public Object getKey()
|
public Parameter getParameter(String name) {
Parameter parameter = parameterInclude.getParameter(name);
if (parameter != null) {
parameter.setEditable(true);
return parameter;
}
if (parent != null) {
parameter = parent.getParameter(name);
if (parameter != null) {
parameter.setEditable(false);
}
return parameter;
}
return null;
}
If the parameter is found in the current description then the Parameter will be writable else
it will be read only |
public Object getParameterValue(String name) {
Parameter param = getParameter(name);
if (param == null) {
return null;
}
return param.getValue();
}
|
public ArrayList getParameters() {
return parameterInclude.getParameters();
}
|
public AxisDescription getParent() {
return parent;
}
|
public PolicyInclude getPolicyInclude() {
if (policyInclude == null) {
policyInclude = new PolicyInclude(this);
}
return policyInclude;
} Deprecated! As - of release 1.4, replaced by #getPolicySubject()
|
public PolicySubject getPolicySubject() {
return policySubject;
}
|
public boolean isEngaged(String moduleName) {
return engagedModules != null
&& engagedModules.keySet().contains(moduleName);
}
Check if a given module is engaged at this level. |
public boolean isEngaged(AxisModule axisModule) {
String id = Utils.getModuleName(axisModule.getName(), axisModule
.getVersion());
return engagedModules != null && engagedModules.keySet().contains(id);
}
|
public boolean isParameterLocked(String parameterName) {
if (this.parent != null && this.parent.isParameterLocked(parameterName)) {
return true;
}
Parameter parameter = getParameter(parameterName);
return parameter != null && parameter.isLocked();
}
|
public boolean isParameterTrue(String name) {
Parameter param = getParameter(name);
return param != null && JavaUtils.isTrue(param.getValue());
}
|
protected void onDisengage(AxisModule module) throws AxisFault {
// Base version does nothing
}
|
protected void onEngage(AxisModule module,
AxisDescription engager) throws AxisFault {
// Default version does nothing, feel free to override
}
|
public void removeChild(Object key) {
children.remove(key);
}
|
public void removeParameter(Parameter param) throws AxisFault {
parameterInclude.removeParameter(param);
}
|
public void removeParameterObserver(ParameterObserver observer) {
if (parameterObservers != null) {
parameterObservers.remove(observer);
}
}
|
public void setDocumentation(OMNode documentation) {
this.documentation = documentation;
}
|
public void setDocumentation(String documentation) {
if (!"".equals(documentation)) {
this.documentation = omFactory.createOMText(documentation);
}
}
|
public void setParent(AxisDescription parent) {
this.parent = parent;
}
|
public void setPolicyInclude(PolicyInclude policyInclude) {
this.policyInclude = policyInclude;
} Deprecated! As - of release 1.4, if you want to access the policy cache of a particular
AxisDescription object use #getPolicySubject() instead.
|