1 17 18 package org.apache.geronimo.connector.mock; 19 20 import javax.resource.ResourceException ; 21 import javax.resource.spi.ActivationSpec ; 22 import javax.resource.spi.BootstrapContext ; 23 import javax.resource.spi.ResourceAdapter ; 24 import javax.resource.spi.ResourceAdapterInternalException ; 25 import javax.resource.spi.endpoint.MessageEndpointFactory ; 26 import javax.transaction.xa.XAResource ; 27 28 34 public class MockResourceAdapter implements ResourceAdapter { 35 36 37 private BootstrapContext bootstrapContext; 38 39 private String raStringProperty; 40 41 public void start(BootstrapContext bootstrapContext) throws ResourceAdapterInternalException { 42 assert this.bootstrapContext == null : "Attempting to restart adapter without stoppping"; 43 assert bootstrapContext != null: "Null bootstrap context"; 44 this.bootstrapContext = bootstrapContext; 45 } 46 47 public void stop() { 48 bootstrapContext = null; 49 } 50 51 public void endpointActivation(MessageEndpointFactory endpointFactory, ActivationSpec spec) throws ResourceException { 52 } 53 54 public void endpointDeactivation(MessageEndpointFactory endpointFactory, ActivationSpec spec) { 55 } 56 57 public XAResource [] getXAResources(ActivationSpec [] specs) throws ResourceException { 58 return new XAResource [0]; 59 } 60 61 public String getRAStringProperty() { 62 return raStringProperty; 63 } 64 65 public void setRAStringProperty(String raStringProperty) { 66 this.raStringProperty = raStringProperty; 67 } 68 69 } 70 | Popular Tags |