Ejemplo n.º 1
0
        public void StoreAndDispatch(IServerChannelSink sink, Object state)
        {
            // Find the entry on the stack.
            while (top != null)
            {
                if (top.sink == sink)
                {
                    break;
                }
                top = top.below;
            }
            if (top == null)
            {
                throw new RemotingException
                          (_("Remoting_SinkNotFoundOnStack"));
            }

            // This entry must be the only one on the stack.
            if (top.below != null)
            {
                throw new RemotingException
                          (_("Remoting_SinkStackNonEmpty"));
            }

            // Update the entry with the new state information.
            top.state = state;

            // TODO: dispatch async messages
        }
Ejemplo n.º 2
0
 // Constructor.
 public SinkStackEntry(IServerChannelSink sink, Object state,
                       SinkStackEntry below)
 {
     this.sink  = sink;
     this.state = state;
     this.below = below;
 }
		// Constructor.
		public SinkStackEntry(IServerChannelSink sink, Object state,
							  SinkStackEntry below)
				{
					this.sink = sink;
					this.state = state;
					this.below = below;
				}
Ejemplo n.º 4
0
        // Store into this sink stack.
        public void Store(IServerChannelSink sink, Object state)
        {
            // Find the entry on the stack.
            while (top != null)
            {
                if (top.sink == sink)
                {
                    break;
                }
                top = top.below;
            }
            if (top == null)
            {
                throw new RemotingException
                          (_("Remoting_SinkNotFoundOnStack"));
            }

            // Remove the entry from the main stack.
            SinkStackEntry entry = top;

            top = top.below;

            // Push the entry onto the store stack.
            entry.below = storeTop;
            entry.state = state;
            storeTop    = entry;
        }
	// Process a response asynchronously.
	public void AsyncProcessResponse
		(IMessage msg, ITransportHeaders headers, Stream stream)
			{
				if(top == null)
				{
					throw new RemotingException
						(_("Remoting_SinkStackEmpty"));
				}
				SinkStackEntry entry = top;
				top = top.below;
				entry.sink.AsyncProcessResponse
					(this, entry.state, msg, headers, stream);
			}
Ejemplo n.º 6
0
        // Process a response asynchronously.
        public void AsyncProcessResponse
            (IMessage msg, ITransportHeaders headers, Stream stream)
        {
            if (top == null)
            {
                throw new RemotingException
                          (_("Remoting_SinkStackEmpty"));
            }
            SinkStackEntry entry = top;

            top = top.below;
            entry.sink.AsyncProcessResponse
                (this, entry.state, msg, headers, stream);
        }
	// Pop an item from the stack.
	public Object Pop(IClientChannelSink sink)
			{
				while(top != null)
				{
					if(top.sink == sink)
					{
						break;
					}
					top = top.below;
				}
				if(top == null)
				{
					throw new RemotingException
						(_("Remoting_SinkNotFoundOnStack"));
				}
				Object state = top.state;
				top = top.below;
				return state;
			}
Ejemplo n.º 8
0
        // Pop an item from the stack.
        public Object Pop(IServerChannelSink sink)
        {
            while (top != null)
            {
                if (top.sink == sink)
                {
                    break;
                }
                top = top.below;
            }
            if (top == null)
            {
                throw new RemotingException
                          (_("Remoting_SinkNotFoundOnStack"));
            }
            Object state = top.state;

            top = top.below;
            return(state);
        }
	// Get the response stream.
	public Stream GetResponseStream(IMessage msg, ITransportHeaders headers)
			{
				if(top == null)
				{
					throw new RemotingException
						(_("Remoting_SinkStackEmpty"));
				}

				// Remove the sink from the stack temporarily.
				SinkStackEntry entry = top;
				top = top.below;

				// Get the stream.
				Stream stream = entry.sink.GetResponseStream
					(this, entry.state, msg, headers);

				// Push the sink back onto the stack.
				entry.below = top;
				top = entry;
				return stream;
			}
Ejemplo n.º 10
0
        // Get the response stream.
        public Stream GetResponseStream(IMessage msg, ITransportHeaders headers)
        {
            if (top == null)
            {
                throw new RemotingException
                          (_("Remoting_SinkStackEmpty"));
            }

            // Remove the sink from the stack temporarily.
            SinkStackEntry entry = top;

            top = top.below;

            // Get the stream.
            Stream stream = entry.sink.GetResponseStream
                                (this, entry.state, msg, headers);

            // Push the sink back onto the stack.
            entry.below = top;
            top         = entry;
            return(stream);
        }
Ejemplo n.º 11
0
 // Push an item onto the stack.
 public void Push(IServerChannelSink sink, Object state)
 {
     top = new SinkStackEntry(sink, state, top);
 }
	public void StoreAndDispatch(IServerChannelSink sink, Object state)
			{
				// Find the entry on the stack.
				while(top != null)
				{
					if(top.sink == sink)
					{
						break;
					}
					top = top.below;
				}
				if(top == null)
				{
					throw new RemotingException
						(_("Remoting_SinkNotFoundOnStack"));
				}

				// This entry must be the only one on the stack.
				if(top.below != null)
				{
					throw new RemotingException
						(_("Remoting_SinkStackNonEmpty"));
				}

				// Update the entry with the new state information.
				top.state = state;

				// TODO: dispatch async messages
			}
	// Store into this sink stack.
	public void Store(IServerChannelSink sink, Object state)
			{
				// Find the entry on the stack.
				while(top != null)
				{
					if(top.sink == sink)
					{
						break;
					}
					top = top.below;
				}
				if(top == null)
				{
					throw new RemotingException
						(_("Remoting_SinkNotFoundOnStack"));
				}

				// Remove the entry from the main stack.
				SinkStackEntry entry = top;
				top = top.below;

				// Push the entry onto the store stack.
				entry.below = storeTop;
				entry.state = state;
				storeTop = entry;
			}
	// Push an item onto the stack.
	public void Push(IServerChannelSink sink, Object state)
			{
				top = new SinkStackEntry(sink, state, top);
			}