/** * make deep copy of <code>ServerSync</code> instance. * * @param source is source for copping * @return deep copy of <code>ServerSync</code> instance */ public static ServerSync deepCopy(ServerSync source) { if (source == null) { return null; } ServerSync copy = new ServerSync(); copy.setRequestId(source.getRequestId()); copy.setStatus(source.getStatus()); copy.setUserSync(deepCopy(source.getUserSync())); copy.setRedirectSync(deepCopy(source.getRedirectSync())); copy.setProfileSync(deepCopy(source.getProfileSync())); copy.setNotificationSync(deepCopy(source.getNotificationSync())); copy.setLogSync(deepCopy(source.getLogSync())); copy.setEventSync(deepCopy(source.getEventSync())); copy.setConfigurationSync(deepCopy(source.getConfigurationSync())); return copy; }
private void sendReply(ActorContext context, SyncRequestMessage request, Exception ex, ServerSync syncResponse) { LOG.debug("[{}] response: {}", actorKey, syncResponse); ServerSync copy = ServerSync.deepCopy(syncResponse); ServerSync.cleanup(syncResponse); NettySessionResponseMessage response = new NettySessionResponseMessage( request.getSession(), copy, ex, request.getCommand().getMessageBuilder(), request.getCommand().getErrorBuilder()); tellActor(context, request.getOriginator(), response); scheduleActorTimeout(context); }