本文整理汇总了C#中ObjectName.CreateSelectorSet方法的典型用法代码示例。如果您正苦于以下问题:C# ObjectName.CreateSelectorSet方法的具体用法?C# ObjectName.CreateSelectorSet怎么用?C# ObjectName.CreateSelectorSet使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ObjectName
的用法示例。
在下文中一共展示了ObjectName.CreateSelectorSet方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: UnregisterMBean
public void UnregisterMBean(ObjectName name)
{
_manClient.Delete(Schema.DynamicMBeanResourceUri, name.CreateSelectorSet());
}
示例2: GetAttribute
public object GetAttribute(ObjectName name, string attributeName)
{
try
{
return _manClient.Get<XmlFragment<DynamicMBeanResource>>(Schema.DynamicMBeanResourceUri,
new GetAttributesFragment(attributeName).GetExpression(), name.CreateSelectorSet())
.Value.Property.First(x => x.name == attributeName).Deserialize();
}
catch (FaultException ex)
{
if (new EndpointUnavailableFaultException().Equals(ex))
{
throw new InstanceNotFoundException(name);
}
throw;
}
}
示例3: SetAttribute
public void SetAttribute(ObjectName name, string attributeName, object value)
{
var request = new DynamicMBeanResource
{
Property = new[]
{
new NamedGenericValueType(attributeName, value),
}
};
_manClient.Put<XmlFragment<DynamicMBeanResource>>(Schema.DynamicMBeanResourceUri, new GetAttributesFragment(attributeName).GetExpression(), new XmlFragment<DynamicMBeanResource>(request), name.CreateSelectorSet());
}
示例4: SetAttributes
public IList<AttributeValue> SetAttributes(ObjectName name, IEnumerable<AttributeValue> namesAndValues)
{
var request = new DynamicMBeanResource
{
Property =
namesAndValues.Select(x => new NamedGenericValueType(x.Name, x.Value)).ToArray()
};
var names = namesAndValues.Select(x => x.Name);
return _manClient.Put<XmlFragment<DynamicMBeanResource>>(
Schema.DynamicMBeanResourceUri,
new GetAttributesFragment(names).GetExpression(),
new XmlFragment<DynamicMBeanResource>(request), name.CreateSelectorSet())
.Value.Property.Select(x => new AttributeValue(x.name, x.Deserialize())).ToList();
}
示例5: QueryNames
public IEnumerable<ObjectName> QueryNames(ObjectName name, IExpression<bool> query)
{
var queryExpression = query != null
? ExpressionGenerator.Generate(query)
: null;
var filter = new Filter(Schema.QueryNamesDialect, queryExpression);
return _enumClient.EnumerateEPR(Schema.DynamicMBeanResourceUri, filter, _enumerationMaxElements,
name.CreateSelectorSet())
.Select(x => x.ExtractObjectName());
}
示例6: IsRegistered
public bool IsRegistered(ObjectName name)
{
return _enumClient.EnumerateEPR(Schema.DynamicMBeanResourceUri, null, 1,
name.CreateSelectorSet()).Count() > 0;
}
示例7: IsInstanceOf
public bool IsInstanceOf(ObjectName name, string className)
{
var responseMessage = _soapClient.BuildMessage()
.WithAction(Schema.InstanceOfAction)
.WithSelectors(name.CreateSelectorSet())
.WithResourceUri(Schema.DynamicMBeanResourceUri)
.AddBody(new IsInstanceOfMessage(className))
.SendAndGetResponse();
var payload = responseMessage.GetPayload<IsInstanceOfResponseMessage>();
return payload.Value;
}
示例8: Invoke
public object Invoke(ObjectName name, string operationName, object[] arguments)
{
var request = new OperationRequestType
{
Input = arguments.Select(x => new ParameterType(null, x)).ToArray(),
name = operationName,
Signature = null
};
var responseMessage = _soapClient.BuildMessage()
.WithAction(Schema.InvokeAction)
.WithSelectors(name.CreateSelectorSet())
.WithResourceUri(Schema.DynamicMBeanResourceUri)
.AddBody(new InvokeMessage(request))
.SendAndGetResponse();
var payload = responseMessage.GetPayload<InvokeResponseMessage>();
return payload.ManagedResourceOperationResult.Deserialize();
}
示例9: GetMBeanInfo
public MBeanInfo GetMBeanInfo(ObjectName name)
{
var responseMessage = _soapClient.BuildMessage()
.WithAction(Schema.GetMBeanInfoAction)
.WithSelectors(name.CreateSelectorSet())
.WithResourceUri(Schema.DynamicMBeanResourceUri)
.SendAndGetResponse();
var payload = responseMessage.GetPayload<ResourceMetaDataTypeMessage>();
return payload.DynamicMBeanResourceMetaData.Deserialize();
}