FileDocCategorySizeDatePackage
BeanVendorAdapter.javaAPI DocApache Axis 1.43347Sat Apr 22 18:57:28 BST 2006None

BeanVendorAdapter

public abstract class BeanVendorAdapter extends JMSVendorAdapter
Uses ClassUtils.forName and reflection to configure ConnectionFactory. Uses the input sessions to create destinations.
author
Jaime Meritt (jmeritt@sonicsoftware.com)

Fields Summary
protected static final String
CONNECTION_FACTORY_CLASS
Constructors Summary
Methods Summary
private voidcallSetters(java.util.HashMap cfConfig, java.lang.Class factoryClass, javax.jms.ConnectionFactory factory)

        BeanPropertyDescriptor[] bpd = BeanUtils.getPd(factoryClass);
        for(int i = 0; i < bpd.length; i++)
        {
            BeanPropertyDescriptor thisBPD = bpd[i];
            String propName = thisBPD.getName();
            if(cfConfig.containsKey(propName))
            {
                Object value = cfConfig.get(propName);
                if(value == null)
                    continue;

                String validType = thisBPD.getType().getName();
                if(!value.getClass().getName().equals(validType))
                    throw new IllegalArgumentException("badType");
                if(!thisBPD.isWriteable())
                    throw new IllegalArgumentException("notWriteable");
                if(thisBPD.isIndexed())
                    throw new IllegalArgumentException("noIndexedSupport");
                thisBPD.set(factory, value);
            }
        }
    
private javax.jms.ConnectionFactorygetConnectionFactory(java.util.HashMap cfConfig)

        String classname = (String)cfConfig.get(CONNECTION_FACTORY_CLASS);
        if(classname == null || classname.trim().length() == 0)
            throw new IllegalArgumentException("noCFClass");

        Class factoryClass = ClassUtils.forName(classname);
        ConnectionFactory factory = (ConnectionFactory)factoryClass.newInstance();
        callSetters(cfConfig, factoryClass, factory);
        return factory;
    
public javax.jms.QueueConnectionFactorygetQueueConnectionFactory(java.util.HashMap cfConfig)


       
         
    
        return (QueueConnectionFactory)getConnectionFactory(cfConfig);
    
public javax.jms.TopicConnectionFactorygetTopicConnectionFactory(java.util.HashMap cfConfig)

        return (TopicConnectionFactory)getConnectionFactory(cfConfig);