⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 destinationimpl.java

📁 Java实现的Socket框架
💻 JAVA
字号:
/**
 * Project:ms4j
 * Date:2007-2-15 
 *
 * This is free software; you can redistribute it and/or modify it
 * under the terms of the GNU Lesser General Public License as
 * published by the Free Software Foundation; either version 2.1 of
 * the License, or (at your option) any later version.
 *
 * This software is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
 * Lesser General Public License for more details.
 *
 */
package com.sunjob.ms4j.client;

import java.io.Serializable;

import javax.jms.Destination;
import javax.jms.JMSException;
import javax.jms.Queue;
import javax.jms.TemporaryQueue;
import javax.jms.TemporaryTopic;
import javax.jms.Topic;

/**
 * @author sunjob
 *
 */
public class DestinationImpl implements 
       Destination, Queue, Topic, 
       TemporaryTopic, TemporaryQueue, 
       Serializable {

	private final static long serialVersionUID = 2810634789345348111L;
	
	public static int GENERATE_DESTINATION = 0;
	public static int QUEUE_DESTINATION = 1;
	public static int TOPIC_DESTINATION = 2;
	public static int TEMP_QUEUE = -1;
	public static int TEMP_TOPIC = -2;
	/////////////////////////////////////////////////////////
	private int DestType = 0;
	private String DestName = "";
	
	public DestinationImpl(String name, int DestinationType)
	{
		this.DestName = name;
		this.DestType = DestinationType;
	}
	/* (non-Javadoc)
	 * @see javax.jms.Queue#getQueueName()
	 */
	public String getQueueName() throws JMSException {
		return this.DestName;
	}

	/* (non-Javadoc)
	 * @see javax.jms.Topic#getTopicName()
	 */
	public String getTopicName() throws JMSException {
		return this.DestName;
	}
	
	/* (non-Javadoc)
	 * @see javax.jms.TemporaryTopic#delete() 
	 *      javax.jms.TemporaryQueue#delete()
	 */
	public void delete() throws JMSException {
		if(this.DestType >= 0)
		{
			throw new JMSException("Only support by TemporatyTopic and TemporatyQueue");
		}
		this.deleteTempDestination();
	}
    /////////////////////////////////////////
	/**
	 * 获取目标的名称
	 */
	public String getName()
	{
		return this.DestName;
	}
	/**
	 * 获取目标的类型
	 * @return
	 */
	public int getType()
	{
		return this.DestType;
	}
	/**
	 * 删除临时目标
	 */
	private void deleteTempDestination()
	{
		//TODO kk
	}
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -