Package com.sun.messaging.jmq.jmsspi

Examples of com.sun.messaging.jmq.jmsspi.JMSAdmin


   * @exception JMSException thrown if JMSAdmin could not be created/returned.
   */
  public JMSAdmin getJMSAdmin(String jmsAdminURL, PropertiesHolder brokerPropertiesHolder, String userName, String adminPassword,
      boolean secure) throws JMSException {
    Properties connectionProps = createProviderProperties(jmsAdminURL, secure);
    JMSAdmin admin = new JMSAdminImpl(connectionProps, brokerPropertiesHolder, userName, adminPassword);
    return admin;
  }
View Full Code Here


   * @exception JMSException  thrown if JMSAdmin could not be created/returned.
   */
  public JMSAdmin getJMSAdmin(String jmsAdminURL, String adminUserName, String adminPassword, boolean secure)
      throws JMSException {
    Properties connectionProps = createProviderProperties(jmsAdminURL, secure);
    JMSAdmin admin = new JMSAdminImpl(connectionProps, null, adminUserName, adminPassword);
    return admin;
  }
View Full Code Here

   * @return Implementation of JMSAdmin.
   * @exception JMSException thrown if JMSAdmin could not be created/returned.
   */
  public JMSAdmin getJMSAdmin(String jmsAdminURL, boolean secure) throws JMSException {
    Properties connectionProps = createProviderProperties(jmsAdminURL, secure);
    JMSAdmin admin = new JMSAdminImpl(connectionProps, null, DEFAULT_ADMIN_USERNAME, DEFAULT_ADMIN_PASSWD);
    return admin;
  }
View Full Code Here

        return jmsAdminFactory;
    }

    protected static JMSAdmin getJMSAdmin() throws Exception {
        JMSAdmin jmsAdmin = JmsProviderLifecycle.getJMSAdmin();
        if (jmsAdmin == null) {
            jmsAdmin = getJMSAdminFactory().getJMSAdmin();
        }
        return jmsAdmin;
    }
