?? destinationimpl.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();
}
/////////////////////////////////////////
/**
* 獲取目標(biāo)的名稱
*/
public String getName()
{
return this.DestName;
}
/**
* 獲取目標(biāo)的類型
* @return
*/
public int getType()
{
return this.DestType;
}
/**
* 刪除臨時目標(biāo)
*/
private void deleteTempDestination()
{
//TODO kk
}
}
?? 快捷鍵說明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -