FileDocCategorySizeDatePackage
JmsResourceAdapter.javaAPI DocJBoss 4.2.13671Fri Jul 13 21:01:16 BST 2007org.jboss.resource.adapter.jms

JmsResourceAdapter

public class JmsResourceAdapter extends Object implements javax.resource.spi.ResourceAdapter
A generic resource adapter for any JMS server.
author
Adrian Brock
version
$Revision: 57189 $

Fields Summary
private static final Logger
log
The logger
private javax.resource.spi.BootstrapContext
ctx
The bootstrap context
private EDU.oswego.cs.dl.util.concurrent.ConcurrentReaderHashMap
activations
The activations by activation spec
Constructors Summary
Methods Summary
public voidendpointActivation(javax.resource.spi.endpoint.MessageEndpointFactory endpointFactory, javax.resource.spi.ActivationSpec spec)

      JmsActivation activation = new JmsActivation(this, endpointFactory, (JmsActivationSpec) spec);
      activations.put(spec, activation);
      activation.start();
   
public voidendpointDeactivation(javax.resource.spi.endpoint.MessageEndpointFactory endpointFactory, javax.resource.spi.ActivationSpec spec)

      JmsActivation activation = (JmsActivation) activations.remove(spec);
      if (activation != null)
         activation.stop();
   
public javax.resource.spi.work.WorkManagergetWorkManager()
Get the work manager

return
the work manager

   
                
     
   
      return ctx.getWorkManager();
   
public javax.transaction.xa.XAResource[]getXAResources(javax.resource.spi.ActivationSpec[] specs)

      // TODO getXAResources
      return null;
   
public voidstart(javax.resource.spi.BootstrapContext ctx)

      this.ctx = ctx;
   
public voidstop()

      for (Iterator i = activations.entrySet().iterator(); i.hasNext();)
      {
         Map.Entry entry = (Map.Entry) i.next();
         try
         {
            JmsActivation activation = (JmsActivation) entry.getValue();
            if (activation != null)
               activation.stop();
         }
         catch (Exception ignored)
         {
            log.debug("Ignored", ignored);
         }
         i.remove();
      }