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 }
// Constructor. public SinkStackEntry(IServerChannelSink sink, Object state, SinkStackEntry below) { this.sink = sink; this.state = state; this.below = below; }
// 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); }
// 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; }
// 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; }
// 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); }
// 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; }