상속: BaseCommand
예제 #1
0
        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;
        }
예제 #2
0
        public void DeleteDestination(IDestination destination)
        {
            DestinationInfo command = new DestinationInfo();
            command.ConnectionId = this.ConnectionId;
            command.OperationType = DestinationInfo.REMOVE_OPERATION_TYPE; // 1 is remove
            command.Destination = (ActiveMQDestination) destination;

            this.Oneway(command);
        }
예제 #3
0
 public override Response processRemoveDestination(DestinationInfo info)
 {
     if(info != null)
     {
         ConnectionState cs = connectionStates[info.ConnectionId];
         if(cs != null && info.Destination.IsTemporary)
         {
             cs.removeTempDestination(info.Destination);
         }
     }
     return TRACKED_RESPONSE_MARKER;
 }
예제 #4
0
 public virtual Response processAddDestination(DestinationInfo info)
 {
     return null;
 }
예제 #5
0
        public override Response processRemoveDestination(DestinationInfo info)
        {
            if(info != null && info.Destination.IsTemporary)
            {
                ConnectionState cs;
				if(connectionStates.TryGetValue(info.ConnectionId, out cs))
				{
                    cs.removeTempDestination(info.Destination);
                }
            }
            return TRACKED_RESPONSE_MARKER;
        }
예제 #6
0
     private void ProcessDestinationInfo(DestinationInfo destInfo)
     {
         ActiveMQDestination dest = destInfo.Destination;
         if(!dest.IsTemporary)
         {
             return;
         }
 
         ActiveMQTempDestination tempDest = dest as ActiveMQTempDestination;
         if(destInfo.OperationType == DestinationInfo.ADD_OPERATION_TYPE)
         {
             if(Tracer.IsDebugEnabled)
             {
                 Tracer.Debug("AdvisoryConsumer adding: " + tempDest);
             }
             this.connection.AddTempDestination(tempDest);
         }
         else if(destInfo.OperationType == DestinationInfo.REMOVE_OPERATION_TYPE)
         {
             if(Tracer.IsDebugEnabled)
             {
                 Tracer.Debug("AdvisoryConsumer removing: " + tempDest);
             }
             this.connection.RemoveTempDestination(tempDest);
         }
     }
예제 #7
0
 public void addTempDestination(DestinationInfo info)
 {
     checkShutdown();
     tempDestinations.Add(info);
 }