Create and activate an instance of MQeQueueManagerConfigure

You create the MQeQueueManagerConfigure object by calling the mqeQueueManagerConfigure_new method. Apart from the ExceptionBlock and the new MQeQueueManagerConfigure Handle, this method takes two additional parameters.

The method of operation depends on these parameters. "NULL" can be passed for these parameters, in which case mqeQueueManagerConfigure_activate is called immediately after mqeQueueManagerConfigure_new. Alternatively startup parameters can be passed.

You can activate the MQeQueueManagerConfigure class in either of the following ways:
  1. Call the empty constructor followed by activate():
    try
    {
       MQeQueueManagerConfigure qmConfig;
       MQeFields parms = new MQeFields();
       // initialize the parameters
    
       qmConfig = new MQeQueueManagerConfigure( ); 
       qmConfig.activate( parms, "MsgLog:qmName\\Queues\\" ); 
    }
    catch (Exception e)
    { … }
      
      
  2. Call the constructor with parameters:
    try
    {
       MQeQueueManagerConfigure qmConfig;
       MQeFields parms = new MQeFields();
       // initialize the parameters
    
       qmConfig = new MQeQueueManagerConfigure( parms, "MsgLog:qmName\\Queues\\" ); 
    }
    catch (Exception e)
    { … }
      
The first parameter is an MQeFields object that contains initialization parameters for the queue manager. These must contain at least the following:
  • An embedded MQeFields object (Name) that contains the name of the queue manager.
  • An embedded MQeFields object, that contains the location of the local queue store as the registry type (LocalRegType) and the registry directory name (DirName). If a base file registry is used these are the only parameters that are required. If a private registry is used, a PIN and KeyRingPassword are also required.

The directory name is stored as part of the queue manager definition and is used as a default value for the queue store in any future queue definitions. The directory does not have to exist and will be created when needed.

If you use an alias for any of the initialization parameters, or if you wish to use an alias to set the connection attribute rule name, the aliases should be defined before activating MQeQueueManagerConfigure .
   import com.ibm.mqe.*;
   import com.ibm.mqe.registry.*;
   import examples.queuemanager.MQeQueueManagerUtils;
   try
   {
      MQeQueueManagerConfigure qmConfig;
      MQeFields parms = new MQeFields();
      // initialize the parameters
      MQeFields qmgrFields  = new MQeFields();
      MQeFields regFields   = new MQeFields();

      // Queue manager name is needed
      qmgrFields.putAscii(MQeQueueManager.Name, "qmName");
      // Registry information
      regFields.putAscii(MQeRegistry.LocalRegType, 
                         "com.ibm.mqe.registry.MQeFileSession");
      regFields.putAscii(MQeRegistry.DirName, "qmname\\Registry"); 

      // add the embedded MQeFields objects
      parms.putFields(MQeQueueManager.QueueManager, qmgrFields);
      parms.putFields(MQeQueueManager.Registry, regFields);
      // activate the configure object
      qmConfig = new MQeQueueManagerConfigure( parms, "MsgLog:qmName\\Queues\\" );
   }
   catch (Exception e)
   { … }

The example code includes creating an instance of MQeQueueManagerConfigure.


Terms of use | WebSphere software

(c) Copyright IBM Corporation 2004, 2005. All rights reserved.