Spot the Signs. According to Alison Green, who writes the blog Ask a Manager, this is common practice for some industries, especially if you're leaving to work for a direct competitor. However, in those situations, you'll likely know it's coming and can prepare accordingly.
Otherwise, look to the history of your company. How have your boss and other managers handled employees' resignations? If you see a pattern of upper management refusing to let the team members work out their notice, you can likely expect the same.