FileDocCategorySizeDatePackage
LocalProducerFactory.javaAPI DocJBoss 4.2.13154Fri Jul 13 20:53:56 BST 2007org.jboss.ejb3.mdb

LocalProducerFactory

public class LocalProducerFactory extends ProducerFactory
comment
author
Bill Burke

Fields Summary
protected String
factoryName
Constructors Summary
public LocalProducerFactory(ConsumerContainer container, Class producer, org.jboss.annotation.ejb.MessageProperties props, javax.jms.Destination dest, InitialContext ctx, Hashtable icProperties)

      super(container, producer, props, dest, ctx, icProperties);

      try
      {
         factoryName = pImpl.connectionFactory();
         if (factoryName.equals("")) factoryName = "java:/ConnectionFactory";
      }
      catch (Exception e)
      {
         throw new RuntimeException(e);
      }
   
Methods Summary
public java.lang.ObjectcreateProxy()

      Class[] interfaces = {producer, ProducerObject.class};

      ProducerManagerImpl mImpl = null;

      mImpl = new ProducerManagerImpl(pImpl, dest, factoryName, props.delivery(), props.timeToLive(), props.priority(), methodMap, initialContextProperties);

      Interceptor[] interceptors = {mImpl};
      ProducerProxy ih = new ProducerProxy(mImpl, interceptors);
      return java.lang.reflect.Proxy.newProxyInstance(producer.getClassLoader(), interfaces, ih);
   
public voidstart()

      super.start();
      try{
         NonSerializableFactory.rebind(ctx, jndiName + PROXY_FACTORY_NAME, this);
      } catch (NamingException e)
      {
         NamingException namingException = new NamingException("Could not bind local producer factory with name " + factoryName + " into JNDI under jndiName: " + ctx.getNameInNamespace() + "/" + jndiName + PROXY_FACTORY_NAME);
         namingException.setRootCause(e);
         throw namingException;
      }
   
public voidstop()

      super.stop();
      NonSerializableFactory.unbind(ctx, jndiName + PROXY_FACTORY_NAME);