MessageQueueCriteriaとは? わかりやすく解説

MessageQueueCriteria クラス

MessageQueue クラスの GetPublicQueues メソッド使用してクエリ実行するときに、メッセージ キューフィルタかけます

名前空間: System.Messaging
アセンブリ: System.Messaging (system.messaging.dll 内)
構文構文

Public Class MessageQueueCriteria
Dim instance As MessageQueueCriteria
public class MessageQueueCriteria
public ref class MessageQueueCriteria
public class MessageQueueCriteria
public class MessageQueueCriteria
解説解説

MessageQueue クラスには、ネットワーク上のパブリック キュー検索結果フィルタをかける多くメソッドありますキューラベルカテゴリ、またはサーバーの場所でフィルタをかけるメソッドは、GetPublicQueuesByLabel、GetPublicQueuesByCategory、および GetPublicQueuesByMachine です。

GetPublicQueues メソッドMessageQueueCriteria クラス使用すると、フィルタ詳細に指定できますGetPublicQueuesBy メソッドいずれかでは処理できない検索条件や、複数基準指定できます。たとえば、キュー作成時刻または変更時刻キュー存在するコンピュータキューラベルまたはカテゴリ、またはこれらのプロパティ任意の組み合わせで検索するには、MessageQueueCriteria インスタンスGetPublicQueues メソッド渡します

複数プロパティフィルタ処理をする場合は、プロパティセットAND 演算子適用することによって、基準作成されます。そのため、CreatedAfter プロパティと MachineName プロパティに値を指定すると、指定した時刻よりも後に作成され特定のコンピュータ存在するすべてのキュー問い合わせることになります

プロパティ設定するときに、プロパティ設定するメソッドは、構築するフィルタにそのプロパティ含め必要があることを示すフラグ設定します検索フィルタから、それぞれのプロパティ削除することはできません。ClearAll を呼び出してすべてのプロパティフィルタから削除した後で検索フィルタ構築するプロパティ設定しますClearAll は、すべてのプロパティ既定の "設定なし" の状態にリセットします。

読み取る前にプロパティ設定する必要があります設定しない場合は、例外スローさます。

使用例使用例

一連のメッセージ キュー反復処理し、1 日前に作成され、"MyComputer" という名前のコンピュータ上に存在するキューパス表示する例を次に示します

Imports System
Imports System.Messaging

 
Public Class MyNewQueue


        '
        ' Provides an entry point into the application.
        '         
        ' This example uses a cursor to step through the
        ' message queues and list the public queues on the
        ' network that specify certain criteria.
        

        Public Shared Sub
 Main()

            ' Create a new instance of the class.
            Dim myNewQueue As New
 MyNewQueue()

            ' Output the count of Lowest priority messages.
            myNewQueue.ListPublicQueuesByCriteria()

            Return

        End Sub 'Main


        
        ' Iterates through message queues and displays the
        ' path of each queue that was created in the last
        ' day and that exists on the computer "MyComputer".
 
        

        Public Sub ListPublicQueuesByCriteria()

            Dim numberQueues As Int32 = 0

            ' Specify the criteria to filter by.
            Dim myCriteria As New
 MessageQueueCriteria()
            myCriteria.MachineName = "MyComputer"
            myCriteria.CreatedAfter = DateTime.Now.Subtract(New
 _
                TimeSpan(1, 0, 0, 0))


            ' Get a cursor into the queues on the network.
            Dim myQueueEnumerator As MessageQueueEnumerator
 = _
                MessageQueue.GetMessageQueueEnumerator(myCriteria)

            ' Move to the next queue and read its path.
            While myQueueEnumerator.MoveNext()
                ' Increase the count if the priority is Lowest.
                Console.WriteLine(myQueueEnumerator.Current.Path)
                numberQueues += 1
            End While

            ' Handle no queues matching the criteria.
            If numberQueues = 0 Then
                Console.WriteLine("No queues match the criteria.")
            End If

            Return

        End Sub 'ListPublicQueuesByCriteria

End Class 'MyNewQueue

using System;
using System.Messaging;

namespace MyProject
{
    /// <summary>
    /// Provides a container class for the example.
    /// </summary>
    public class MyNewQueue
    {

        //**************************************************
        // Provides an entry point into the application.
        //         
        // This example uses a cursor to step through the
        // message queues and list the public queues on the
        // network that specify certain criteria.
        //**************************************************

        public static void
 Main()
        {
            // Create a new instance of the class.
            MyNewQueue myNewQueue = new MyNewQueue();

            // Output the count of Lowest priority messages.
            myNewQueue.ListPublicQueuesByCriteria();
                        
            return;
        }


        //**************************************************
        // Iterates through message queues and displays the
        // path of each queue that was created in the last
        // day and that exists on the computer "MyComputer".
 
        //**************************************************
        
