A VMessageQueue object is a resource that represents the messages in a server message queue for use in AS400Panes.
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 AS400Pane as the root by using the constructor or setRoot() method of the AS400Pane.
VMessageQueue has some other useful properties for defining the set of messages that are presented in AS400Panes. Use setSeverity() to specify the severity of messages that appear. Use setSelection() to specify the type of messages that appear.
When AS400Pane 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 server to gather the contents of the list.
At run-time, a user can perform actions on a message or message queue by right-clicking it to display the context menu. The context menu for message queues can include the following items:
The following action is available for messages on a message queue:
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);Example
Present the list of messages in a message queue using an AS400ExplorerPane with a VMessageQueue object. Figure 1 shows the VMessageQueue graphical user interface component:
Figure 1: VMessageQueue GUI component