1 23 24 package com.sun.enterprise.admin.common; 25 26 import java.io.Serializable ; 27 28 import com.sun.enterprise.admin.common.Param; 29 import com.sun.enterprise.admin.common.AdminResponse; 30 import com.sun.enterprise.admin.common.constant.AdminConstants; 31 32 34 public class AdminResponseConfigurator 35 { 36 private final AdminResponse response; 37 38 41 public AdminResponseConfigurator(AdminResponse response) 42 { 43 this.response = response; 45 } 46 47 49 public void setException(Throwable t) 50 { 51 response.addParam(new Param(AdminConstants.EXCEPTION, t)); 53 } 54 55 public boolean hasException() 56 { 57 Param param = response.getParam(AdminConstants.EXCEPTION); 58 if (param != null) 59 { 60 return (param.mValue != null); 61 } 62 return false; 63 } 64 65 public Throwable getException() 66 { 67 Throwable t = null; 68 if (hasException()) 69 { 70 Param param = response.getParam(AdminConstants.EXCEPTION); 71 t = (Throwable )param.mValue; 72 } 73 return t; 74 } 75 76 public void setReturnValue(Serializable value) 77 { 78 response.addParam(new Param(AdminConstants.RETURN_VALUE, value)); 79 } 80 81 public Object getReturnValue() 82 { 83 Object returnValue = null; 84 Param param = response.getParam(AdminConstants.RETURN_VALUE); 85 if (param != null) 86 { 87 returnValue = (Object )param.mValue; 88 } 89 return returnValue; 90 } 91 } | Popular Tags |