return new Buffer(CoreGroupCommunicationService.this.objectToByteBufferResponseInternal(obj));
}
@Override
public Object objectFromBuffer(byte[] buf, int offset, int length) throws Exception {
Object retval = CoreGroupCommunicationService.this.objectFromByteBufferResponseInternal(new SimpleClassResolver(HAServiceResponse.class.getClassLoader()), buf, offset, length);
// HAServiceResponse is only received when a scoped classloader is required for unmarshalling
if (!(retval instanceof HAServiceResponse)) {
return retval;
}
String serviceName = ((HAServiceResponse) retval).getServiceName();
byte[] payload = ((HAServiceResponse) retval).getPayload();
ClassResolver resolver = CoreGroupCommunicationService.this.resolvers.get(serviceName);
if (resolver == null) {
resolver = new SimpleClassResolver(CoreGroupCommunicationService.class.getClassLoader());
}
return CoreGroupCommunicationService.this.objectFromByteBufferResponseInternal(resolver, payload, offset, length);
}