else if ( operation instanceof UpdateAssociationOperation ) {
UpdateAssociationOperation update = (UpdateAssociationOperation) operation;
updateAssociation( update.getAssociation(), update.getAssociationKey(), update.getContext() );
}
else if ( operation instanceof RemoveAssociationOperation ) {
RemoveAssociationOperation remove = (RemoveAssociationOperation) operation;
removeAssociation( remove.getAssociationKey(), remove.getContext() );
}
else {
throw new UnsupportedOperationException( "Operation not supported on MongoDB: " + operation.getClass().getName() );
}
operation = queue.poll();