18 * |
18 * |
19 * CDDL HEADER END |
19 * CDDL HEADER END |
20 */ |
20 */ |
21 |
21 |
22 /* |
22 /* |
23 * Copyright (c) 2011, 2012, Oracle and/or its affiliates. All rights reserved. |
23 * Copyright (c) 2011, 2013, Oracle and/or its affiliates. All rights reserved. |
24 */ |
24 */ |
25 |
25 |
26 package com.oracle.solaris.vp.panels.zconsole.client.text; |
26 package com.oracle.solaris.vp.panels.zconsole.client.text; |
27 |
27 |
28 import java.io.IOException; |
28 import java.io.IOException; |
29 import java.util.logging.Level; |
29 import java.util.logging.Level; |
30 import javax.management.*; |
30 import com.oracle.solaris.rad.client.RadException; |
31 import com.oracle.solaris.adr.Stability; |
31 import com.oracle.solaris.rad.connect.Connection; |
32 import com.oracle.solaris.rad.jmx.*; |
32 import com.oracle.solaris.rad.zonesbridge.IO; |
33 import com.oracle.solaris.rad.zonesbridge.IOMXBean; |
|
34 import com.oracle.solaris.vp.panel.common.ClientContext; |
33 import com.oracle.solaris.vp.panel.common.ClientContext; |
35 import com.oracle.solaris.vp.panel.common.api.panel.MBeanUtil; |
|
36 import com.oracle.solaris.vp.panel.common.control.Control; |
34 import com.oracle.solaris.vp.panel.common.control.Control; |
37 import com.oracle.solaris.vp.panel.common.model.*; |
35 import com.oracle.solaris.vp.panel.common.model.*; |
38 |
36 |
39 @SuppressWarnings({"serial"}) |
37 @SuppressWarnings({"serial"}) |
40 public class ZoneConsolePanelDescriptor |
38 public class ZoneConsolePanelDescriptor |
49 // |
47 // |
50 // Constructors |
48 // Constructors |
51 // |
49 // |
52 |
50 |
53 public ZoneConsolePanelDescriptor(String id, ClientContext context) |
51 public ZoneConsolePanelDescriptor(String id, ClientContext context) |
54 throws JMException, IncompatibleVersionException, IOException { |
52 throws IOException { |
55 |
53 |
56 super(id, context); |
54 super(id, context); |
57 |
55 |
58 MBeanServerConnection mbsc = context.getConnectionInfo().getConnector(). |
56 IO bean = null; |
59 getMBeanServerConnection(); |
|
60 |
|
61 ObjectName oName = MBeanUtil.makeObjectName( |
|
62 "com.oracle.solaris.rad.zonesbridge", "IO"); |
|
63 |
|
64 IOMXBean bean; |
|
65 try { |
57 try { |
66 bean = RadJMX.newMXBeanProxy(mbsc, oName, IOMXBean.class, |
58 Connection conn = context.getConnectionInfo().getConnection(); |
67 Stability.PRIVATE); |
59 bean = conn.getObject(new IO()); |
68 } catch (IncompatibleVersionException e) { |
60 } catch (RadException e) { |
69 String msg = "Incompatible client and server versions for: " + |
61 String msg = "Error getting object information for: " + |
70 IOMXBean.class.getSimpleName(); |
62 IO.class.getSimpleName(); |
71 getLog().log(Level.SEVERE, msg, e); |
|
72 throw e; |
|
73 } catch (JMException e) { |
|
74 // InstanceNotFoundException, IntrospectionException, |
|
75 // or ReflectionException |
|
76 String msg = "Error getting MBean information for: " + oName; |
|
77 getLog().log(Level.SEVERE, msg, e); |
63 getLog().log(Level.SEVERE, msg, e); |
78 throw e; |
64 throw e; |
79 } catch (IOException e) { |
65 } catch (IOException e) { |
80 String msg = "Error contacting MBean server while creating " + |
66 String msg = "Error contacting server while creating " + |
81 "proxy for: " + IOMXBean.class.getSimpleName(); |
67 "proxy for: " + IO.class.getSimpleName(); |
82 getLog().log(Level.SEVERE, msg, e); |
68 getLog().log(Level.SEVERE, msg, e); |
83 throw e; |
69 throw e; |
84 } |
70 } |
85 |
71 |
86 control = new MainControl(this, bean); |
72 control = new MainControl(this, bean); |