1 22 package org.jboss.test.jcaprops.support; 23 24 import javax.management.MBeanServer ; 25 import javax.resource.ResourceException ; 26 import javax.resource.spi.ActivationSpec ; 27 import javax.resource.spi.InvalidPropertyException ; 28 import javax.resource.spi.ResourceAdapter ; 29 import javax.resource.spi.ResourceAdapterInternalException ; 30 31 import org.jboss.logging.Logger; 32 import org.jboss.mx.util.MBeanServerLocator; 33 34 40 public class PropertyTestActivationSpec implements ActivationSpec , PropertyTestActivationSpecMBean 41 { 42 private static final Logger log = Logger.getLogger(PropertyTestActivationSpec.class); 43 44 private String stringAS; 45 private Boolean booleanAS; 46 private Byte byteAS; 47 private Character characterAS; 48 private Short shortAS; 49 private Integer integerAS; 50 private Long longAS; 51 private Float floatAS; 52 private Double doubleAS; 53 54 private PropertyTestResourceAdapter resourceAdapter; 55 56 public String getStringAS() 57 { 58 return stringAS; 59 } 60 61 public void setStringAS(String string) 62 { 63 this.stringAS = string; 64 } 65 66 public Boolean getBooleanAS() 67 { 68 return booleanAS; 69 } 70 71 public void setBooleanAS(Boolean booleanAS) 72 { 73 this.booleanAS = booleanAS; 74 } 75 76 public Byte getByteAS() 77 { 78 return byteAS; 79 } 80 81 public void setByteAS(Byte byteAS) 82 { 83 this.byteAS = byteAS; 84 } 85 86 public Character getCharacterAS() 87 { 88 return characterAS; 89 } 90 91 public void setCharacterAS(Character characterAS) 92 { 93 this.characterAS = characterAS; 94 } 95 96 public Double getDoubleAS() 97 { 98 return doubleAS; 99 } 100 101 public void setDoubleAS(Double doubleAS) 102 { 103 this.doubleAS = doubleAS; 104 } 105 106 public Float getFloatAS() 107 { 108 return floatAS; 109 } 110 111 public void setFloatAS(Float floatAS) 112 { 113 this.floatAS = floatAS; 114 } 115 116 public Integer getIntegerAS() 117 { 118 return integerAS; 119 } 120 121 public void setIntegerAS(Integer integerAS) 122 { 123 this.integerAS = integerAS; 124 } 125 126 public Long getLongAS() 127 { 128 return longAS; 129 } 130 131 public void setLongAS(Long longAS) 132 { 133 this.longAS = longAS; 134 } 135 136 public Short getShortAS() 137 { 138 return shortAS; 139 } 140 141 public void setShortAS(Short shortAS) 142 { 143 this.shortAS = shortAS; 144 } 145 146 public void validate() throws InvalidPropertyException 147 { 148 } 149 150 public ResourceAdapter getResourceAdapter() 151 { 152 return resourceAdapter; 153 } 154 155 public void setResourceAdapter(ResourceAdapter ra) throws ResourceException 156 { 157 this.resourceAdapter = (PropertyTestResourceAdapter) ra; 158 } 159 160 protected void registerMBean() throws ResourceAdapterInternalException 161 { 162 MBeanServer server = MBeanServerLocator.locateJBoss(); 163 try 164 { 165 server.registerMBean(this, NAME); 166 } 167 catch (Exception e) 168 { 169 throw new ResourceAdapterInternalException (e); 170 } 171 } 172 173 protected void unregisterMBean() 174 { 175 MBeanServer server = MBeanServerLocator.locateJBoss(); 176 try 177 { 178 server.unregisterMBean(NAME); 179 } 180 catch (Exception e) 181 { 182 log.warn("Unable to unregisterMBean", e); 183 } 184 } 185 } 186 | Popular Tags |