Examples of MQJMXConnectorInfo


Examples of com.sun.enterprise.connectors.system.MQJMXConnectorInfo

  // create-jmsdest
  public void createJMSDestination(String destName, String destType,
    Properties destProps, String tgtName) throws JMSAdminException {

    sLogger.log(Level.FINE, "createJMSDestination ...");
                MQJMXConnectorInfo mqInfo = getMQJMXConnectorInfo(tgtName);

    //MBeanServerConnection  mbsc = getMBeanServerConnection(tgtName);
    try {
            MBeanServerConnection mbsc = mqInfo.getMQMBeanServerConnection();
      ObjectName on = new ObjectName(
        MQObjectName.DESTINATION_MANAGER_CONFIG_MBEAN_NAME);
      String [] signature = null;
      AttributeList destAttrs = null;
      Object [] params = null;

      if (destProps != null) {
        destAttrs = convertProp2Attrs(destProps);
      }
                       
            // setAppserverDefaults(destAttrs, mqInfo);

      if (destType.equalsIgnoreCase(JMSAdminConstants.JMS_DEST_TYPE_TOPIC)) {
        destType = DestinationType.TOPIC;
      } else if (destType.equalsIgnoreCase(JMSAdminConstants.JMS_DEST_TYPE_QUEUE)) {
        destType = DestinationType.QUEUE;
      }
      if ((destAttrs == null) || (destAttrs.size() == 0)){
                      signature = new String [] {
                     "java.lang.String",
                     "java.lang.String"};
                       params = new Object [] {destType, destName};
                  } else {
                     signature = new String [] {
                     "java.lang.String",
                     "java.lang.String",
                     "javax.management.AttributeList"};
                     params = new Object [] {destType, destName, destAttrs};
                  }

    mbsc.invoke(on, "create", params, signature);
    } catch (Exception e) {
                    logAndHandleException(e, "admin.mbeans.rmb.error_creating_jms_dest");
    } finally {
                    try {
                        if(mqInfo != null) {
                            mqInfo.closeMQMBeanServerConnection();
                        }
                    } catch (Exception e) {
                      handleException(e);
                    }
                }
View Full Code Here

Examples of com.sun.enterprise.connectors.system.MQJMXConnectorInfo

  public void deleteJMSDestination(String destName, String destType,
    String tgtName)
    throws JMSAdminException {

    sLogger.log(Level.FINE, "deleteJMSDestination ...");
                MQJMXConnectorInfo mqInfo = getMQJMXConnectorInfo(tgtName);

    //MBeanServerConnection  mbsc = getMBeanServerConnection(tgtName);

    try {
      MBeanServerConnection mbsc = mqInfo.getMQMBeanServerConnection();
      ObjectName on = new ObjectName(
        MQObjectName.DESTINATION_MANAGER_CONFIG_MBEAN_NAME);
      String [] signature = null;
      Object [] params = null;

      signature = new String [] {
        "java.lang.String",
        "java.lang.String"};

      if (destType.equalsIgnoreCase("topic")) {
        destType = DestinationType.TOPIC;
      } else if (destType.equalsIgnoreCase("queue")) {
        destType = DestinationType.QUEUE;
      }
      params = new Object [] {destType, destName};
      mbsc.invoke(on, "destroy", params, signature);
    } catch (Exception e) {
                   //log JMX Exception trace as WARNING
                   logAndHandleException(e, "admin.mbeans.rmb.error_deleting_jms_dest");
                } finally {
                    try {
                        if(mqInfo != null) {
                            mqInfo.closeMQMBeanServerConnection();
                        }
                    } catch (Exception e) {
                      handleException(e);
                    }
                }
View Full Code Here

Examples of com.sun.enterprise.connectors.system.MQJMXConnectorInfo

  // list-jmsdest
  public JMSDestinationInfo [] listJMSDestinations(String tgtName, String destType)
    throws JMSAdminException {

    sLogger.log(Level.FINE, "listJMSDestination ...");
                MQJMXConnectorInfo mqInfo = getMQJMXConnectorInfo(tgtName);

    //MBeanServerConnection  mbsc = getMBeanServerConnection(tgtName);
    try {
                        MBeanServerConnection mbsc = mqInfo.getMQMBeanServerConnection();
      ObjectName on = new ObjectName(
        MQObjectName.DESTINATION_MANAGER_CONFIG_MBEAN_NAME);
      String [] signature = null;
      Object [] params = null;

      ObjectName [] dests = (ObjectName [])mbsc.invoke(on, "getDestinations", params, signature);
      if ((dests != null) && (dests.length > 0)) {
                List<JMSDestinationInfo> jmsdi = new ArrayList<JMSDestinationInfo>();
        for (int i=0; i<dests.length; i++) {
          on = dests[i];

                    String jdiType = DestinationType.toStringLabel(on.getKeyProperty("desttype"));
          String jdiName = on.getKeyProperty("name");

          // check if the destination name has double quotes at the beginning
          // and end, if yes strip them
          if ((jdiName != null) && (jdiName.length() > 1)) {
            if (jdiName.indexOf('"') == 0) {
                      jdiName = jdiName.substring(1);
                  }
                  if (jdiName.lastIndexOf('"') == (jdiName.length() - 1)) {
                      jdiName = jdiName.substring(0, jdiName.lastIndexOf('"'));
                  }
          }

                    JMSDestinationInfo jdi = new JMSDestinationInfo(jdiName, jdiType);

                    if(destType == null) {
                        jmsdi.add(jdi);
                    } else if (destType.equals(JMSAdminConstants.JMS_DEST_TYPE_TOPIC)
                            || destType.equals(JMSAdminConstants.JMS_DEST_TYPE_QUEUE)) {
                        //Physical Destination Type specific listing
                        if (jdiType.equalsIgnoreCase(destType)) {
                            jmsdi.add(jdi);
                        }
                    }
        }
        return (JMSDestinationInfo[]) jmsdi.toArray(new JMSDestinationInfo[]{});
      }
    } catch (Exception e) {
                    //log JMX Exception trace as WARNING
                    logAndHandleException(e, "admin.mbeans.rmb.error_listing_jms_dest");
                } finally {
                    try {
                        if(mqInfo != null) {
                            mqInfo.closeMQMBeanServerConnection();
                        }
                    } catch (Exception e) {
                      handleException(e);
                    }
                }
View Full Code Here

Examples of com.sun.enterprise.connectors.system.MQJMXConnectorInfo

  // String status of jms ping RUNNING or exception
  public String JMSPing(String tgtName)
    throws JMSAdminException {

    sLogger.log(Level.FINE, "JMSPing ...");
                MQJMXConnectorInfo mqInfo = null;
    try {
      MQJMXConnectorInfo [] cInfo =
        ConnectorRuntime.getRuntime().getMQJMXConnectorInfo(tgtName);
      if ((cInfo == null) || (cInfo.length < 1)) {
        throw new JMSAdminException(
                        localStrings.getString("admin.mbeans.rmb.error_obtaining_jms"));
      }
      int k = -1;
      for (int i=0; i<cInfo.length; i++) {
        if (tgtName.equals(cInfo[i].getASInstanceName())) {
          k = i;
          break;
        }
      }
      if (k == -1) {
        throw new JMSAdminException(
        localStrings.getString("admin.mbeans.rmb.invalid_server_instance", tgtName));
      }
                        mqInfo = cInfo[k];

      MBeanServerConnection mbsc = cInfo[k].getMQMBeanServerConnection();
                        //perform some work on the connection to check for connection health.
                        mbsc.getMBeanCount();

    } catch (Exception e) {
                    //log JMX Exception trace as WARNING
                    logAndHandleException(e, "admin.mbeans.rmb.error_pinging_jms");
                } finally {
                    try {
                        if(mqInfo != null) {
                            mqInfo.closeMQMBeanServerConnection();
                        }
                    } catch (Exception e) {
                      handleException(e);
                    }
                }
View Full Code Here

Examples of com.sun.enterprise.connectors.system.MQJMXConnectorInfo

  // purge-jmsdest
  public void purgeJMSDestination(String destName, String destType, String tgtName)
    throws JMSAdminException {

    sLogger.log(Level.FINE, "purgeJMSDestination ...");
                MQJMXConnectorInfo mqInfo = getMQJMXConnectorInfo(tgtName);

    //MBeanServerConnection  mbsc = getMBeanServerConnection(tgtName);
    try {

                        MBeanServerConnection mbsc = mqInfo.getMQMBeanServerConnection();
      if (destType.equalsIgnoreCase("topic")) {
        destType = DestinationType.TOPIC;
      } else if (destType.equalsIgnoreCase("queue")) {
        destType = DestinationType.QUEUE;
      }
      ObjectName on =
        MQObjectName.createDestinationConfig(destType, destName);
      String [] signature = null;
      Object [] params = null;

      mbsc.invoke(on, "purge", params, signature);
    } catch (Exception e) {
                    //log JMX Exception trace as WARNING
                    logAndHandleException(e, "admin.mbeans.rmb.error_purging_jms_dest");
                } finally {
                    try {
                        if(mqInfo != null) {
                            mqInfo.closeMQMBeanServerConnection();
                        }
                    } catch (Exception e) {
                      handleException(e);
                    }
                }
View Full Code Here

Examples of com.sun.enterprise.connectors.system.MQJMXConnectorInfo


        private MQJMXConnectorInfo getMQJMXConnectorInfo(String tgtName)
                                                    throws JMSAdminException {
                sLogger.log(Level.FINE, "getMQJMXConnectorInfo for " + tgtName);
                MQJMXConnectorInfo mcInfo = null;
                                                                                                                                             
                try {
                        MQJMXConnectorInfo [] cInfo =
                                ConnectorRuntime.getRuntime().getMQJMXConnectorInfo(tgtName);
                        if ((cInfo == null) || (cInfo.length < 1)) {
View Full Code Here

Examples of org.glassfish.jms.admin.cli.MQJMXConnectorInfo

        } else {
            configRef = cluster.getConfigRef();
        }
       
        PhysicalDestinations pd = new PhysicalDestinations();
        MQJMXConnectorInfo mqInfo = pd.getConnectorInfo(target, configRef, habitat, domain);
       
        return mqInfo.getMQMBeanServerConnection();
    }
View Full Code Here

Examples of org.glassfish.jms.admin.cli.MQJMXConnectorInfo

        } else {
            configRef = cluster.getConfigRef();
        }
       
        PhysicalDestinations pd = new PhysicalDestinations();
        MQJMXConnectorInfo mqInfo = pd.getConnectorInfo(target, configRef, habitat, domain);
       
        return mqInfo.getMQMBeanServerConnection();
    }
View Full Code Here

Examples of org.glassfish.jms.admin.cli.MQJMXConnectorInfo

        } else {
            configRef = cluster.getConfigRef();
        }
       
        PhysicalDestinations pd = new PhysicalDestinations();
        MQJMXConnectorInfo mqInfo = pd.getConnectorInfo(target, configRef, habitat, domain);
       
        return mqInfo.getMQMBeanServerConnection();
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.