~ubuntu-branches/ubuntu/natty/tomcat6/natty-proposed

« back to all changes in this revision

Viewing changes to java/org/apache/catalina/mbeans/MBeanUtils.java

  • Committer: Bazaar Package Importer
  • Author(s): Thierry Carrez
  • Date: 2010-05-21 13:51:15 UTC
  • mfrom: (2.2.12 sid)
  • Revision ID: james.westby@ubuntu.com-20100521135115-qfwnf24lzvi3644v
Tags: 6.0.26-2
* debian/tomcat6.{postinst,prerm}: Respect TOMCAT6_USER and TOMCAT6_GROUP
  as defined in /etc/default/tomcat6 when setting directory permissions and
  authbind configuration (Closes: #581018, LP: #557300)
* debian/tomcat6.postinst: Use group "tomcat6" instead of "adm" for
  permissions in /var/lib/tomcat6, so that group "adm" doesn't get write
  permissions over /var/lib/tomcat6/webapps (LP: #569118)

Show diffs side-by-side

added added

removed removed

Lines of Context:
66
66
 *
67
67
 * @author Craig R. McClanahan
68
68
 * @author Amy Roh
69
 
 * @version $Revision: 777611 $ $Date: 2009-05-22 18:41:15 +0200 (Fr, 22. Mai 2009) $
 
69
 * @version $Revision: 911321 $ $Date: 2010-02-18 11:47:34 +0100 (Do, 18. Feb 2010) $
70
70
 */
71
71
 
72
72
public class MBeanUtils {
742
742
 
743
743
        ObjectName name = null;
744
744
        try {
745
 
            String address = (String)
 
745
            Object addressObj =
746
746
                IntrospectionUtils.getProperty(connector, "address");
747
747
            Integer port = (Integer)
748
748
                IntrospectionUtils.getProperty(connector, "port");
 
749
 
749
750
            StringBuffer sb = new StringBuffer(domain);
750
751
            sb.append(":type=Connector");
751
 
            sb.append(",port=" + port);
752
 
            if ((address != null) && (address.length()>0)) {
753
 
                sb.append(",address=" + address);
 
752
            sb.append(",port=");
 
753
            sb.append(port);
 
754
            if (addressObj != null) {
 
755
                String address = addressObj.toString();
 
756
                if (address.length() > 0) {
 
757
                    sb.append(",address=");
 
758
                    sb.append(ObjectName.quote(address));
 
759
                }
754
760
            }
755
761
            name = new ObjectName(sb.toString());
756
762
            return (name);
757
763
        } catch (Exception e) {
758
 
            throw new MalformedObjectNameException
759
 
                ("Cannot create object name for " + connector+e);
 
764
            MalformedObjectNameException mone =
 
765
                new MalformedObjectNameException
 
766
                ("Cannot create object name for " + connector);
 
767
            mone.initCause(e);
 
768
            throw mone;
760
769
        }
761
770
    }
762
771