protected abstract void doTerminate() throws IOException;
protected String serialize(Serializable message) throws NotSerializableException, UnsupportedEncodingException {
try {
if (clientOracle == null) {
ServerSerializationStreamWriter streamWriter = new ServerSerializationStreamWriter(serializationPolicy);
streamWriter.prepareToWrite();
streamWriter.writeObject(message);
return streamWriter.toString();
}
else {
ByteArrayOutputStream result = new ByteArrayOutputStream();
RPC.streamResponseForSuccess(clientOracle, result, message);
return new String(result.toByteArray(), "UTF-8");