Methods Summary |
---|
public void | addNewHandler(java.lang.String className, java.util.Map config)
try {
HandlerInfo handlerInfo =
new HandlerInfo(ClassUtils.forName(className), config, null);
handlerInfos.add(handlerInfo);
add(newHandler(handlerInfo));
} catch (Exception ex) {
String messageText =
Messages.getMessage("NoJAXRPCHandler00", className);
throw new JAXRPCException(messageText, ex);
}
|
public void | destroy()
int endIdx = size() - 1;
if (falseIndex != -1) {
endIdx = falseIndex;
}
for (int i = endIdx; i >= 0; i--) {
getHandlerInstance(i).destroy();
}
falseIndex = -1;
clear();
|
private javax.xml.rpc.handler.HandlerInfo | getHandlerInfo(int index)
return (HandlerInfo)handlerInfos.get(index);
|
private javax.xml.rpc.handler.Handler | getHandlerInstance(int index)
return (Handler)get(index);
|
public java.util.ArrayList | getMessageInfo(javax.xml.soap.SOAPMessage message)
ArrayList list = new ArrayList();
try {
if(message == null || message.getSOAPPart() == null)
return list;
SOAPEnvelope env = message.getSOAPPart().getEnvelope();
SOAPBody body = env.getBody();
Iterator it = body.getChildElements();
SOAPElement operation = (SOAPElement)it.next();
list.add(operation.getElementName().toString());
for (Iterator i = operation.getChildElements(); i.hasNext();) {
SOAPElement elt = (SOAPElement)i.next();
list.add(elt.getElementName().toString());
}
} catch (Exception e) {
log.debug("Exception in getMessageInfo : ", e);
}
return list;
|
public java.lang.String[] | getRoles()
return _roles;
|
public boolean | handleFault(javax.xml.rpc.handler.MessageContext _context)
SOAPMessageContext context = (SOAPMessageContext)_context;
preInvoke(context);
try {
int endIdx = size() - 1;
if (falseIndex != -1) {
endIdx = falseIndex;
}
for (int i = endIdx; i >= 0; i--) {
if (getHandlerInstance(i).handleFault(context) == false) {
return false;
}
}
return true;
} finally {
postInvoke(context);
}
|
public boolean | handleRequest(javax.xml.rpc.handler.MessageContext _context)
org.apache.axis.MessageContext actx =
(org.apache.axis.MessageContext)_context;
actx.setRoles(getRoles());
SOAPMessageContext context = (SOAPMessageContext)_context;
preInvoke(context);
try {
for (int i = 0; i < size(); i++) {
Handler currentHandler = getHandlerInstance(i);
try {
if (currentHandler.handleRequest(context) == false) {
falseIndex = i;
return false;
}
} catch (SOAPFaultException sfe) {
falseIndex = i;
throw sfe;
}
}
return true;
} finally {
postInvoke(context);
}
|
public boolean | handleResponse(javax.xml.rpc.handler.MessageContext context)
SOAPMessageContext scontext = (SOAPMessageContext)context;
preInvoke(scontext);
try {
int endIdx = size() - 1;
if (falseIndex != -1) {
endIdx = falseIndex;
}
for (int i = endIdx; i >= 0; i--) {
if (getHandlerInstance(i).handleResponse(context) == false) {
return false;
}
}
return true;
} finally {
postInvoke(scontext);
}
|
public void | init(java.util.Map map)
// DO SOMETHING WITH THIS
|
private javax.xml.rpc.handler.Handler | newHandler(javax.xml.rpc.handler.HandlerInfo handlerInfo)
try {
Handler handler = (Handler)handlerInfo.getHandlerClass()
.newInstance();
handler.init(handlerInfo);
return handler;
} catch (Exception ex) {
String messageText =
Messages.getMessage("NoJAXRPCHandler00",
handlerInfo.getHandlerClass().toString());
throw new JAXRPCException(messageText, ex);
}
|
private void | postInvoke(javax.xml.rpc.handler.soap.SOAPMessageContext msgContext)
Boolean propFormOptimization = (Boolean)msgContext.getProperty(org.apache.axis.SOAPPart.ALLOW_FORM_OPTIMIZATION);
if (propFormOptimization != null && !propFormOptimization.booleanValue()) {
msgContext.setProperty(org.apache.axis.SOAPPart.ALLOW_FORM_OPTIMIZATION,
Boolean.TRUE);
SOAPMessage message = msgContext.getMessage();
ArrayList oldList =
(ArrayList)msgContext.getProperty(JAXRPC_METHOD_INFO);
if (oldList != null) {
if (!Arrays.equals(oldList.toArray(), getMessageInfo(message)
.toArray())) {
throw new RuntimeException(Messages.getMessage("invocationArgumentsModified00"));
}
}
try {
if (message != null) {
message.saveChanges();
}
} catch (SOAPException e) {
log.debug("Exception in postInvoke : ", e);
throw new RuntimeException("Exception in postInvoke : " + e.toString());
}
}
|
private void | preInvoke(javax.xml.rpc.handler.soap.SOAPMessageContext msgContext)
try {
SOAPMessage message = msgContext.getMessage();
// Ensure that message is already in the form we want
if(message != null && message.getSOAPPart() != null)
message.getSOAPPart().getEnvelope();
msgContext.setProperty(org.apache.axis.SOAPPart.ALLOW_FORM_OPTIMIZATION,
Boolean.FALSE);
msgContext.setProperty(JAXRPC_METHOD_INFO, getMessageInfo(message));
} catch (Exception e) {
log.debug("Exception in preInvoke : ", e);
throw new RuntimeException("Exception in preInvoke : " + e.toString());
}
|
public void | setRoles(java.lang.String[] roles)
if (roles != null) {
// use clone for cheap array copy
_roles = (String[])roles.clone();
}
|