String encodedPath = path.substring("/stub/".length());
byte[] decodedPath = Base64.decode(encodedPath);
ByteArrayInputStream bin = new ByteArrayInputStream(decodedPath);
ObjectInputStream ois = new ObjectInputStreamWithClassLoader(bin, defaultClassLoader);
try
{
Object obj = ois.readObject();
rmiServer = (RMIServer) PortableRemoteObject.narrow(obj, RMIServer.class);
}
catch(ClassNotFoundException e)
{
log.error("Could not find class " + e.getMessage() + " when loading stub.", e);
throw new MalformedURLException("Could not find class " + e.getMessage() + " when loading stub.");
}
catch(ClassCastException cce)
{
log.error("Could not convert stub to RMIServer type.", cce);
throw new MalformedURLException("Could not convert stub to RMIServer type.");
}
finally
{
if(ois != null)
{
ois.close();
}
}
}
else
{