Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public interface DoorService
- {
- void open(Door door) throws DoorLockedException, DoorAlreadyOpenedException;
- void close(Door door) throws DoorAlreadyClosedException;
- /**
- * Closes the door if open
- */
- void lock(Door door) throws DoorAlreadyLockedException;
- }
- try
- {
- doorService.lock(myDoor);
- }
- catch(DoorLockedException ex) // door ALREADY locked
- {
- //error handling...
- }
Add Comment
Please, Sign In to add comment