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

MessageQueueEnumerator クラス

メッセージ キュー内のメッセージ列挙するための前方カーソル提供します

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

Public Class MessageQueueEnumerator
    Inherits MarshalByRefObject
    Implements IEnumerator, IDisposable
Dim instance As MessageQueueEnumerator
public class MessageQueueEnumerator : MarshalByRefObject,
 IEnumerator, IDisposable
public ref class MessageQueueEnumerator : public
 MarshalByRefObject, IEnumerator, IDisposable
public class MessageQueueEnumerator extends
 MarshalByRefObject implements IEnumerator, IDisposable
public class MessageQueueEnumerator extends
 MarshalByRefObject implements IEnumerator, IDisposable
解説解説

ネットワーク上でキューとの動的な対話には MessageQueueEnumerator使いますMessageQueue クラス通じて使用できるメソッドは、キュー動的リストを含む MessageQueueEnumerator か、指定されメソッド呼び出され時点でのキューコレクションスナップショットを含む配列いずれかを、返すことができます

ネットワークでのキュー順序定義されていません。たとえば、コンピュータラベルパブリック ステータスプライベート ステータスなどのユーザーアクセスできる基準によって、キュー順序付けることはできません。MessageQueueEnumeratorカーソルであり、初期化時に動的リスト先頭配置されます。MoveNext を呼び出すことで、このカーソル列挙体の最初キュー移動させることができます列挙子が初期化された後に、MoveNext使って残りキューを順に進んでいくことができます

MessageQueueEnumerator後方移動することはできません。キュー列挙体の中では、カーソル前方移動だけできます。しかし、Reset呼び出すと、列挙体をリセットしカーソルを再びリスト先頭に置くことができます列挙子は動的であるため、カーソル現在位置より後に追加されるキューには、列挙子によってアクセスできます。しかし、カーソル現在位置よりも前に挿入されているキューアクセスするには、最初に Reset呼び出す必要があります

使用例使用例

ネットワーク上のすべてのメッセージ キュー反復処理し、各キューパス取得するコード例次に示します。この例では最後にネットワーク上のパブリック キューの数を表示します

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.
        

        Public Shared Sub
 Main()

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

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

            Return

        End Sub 'Main


        
        ' Iterates through message queues and examines the
        ' path for each queue. Also displays the number of
        ' public queues on the network.
        

        Public Sub ListPublicQueues()

            ' Holds the count of private queues.
            Dim numberQueues As Int32 = 0

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

            ' 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

            ' Display final count.
            Console.WriteLine(("Number of public queues: "
 + _
                numberQueues.ToString()))

            Return

        End Sub 'ListPublicQueues

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.
        //**************************************************

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

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


        //**************************************************
        // Iterates through message queues and examines the
        // path for each queue. Also displays the number of
        // public queues on the network.
        //**************************************************
        
        public void ListPublicQueues()
        {
            // Holds the count of private queues.
            uint numberQueues = 0;
    
            // Get a cursor into the queues on the network.
            MessageQueueEnumerator myQueueEnumerator = 
                MessageQueue.GetMessageQueueEnumerator();

            // 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++;
            }

            // Display final count.
            Console.WriteLine("Number of public queues: "
 + 
                numberQueues.ToString());
            
            return;
        }
    }
}
#using <System.dll>
#using <System.Messaging.dll>

using namespace System;
using namespace System::Messaging;

//**************************************************
// Iterates through message queues and examines the
// path for each queue. Also displays the number of
// public queues on the network.
//**************************************************
void ListPublicQueues()
{
   
   // Holds the count of private queues.
   int numberQueues = 0;
   
   // Get a cursor into the queues on the network.
   MessageQueueEnumerator^ myQueueEnumerator = MessageQueue::GetMessageQueueEnumerator();
   
   // 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++;
   }

   
   // Display final count.
   Console::WriteLine( "Number of public queues: {0}",
 numberQueues );
   return;
}


//**************************************************
// 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.
//**************************************************
int main()
{
   
   // Output the count of Lowest priority messages.
   ListPublicQueues();
}

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.
    //**************************************************
    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.ListPublicQueues();
        return;
    } //main

    //**************************************************
    // Iterates through message queues and examines the
    // path for each queue. Also displays the number of
    // public queues on the network.
    //**************************************************
    public void ListPublicQueues()
    {
        // Holds the count of private queues.
        long numberQueues = 0;        
        
        // Get a cursor into the queues on the network.
        MessageQueueEnumerator myQueueEnumerator =
            MessageQueue.GetMessageQueueEnumerator();
        // 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++;
        }
        // Display final count.
        Console.WriteLine("Number of public queues: "
            + ((Int32)numberQueues).ToString());
        return;
    } //ListPublicQueues
} //MyNewQueue
継承階層継承階層
System.Object
   System.MarshalByRefObject
    System.Messaging.MessageQueueEnumerator
