You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-dev@axis.apache.org by Jim Stafford <jc...@apl.jhu.edu> on 2004/01/28 05:45:44 UTC

SimpleJMSListener not using Connector props for Subscription

I am havimg problems getting my selector registered for my 
SimpleJMSListener. The problem appears to be in the fact that the 
start() method does not pass in the HashMap connector properties, with 
the selector, to the endpoint.registerListener() call. It uses the 
version of the call that accepts no additional properties.

    public void start()
        throws Exception
    {
        endpoint.registerListener(this);
        connector.start();
    }

The version of endpoint.registerListener that accepts the HashMap passes 
these to the Subscription.
    protected Subscription createSubscription(MessageListener listener,
                                              HashMap properties)
    {
        return new Subscription(listener, this, properties);
    }

The Subscription extracts the selector from the properties.
    Subscription(MessageListener listener,
                 JMSEndpoint endpoint,
                 HashMap properties)
    {
        m_listener = listener;
        m_endpoint = endpoint;
        m_messageSelector = MapUtils.removeStringProperty(
                                            properties,
                                            JMSConstants.MESSAGE_SELECTOR,
                                            null);
        ...

I would override the SimpleJMSListener.start() method with a version 
that used the properties, but the endpoint and other variables are all 
declared private.

Do you agree that this should be changed? or should I just re-write the 
SimpleJMSListener as my own class and push the pedals the way I want to?