Guest User

Untitled

a guest
Jul 16th, 2018
73
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.40 KB | None | 0 0
  1. public interface DoorService
  2. {
  3. void open(Door door) throws DoorLockedException, DoorAlreadyOpenedException;
  4.  
  5. void close(Door door) throws DoorAlreadyClosedException;
  6.  
  7. /**
  8. * Closes the door if open
  9. */
  10. void lock(Door door) throws DoorAlreadyLockedException;
  11. }
  12.  
  13. try
  14. {
  15. doorService.lock(myDoor);
  16. }
  17. catch(DoorLockedException ex) // door ALREADY locked
  18. {
  19. //error handling...
  20. }
Add Comment
Please, Sign In to add comment