本文整理汇总了C#中IClientMessage.GetMessageType方法的典型用法代码示例。如果您正苦于以下问题:C# IClientMessage.GetMessageType方法的具体用法?C# IClientMessage.GetMessageType怎么用?C# IClientMessage.GetMessageType使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类IClientMessage
的用法示例。
在下文中一共展示了IClientMessage.GetMessageType方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Handle
public static void Handle(IClientMessage clientMessage, HandleDistributedObject handleDistributedObject)
{
int messageType = clientMessage.GetMessageType();
if (messageType == EventMessageConst.EventDistributedObject)
{
string name = null;
name = clientMessage.GetStringUtf8();
string serviceName = null;
serviceName = clientMessage.GetStringUtf8();
string eventType = null;
eventType = clientMessage.GetStringUtf8();
handleDistributedObject(name, serviceName, eventType);
return;
}
Hazelcast.Logging.Logger.GetLogger(typeof(AbstractEventHandler)).Warning("Unknown message type received on event handler :" + clientMessage.GetMessageType());
}
开发者ID:hasancelik,项目名称:hazelcast-csharp-client,代码行数:16,代码来源:ClientAddDistributedObjectListenerCodec.cs
示例2: Handle
public static void Handle(IClientMessage clientMessage, HandleMember handleMember,
HandleMemberSet handleMemberSet, HandleMemberAttributeChange handleMemberAttributeChange)
{
var messageType = clientMessage.GetMessageType();
if (messageType == EventMessageConst.EventMember)
{
IMember member = null;
member = MemberCodec.Decode(clientMessage);
int eventType;
eventType = clientMessage.GetInt();
handleMember(member, eventType);
return;
}
if (messageType == EventMessageConst.EventMemberSet)
{
IList<IMember> members = null;
var members_size = clientMessage.GetInt();
members = new List<IMember>();
for (var members_index = 0; members_index < members_size; members_index++)
{
IMember members_item;
members_item = MemberCodec.Decode(clientMessage);
members.Add(members_item);
}
handleMemberSet(members);
return;
}
if (messageType == EventMessageConst.EventMemberAttributeChange)
{
string uuid = null;
uuid = clientMessage.GetStringUtf8();
string key = null;
key = clientMessage.GetStringUtf8();
int operationType;
operationType = clientMessage.GetInt();
string value = null;
var value_isNull = clientMessage.GetBoolean();
if (!value_isNull)
{
value = clientMessage.GetStringUtf8();
}
handleMemberAttributeChange(uuid, key, operationType, value);
return;
}
Logger.GetLogger(typeof (AbstractEventHandler))
.Warning("Unknown message type received on event handler :" + clientMessage.GetMessageType());
}
示例3: Handle
public static void Handle(IClientMessage clientMessage, HandleTopic handleTopic)
{
var messageType = clientMessage.GetMessageType();
if (messageType == EventMessageConst.EventTopic)
{
IData item = null;
item = clientMessage.GetData();
long publishTime;
publishTime = clientMessage.GetLong();
string uuid = null;
uuid = clientMessage.GetStringUtf8();
handleTopic(item, publishTime, uuid);
return;
}
Logger.GetLogger(typeof (AbstractEventHandler))
.Warning("Unknown message type received on event handler :" + clientMessage.GetMessageType());
}
示例4: Handle
public static void Handle(IClientMessage clientMessage, HandleItem handleItem)
{
int messageType = clientMessage.GetMessageType();
if (messageType == EventMessageConst.EventItem)
{
IData item = null;
bool item_isNull = clientMessage.GetBoolean();
if (!item_isNull)
{
item = clientMessage.GetData();
}
string uuid = null;
uuid = clientMessage.GetStringUtf8();
int eventType;
eventType = clientMessage.GetInt();
handleItem(item, uuid, eventType);
return;
}
Hazelcast.Logging.Logger.GetLogger(typeof(AbstractEventHandler)).Warning("Unknown message type received on event handler :" + clientMessage.GetMessageType());
}
示例5: Handle
public static void Handle(IClientMessage clientMessage, HandleEntry handleEntry)
{
var messageType = clientMessage.GetMessageType();
if (messageType == EventMessageConst.EventEntry)
{
IData key = null;
var key_isNull = clientMessage.GetBoolean();
if (!key_isNull)
{
key = clientMessage.GetData();
}
IData value = null;
var value_isNull = clientMessage.GetBoolean();
if (!value_isNull)
{
value = clientMessage.GetData();
}
IData oldValue = null;
var oldValue_isNull = clientMessage.GetBoolean();
if (!oldValue_isNull)
{
oldValue = clientMessage.GetData();
}
IData mergingValue = null;
var mergingValue_isNull = clientMessage.GetBoolean();
if (!mergingValue_isNull)
{
mergingValue = clientMessage.GetData();
}
int eventType;
eventType = clientMessage.GetInt();
string uuid = null;
uuid = clientMessage.GetStringUtf8();
int numberOfAffectedEntries;
numberOfAffectedEntries = clientMessage.GetInt();
handleEntry(key, value, oldValue, mergingValue, eventType, uuid, numberOfAffectedEntries);
return;
}
Logger.GetLogger(typeof (AbstractEventHandler))
.Warning("Unknown message type received on event handler :" + clientMessage.GetMessageType());
}
示例6: Handle
public static void Handle(IClientMessage clientMessage, HandleIMapInvalidation handleIMapInvalidation,
HandleIMapBatchInvalidation handleIMapBatchInvalidation)
{
var messageType = clientMessage.GetMessageType();
if (messageType == EventMessageConst.EventIMapInvalidation)
{
IData key = null;
var key_isNull = clientMessage.GetBoolean();
if (!key_isNull)
{
key = clientMessage.GetData();
}
handleIMapInvalidation(key);
return;
}
if (messageType == EventMessageConst.EventIMapBatchInvalidation)
{
IList<IData> keys = null;
var keys_size = clientMessage.GetInt();
keys = new List<IData>();
for (var keys_index = 0; keys_index < keys_size; keys_index++)
{
IData keys_item;
keys_item = clientMessage.GetData();
keys.Add(keys_item);
}
handleIMapBatchInvalidation(keys);
return;
}
Logger.GetLogger(typeof (AbstractEventHandler))
.Warning("Unknown message type received on event handler :" + clientMessage.GetMessageType());
}
示例7: HandleResponseMessage
private void HandleResponseMessage(IClientMessage response)
{
var correlationId = response.GetCorrelationId();
ClientInvocation invocation;
if (_invocations.TryRemove(correlationId, out invocation))
{
if (response.GetMessageType() == Error.Type)
{
var error = Error.Decode(response);
var exception = ExceptionUtil.ToException(error);
// retry only specific exceptions
HandleException(invocation, exception);
}
// if this was a re-registration operation, then we will throw away the response and just store the alias
else if (invocation is ClientListenerInvocation && invocation.Future.IsComplete &&
invocation.Future.Result != null)
{
var listenerInvocation = (ClientListenerInvocation) invocation;
var originalRegistrationId = GetRegistrationIdFromResponse(listenerInvocation);
var newRegistrationId = listenerInvocation.ResponseDecoder(response);
_client.GetListenerService()
.ReregisterListener(originalRegistrationId, newRegistrationId,
invocation.Message.GetCorrelationId());
if (Logger.IsFinestEnabled())
{
Logger.Finest(string.Format("Re-registered listener for {0} of type {1:X}",
originalRegistrationId,
listenerInvocation.Message.GetMessageType()));
}
}
else
{
invocation.Future.Result = response;
}
}
else
{
Logger.Warning("No call for correlationId: " + correlationId + ", response: " + response);
}
}