コード例 #1
0
        /// <summary>
        /// Query remote objects to find matches to the given domain & filter values in accordance with the domain:filter pattern.
        /// </summary>
        /// <param name="domain">The domain to match.</param>
        /// <param name="filter">The filter to match.</param>
        /// <returns>List of object names matching the domain:filter search parameters.</returns>
        public IList <ObjectName> QueryObjects(string domain, string filter)
        {
            IList <ObjectName> objects = new List <ObjectName>();
            var name             = new ObjectName(domain + ":" + filter);
            var serverConnection = Connector.GetConnection();

            // Return empty list if we were unable to connect.
            if (serverConnection == null)
            {
                return(objects);
            }

            var objectNames = serverConnection.queryNames(name, null);

            // We're working with a Java set here, so we need to explicitly use an iterator to loop over the data structure.
            var it = objectNames.iterator();

            while (it.hasNext())
            {
                var obj = (ObjectName)it.next();
                objects.Add(obj);
            }

            return(objects);
        }
コード例 #2
0
ファイル: MBeanClient.cs プロジェクト: yaswanth369/TabMon
        /// <summary>
        /// Query remote objects to find matches to the given domain & filter values in accordance with the domain:filter pattern.
        /// </summary>
        /// <param name="domain">The domain to match.</param>
        /// <param name="filter">The filter to match.</param>
        /// <returns>List of object names matching the domain:filter search parameters.</returns>
        public IList<ObjectName> QueryObjects(string domain, string filter)
        {
            IList<ObjectName> objects = new List<ObjectName>();
            var name = new ObjectName(domain + ":" + filter);
            var serverConnection = Connector.GetConnection();

            // Return empty list if we were unable to connect.
            if (serverConnection == null) return objects;

            var objectNames = serverConnection.queryNames(name, null);

            // We're working with a Java set here, so we need to explicitly use an iterator to loop over the data structure.
            var it = objectNames.iterator();
            while (it.hasNext())
            {
                var obj = (ObjectName)it.next();
                objects.Add(obj);
            }

            return objects;
        }
コード例 #3
0
        /// <summary>
        /// Retrieve a collection of operations that a given object name exposes.
        /// </summary>
        /// <param name="objectName">The object name to query.</param>
        /// <returns>A collection of operations that the given object exposes.</returns>
        public ICollection <MBeanOperationInfo> GetOperations(ObjectName objectName)
        {
            var operationCollection = GetMBeanInfo(objectName).getOperations();

            return(new List <MBeanOperationInfo>(operationCollection));
        }
コード例 #4
0
        /// <summary>
        /// Retrieve MBeanInfo object for a given object name.
        /// </summary>
        /// <param name="objectName">The object name to query.</param>
        /// <returns>MBeanInfo for the given object.</returns>
        public MBeanInfo GetMBeanInfo(ObjectName objectName)
        {
            var serverConnection = Connector.GetConnection();

            return(serverConnection.getMBeanInfo(objectName));
        }
コード例 #5
0
        /// <summary>
        /// Retrieve the value of some attribute on a remote object.
        /// </summary>
        /// <param name="objectName">The object name to query.</param>
        /// <param name="attributeName">The attribute name to sample.</param>
        /// <returns>Generic object containing the sampled value of the attribute.</returns>
        public object GetAttributeValue(ObjectName objectName, string attributeName)
        {
            var serverConnection = Connector.GetConnection();

            return(serverConnection.getAttribute(objectName, attributeName));
        }
コード例 #6
0
        /// <summary>
        /// Invokes an operation on a remote object.
        /// </summary>
        /// <param name="objectName">The object name containing the method to execute.</param>
        /// <param name="methodname">The name of the method to execute.</param>
        /// <returns></returns>
        public object InvokeMethod(ObjectName objectName, string methodname)
        {
            var serverConnection = Connector.GetConnection();

            return(serverConnection.invoke(objectName, methodname, null, null));
        }
コード例 #7
0
ファイル: MBeanClient.cs プロジェクト: yaswanth369/TabMon
 /// <summary>
 /// Invokes an operation on a remote object.
 /// </summary>
 /// <param name="objectName">The object name containing the method to execute.</param>
 /// <param name="methodname">The name of the method to execute.</param>
 /// <returns></returns>
 public object InvokeMethod(ObjectName objectName, string methodname)
 {
     var serverConnection = Connector.GetConnection();
     return serverConnection.invoke(objectName, methodname, null, null);
 }
コード例 #8
0
ファイル: MBeanClient.cs プロジェクト: yaswanth369/TabMon
 /// <summary>
 /// Retrieve a collection of operations that a given object name exposes.
 /// </summary>
 /// <param name="objectName">The object name to query.</param>
 /// <returns>A collection of operations that the given object exposes.</returns>
 public ICollection<MBeanOperationInfo> GetOperations(ObjectName objectName)
 {
     var operationCollection = GetMBeanInfo(objectName).getOperations();
     return new List<MBeanOperationInfo>(operationCollection);
 }
コード例 #9
0
ファイル: MBeanClient.cs プロジェクト: yaswanth369/TabMon
 /// <summary>
 /// Retrieve MBeanInfo object for a given object name.
 /// </summary>
 /// <param name="objectName">The object name to query.</param>
 /// <returns>MBeanInfo for the given object.</returns>
 public MBeanInfo GetMBeanInfo(ObjectName objectName)
 {
     var serverConnection = Connector.GetConnection();
     return serverConnection.getMBeanInfo(objectName);
 }
コード例 #10
0
ファイル: MBeanClient.cs プロジェクト: yaswanth369/TabMon
 /// <summary>
 /// Retrieve the value of some attribute on a remote object.
 /// </summary>
 /// <param name="objectName">The object name to query.</param>
 /// <param name="attributeName">The attribute name to sample.</param>
 /// <returns>Generic object containing the sampled value of the attribute.</returns>
 public object GetAttributeValue(ObjectName objectName, string attributeName)
 {
     var serverConnection = Connector.GetConnection();
     return serverConnection.getAttribute(objectName, attributeName);
 }