X-Git-Url: http://git.argeo.org/?a=blobdiff_plain;f=server%2Fruntime%2Forg.argeo.server.core%2FJndiJmsBinder.txt;fp=server%2Fruntime%2Forg.argeo.server.core%2FJndiJmsBinder.txt;h=0000000000000000000000000000000000000000;hb=31dc5165b031f789381e6af8aa81f1a75661bd86;hp=3b08284f7907ac3fe292217ac84ee720ed9c029d;hpb=ecfe5aad6ecb3e05eeee1f700950c352fc4bfcd1;p=lgpl%2Fargeo-commons.git diff --git a/server/runtime/org.argeo.server.core/JndiJmsBinder.txt b/server/runtime/org.argeo.server.core/JndiJmsBinder.txt deleted file mode 100644 index 3b08284f7..000000000 --- a/server/runtime/org.argeo.server.core/JndiJmsBinder.txt +++ /dev/null @@ -1,62 +0,0 @@ -package com.hsbc.xfos.swapswire.jms; - -import java.util.Map; - -import javax.jms.ConnectionFactory; -import javax.jms.Destination; - -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; -import org.springframework.beans.factory.DisposableBean; -import org.springframework.beans.factory.InitializingBean; -import org.springframework.jndi.JndiTemplate; - -/** Register/unregister a JMS connection factory in JNDI. */ -public class JndiJmsBinder implements InitializingBean, DisposableBean { - private final static Log log = LogFactory.getLog(JndiJmsBinder.class); - - private ConnectionFactory jmsConnectionFactory; - private JndiTemplate jndiTemplate; - private String connectionFactoryName; - private Map destinations; - - public void afterPropertiesSet() { - try { - Thread.sleep(5000); - jndiTemplate.bind(connectionFactoryName, jmsConnectionFactory); - for (String key : destinations.keySet()) - jndiTemplate.bind(key, destinations.get(key)); - log.info("JMS object bound to JNDI"); - } catch (Exception e) { - throw new RuntimeException("Cannot bind JMS objects", e); - } - } - - public void destroy() { - try { - for (String key : destinations.keySet()) - jndiTemplate.unbind(key); - jndiTemplate.unbind(connectionFactoryName); - log.info("JMS object unbound to JNDI"); - } catch (Exception e) { - throw new RuntimeException("Cannot unbind JMS objects", e); - } - } - - public void setJmsConnectionFactory(ConnectionFactory jmsConnectionFactory) { - this.jmsConnectionFactory = jmsConnectionFactory; - } - - public void setJndiTemplate(JndiTemplate jndiTemplate) { - this.jndiTemplate = jndiTemplate; - } - - public void setConnectionFactoryName(String connectionFactoryName) { - this.connectionFactoryName = connectionFactoryName; - } - - public void setDestinations(Map destinations) { - this.destinations = destinations; - } - -}