/** * Create a Destination * @param type * @param pyhsicalName * @return */ public static ActiveMQDestination CreateDestination(int type, String pyhsicalName) { ActiveMQDestination result = null; if (pyhsicalName == null) { return(null); } else if (type == ACTIVEMQ_TOPIC) { result = new ActiveMQTopic(pyhsicalName); } else if (type == ACTIVEMQ_TEMPORARY_TOPIC) { result = new ActiveMQTempTopic(pyhsicalName); } else if (type == ACTIVEMQ_QUEUE) { result = new ActiveMQQueue(pyhsicalName); } else { result = new ActiveMQTempQueue(pyhsicalName); } return(result); }
/** * @param destination */ public static ActiveMQDestination Transform(IDestination destination) { ActiveMQDestination result = null; if (destination != null) { if (destination is ActiveMQDestination) { result = (ActiveMQDestination)destination; } else { if (destination is ITemporaryQueue) { result = new ActiveMQTempQueue(((IQueue)destination).QueueName); } else if (destination is ITemporaryTopic) { result = new ActiveMQTempTopic(((ITopic)destination).TopicName); } else if (destination is IQueue) { result = new ActiveMQQueue(((IQueue)destination).QueueName); } else if (destination is ITopic) { result = new ActiveMQTopic(((ITopic)destination).TopicName); } } } return(result); }
/// <summary> /// Create a Destination /// </summary> /// <param name="type"></param> /// <param name="pyhsicalName"></param> /// <returns></returns> public static ActiveMQDestination CreateDestination(int type, String pyhsicalName) { ActiveMQDestination result = null; if (pyhsicalName == null) { return(null); } else { switch (type) { case ACTIVEMQ_TOPIC: result = new ActiveMQTopic(pyhsicalName); break; case ACTIVEMQ_TEMPORARY_TOPIC: result = new ActiveMQTempTopic(pyhsicalName); break; case ACTIVEMQ_QUEUE: result = new ActiveMQQueue(pyhsicalName); break; default: result = new ActiveMQTempQueue(pyhsicalName); break; } } return(result); }
public override Object Clone() { // Since we are a derived class use the base's Clone() // to perform the shallow copy. Since it is shallow it // will include our derived class. Since we are derived, // this method is an override. ActiveMQTempQueue o = (ActiveMQTempQueue)base.Clone(); // Now do the deep work required // If any new variables are added then this routine will // likely need updating return(o); }
public ActiveMQTempDestination CreateTemporaryDestination(bool topic) { ActiveMQTempDestination destination = null; if(topic) { destination = new ActiveMQTempTopic( info.ConnectionId.Value + ":" + Interlocked.Increment(ref temporaryDestinationCounter)); } else { destination = new ActiveMQTempQueue( info.ConnectionId.Value + ":" + Interlocked.Increment(ref temporaryDestinationCounter)); } DestinationInfo command = new DestinationInfo(); command.ConnectionId = ConnectionId; command.OperationType = DestinationInfo.ADD_OPERATION_TYPE; // 0 is add command.Destination = destination; this.SyncRequest(command); destination.Connection = this; return destination; }
/// <summary> /// Create a Destination /// </summary> /// <param name="type"></param> /// <param name="pyhsicalName"></param> /// <returns></returns> public static ActiveMQDestination CreateDestination(int type, String pyhsicalName) { ActiveMQDestination result = null; if(pyhsicalName == null) { return null; } else switch(type) { case ACTIVEMQ_TOPIC: result = new ActiveMQTopic(pyhsicalName); break; case ACTIVEMQ_TEMPORARY_TOPIC: result = new ActiveMQTempTopic(pyhsicalName); break; case ACTIVEMQ_QUEUE: result = new ActiveMQQueue(pyhsicalName); break; default: result = new ActiveMQTempQueue(pyhsicalName); break; } return result; }
/// <summary> /// </summary> /// <param name="destination"></param> /// <returns></returns> public static ActiveMQDestination Transform(IDestination destination) { ActiveMQDestination result = null; if(destination != null) { if(destination is ActiveMQDestination) { result = (ActiveMQDestination) destination; } else { if(destination is ITemporaryQueue) { result = new ActiveMQTempQueue(((IQueue) destination).QueueName); } else if(destination is ITemporaryTopic) { result = new ActiveMQTempTopic(((ITopic) destination).TopicName); } else if(destination is IQueue) { result = new ActiveMQQueue(((IQueue) destination).QueueName); } else if(destination is ITopic) { result = new ActiveMQTopic(((ITopic) destination).TopicName); } } } return result; }