/*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation. Oracle designates this
* particular file as subject to the "Classpath" exception as provided
* by Oracle in the LICENSE file that accompanied this code.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
@SuppressWarnings("serial")
implements ActionListener, InternalFrameListener {
static {
// Apply the system L&F if it is GTK or Windows, and
// the L&F is not specified using a system property.
try {
} catch (Exception e) {
}
}
}
}
static void updateLafValues() {
//BorderedComponent.updateLafValues();
}
"service:jmx:";
new ArrayList<VMInternalFrame>();
static boolean debug;
super(title);
setRootPane(new FixedJRootPane());
setAccessibleDescription(this,
// TODO: Use Actions !
if(hotspot) {
hotspotMI.addActionListener(this);
}
connectMI.addActionListener(this);
exitMI.addActionListener(this);
if (AboutDialog.isBrowseSupported()) {
userGuideMI.addActionListener(this);
}
aboutMI.addActionListener(this);
}
return desktop;
}
return windows;
}
private void createMDI() {
// Restore title - we now show connection name on internal frames
// Add Window menu before Help menu
desktop = new JDesktopPane();
}
}
int separatorPosition;
// The width value of viewR is used to truncate long menu items.
// The rest are placeholders and are ignored for this purpose.
super(text);
}
if (separatorPosition == getMenuComponentCount()) {
addSeparator();
}
int index = -1;
int n = windowMenuWindows.length;
for (int i = 0; i < n; i++) {
if (windowMenuWindows[i] != null) {
// Slot is in use, try next
position++;
} else {
// Found a free slot
index = i;
break;
}
}
if (index == -1) {
// Create a slot at the end
index = n;
}
// Maybe truncate menu item string and end with "..."
}
// Set mnemonic using last digit of number
}
if (windowMenuWindows[i] == vmIF) {
windowMenuWindows[i] = null;
}
}
}
}
}
}
if (vmIF instanceof VMInternalFrame) {
}
}
tileWindows();
} else if (src == minimizeAllMI) {
try {
} catch (PropertyVetoException ex) {
// Ignore
}
}
} else if (src == restoreAllMI) {
try {
} catch (PropertyVetoException ex) {
// Ignore
}
}
} else if (src == userGuideMI) {
AboutDialog.browseUserGuide(this);
AboutDialog.showAboutDialog(this);
getClientProperty("JConsole.vmIF");
try {
vmIF.setSelected(true);
} catch (PropertyVetoException ex) {
// Ignore
}
vmIF.moveToFront();
}
}
}
public void tileWindows() {
int w = -1;
int h = -1;
int n = 0;
n++;
if (w == -1) {
try {
vmIF.setMaximum(true);
} catch (PropertyVetoException ex) {
// Ignore
}
}
}
}
if (n > 0 && w > 0 && h > 0) {
int x = 0;
int y = 0;
w /= cols;
h /= rows;
int col = 0;
try {
} catch (PropertyVetoException ex) {
// Ignore
}
if (n > 1) {
}
col++;
x += w;
} else {
col = 0;
x = 0;
y += h;
}
}
}
}
}
public void cascadeWindows() {
int n = 0;
int w = -1;
int h = -1;
try {
vmIF.setMaximum(false);
} catch (PropertyVetoException ex) {
// Ignore
}
n++;
if (w == -1) {
try {
vmIF.setMaximum(true);
} catch (PropertyVetoException ex) {
// Ignore
}
}
}
}
int x = 0;
int y = 0;
vmIF.setLocation(x, y);
vmIF.moveToFront();
x += dX;
y += dY;
}
}
}
// Call on EDT
}
// Call on EDT
}
// Call on EDT
new Thread("JConsole.addVmid") {
public void run() {
try {
} catch (final SecurityException ex) {
} catch (final IOException ex) {
}
}
}.start();
}
// Call on EDT
final boolean tile) {
new Thread("JConsole.addUrl") {
public void run() {
try {
tile);
} catch (final MalformedURLException ex) {
} catch (final SecurityException ex) {
} catch (final IOException ex) {
}
}
}.start();
}
// Call on EDT
final boolean tile) {
new Thread("JConsole.addHost") {
public void run() {
try {
tile);
} catch (final IOException ex) {
public void run() {
}
});
}
}
}.start();
}
// Call on worker thread
public void run() {
if (tile) {
public void run() {
tileWindows();
}
});
}
}
});
}
// Call on worker thread
public void run() {
null,
-1,
errorMessage(ex));
}
});
}
for (VMInternalFrame f : windows) {
try {
f.setMaximum(false);
} catch (PropertyVetoException ex) {
// Ignore
}
}
frameLoc += 30;
vmIF.setVisible(true);
try {
vmIF.setMaximum(true);
} catch (PropertyVetoException ex) {
// Ignore
}
}
vmIF.addInternalFrameListener(this);
return vmIF;
}
int port,
if (connectDialog == null) {
connectDialog = new ConnectDialog(this);
}
port,
msg);
connectDialog.setVisible(true);
try {
// Bring to front of other dialogs
connectDialog.setSelected(true);
} catch (PropertyVetoException e) {
}
}
private void showCreateMBeanDialog() {
if (createDialog == null) {
createDialog = new CreateMBeanDialog(this);
}
createDialog.setVisible(true);
try {
// Bring to front of other dialogs
createDialog.setSelected(true);
} catch (PropertyVetoException e) {
}
}
}
return true;
}
return false;
}
boolean valid = false;
valid = true;
}
} else {
//---------------------------------------
// Supported host and port combinations:
// hostname:port
// IPv4Address:port
// [IPv6Address]:port
//---------------------------------------
// Is literal IPv6 address?
//
if (index != -1) {
// Extract literal IPv6 address
//
// Extract port
//
try {
valid = true;
}
} catch (NumberFormatException ex) {
valid = false;
}
}
}
} else {
if (s.length == 2) {
try {
valid = true;
}
} catch (NumberFormatException ex) {
valid = false;
}
}
}
}
}
return valid;
}
while (c != null) {
cause = c;
c = c.getCause();
}
if (cause instanceof ConnectException) {
} else if (cause instanceof UnknownHostException) {
} else if (cause instanceof NoRouteToHostException) {
} else if (cause instanceof FailedLoginException) {
} else if (cause instanceof SSLHandshakeException) {
}
} else if (ex instanceof MalformedURLException) {
}
}
// InternalFrameListener interface
if(!isProxyClientUsed(client))
client.markAsDead();
}
}
private static void usage() {
}
final ProxyClient proxyClient,
final boolean noTile,
final boolean hotspot) {
// Always create Swing GUI on the Event Dispatching Thread
public void run() {
// Center the window on screen, taking into account screen
// size and insets.
w, h);
jConsole.setVisible(true);
!noTile : false);
}
null,
null,
!noTile : false);
}
!noTile : false);
}
null,
0,
null,
null,
null);
}
}
});
}
int argIndex = 0;
OutputViewer.init();
}
usage();
return;
try {
1000;
} catch (NumberFormatException ex) {
usage();
return;
}
} else {
// Invalid argument
usage();
return;
}
noTile = true;
return;
debug = true;
return;
} else {
// Unknown switch
usage();
return;
}
}
hotspot = true;
}
if (isValidRemoteString(arg)) {
try {
} catch (NumberFormatException ex) {
usage();
return;
}
}
} else {
if (!isLocalAttachAvailable()) {
return;
}
try {
return;
}
} catch (NumberFormatException ex) {
usage();
return;
}
}
}
}
public static boolean isDebug() {
return debug;
}
if (debug) {
}
}
private static final boolean localAttachmentSupported;
static {
boolean supported;
try {
supported = true;
} catch (NoClassDefFoundError x) {
supported = false;
} catch (ClassNotFoundException x) {
supported = false;
}
}
public static boolean isLocalAttachAvailable() {
return localAttachmentSupported;
}
// Return a list of newly instantiated JConsolePlugin objects
if (pluginService == null) {
// First time loading and initializing the plugins
} else {
// reload the plugin so that new instances will be created
}
for (JConsolePlugin p : pluginService) {
}
return plugins;
}
try {
// validate all plugins
for (JConsolePlugin p : plugins) {
if (isDebug()) {
}
}
} catch (ServiceConfigurationError e) {
// Error occurs during initialization of plugin
e.getMessage()));
} catch (MalformedURLException e) {
e.printStackTrace();
}
e.getMessage()));
}
}
if (pluginService == null) {
}
}
private static void initEmptyPlugin() {
}
/**
* Utility method for converting a search path string to an array
* of directory and JAR file URLs.
*
* @param path the search path string
* @return the resulting array of directory and JAR file URLs
*/
int count = 0;
}
return urls;
}
/**
* Returns the directory or JAR file URL corresponding to the specified
* local file name.
*
* @param file the File object
* @return the resulting directory or JAR file URL, or null if unknown
*/
try {
} catch (IOException e) {
}
}
// If the file does not exist, then assume that it's a directory
}
}
public void updateUI() {
super.updateUI();
}
/**
* The revalidate method seems to be the only one that gets
* called whenever there is a change of L&F or change of theme
* in Windows L&F and GTK L&F.
*/
public void revalidate() {
// Workaround for Swing bug where the titledborder in both
// GTK and Windows L&F's use calculated colors instead of
//
// Putting null removes any previous override and causes a
// fallback to the current L&F's value.
shadow);
}
if (IS_GTK) {
// Workaround for Swing bug where the titledborder in
// GTK L&F use hardcoded color and font for the title
// instead of getting them from the theme.
}
super.revalidate();
}
}
}