1 10 package ersatz.resourceadapter; 11 12 import javax.resource.ResourceException; 13 import javax.resource.spi.ResourceAdapter; 14 import javax.resource.spi.ActivationSpec; 15 16 18 public class ActivationSpecImpl implements ActivationSpec, 19 java.io.Serializable 20 { 21 private transient ResourceAdapter ra = null; private boolean raLoaded; 23 private String messageObjectType; 24 String cName = "ActivationSpecImpl"; 25 ResourceAdapterImpl rai; 26 27 public ActivationSpecImpl() 28 { 29 Utility.log(cName+".constructor"); 30 } 31 public void validate() 32 throws javax.resource.spi.InvalidPropertyException 33 { 34 Utility.log(cName+".validate. eis="+rai.EIS_URL); 35 } 36 public ResourceAdapter getResourceAdapter() 37 { 38 return ra; 39 } 40 45 public void setResourceAdapter(ResourceAdapter ra) throws ResourceException 46 { 47 Utility.log(cName+".setResourceAdapter arg="+ra); 48 rai = (ResourceAdapterImpl)ra; 49 if (ra==null) { 50 String s = "Application Server cannot set ResourceAdapter to null"; 51 Utility.log(cName+".setResourceAdapter error: "+s); 52 throw new ResourceException(s); 53 } 54 if (this.ra==null) { 55 this.ra = ra; 56 } else if (this.ra != ra) { 57 String s = "ResourceAdapter already set to "+this.ra 58 +". Must not change association"; 59 Utility.log(cName+".setResourceAdapter error: "+s); 60 throw new ResourceException(s); 61 } 62 } 63 64 public void setFormat(String f) { 68 messageObjectType=f; } 70 public String getFormat() { 71 return messageObjectType; 72 } 73 } | Popular Tags |