スレッド セーフスレッド セーフ
この型の public static (Visual Basic では Shared) メンバはすべて、スレッド セーフです。インスタンス メンバ場合は、スレッド セーフであるとは限りません。
プラットフォームプラットフォーム
バージョン情報バージョン情報
参照参照
関連項目
MessageQueueEnumerator メンバ
System.Messaging 名前空間
MessageQueue クラス
MessageQueue.GetMessageQueueEnumerator

MessageQueueEnumerator プロパティ


MessageQueueEnumerator メソッド


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

( プロテクト メソッド参照)
  名前 説明
パブリック メソッド Close 列挙子と関連付けられたリソース解放します。
パブリック メソッド CreateObjRef  リモート オブジェクトとの通信使用するプロキシ生成必要な情報をすべて格納しているオブジェクト作成します。 ( MarshalByRefObject から継承されます。)
パブリック メソッド Dispose オーバーロードされます。 MessageQueueEnumerator によって使用されているリソース解放します。
パブリック メソッド Equals  オーバーロードされます2 つObject インスタンス等しかどうか判断します。 ( Object から継承されます。)
パブリック メソッド GetHashCode  特定の型のハッシュ関数として機能します。GetHashCode は、ハッシュ アルゴリズムや、ハッシュ テーブルのようなデータ構造での使用適してます。 ( Object から継承されます。)
パブリック メソッド GetLifetimeService  対象インスタンス有効期間ポリシー制御する現在の有効期間サービス オブジェクト取得します。 ( MarshalByRefObject から継承されます。)
パブリック メソッド GetType  現在のインスタンスType取得します。 ( Object から継承されます。)
パブリック メソッド InitializeLifetimeService  対象インスタンス有効期間ポリシー制御する有効期間サービス オブジェクト取得します。 ( MarshalByRefObject から継承されます。)
パブリック メソッド MoveNext 列挙体の次のキュー列挙子を進めます (そのキューが現在使用できる場合)。
パブリック メソッド ReferenceEquals  指定した複数Object インスタンス同一かどうか判断します。 ( Object から継承されます。)
パブリック メソッド Reset 列挙体の先頭を指すようにカーソルリセットします。
パブリック メソッド ToString  現在の Object を表す String返します。 ( Object から継承されます。)
プロテクト メソッドプロテクト メソッド
参照参照

関連項目

MessageQueueEnumerator クラス
System.Messaging 名前空間
MessageQueue クラス
MessageQueue.GetMessageQueueEnumerator

MessageQueueEnumerator メンバ

メッセージ キュー内のメッセージ列挙するための前方カーソル提供します

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


パブリック プロパティパブリック プロパティ
パブリック メソッドパブリック メソッド
( プロテクト メソッド参照)
  名前 説明
パブリック メソッド Close 列挙子と関連付けられたリソース解放します。
パブリック メソッド CreateObjRef  リモート オブジェクトとの通信使用するプロキシ生成必要な情報をすべて格納しているオブジェクト作成します。 (MarshalByRefObject から継承されます。)
パブリック メソッド Dispose オーバーロードされます。 MessageQueueEnumerator によって使用されているリソース解放します。
パブリック メソッド Equals  オーバーロードされます2 つObject インスタンス等しかどうか判断します。 (Object から継承されます。)
パブリック メソッド GetHashCode  特定の型のハッシュ関数として機能します。GetHashCode は、ハッシュ アルゴリズムや、ハッシュ テーブルのようなデータ構造での使用適してます。 (Object から継承されます。)
パブリック メソッド GetLifetimeService  対象インスタンス有効期間ポリシー制御する現在の有効期間サービス オブジェクト取得します。 (MarshalByRefObject から継承されます。)
パブリック メソッド GetType  現在のインスタンスType取得します。 (Object から継承されます。)
パブリック メソッド InitializeLifetimeService  対象インスタンス有効期間ポリシー制御する有効期間サービス オブジェクト取得します。 (MarshalByRefObject から継承されます。)
パブリック メソッド MoveNext 列挙体の次のキュー列挙子を進めます (そのキューが現在使用できる場合)。
パブリック メソッド ReferenceEquals  指定した複数Object インスタンス同一かどうか判断します。 (Object から継承されます。)
パブリック メソッド Reset 列挙体の先頭を指すようにカーソルリセットします。
パブリック メソッド ToString  現在の Object を表す String返します。 (Object から継承されます。)
プロテクト メソッドプロテクト メソッド
明示的インターフェイスの実装明示的インターフェイス実装
  名前 説明
インターフェイスの明示的な実装 System.Collections.IEnumerator.Current 列挙体の現在の MessageQueue取得します
参照参照

関連項目

MessageQueueEnumerator クラス
System.Messaging 名前空間
MessageQueue クラス
MessageQueue.GetMessageQueueEnumerator



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

辞書ショートカット

すべての辞書の索引

「MessageQueueEnumerator」の関連用語

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

   

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



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

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

©2025 GRAS Group, Inc.RSS