A VMessageQueue object is a resource that represents the messages in an AS/400 message queue for use in AS/400 panes.
To use a VMessageQueue, set the system and path properties. These properties can be set using a constructor or through the setSystem() and setPath() methods. The VMessageQueue object is then "plugged" into the AS/400 pane as the root, using the pane's constructor or setRoot() method.
VMessageQueue has some other useful properties for defining the set of messages that are presented in AS/400 panes. Use setSeverity() to specify the severity of messages that should appear. Use setSelection() to specify the type of messages that should appear.
When AS/400 pane and VMessageQueue objects are created, they are initialized to a default state. The list of messages is not loaded at creation time. To load the contents, the caller must explicitly call the load() method on either object. This will initiate communication to the AS/400 system to gather the contents of the list.
At run-time, a user can perform actions on any message queue or message through the pop-up menu. The following actions are available for message queues:
Of course, users can only access message queues to which they are authorized. In addition, the caller can prevent the user from performing actions by using the setAllowActions() method on the pane.
The following example creates a VMessageQueue and presents it in an AS400ExplorerPane:
// Create the VMessageQueue object. // Assume that "system" is an AS400 // object created and initialized // elsewhere. VMessageQueue root = new VMessageQueue (system, "/QSYS.LIB/MYLIB.LIB/MYMSGQ.MSGQ"); // Create and load an // AS400ExplorerPane object. AS400ExplorerPane explorerPane = new AS400ExplorerPane (root); explorerPane.load (); // Add the explorer pane to a frame. // Assume that "frame" is a JFrame // created elsewhere. frame.getContentPane ().add (explorerPane);
Present the list of messages in a message queue using an AS400ExplorerPane with a VMessageQueue object.
The following image shows the VMessageQueue graphical user interface component:
VMessageQueue GUI component |
![]() |