Package org.mc4j.ems.connection.local

Examples of org.mc4j.ems.connection.local.LocalVirtualMachine


                throw new InvalidPluginConfigurationException("A command line is required for the "
                    + connectionTypeDescriptorClassName + " connection type.");
            }

            Map<Integer, LocalVirtualMachine> vms = LocalVMFinder.getManageableVirtualMachines();
            LocalVirtualMachine targetVm = null;
            if (vms != null) {
                for (LocalVirtualMachine vm : vms.values()) {
                    if (vm.getCommandLine().equals(commandLine)) {
                        targetVm = vm;
                        break;
                    }
                }
            }
            if (targetVm == null) {
                // This could just be because the JVM is not currently running.
                throw new Exception("JVM with command line [" + commandLine + "] not found.");
            }
            String vmId = String.valueOf(targetVm.getVmid());
            settings.setServerUrl(vmId);
        } else if (connectionTypeDescriptor instanceof J2SE5ConnectionTypeDescriptor) {
            // Connect via JMX Remoting, using the JVM Attach API to start up a JMX Remoting Agent if necessary.
            String jmxConnectorAddress = getJmxConnectorAddress(pluginConfig, process);
            settings.setServerUrl(jmxConnectorAddress);
View Full Code Here


                    s1 = ConnectorAddressLink.importFrom(i);
                    monitoredvm.detach();
                }
                catch (Exception exception) {
                }
                map.put((Integer) obj, new LocalVirtualMachine(i, s, flag, s1));
            }
        }
    }
View Full Code Here

                    }
                    catch (AttachNotSupportedException attachnotsupportedexception) {
                    }
                    catch (IOException ioexception) {
                    }
                    map.put(integer, new LocalVirtualMachine(integer.intValue(), virtualmachinedescriptor.displayName(), flag, s));
                }
            }
            catch (NumberFormatException numberformatexception) {
            }
        }
View Full Code Here


    protected void doConnect() {

        Integer vmid = Integer.parseInt(this.connectionSettings.getServerUrl());
        LocalVirtualMachine lvm = LocalVMConnector.getAllMonitorableVirtualMachines().get(vmid);
        if (lvm == null) {
            throw new EmsConnectException("Couldn't find VirtualMachine with id " + vmid);
        }

        if (!lvm.isManageable()) {
            try {
                LocalVMConnector.startManagementAgent(lvm);
            } catch (IOException e) {
                throw new EmsConnectException("Couldn't make vm manageable through agent attachment",e);
            }
        }
        connectionSettings.setServerUrl(lvm.getConnectorAddress());

        super.doConnect();
    }
View Full Code Here


    protected void doConnect() {

        Integer vmid = Integer.parseInt(this.connectionSettings.getServerUrl());
        LocalVirtualMachine lvm = LocalVMConnector.getAllMonitorableVirtualMachines().get(vmid);
        if (lvm == null) {
            throw new EmsConnectException("Couldn't find VirtualMachine with id " + vmid);
        }

        if (!lvm.isManageable()) {
            try {
                LocalVMConnector.startManagementAgent(lvm);
            } catch (IOException e) {
                throw new EmsConnectException("Couldn't make vm manageable through agent attachment",e);
            }
        }
        connectionSettings.setServerUrl(lvm.getConnectorAddress());

        super.doConnect();
    }
View Full Code Here

TOP

Related Classes of org.mc4j.ems.connection.local.LocalVirtualMachine

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.