        public void ListPublicQueuesByCriteria()
        {
            uint numberQueues = 0;
            
            // Specify the criteria to filter by.
            MessageQueueCriteria myCriteria = new 
                MessageQueueCriteria();
            myCriteria.MachineName = "MyComputer";
            myCriteria.CreatedAfter = DateTime.Now.Subtract(new
 
                TimeSpan(1,0,0,0));
    

            // Get a cursor into the queues on the network.
            MessageQueueEnumerator myQueueEnumerator = 
                MessageQueue.GetMessageQueueEnumerator(myCriteria);

            // Move to the next queue and read its path.
            while(myQueueEnumerator.MoveNext())
            {
                // Increase the count if priority is Lowest.
                Console.WriteLine(myQueueEnumerator.Current.Path);
                numberQueues++;
            }

            // Handle no queues matching the criteria.
            if (numberQueues == 0)
            {
                Console.WriteLine("No public queues match
 criteria.");
            }

            return;
        }
    }
}
#using <system.dll>
#using <system.messaging.dll>

using namespace System;
using namespace System::Messaging;
ref class MyNewQueue
{
public:

   // Iterates through message queues and displays the
   // path of each queue that was created in the last
   // day and that exists on the computer "MyComputer". 
   void ListPublicQueuesByCriteria()
   {
      UInt32 numberQueues = 0;
      
      // Specify the criteria to filter by.
      MessageQueueCriteria^ myCriteria = gcnew MessageQueueCriteria;
      myCriteria->MachineName = "MyComputer";
      myCriteria->CreatedAfter = DateTime::Now.Subtract( TimeSpan(1,0,0,0) );
      
      // Get a cursor into the queues on the network.
      MessageQueueEnumerator^ myQueueEnumerator = MessageQueue::GetMessageQueueEnumerator(
 myCriteria );
      
      // Move to the next queue and read its path.
      while ( myQueueEnumerator->MoveNext() )
      {
         
         // Increase the count if priority is Lowest.
         Console::WriteLine( myQueueEnumerator->Current->Path );
         numberQueues++;
      }

      
      // Handle no queues matching the criteria.
      if ( numberQueues == 0 )
      {
         Console::WriteLine( "No public queues match criteria."
 );
      }

      return;
   }

};

int main()
{
   
   // Create a new instance of the class.
   MyNewQueue^ myNewQueue = gcnew MyNewQueue;
   
   // Output the count of Lowest priority messages.
   myNewQueue->ListPublicQueuesByCriteria();
   return 0;
}

package MyProject;

import System.*;
import System.Messaging.*;

/// <summary>
/// Provides a container class for the example.
/// </summary>
public class MyNewQueue
{
    //**************************************************
    // Provides an entry point into the application.
    //         
    // This example uses a cursor to step through the
    // message queues and list the public queues on the
    // network that specify certain criteria.
    //**************************************************
    public static void main(String[]
 args)
    {
        // Create a new instance of the class.
        MyNewQueue myNewQueue = new MyNewQueue();
        // Output the count of Lowest priority messages.
        myNewQueue.ListPublicQueuesByCriteria();
        return;
    } //main

    //**************************************************
    // Iterates through message queues and displays the
    // path of each queue that was created in the last
    // day and that exists on the computer "MyComputer". 
    //**************************************************
    public void ListPublicQueuesByCriteria()
    {
        long numberQueues = 0;        
        // Specify the criteria to filter by.
        MessageQueueCriteria myCriteria = new MessageQueueCriteria();
        myCriteria.set_MachineName("MyComputer");
        myCriteria.set_CreatedAfter(DateTime.get_Now().
            Subtract(new TimeSpan(1, 0, 0, 0)));
        // Get a cursor into the queues on the network.
        MessageQueueEnumerator myQueueEnumerator =
            MessageQueue.GetMessageQueueEnumerator(myCriteria);
        // Move to the next queue and read its path.
        while (myQueueEnumerator.MoveNext()) {
            // Increase the count if priority is Lowest.
            Console.WriteLine(myQueueEnumerator.get_Current().get_Path());
            numberQueues++;
        }
        // Handle no queues matching the criteria.
        if (numberQueues == 0) {
            Console.WriteLine("No public queues match criteria.");
        }
        return;
    } //ListPublicQueuesByCriteria
} //MyNewQueue
継承階層継承階層
System.Object
  System.Messaging.MessageQueueCriteria
スレッド セーフスレッド セーフ
この型の public static (Visual Basic では Shared) メンバはすべて、スレッド セーフです。インスタンス メンバ場合は、スレッド セーフであるとは限りません。
プラットフォームプラットフォーム
バージョン情報バージョン情報
参照参照
関連項目
MessageQueueCriteria メンバ
System.Messaging 名前空間
GetPublicQueues
GetPublicQueuesByMachine
GetPublicQueuesByLabel
GetPublicQueuesByCategory

MessageQueueCriteria コンストラクタ


MessageQueueCriteria プロパティ


MessageQueueCriteria メソッド


パブリック メソッドパブリック メソッド

プロテクト メソッドプロテクト メソッド
参照参照

関連項目

MessageQueueCriteria クラス
System.Messaging 名前空間
GetPublicQueues
GetPublicQueuesByMachine
GetPublicQueuesByLabel
GetPublicQueuesByCategory

MessageQueueCriteria メンバ

MessageQueue クラスの GetPublicQueues メソッド使用してクエリ実行するときに、メッセージ キューフィルタかけます

MessageQueueCriteria データ型公開されるメンバを以下の表に示します


パブリック コンストラクタパブリック コンストラクタ
  名前 説明
パブリック メソッド MessageQueueCriteria MessageQueueCriteria クラス新しインスタンス初期化します。
パブリック プロパティパブリック プロパティ
パブリック メソッドパブリック メソッド
プロテクト メソッドプロテクト メソッド
参照参照

関連項目

MessageQueueCriteria クラス
System.Messaging 名前空間
GetPublicQueues
GetPublicQueuesByMachine
GetPublicQueuesByLabel
GetPublicQueuesByCategory



英和和英テキスト翻訳>> Weblio翻訳
英語⇒日本語日本語⇒英語
  

辞書ショートカット

すべての辞書の索引

「MessageQueueCriteria」の関連用語

MessageQueueCriteriaのお隣キーワード
検索ランキング

   

英語⇒日本語
日本語⇒英語
   



MessageQueueCriteriaのページの著作権
Weblio 辞書 情報提供元は 参加元一覧 にて確認できます。

   
日本マイクロソフト株式会社日本マイクロソフト株式会社
© 2025 Microsoft.All rights reserved.

©2025 GRAS Group, Inc.RSS