/** * {@inheritDoc} */ @Override public synchronized List<RemoteCommand> handleCommands(List<RemoteCommand> commands) { try { if (commands != null) { for (RemoteCommand command : commands) { handleCommand(command); } } if (removedPeersGuids != null && removedPeersGuids.size() > 0) { RemoteCleanupCommand cleanupCommand = new RemoteCleanupCommand(); cleanupCommand.setRemovedPeerGuids(removedPeersGuids.toArray(new String[removedPeersGuids.size()])); registerCommand(cleanupCommand); removedPeersGuids.clear(); } } catch (Exception ex) { handleException(ex, getInitialActionContext()); } finally { IBackendController bc = getBackendController(); if (bc != null) { bc.cleanupRequestResources(); } } return resetCommandQueue(); }