mirror of https://github.com/apache/activemq.git
moved the Transport API into the Core package and put an initial JMS-like API in place
git-svn-id: https://svn.apache.org/repos/asf/incubator/activemq/trunk@367584 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
89000d1b43
commit
3089079547
|
@ -1,44 +0,0 @@
|
||||||
using System;
|
|
||||||
using System.Threading;
|
|
||||||
|
|
||||||
using OpenWire.Client;
|
|
||||||
using OpenWire.Client.Commands;
|
|
||||||
|
|
||||||
namespace OpenWire.Client.Transport {
|
|
||||||
/// <summary>
|
|
||||||
/// Handles asynchronous responses
|
|
||||||
/// </summary>
|
|
||||||
public class FutureResponse : IAsyncResult {
|
|
||||||
|
|
||||||
private Response response;
|
|
||||||
private Mutex asyncWaitHandle = new Mutex();
|
|
||||||
private bool isCompleted;
|
|
||||||
|
|
||||||
public WaitHandle AsyncWaitHandle {
|
|
||||||
get { return asyncWaitHandle; }
|
|
||||||
}
|
|
||||||
|
|
||||||
public object AsyncState {
|
|
||||||
get { return response; }
|
|
||||||
set { response = (Response) value; }
|
|
||||||
}
|
|
||||||
|
|
||||||
public bool IsCompleted {
|
|
||||||
get { return isCompleted; }
|
|
||||||
}
|
|
||||||
|
|
||||||
public bool CompletedSynchronously {
|
|
||||||
get { return false; }
|
|
||||||
}
|
|
||||||
|
|
||||||
public Response Response {
|
|
||||||
get { return response; }
|
|
||||||
set {
|
|
||||||
asyncWaitHandle.WaitOne();
|
|
||||||
response = value;
|
|
||||||
isCompleted = true;
|
|
||||||
asyncWaitHandle.ReleaseMutex();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -1,25 +0,0 @@
|
||||||
using System;
|
|
||||||
|
|
||||||
using OpenWire.Client;
|
|
||||||
using OpenWire.Client.Commands;
|
|
||||||
using OpenWire.Client.Core;
|
|
||||||
|
|
||||||
namespace OpenWire.Client.Transport {
|
|
||||||
|
|
||||||
public delegate void CommandHandler(Transport sender, Command command);
|
|
||||||
public delegate void ExceptionHandler(Transport sender, Exception command);
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Represents the logical networking transport layer.
|
|
||||||
/// </summary>
|
|
||||||
public interface Transport {
|
|
||||||
void Oneway(Command command);
|
|
||||||
|
|
||||||
FutureResponse AsyncRequest(Command command);
|
|
||||||
|
|
||||||
Response Request(Command command);
|
|
||||||
|
|
||||||
event CommandHandler Command;
|
|
||||||
event ExceptionHandler Exception;
|
|
||||||
}
|
|
||||||
}
|
|
Loading…
Reference in New Issue