1 6 7 package javax.portlet; 8 9 14 15 public class UnavailableException extends PortletException 16 { 17 18 private boolean permanent; private int seconds; 21 22 32 33 public UnavailableException(String text) { 34 super(text); 35 36 permanent = true; 37 } 38 39 60 61 public UnavailableException(String text, int seconds) { 62 super(text); 63 64 if (seconds <= 0) 65 this.seconds = -1; 66 else 67 this.seconds = seconds; 68 69 permanent = false; 70 } 71 72 85 86 public boolean isPermanent() { 87 return permanent; 88 } 89 90 91 110 111 public int getUnavailableSeconds() { 112 return permanent ? -1 : seconds; 113 } 114 115 116 } 117 | Popular Tags |