View Full Code Here

         @return Status of JMS service
    */
    public JMSStatus JMSPing() throws JMSAdminException
    {
        try {
            JMSAdmin jmsAdmin = getJMSAdmin();
            jmsAdmin.pingProvider();
        } catch (Exception e) {
            sLogger.throwing(getClass().getName(), "JMSPing", e);
            handleException(e);
        }

View Full Code Here

    */
    public JMSStatus JMSPing(String username, String password, int port)
                        throws JMSAdminException
    {
        try {
            JMSAdmin jmsAdmin = getJMSAdmin();
            jmsAdmin.pingProvider(username, RelativePathResolver.getRealPasswordFromAlias(password), port);
        } catch (Exception e) {
            sLogger.throwing(getClass().getName(), "JMSPing", e);
            handleException(e);
        }

View Full Code Here

    public String JMSPing(String targetName)
                        throws JMSAdminException
    {
        try {
               
                JMSAdmin jmsAdmin = getJMSAdmin(targetName);
                jmsAdmin.pingProvider();
        } catch (Exception e) {
            sLogger.throwing(getClass().getName(), "JMSPing", e);
            handleException(e);
        }
View Full Code Here

        validateJMSDestName(destName);
        validateJMSDestType(destType);

        int newDestType = JMSConstants.QUEUE;
        JMSAdmin jmsAdmin = null;
        boolean connected = false;


        try {
       /* Do not restrict the number of consumers, because in 4.1 MQ
        * open MQ, there is no restriction on the number of consumers
        * for a queue. In 4.0 PE there was a restriction of 2.
        * Fixes issue : 6543199
        */
             if (destType.equals(JMSAdminConstants.JMS_DEST_TYPE_QUEUE)) {
                if (destProps == null) {
                    destProps = new Properties();
                }
                String maxConsumersProperty = IASJmsUtil.getMaxActiveConsumersProperty();
                String maxConsumersAttribute = IASJmsUtil.getMaxActiveConsumersAttribute();
                String maxConsumersValue = IASJmsUtil.getDefaultMaxActiveConsumers();
                if (!destProps.containsKey(maxConsumersProperty) &&
                    !destProps.containsKey(maxConsumersAttribute) ) {
                    destProps.put(maxConsumersAttribute, maxConsumersValue);
                }
            }

        // check and use JMX
            Target target = getResourceTarget(tgtName);
        if (JMSDestination.useJMX(target)) {
          JMSDestination jmsd = new JMSDestination();
          jmsd.createJMSDestination(destName, destType, destProps, tgtName);
          return;
        } else {
              jmsAdmin = getJMSAdmin(tgtName);
              jmsAdmin.connectToProvider();
              connected = true;
 
              if (destType.equals(JMSAdminConstants.JMS_DEST_TYPE_TOPIC)) {
                  newDestType = JMSConstants.TOPIC;
              } else if (destType.equals(JMSAdminConstants.JMS_DEST_TYPE_QUEUE)) {
                  newDestType = JMSConstants.QUEUE;
              }
 
              jmsAdmin.createProviderDestination(destName, newDestType, destProps);
        }
        } catch (Exception e) {
            handleException(e);
        } finally {
            if (connected)  {
                try  {
                    jmsAdmin.disconnectFromProvider();
                } catch (Exception ex)  {
                    handleException(ex);
                }
            }
        }
View Full Code Here

    validateJMSDestName(destName);
    validateJMSDestType(destType);

        int newDestType = JMSConstants.QUEUE;
        JMSAdmin jmsAdmin = null;
        boolean connected = false;

        try {
        // check and use JMX
            Target target = getResourceTarget(tgtName);
        if (JMSDestination.useJMX(target)) {
          JMSDestination jmsd = new JMSDestination();
          jmsd.deleteJMSDestination(destName, destType, tgtName);
          return;
        } else {
              jmsAdmin = getJMSAdmin(tgtName);
              jmsAdmin.connectToProvider();
              connected = true;
 
              if (destType.equals(JMSAdminConstants.JMS_DEST_TYPE_TOPIC)) {
                      newDestType = JMSConstants.TOPIC;
              } else if (destType.equals(JMSAdminConstants.JMS_DEST_TYPE_QUEUE)) {
                      newDestType = JMSConstants.QUEUE;
              }
 
              jmsAdmin.deleteProviderDestination(destName, newDestType);
        }
        } catch (Exception e) {
            sLogger.throwing(getClass().getName(), "deleteJMSDestination", e);
            handleException(e);
        } finally {
            if (connected)  {
                try  {
                    jmsAdmin.disconnectFromProvider();
                } catch (Exception ex)  {
                    handleException(ex);
                }
            }
        }
View Full Code Here

      */
    public JMSDestinationInfo[] listJMSDestinations(String destType, String tgtName)
                throws JMSAdminException
    {
        JMSDestinationInfo  destInfoArray[] = null;
        JMSAdmin jmsAdmin = null;
        boolean connected = false;

        sLogger.entering(getClass().getName(), "listJMSDestinations", destType);
       
        try {

              String s[][] = {null, null};
              jmsAdmin = getJMSAdmin();
              jmsAdmin.connectToProvider();
              connected = true;
 
              s = jmsAdmin.getProviderDestinations();
 
              if (destType == null) {
                  destInfoArray = listAllDestinations(s);
              } else if (destType.equals(JMSAdminConstants.JMS_DEST_TYPE_TOPIC) ||
                 destType.equals(JMSAdminConstants.JMS_DEST_TYPE_QUEUE)) {
                 destInfoArray = listDestinationsByType(destType, s);
              } else {
                 destInfoArray = listAllDestinations(s);
              }
              return (destInfoArray);
       
        } catch (Exception e) {
            sLogger.throwing(getClass().getName(), "listJMSDestinations", e);
            handleException(e);
        } finally {
            if (connected)  {
                try  {
                    jmsAdmin.disconnectFromProvider();
                } catch (Exception ex)  {
                    handleException(ex);
                }
            }
        }
View Full Code Here

TOP

Related Classes of com.sun.messaging.jmq.jmsspi.JMSAdmin

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.