/** 
 * 
 * Copyright 2004 Protique Ltd
 * 
 * Licensed under the Apache License, Version 2.0 (the "License"); 
 * you may not use this file except in compliance with the License. 
 * You may obtain a copy of the License at 
 * 
 * http://www.apache.org/licenses/LICENSE-2.0
 * 
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS, 
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 
 * See the License for the specific language governing permissions and 
 * limitations under the License. 
 * 
 **/

package org.codehaus.activemq.service.boundedvm;


import javax.jms.JMSException;
import org.codehaus.activemq.filter.Filter;
import org.codehaus.activemq.message.ActiveMQMessage;
import org.codehaus.activemq.message.ConsumerInfo;

/**
 * A holder for Transient  consumer info and message routing
 * 
 * @version $Revision: 1.1 $
 */
public abstract class TransientSubscription  {
    protected Filter filter;
    protected ConsumerInfo consumerInfo;
    
    
    /**
     * Construct the TransientSubscription
     * @param filter
     * @param info
     */
    
    public TransientSubscription(Filter filter,ConsumerInfo info){
        this.filter = filter;
        this.consumerInfo = info;
    }

    
    /**
     * determines if the Subscription is interested in the message
     *
     * @param message
     * @return true if this Subscription will accept the message
     * @throws JMSException
     */
    public abstract boolean isTarget(ActiveMQMessage message) throws JMSException;
   
    /**
     * @return Returns the consumerInfo.
     */
    public ConsumerInfo getConsumerInfo() {
        return consumerInfo;
    }
    /**
     * @param consumerInfo The consumerInfo to set.
     */
    public void setConsumerInfo(ConsumerInfo consumerInfo) {
        this.consumerInfo = consumerInfo;
    }
    /**
     * @return Returns the filter.
     */
    public Filter getFilter() {
        return filter;
    }
    /**
     * @param filter The filter to set.
     */
    public void setFilter(Filter filter) {
        this.filter = filter;
    }
    
    /**
     * close the subscription
     */
    public void close(){
    }
}