Package com.sun.messaging

Examples of com.sun.messaging.AdministeredObject


  workPanel.add(separator);
 
  /*
   * From here, list the properties on the destination.
   */
  AdministeredObject obj = (AdministeredObject)new com.sun.messaging.Topic();
  Properties props = obj.getConfiguration();

  LabelledComponent items2[] = new LabelledComponent[props.size()];
  textItems = new JTextField[props.size()];

  int i = 0;
  for (Enumeration e = obj.enumeratePropertyNames(); e.hasMoreElements(); i++) {
      String propName = (String)e.nextElement();
      try {
    textItems[i] = new JTextField((String)props.get(propName), 25);
    items2[i] = new LabelledComponent(obj.getPropertyLabel(propName) + ":",
              textItems[i]);
      } catch (Exception ex) {
      }
  }

View Full Code Here


 
  /*
   * Factory Type
   */
  int type = ObjAdminEvent.QCF;
  AdministeredObject tempObj = null;

  if (cfLabel.getText().equals(acr.getString(acr.I_QCF))) {
      type = ObjAdminEvent.QCF;
      tempObj = (AdministeredObject)
      new com.sun.messaging.QueueConnectionFactory();
  } else if (cfLabel.getText().equals(acr.getString(acr.I_TCF))) {
      type = ObjAdminEvent.TCF;
      tempObj = (AdministeredObject)
      new com.sun.messaging.TopicConnectionFactory();
  } else if (cfLabel.getText().equals(acr.getString(acr.I_CF))) {
      type = ObjAdminEvent.CF;
      tempObj = (AdministeredObject)
      new com.sun.messaging.ConnectionFactory();
  } else if (cfLabel.getText().equals(acr.getString(acr.I_XAQCF))) {
      type = ObjAdminEvent.XAQCF;
      tempObj = (AdministeredObject)
      new com.sun.messaging.XAQueueConnectionFactory();
  } else if (cfLabel.getText().equals(acr.getString(acr.I_XATCF))) {
      type = ObjAdminEvent.XATCF;
      tempObj = (AdministeredObject)
      new com.sun.messaging.XATopicConnectionFactory();
  } else if (cfLabel.getText().equals(acr.getString(acr.I_XACF))) {
      type = ObjAdminEvent.XACF;
      tempObj = (AdministeredObject)
      new com.sun.messaging.XAConnectionFactory();
  }

  /*
   * Conn Factory Object Properties.
   * Go through each of the cfProps, get the userdata which is
   * the property name, get the value, set it in props.
   */
  Properties props = tempObj.getConfiguration();
  String propName, propValue, propType = null, propLabel = null;

  for (int i = 0; i < cfProps.size(); i++) {
      LabelledComponent cfItem = (LabelledComponent)cfProps.elementAt(i);
            propName = (String)cfItem.getClientData();
            if (propName == null)
    continue;

      // Remove this propName from the props, no longer applies.
            if (!(cfItem.getComponent().isEnabled())) {
    props.remove(propName);
                continue;
            }

      try {
                propType = tempObj.getPropertyType(propName);
                propLabel = tempObj.getPropertyLabel(propName);
      } catch (javax.jms.JMSException jmsex) {
        JOptionPane.showOptionDialog(this,
      jmsex.toString(),
      acr.getString(acr.I_OBJSTORE_CF_PROPS),
                        JOptionPane.YES_NO_OPTION,
                        JOptionPane.ERROR_MESSAGE, null, close, close[0]);
    return;
      }

      if (propType == null)
    continue;

      propValue = getValue(cfItem.getComponent(), propType).trim();

            // If blank, then use default set in Administered Object
            // so no need to set to "".
            if (propValue.equals(""))
                continue;

       try {
          // Calling setProperty() will verify if this value is valid.
    tempObj.setProperty(propName, propValue.trim());
    props.put(propName, propValue.trim());
      } catch (javax.jms.JMSException jmsex) {
    if (jmsex instanceof com.sun.messaging.InvalidPropertyValueException) {
            JOptionPane.showOptionDialog(this,
      acr.getString(acr.E_INVALID_VALUE, propLabel),
View Full Code Here

  //
  String propName = null;
  String propType = null;
  String value = null;

  AdministeredObject adminObj = (AdministeredObject)object;
  Properties props = adminObj.getConfiguration();

  for (int i = 0; i < cfProps.size(); i++) {
      LabelledComponent cfItem = (LabelledComponent)cfProps.elementAt(i);
      JComponent comp = cfItem.getComponent();
      propName = (String)cfItem.getClientData();
      if (propName == null)
    continue;

      try {
    if (comp.isEnabled()) {
                    propType = adminObj.getPropertyType(propName);
                    value = adminObj.getProperty(propName);
                    setValue(comp, propType, value);

                    // XXX This assumes the ConnectionType setting
                    // comes before the getting of the connection handler
                    // properties. Also, hard codes JMQConnectionType
                    // setting.
              if (comp instanceof JComboBox) {
            doComboBox((JComboBox)comp);
         }
    }
            } catch (Exception e) {
                System.err.println(e.toString() + ": " + propName);
            }

  }

  // now we should be able to set values.
  AdministeredObject tempObj2 = new com.sun.messaging.QueueConnectionFactory();
  setOtherValues(tempObj2, true);

  // Set read-only box
  if (adminObj.isReadOnly())
      checkBox.setSelected(true);
View Full Code Here

  }

  JPanel workPanel = new JPanel();
  JPanel topPanel = makeTopPanel(propsDlg);

  AdministeredObject aobj = new com.sun.messaging.QueueConnectionFactory();

  // Get the groups for this admin obj.
  String groupString = aobj.getPropertyGroups();
  String groups[] = stringToArray(groupString, "|");
  if (groups == null)
      return workPanel;

        GridBagLayout gridbag = new GridBagLayout();
        workPanel.setLayout(gridbag);
        GridBagConstraints c = new GridBagConstraints();
 
  c.gridx = 0;
  c.gridy = 0;
  c.weightx = 1;
  c.fill = GridBagConstraints.HORIZONTAL;
  c.anchor = GridBagConstraints.WEST;
  gridbag.setConstraints(topPanel, c);
  workPanel.add(topPanel);

  tabbedPane = new JTabbedPane();
  cfProps = new Vector();

  // Get properties for each group.
  // Then create a separate panel of properties for each group.
  for (int i = 0; i < groups.length; i++) {
 
      String groupName = aobj.getLabelForGroup(groups[i]);
      String groupPropsString = aobj.getPropertiesForGroup(groups[i]);
      String props[] = stringToArray(groupPropsString, "|");

      JPanel groupPanel = layoutGroupProperties(groups[i], groupName,
              props, aobj);
 
View Full Code Here

  /*
   * Destination Type
   */
  int type = ObjAdminEvent.QUEUE;
  AdministeredObject tempObj = null;

  if (queueButton.isSelected()) {
      type = ObjAdminEvent.QUEUE;
      tempObj = (AdministeredObject)new com.sun.messaging.Queue();
  }
  else if (topicButton.isSelected()) {
      type = ObjAdminEvent.TOPIC;
      tempObj = (AdministeredObject)new com.sun.messaging.Topic();
  }

  /*
   * Object Properties (dest name, ...);
   */
  int i = 0;
  Properties props = tempObj.getConfiguration();
  for (Enumeration e = tempObj.enumeratePropertyNames();
          e.hasMoreElements(); i++) {
      String propName = (String)e.nextElement();
      String value = textItems[i].getText();
      value = value.trim();
      // If blank, then use default set in Administered Object
View Full Code Here

  //
  // Create a temp object and set its default values in the
  // text fields.
  //
  AdministeredObject tempObj = new com.sun.messaging.Queue();
  Properties props = tempObj.getConfiguration();
  int i = 0;
  for (Enumeration e = tempObj.enumeratePropertyNames();
          e.hasMoreElements(); i++) {
      String propName = (String)e.nextElement();
      try {
          textItems[i].setText(tempObj.getProperty(propName));
      } catch (Exception ex) {
          textItems[i].setText("");
      }
  }
  lookupText.requestFocus();
View Full Code Here

  /*
   * Factory Type
   */
  int type = ObjAdminEvent.CF;
  AdministeredObject tempObj = null;

  String factory = (String)factoryCombo.getSelectedItem();
  if (factory.equals(acr.getString(acr.I_QCF))) {
      type = ObjAdminEvent.QCF;
      tempObj = (AdministeredObject)new com.sun.messaging.QueueConnectionFactory();
  } else if (factory.equals(acr.getString(acr.I_TCF))) {
      type = ObjAdminEvent.TCF;
      tempObj = (AdministeredObject)new com.sun.messaging.TopicConnectionFactory();
  } else if (factory.equals(acr.getString(acr.I_CF))) {
      type = ObjAdminEvent.CF;
      tempObj = (AdministeredObject)new com.sun.messaging.ConnectionFactory();
  } else if (factory.equals(acr.getString(acr.I_XAQCF))) {
      type = ObjAdminEvent.XAQCF;
      tempObj = (AdministeredObject)new com.sun.messaging.XAQueueConnectionFactory();
  } else if (factory.equals(acr.getString(acr.I_XATCF))) {
      type = ObjAdminEvent.XATCF;
      tempObj = (AdministeredObject)new com.sun.messaging.XATopicConnectionFactory();
  } else if (factory.equals(acr.getString(acr.I_XACF))) {
      type = ObjAdminEvent.XACF;
      tempObj = (AdministeredObject)new com.sun.messaging.XAConnectionFactory();
  }

  /*
   * Conn Factory Object Properties.
   * Go through each of the cfProps, get the userdata which is
   * the property name, get the value, set it in props.
   */
  Properties props = tempObj.getConfiguration();
  String propName, propValue, propType = null, propLabel = null;

  for (int i = 0; i < cfProps.size(); i++) {
      LabelledComponent cfItem = (LabelledComponent)cfProps.elementAt(i);
            propName = (String)cfItem.getClientData();
            if (propName == null)
    continue;

      if (!(cfItem.getComponent().isEnabled())) {
    props.remove(propName);
    continue;
      }

      // XXX Asssumes ConnectionType is set before it's
      // associated properties or exception will occur.
      try {
                propType = tempObj.getPropertyType(propName);
                propLabel = tempObj.getPropertyLabel(propName);
      } catch (javax.jms.JMSException jmsex) {
        JOptionPane.showOptionDialog(this,
        jmsex.toString(),
        acr.getString(acr.I_ADD_OBJSTORE_CF),
                    JOptionPane.YES_NO_OPTION,
                    JOptionPane.ERROR_MESSAGE, null, close, close[0]);
    return;
      }

      if (propType == null)
    continue;

      propValue = getValue(cfItem.getComponent(), propType).trim();

            // If blank, then use default set in Administered Object
            // so no need to set to "".
      if (propValue.equals(""))
     continue;

       try {
          // Calling setProperty() will verify if this value is valid.
    tempObj.setProperty(propName, propValue);
    props.put(propName, propValue);
      } catch (javax.jms.JMSException jmsex) {
    if (jmsex instanceof com.sun.messaging.InvalidPropertyValueException) {
            JOptionPane.showOptionDialog(this,
      acr.getString(acr.E_INVALID_VALUE, propLabel),
View Full Code Here

  //
  // Go through each of the items, get the userData which is
  // the property name, then get the default value from a
  // temporary object.
  //
  AdministeredObject tempObj = new com.sun.messaging.QueueConnectionFactory();
  Properties props = tempObj.getConfiguration();
  String propName = null, propType = null;
  String defaultValue = null;

  for (int i = 0; i < cfProps.size(); i++) {

      LabelledComponent cfItem = (LabelledComponent)cfProps.elementAt(i);
      JComponent comp = cfItem.getComponent();

      propName = (String)cfItem.getClientData();
      if (propName != null) {
    try {
        // Get value only if enabled, otherwise
        // gets, InvalidPropertyException.
        if (comp.isEnabled()) {
                  propType = tempObj.getPropertyType(propName);
            defaultValue = tempObj.getProperty(propName);
                  setValue(comp, propType, defaultValue);

            // XXX This assumes the ConnectionType setting
            // comes before the getting of the connection handler
            // properties. Also, hard codes JMQConnectionType
            // setting.
            if (comp instanceof JComboBox) {
          doComboBox((JComboBox)comp);
            }
        }
       
    } catch (Exception e) {
        System.err.println(e.toString() + ": " + propName);
    }
      }
  }

  // XXX Bad
  AdministeredObject tempObj2 = new com.sun.messaging.QueueConnectionFactory();
  setOtherValues(tempObj2, false);

  lookupText.requestFocus();
 
    }
View Full Code Here

TOP

Related Classes of com.sun.messaging.AdministeredObject

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.