本文整理汇总了C#中IDestination类的典型用法代码示例。如果您正苦于以下问题:C# IDestination类的具体用法?C# IDestination怎么用?C# IDestination使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
IDestination类属于命名空间,在下文中一共展示了IDestination类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: CallIndirect
public CallIndirect(LIRMethod parent, ISource targetMethod, IEnumerable<ISource> sources = null, IDestination returnValueDest = null) : base(parent, LIROpCode.CallIndirect)
{
this.TargetMethod = targetMethod;
if (sources != null)
Sources.AddRange(sources);
this.ReturnValueDestination = returnValueDest;
}
示例2: Producer
public Producer(ISession session, IDestination dest, int count, MsgPriority priority)
{
this.session = session;
this.dest = dest;
this.count = count;
this.priority = priority;
}
示例3: Initialize
public Task Initialize(IDestination actor, long repeats)
{
this.actor = actor;
this.repeats = repeats;
return TaskDone.Done;
}
示例4: Convert
public Convert(LIRMethod parent, ISource source, LIRType sourceType, IDestination dest, LIRType destType) : base(parent, LIROpCode.Convert)
{
Source = source;
SourceType = sourceType;
Destination = dest;
DestinationType = destType;
}
示例5: Unary
public Unary(LIRMethod parent, ISource src, IDestination dest, UnaryOperation op, LIRType argType) : base(parent, LIROpCode.Unary)
{
Source = src;
Destination = dest;
Operation = op;
ArgumentType = argType;
}
示例6: Destination
public Destination(IDestination destination)
{
if (destination == null)
throw new ArgumentNullException("destination");
this.destination = destination;
this.destinationType = DestinationType.Destination;
}
示例7: NmsSystemEventsImpl
public NmsSystemEventsImpl(INmsOperations nmsOperations,
IDestination cargoHandledDestination,
IDestination cargoUpdateDestination)
{
this.nmsOperations = nmsOperations;
this.cargoHandledDestination = cargoHandledDestination;
this.cargoUpdateDestination = cargoUpdateDestination;
}
示例8: Math
public Math(LIRMethod parent, ISource srcA, ISource srcB, IDestination dest, MathOperation op, LIRType argType) : base(parent, LIROpCode.Math)
{
SourceA = srcA;
SourceB = srcB;
Destination = dest;
Operation = op;
ArgumentType = argType;
}
示例9: Compare
public Compare(LIRMethod parent, ISource sourceA, ISource sourceB, IDestination destination, LIRType type, CompareCondition condition) : base(parent, LIROpCode.Compare)
{
this.SourceA = sourceA;
this.SourceB = sourceB;
this.Destination = destination;
this.Type = type;
this.Condition = condition;
}
示例10: CreateConsumer
public IMessageConsumer CreateConsumer(IDestination destination, string selector, bool noLocal)
{
if (selector != null)
{
throw new NotImplementedException("Selectors are not supported by MSQM");
}
MessageQueue queue = MessageConverter.ToMsmqDestination(destination);
return new MessageConsumer(this, acknowledgementMode, queue);
}
示例11: PurgeQueue
private void PurgeQueue(IConnection conn, IDestination queue)
{
ISession session = conn.CreateSession();
IMessageConsumer consumer = session.CreateConsumer(queue);
while(consumer.Receive(TimeSpan.FromMilliseconds(500)) != null)
{
}
consumer.Close();
session.Close();
}
示例12: removeTempDestination
public void removeTempDestination(IDestination destination)
{
for(int i = tempDestinations.Count - 1; i >= 0; i--)
{
DestinationInfo di = tempDestinations[i];
if(di.Destination.Equals(destination))
{
tempDestinations.RemoveAt(i);
}
}
}
示例13: Queue
public Queue(MsgDeliveryMode mode = MsgDeliveryMode.NonPersistent)
{
Uri msgQueue = new Uri("activemq:tcp://localhost:61616");
_factory = new ConnectionFactory(msgQueue);
try
{
_connection = _factory.CreateConnection();
}
catch (NMSConnectionException ex)
{
Log.FatalException("Error connecting to MQ server", ex);
throw;
}
// TODO check _connection for null
_connection.RequestTimeout = TimeSpan.FromSeconds(60);
Session = _connection.CreateSession();
// TODO need to find out if queue exists.
// It creates a new queue if it doesn't exist.
_destination = Session.GetDestination("queue://TwitterSearchStream");
_consumer = Session.CreateConsumer(_destination);
_producer = Session.CreateProducer(_destination);
_producer.RequestTimeout = TimeSpan.FromSeconds(60);
_producer.DeliveryMode = mode;
_connection.Start();
_connection.ExceptionListener += _connection_ExceptionListener;
_connection.ConnectionInterruptedListener += _connection_ConnectionInterruptedListener;
}
示例14: OpenWireConsumer
/// <summary>
/// 消息消费构造器
/// </summary>
/// <param name="brokerUri">地址</param>
/// <param name="username">用户名</param>
/// <param name="psw">密码</param>
/// <param name="clientId">客户端标识 兼做队列接收目的地</param>
/// <param name="isClient">true 客户端;false 服务端</param>
public OpenWireConsumer(string brokerUri, string username, string psw, string clientId,bool isClient)
{
NMSConnectionFactory _factory = new NMSConnectionFactory(brokerUri, clientId);
_connection = _factory.CreateConnection(username, psw);
_connection.Start();
_session = _connection.CreateSession(AcknowledgementMode.AutoAcknowledge);
if (isClient)
{
_qReceiveDest = _session.GetDestination(clientId, DestinationType.TemporaryQueue);
}
else
{
_qReceiveDest = _session.GetQueue(clientId);
}
_messageConsumer = _session.CreateConsumer(_qReceiveDest);
_messageConsumer.Listener += (message) =>
{
if (Listener != null)
{
Listener(message);
}
};
}
示例15: Receive
public String Receive(String queueName)
{
String message = "";
using (IConnection connection = factory.CreateConnection())
using (ISession session = connection.CreateSession())
{
destination = SessionUtil.GetDestination(session, "queue://" + queueName);
Console.WriteLine("Using destination: " + destination);
using (IMessageConsumer consumer = session.CreateConsumer(destination))
{
connection.Start();
ITextMessage textMessage = consumer.Receive() as ITextMessage;
if (textMessage == null)
{
Console.WriteLine("No message received!");
}
else
{
message = textMessage.Text;
}
}
}
return message;
}