components/visual-panels/core/src/java/vpanels/client/com/oracle/solaris/vp/client/common/PanelResourceManager.java
equal
deleted
inserted
replaced
18 * |
18 * |
19 * CDDL HEADER END |
19 * CDDL HEADER END |
20 */ |
20 */ |
21 |
21 |
22 /* |
22 /* |
23 * Copyright (c) 2010, 2012, Oracle and/or its affiliates. All rights reserved. |
23 * Copyright (c) 2010, 2013, Oracle and/or its affiliates. All rights reserved. |
24 */ |
24 */ |
25 |
25 |
26 package com.oracle.solaris.vp.client.common; |
26 package com.oracle.solaris.vp.client.common; |
27 |
27 |
28 import java.io.*; |
28 import java.io.*; |
29 import java.net.*; |
29 import java.net.*; |
30 import java.security.*; |
30 import java.security.*; |
31 import java.util.*; |
31 import java.util.*; |
32 import com.oracle.solaris.rad.jmx.IncompatibleVersionException; |
|
33 import com.oracle.solaris.vp.panel.common.*; |
32 import com.oracle.solaris.vp.panel.common.*; |
34 import com.oracle.solaris.vp.panel.common.action.ActionAbortedException; |
33 import com.oracle.solaris.vp.panel.common.action.ActionAbortedException; |
35 import com.oracle.solaris.vp.panel.common.api.panel.*; |
34 import com.oracle.solaris.vp.panel.common.api.panel.*; |
36 import com.oracle.solaris.vp.util.misc.*; |
35 import com.oracle.solaris.vp.util.misc.*; |
37 import com.oracle.solaris.vp.util.misc.finder.Finder; |
36 import com.oracle.solaris.vp.util.misc.finder.Finder; |
81 throws ActionAbortedException, PanelResourceException |
80 throws ActionAbortedException, PanelResourceException |
82 { |
81 { |
83 List<URL> urls = new ArrayList<URL>(); |
82 List<URL> urls = new ArrayList<URL>(); |
84 boolean isLocal = NetUtil.isLocalAddress(info.getHost()); |
83 boolean isLocal = NetUtil.isLocalAddress(info.getHost()); |
85 |
84 |
86 PanelMXBeanTracker tracker = null; |
85 PanelBeanTracker tracker = null; |
87 PanelMXBean bean = null; |
86 Panel bean = null; |
88 |
87 |
89 // Download each resource |
88 // Download each resource |
90 for (ResourceDescriptor descriptor : panel.getResourceDescriptors()) { |
89 for (ResourceDescriptor descriptor : panel.getResourceDescriptors()) { |
91 checkForCancel(); |
90 checkForCancel(); |
92 |
91 |
210 |
209 |
211 // |
210 // |
212 // Private methods |
211 // Private methods |
213 // |
212 // |
214 |
213 |
215 private PanelMXBeanTracker createTracker(ConnectionInfo info) |
214 private PanelBeanTracker createTracker(ConnectionInfo info) |
216 throws PanelResourceException { |
215 throws PanelResourceException { |
217 |
216 |
218 PanelMXBeanTracker tracker; |
217 PanelBeanTracker tracker; |
219 |
218 |
220 try { |
219 try { |
221 tracker = new PanelMXBeanTracker(); |
220 tracker = new PanelBeanTracker(); |
222 tracker.setConnectionInfo(info); |
221 tracker.setConnectionInfo(info); |
223 |
222 |
224 } catch (TrackerException e) { |
223 } catch (TrackerException e) { |
225 Throwable cause = e.getCause(); |
224 Throwable cause = e.getCause(); |
226 String message; |
225 String message = Finder.getString("download.error.general", |
227 |
226 info.getHost()); |
228 if (cause instanceof IncompatibleVersionException) { |
|
229 IncompatibleVersionException ive = |
|
230 (IncompatibleVersionException)cause; |
|
231 |
|
232 message = Finder.getString("proxy.error.version", |
|
233 ive.getClientVersion(), ive.getServerVersion(), |
|
234 ive.getInterfaceClass().getSimpleName()); |
|
235 } else { |
|
236 message = Finder.getString("download.error.general", |
|
237 info.getHost()); |
|
238 } |
|
239 |
|
240 throw new PanelResourceException(message, cause); |
227 throw new PanelResourceException(message, cause); |
241 } |
228 } |
242 |
229 |
243 return tracker; |
230 return tracker; |
244 } |
231 } |