Package com.sun.enterprise.connectors.jms.config

Examples of com.sun.enterprise.connectors.jms.config.JmsHost


        report.setActionExitCode(ActionReport.ExitCode.SUCCESS);
    }

   private JmsHost getDefaultJmsHost(JmsService jmsService){

      JmsHost jmsHost = null;
            String defaultJmsHostName = jmsService.getDefaultJmsHost();
            List jmsHostsList = jmsService.getJmsHost();

            for (int i=0; i < jmsHostsList.size(); i ++)
            {
               JmsHost tmpJmsHost = (JmsHost) jmsHostsList.get(i);
               if (tmpJmsHost != null && tmpJmsHost.getName().equals(defaultJmsHostName))
                     jmsHost = tmpJmsHost;
            }
      return jmsHost;
      }
View Full Code Here


        try {
            ConfigSupport.apply(new SingleConfigCode<JmsService>() {
                public Object run(JmsService param) throws PropertyVetoException, TransactionFailure {

                    JmsHost jmsHost = param.createChild(JmsHost.class); //TODO: need a way to create a JmsHost instance
                    jmsHost.setAdminPassword(mqpassword);
                    jmsHost.setAdminUserName(mquser);
                    jmsHost.setName(jmsHostName);
                    jmsHost.setHost(mqhost);
                    jmsHost.setPort(mqport);
        if(props != null)
        {
          for (Map.Entry e: props.entrySet()){
        Property prop = jmsHost.createChild(Property.class);
        prop.setName((String)e.getKey());
        prop.setValue((String)e.getValue());
        jmsHost.getProperty().add(prop);
      }
        }
                    param.getJmsHost().add(jmsHost);

                    return jmsHost;
View Full Code Here

                      if(configRef.equals(c.getName()))
                            jmsservice = c.getJmsService();
                   } */
         String defaultJmshostStr = jmsservice.getDefaultJmsHost();
         JmsHost defaultJmsHost = null;
               for (JmsHost jmshost : jmsservice.getJmsHost()) {

                      if(defaultJmshostStr.equals(jmshost.getName()))
                            defaultJmsHost = jmshost;
                   }
View Full Code Here

                       connectionURL = mqadList.toString();
                   }
                   logger.log(Level.FINE, " _getMQJMXConnectorInfo - connection URL " + connectionURL);
                   String adminUserName = null;
                String adminPassword = null;
                JmsHost jmsHost = mqadList.getDefaultJmsHost(jmsService);
                if (jmsHost != null) {//&& jmsHost.isEnabled()) {
                    adminUserName = jmsHost.getAdminUserName();
                    adminPassword = JmsRaUtil.getUnAliasedPwd(jmsHost.getAdminPassword());
                } else {
                    logger.log(Level.FINE, " _getMQJMXConnectorInfo, using default jms admin user and password ");
                }
                ResourceAdapter raInstance = getConfiguredRA(mqRAClassName,
                            connectionURL, adminUserName, adminPassword);
View Full Code Here

                 }

              String connectionUrl = list.toString();
              String adminUserName = null;
              String adminPassword = null;
              JmsHost jmsHost = list.getDefaultJmsHost(jmsService);
              if (jmsHost != null){// && jmsHost.isEnabled()) {
                  adminUserName = jmsHost.getAdminUserName();
                  adminPassword = JmsRaUtil.getUnAliasedPwd(jmsHost.getAdminPassword());
              } else {
                  logger.log(Level.FINE, " _getMQJMXConnectorInfo, using default jms admin user and password ");
              }
               raInstance = getConfiguredRA(mqRAClassName, connectionUrl,
                                           adminUserName, adminPassword);
View Full Code Here

            report.setMessage(localStrings.getLocalString("list.jms.host.invalidTarget",
                            "Invalid Target specified."));
            report.setActionExitCode(ActionReport.ExitCode.FAILURE);
            return;
        }
            JmsHost jmsHost = null;
            for (JmsHost r : jmsService.getJmsHost()) {
                if(jmsHostName.equals(r.getName())){
                    jmsHost = r;
                    break;
                }
            }
           if (jmsHost == null) {
            report.setMessage(localStrings.getLocalString("list.jms.host.noJmsHostFound",
                            "JMS Host {0} does not exist.", jmsHostName));
            report.setActionExitCode(ActionReport.ExitCode.FAILURE);
            return;
        }

        final JmsHost jHost = jmsHost;
         try {
            ConfigSupport.apply(new SingleConfigCode<JmsService>() {
                public Object run(JmsService param) throws PropertyVetoException, TransactionFailure {
                    return param.getJmsHost().remove(jHost);
                }
View Full Code Here

        //for EE to get port, host, adminusername, adminpassword.
        //JmsService jmsService = ServerBeansFactory.getJmsServiceBean(ctx);
        String defaultJmsHost = getJmsService().getDefaultJmsHost();
        logFine("Default JMS Host :: " + defaultJmsHost);

        JmsHost jmsHost = getJmsHost();


        if (jmsHost != null) {//todo: && jmsHost.isEnabled()) {
            JavaConfig javaConfig = (JavaConfig) Globals.get(JavaConfig.class); ;
            String java_home = javaConfig.getJavaHome();

            //Get broker type from JMS Service.
            // String brokerType = jmsService.getType();
            /*
             * XXX: adjust the brokertype for the new DIRECT mode in 4.1
             * uncomment the line below once we have an MQ integration
             * that has DIRECT mode support
             */
            String brokerType = adjustForDirectMode(getJmsService().getType());

            String brokerPort = jmsHost.getPort();
            brkrPort = brokerPort;
            String adminUserName = jmsHost.getAdminUserName();
            String adminPassword = JmsRaUtil.getUnAliasedPwd(jmsHost.getAdminPassword());
            List jmsHostProps= getJmsService().getProperty();

            String username = null;
            String password = null;
            if (jmsHostProps != null) {
            for (int i =0;i <jmsHostProps.size(); i++) {
                Property jmsProp =(Property)jmsHostProps.get(i);
                String propName = jmsProp.getName();
                String propValue = jmsProp.getValue();
                if ("user-name".equals(propName)) {
                    username = propValue;
                } else if ("password".equals(propName)) {
                    password = propValue;
                }
                // Add more properties as and when you want.
            }
           }

        logFine("Broker UserName = " + username);
            createMQVarDirectoryIfNecessary();
            String brokerVarDir = getMQVarDir();

            String tmpString = getJmsService().getStartArgs();
            if (tmpString == null) {
                tmpString = "";
            }

            String brokerArgs = tmpString;


            //XX: Extract the information from the optional properties.
       List jmsProperties =    getJmsService().getProperty();
     List jmsHostProperties = jmsHost.getProperty();
     Properties jmsServiceProp = listToProperties(jmsProperties);
     Properties jmsHostProp = listToProperties (jmsHostProperties);

     jmsServiceProp.putAll(jmsHostProp);
     if(jmsServiceProp.size() > 0) {
View Full Code Here

        List jmsHostsList = getJmsService().getJmsHost();
        if (jmsHostsList == null || jmsHostsList.size() == 0) {
            return (JmsHost) Globals.get(JmsHost.class);
        }

        JmsHost jmsHost = null;
        for (int i=0; i < jmsHostsList.size(); i ++) {
            JmsHost tmpJmsHost = (JmsHost) jmsHostsList.get(i);
            if (tmpJmsHost != null && tmpJmsHost.getName().equals(defaultJmsHost)) {
                jmsHost = tmpJmsHost;
                break;
            }
        }
        if (jmsHost == null) {
View Full Code Here

                   if (logger.isLoggable(Level.FINE)) {
                       logger.log(Level.FINE, " _getMQJMXConnectorInfo - connection URL " + connectionURL);
                   }
                   String adminUserName = null;
                String adminPassword = null;
                JmsHost jmsHost = mqadList.getDefaultJmsHost(jmsService);
                if (jmsHost != null) {//&& jmsHost.isEnabled()) {
                    adminUserName = jmsHost.getAdminUserName();
                    adminPassword = JmsRaUtil.getUnAliasedPwd(jmsHost.getAdminPassword());
                } else {
                    if (logger.isLoggable(Level.FINE)) {
                        logger.log(Level.FINE, " _getMQJMXConnectorInfo, using default jms admin user and password ");
                    }
                }
View Full Code Here

                 }

              String connectionUrl = list.toString();
              String adminUserName = null;
              String adminPassword = null;
              JmsHost jmsHost = list.getDefaultJmsHost(jmsService);
              if (jmsHost != null){// && jmsHost.isEnabled()) {
                  adminUserName = jmsHost.getAdminUserName();
                  adminPassword = JmsRaUtil.getUnAliasedPwd(jmsHost.getAdminPassword());
              } else {
                  if (logger.isLoggable(Level.FINE)) {
                      logger.log(Level.FINE, " _getMQJMXConnectorInfo, using default jms admin user and password ");
                  }
              }
View Full Code Here

TOP

Related Classes of com.sun.enterprise.connectors.jms.config.JmsHost

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.