1 22 package org.jboss.test.jca.fs; 23 24 import javax.resource.spi.endpoint.MessageEndpointFactory ; 25 import javax.resource.spi.ActivationSpec ; 26 import javax.resource.spi.BootstrapContext ; 27 import javax.resource.spi.ResourceAdapterInternalException ; 28 import javax.resource.spi.ResourceAdapter ; 29 import javax.resource.spi.work.WorkManager ; 30 import javax.resource.ResourceException ; 31 import javax.transaction.xa.XAResource ; 32 33 import org.jboss.logging.Logger; 34 import EDU.oswego.cs.dl.util.concurrent.ConcurrentReaderHashMap; 35 36 41 public class FSDirContextAdaptor implements ResourceAdapter 42 { 43 private static final Logger log = Logger.getLogger(FSDirContextAdaptor.class); 44 45 private BootstrapContext ctx; 46 47 private ConcurrentReaderHashMap activations = new ConcurrentReaderHashMap(); 48 49 54 public WorkManager getWorkManager() 55 { 56 return ctx.getWorkManager(); 57 } 58 59 public void start(BootstrapContext ctx) 61 throws ResourceAdapterInternalException 62 { 63 log.debug("start"); 64 this.ctx = ctx; 65 WorkManager mgr = ctx.getWorkManager(); 66 } 67 68 public void stop() 69 { 70 log.debug("stop"); 71 } 72 73 public void endpointActivation(MessageEndpointFactory endpointFactory, 74 ActivationSpec spec) 75 throws ResourceException 76 { 77 log.debug("endpointActivation, spec="+spec); 78 FSActivationSpec fsSpec = (FSActivationSpec) spec; 79 FSActivation activation = new FSActivation(this, endpointFactory, 80 fsSpec); 81 activations.put(spec, activation); 82 } 83 84 public void endpointDeactivation(MessageEndpointFactory endpointFactory, 85 ActivationSpec spec) 86 { 87 log.debug("endpointDeactivation, spec="+spec); 88 FSActivation activation = (FSActivation) activations.remove(spec); 89 } 90 91 public XAResource [] getXAResources(ActivationSpec [] specs) throws ResourceException 92 { 93 return new XAResource [0]; 94 } 95 } 97 | Popular Tags |