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

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


     */
    private void setupForCluster() throws Exception {
        java.util.Map<String,JmsHost> hostMap =
            getResolvedLocalJmsHostsInMyCluster(true);
        //First add my jms host.
        JmsHost jmsHost = hostMap.get(myName);
        MQUrl myUrl = createUrl(jmsHost, nodeHost);
        urlList.add(myUrl);
        hostMap.remove(myName);

        // Add all buddies to URL.
View Full Code Here


            final Server[] buddies = getServersInCluster(cluster);
            for (final Server as : buddies) {
                if (!includeMe && myName.equals(as.getName()))
                    continue;

                JmsHost copy = null;
                try {
                            copy  = getResolvedJmsHost(as);
                    } catch (Exception e) {
                      //e.printStackTrace();
                }
View Full Code Here

                                         String serverName) throws Exception {
        logFine(" getresolved " + serverName);
       //ConfigContext con =  getAdminConfigContext();
       Server serverInstance = getServerByName(serverName);
       logFine("serverinstace " + serverInstance);
       JmsHost jmsHost = getResolvedJmsHost(serverInstance);
       return jmsHost;
    }
View Full Code Here

    //    if (JMSServiceType.LOCAL.toString().equals(jmsService.getType())  || JMSServiceType.EMBEDDED.toString().equals(jmsService.getType())) {
      //      jmsHost = getDefaultJmsHost(jmsService);
        //}
       // return ( jmsHost );

        JmsHost jmsHost   = getResolvedLocalJmsHostInServer(as);
        JmsHost copy      = createJmsHostCopy(jmsHost, as);


        String hostName = getNodeHostName(as);
        String port = JmsRaUtil.getJMSPropertyValue(as) ;//"JMS_PROVIDER_PORT", "7676");
        if (copy != null) {
             copy.setHost(hostName);
             copy.setPort(port);
        }

        return copy;

       // return null; //getResolvedJmsHost(as);
View Full Code Here

       // return null; //getResolvedJmsHost(as);
    }

    private JmsHost createJmsHostCopy(final JmsHost jmsHost, final Server server)
        {
        JmsHost jmsHostCopy = new JmsHostWrapper();


        try {
            jmsHostCopy.setAdminPassword(jmsHost.getAdminPassword());
            jmsHostCopy.setAdminUserName(jmsHost.getAdminUserName());
            jmsHostCopy.setName(jmsHost.getName());
            jmsHostCopy.setHost(jmsHost.getHost());
            jmsHostCopy.setPort(jmsHost.getPort());
        } catch(Exception tfe) {
            tfe.printStackTrace();//todo: handle this exception
        }
        return jmsHostCopy;
     }
View Full Code Here

     private JmsHost getResolvedLocalJmsHostInServer(final Server server)  {
        Config config = getConfigForServer(server);
        if (config != null)
        {
            JmsService jmsService = config.getExtensionByType(JmsService.class);
            JmsHost jmsHost = null;
             if (JMSServiceType.LOCAL.toString().equals(jmsService.getType())  || JMSServiceType.EMBEDDED.toString().equals(jmsService.getType())) {
            jmsHost = getDefaultJmsHost(jmsService);
            }
            return ( jmsHost );
View Full Code Here

     }

    public JmsHost getDefaultJmsHost(JmsService jmsService){
        String defaultJmsHost=   jmsService.getDefaultJmsHost();
        List <JmsHost> jmsHosts = jmsService.getJmsHost();
        JmsHost jmsHost = null;
        if (defaultJmsHost != null && ! defaultJmsHost.equals("") && jmsHosts != null && jmsHosts.size()> 0){
            for (int i=0; i <jmsHosts.size(); i++)
                   if (defaultJmsHost.equals((jmsHosts.get(i)).getName()))
                          return (JmsHost)jmsHosts.get(i);
            }
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

    }

    protected JmsHost getJmsHost()
    {
        String defaultJmsHost = getJmsService().getDefaultJmsHost();
        JmsHost jmsHost = null;
        if (defaultJmsHost == null || defaultJmsHost.equals("")) {
            jmsHost = (JmsHost) Globals.get(JmsHost.class); //ServerBeansFactory.getJmsHostBean(ctx);
        } else {
                List jmsHostsList = getJmsService().getJmsHost();

                for (int i=0; i < jmsHostsList.size(); i ++)
                {
                    JmsHost tmpJmsHost = (JmsHost) jmsHostsList.get(i);
                    if (tmpJmsHost != null && tmpJmsHost.getName().equals(defaultJmsHost))
                        jmsHost = tmpJmsHost;
                }
            if(jmsHost == null){
                if (jmsHostsList != null && jmsHostsList.size() > 0){
                    jmsHost = (JmsHost) jmsHostsList.get(0);
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

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.