FileDocCategorySizeDatePackage
TesterBean.javaAPI DocJBoss 4.2.13028Fri Jul 13 20:54:48 BST 2007org.jboss.tutorial.consumer_deployment_descriptor.bean

TesterBean

public class TesterBean extends Object implements Tester
Show injecting in producers Show how to interact with local producers
author
Bill Burke
version
$Revision: 60233 $

Fields Summary
private ExampleProducerXA
xa
private org.jboss.ejb3.mdb.ProducerManager
xaManager
private ExampleProducer
local
private org.jboss.ejb3.mdb.ProducerManager
localManager
Constructors Summary
Methods Summary
public voidsetLocal(ExampleProducer local)

      this.local = local;
      this.localManager = ((ProducerObject)local).getProducerManager();
   
public voidsetXa(ExampleProducerXA xa)

      this.xa = xa;
      this.xaManager = ((ProducerObject)xa).getProducerManager();
   
public voidtestLocal()


      localManager.connect();
      local.method1("testLocal", 1);
      Map<String, String> map = new HashMap<String, String>();
      map.put("hello", "world");
      map.put("great", "ejb3");
      local.method2("testLocal2", map);
      localManager.close();
   
public voidtestXA()


      xaManager.connect();
      xa.method1("testXA", 1);
      Map<String, String> map = new HashMap<String, String>();
      map.put("hello", "world");
      map.put("great", "ejb3");
      xa.method2("testXA2", map);
      System.out.println("end TESTXA **");
      xaManager.close();