Methods Summary |
---|
java.lang.Object | createInstance(java.lang.Class _class)
return _class.newInstance();
|
public final org.apache.axis.Handler | getInstance(org.apache.axis.EngineConfiguration registry)
if (scope == SCOPE_SINGLETON) {
synchronized (this) {
if (singletonInstance == null)
singletonInstance = getNewInstance(registry);
}
return singletonInstance;
}
return getNewInstance(registry);
|
public java.lang.Class | getJavaClass()
QName type = getType();
if (type != null &&
URI_WSDD_JAVA.equals(type.getNamespaceURI())) {
return ClassUtils.forName(type.getLocalPart());
}
return null;
|
private org.apache.axis.Handler | getNewInstance(org.apache.axis.EngineConfiguration registry)
QName type = getType();
if (type == null ||
WSDDConstants.URI_WSDD_JAVA.equals(type.getNamespaceURI())) {
return makeNewInstance(registry);
} else {
return registry.getHandler(type);
}
|
public java.lang.String | getParameter(java.lang.String name)Get the value of one of our parameters
if (name == null || parameters == null) {
return null;
}
return (String)parameters.get(name);
|
public org.apache.axis.utils.LockableHashtable | getParametersTable()Returns the config parameters as a hashtable (lockable)
return parameters;
|
public javax.xml.namespace.QName | getQName()
return qname;
|
public javax.xml.namespace.QName | getType()
return type;
|
protected org.apache.axis.Handler | makeNewInstance(org.apache.axis.EngineConfiguration registry)Creates a new instance of this deployable. if the
java class is not found, the registry is queried to
find a suitable item
Class c = null;
Handler h = null;
try {
c = getJavaClass();
} catch (ClassNotFoundException e) {
throw new ConfigurationException(e);
}
if (c != null) {
try {
h = (Handler)createInstance(c);
} catch (Exception e) {
throw new ConfigurationException(e);
}
if (h != null) {
if ( qname != null )
h.setName(qname.getLocalPart());
h.setOptions(getParametersTable());
try{
h.init();
}catch(Exception e){
String msg=e + JavaUtils.LS + JavaUtils.stackToString(e);
log.debug(msg);
throw new ConfigurationException(e);
}catch(Error e){
String msg=e + JavaUtils.LS + JavaUtils.stackToString(e);
log.debug(msg);
throw new ConfigurationException(msg);
}
}
} else {
// !!! Should never get here!
h = registry.getHandler(getType());
}
return h;
|
public void | removeParameter(java.lang.String name)
if (parameters != null) {
parameters.remove(name);
}
|
public void | setName(java.lang.String name)
qname = new QName(null, name);
|
public void | setOptionsHashtable(java.util.Hashtable hashtable)Convenience method for using old deployment XML with WSDD.
This allows us to set the options directly after the Admin class
has parsed them out of the old format.
if (hashtable == null)
return;
parameters = new LockableHashtable(hashtable);
|
public void | setParameter(java.lang.String name, java.lang.String value)Set a parameter
if (parameters == null) {
parameters = new LockableHashtable();
}
parameters.put(name, value);
|
public void | setQName(javax.xml.namespace.QName qname)
this.qname = qname;
|
public void | setType(javax.xml.namespace.QName type)
this.type = type;
|
public void | writeParamsToContext(org.apache.axis.encoding.SerializationContext context)
if (parameters == null)
return;
Set entries = parameters.entrySet();
Iterator i = entries.iterator();
while (i.hasNext()) {
Map.Entry entry = (Map.Entry) i.next();
String name = (String) entry.getKey();
AttributesImpl attrs = new AttributesImpl();
attrs.addAttribute("", ATTR_NAME, ATTR_NAME, "CDATA", name);
attrs.addAttribute("", ATTR_VALUE, ATTR_VALUE, "CDATA",
entry.getValue().toString());
if (parameters.isKeyLocked(name)) {
attrs.addAttribute("", ATTR_LOCKED, ATTR_LOCKED, "CDATA", "true");
}
context.startElement(QNAME_PARAM, attrs);
context.endElement();
}
|