RemoteProducerFactorypublic class RemoteProducerFactory extends ProducerFactory
Fields Summary |
---|
protected javax.jms.ConnectionFactory | factory |
Constructors Summary |
---|
public RemoteProducerFactory(ConsumerContainer container, Class producer, org.jboss.annotation.ejb.MessageProperties props, javax.jms.Destination dest, InitialContext ctx, Hashtable initialContextProperties)
super(container, producer, props, dest, ctx, initialContextProperties);
try
{
String factoryName = pImpl.connectionFactory();
if (factoryName.equals("")) factoryName = "ConnectionFactory";
factory = (ConnectionFactory) ctx.lookup(factoryName);
}
catch (Exception e)
{
throw new RuntimeException(e);
}
|
Methods Summary |
---|
public java.lang.Object | createProxy()
Class[] interfaces = {producer, ProducerObject.class};
ProducerManagerImpl mImpl = null;
mImpl = new ProducerManagerImpl(pImpl, dest, factory, 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 void | setContainer(org.jboss.ejb3.Container container)
| public void | start()
super.start();
Class[] interfaces = {ProxyFactory.class};
Object factoryProxy = Remoting.createPojiProxy(jndiName + PROXY_FACTORY_NAME, interfaces, RemoteProxyFactory.DEFAULT_CLIENT_BINDING);
try
{
Util.rebind(ctx, jndiName + PROXY_FACTORY_NAME, factoryProxy);
} catch (NamingException e)
{
NamingException namingException = new NamingException("Could not bind remote producer factory into JNDI under jndiName: " + ctx.getNameInNamespace() + "/" + jndiName + PROXY_FACTORY_NAME);
namingException.setRootCause(e);
throw namingException;
}
Dispatcher.singleton.registerTarget(jndiName + PROXY_FACTORY_NAME, this);
| public void | stop()
super.stop();
Util.unbind(ctx, jndiName + PROXY_FACTORY_NAME);
Dispatcher.singleton.unregisterTarget(jndiName + PROXY_FACTORY_NAME);
|
|