return new BasicClusterableRequestHandler();
}
public void processRequest(ObjectInputStream in, ObjectOutputStream out) {
JNDIResponse res = new JNDIResponse();
JNDIRequest req = null;
try {
req = new JNDIRequest();
req.readExternal(in);
} catch (Throwable e) {
res.setResponseCode(ResponseCodes.JNDI_NAMING_EXCEPTION);
NamingException namingException = new NamingException("Could not read jndi request");
namingException.setRootCause(e);
res.setResult(new ThrowableArtifact(namingException));
if (logger.isDebugEnabled()) {
try {
logger.debug("JNDI REQUEST: " + req + " -- RESPONSE: " + res);
} catch (Exception ignore) {
}
}
try {
res.writeExternal(out);
} catch (java.io.IOException ie) {
logger.fatal("Couldn't write JndiResponse to output stream", ie);
}
}
try {
if (req.getRequestString().startsWith("/")) {
req.setRequestString(req.getRequestString().substring(1));
}
String prefix = getPrefix(req);
switch (req.getRequestMethod()) {
case JNDI_LOOKUP:
doLookup(req, res, prefix);
break;
case JNDI_LIST:
doList(req, res, prefix);