1 25 package org.objectweb.easybeans.tests.common.ejbs.stateless.containermanaged.simpleentry; 26 27 import static org.objectweb.easybeans.tests.common.helper.ContextHelper.checkSimpleEntry; 28 29 import javax.annotation.Resource; 30 import javax.ejb.Remote ; 31 import javax.ejb.SessionContext ; 32 import javax.ejb.Stateless ; 33 34 import org.objectweb.easybeans.tests.common.ejbs.base.ItfSimpleEnvEntry; 35 36 41 @Stateless (name="SLSBSimpleEnvEntryFieldInjection00") 42 @Remote ({ItfSimpleEnvEntry.class}) 43 public class SLSBSimpleEnvEntryFieldInjection00 implements ItfSimpleEnvEntry{ 44 45 48 @Resource 49 private SessionContext sessionContext; 50 51 54 @Resource(name = "str00") 55 private String strInjection; 56 57 60 @Resource(name = "strWithDefaultValue") 61 private String strWithDefaultValue = ENTRY_STRING; 62 63 66 @Resource(name = "chr00") 67 private char chrInjection; 68 69 72 @Resource(name = "int00") 73 private int intInjection; 74 75 78 @Resource(name = "bol00") 79 private boolean bolInjection; 80 81 84 @Resource(name = "dbl00") 85 private double dblInjection; 86 87 90 @Resource(name = "bte00") 91 private byte bteInjection; 92 93 96 @Resource(name = "shr00") 97 private short shrInjection; 98 99 102 @Resource(name = "lng00") 103 private long lngInjection; 104 105 108 @Resource 109 private float fltInjection; 110 111 118 public void checkString00() { 119 checkSimpleEntry(sessionContext, "str00", strInjection, ENTRY_STRING); 120 121 if (!ENTRY_STRING.equals(strWithDefaultValue)) { 122 throw new IllegalStateException ("There is not a default value declared in the deployment descriptor, " 123 + "so the container should not override the value specified in the variable declaration."); 124 } 125 } 126 127 130 @SuppressWarnings ("boxing") 131 public void checkCharacter00() { 132 checkSimpleEntry(sessionContext, "chr00", chrInjection, ENTRY_CHARACTER); 133 } 134 135 138 @SuppressWarnings ("boxing") 139 public void checkInteger00() { 140 checkSimpleEntry(sessionContext, "int00", intInjection, ENTRY_INTEGER); 141 } 142 143 146 @SuppressWarnings ("boxing") 147 public void checkBoolean00() { 148 checkSimpleEntry(sessionContext, "bol00", bolInjection, ENTRY_BOOLEAN); 149 } 150 151 154 @SuppressWarnings ("boxing") 155 public void checkDouble00() { 156 checkSimpleEntry(sessionContext, "dbl00", dblInjection, ENTRY_DOUBLE); 157 } 158 159 162 @SuppressWarnings ("boxing") 163 public void checkByte00() { 164 checkSimpleEntry(sessionContext, "bte00", bteInjection, ENTRY_BYTE); 165 166 } 167 168 171 @SuppressWarnings ("boxing") 172 public void checkShort00() { 173 checkSimpleEntry(sessionContext, "shr00", shrInjection, ENTRY_SHORT); 174 } 175 176 179 @SuppressWarnings ("boxing") 180 public void checkLong00() { 181 checkSimpleEntry(sessionContext, "lng00", lngInjection, ENTRY_LONG); 182 } 183 184 187 @SuppressWarnings ("boxing") 188 public void checkFloat00() { 189 checkSimpleEntry(sessionContext, this.getClass().getName().toString()+"/"+ "fltInjection", fltInjection, ENTRY_FLOAT); 190 } 191 192 } 193 | Popular Tags |