/*
* 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.
*/
public WindowsAttachProvider() {
throw new RuntimeException(
"This provider is not supported on this version of Windows");
}
throw new RuntimeException(
"This provider is not supported on this processor architecture");
}
}
return "sun";
}
return "windows";
}
{
// AttachNotSupportedException will be thrown if the target VM can be determined
// to be not attachable.
return new WindowsVirtualMachine(this, vmid);
}
// If the temporary file system is secure then we use the default
// implementation, otherwise we create a list of Windows processes.
if (isTempPathSecure()) {
return super.listVirtualMachines();
} else {
return listJavaProcesses();
}
}
/**
* Returns true if the temporary file system supports security
*/
private static boolean isTempPathSecure() {
if (!wasTempPathChecked) {
synchronized (WindowsAttachProvider.class) {
if (!wasTempPathChecked) {
// aren't absolute
{
// check if the volume supports security
}
wasTempPathChecked = true;
}
}
}
return isTempPathSecure;
}
// flag to indicate persistent ACLs are supported
// indicates if we've checked the temporary file system
private static volatile boolean wasTempPathChecked;
// indicates if the temporary file system is secure (only valid when
// wasTempPathChecked is true)
private static boolean isTempPathSecure;
// returns the flags for the given volume
/**
* Returns a list of virtual machine descriptors derived from an enumeration
* of the process list.
*/
new ArrayList<VirtualMachineDescriptor>();
// Use localhost in the display name
try {
} catch (UnknownHostException uhe) {
// ignore
}
// Enumerate all processes.
// For those processes that have loaded a library named "jvm.dll"
// then we attempt to attach. If we succeed then we have a 6.0+ VM.
int processes[] = new int[1024];
for (int i=0; i<count; i++) {
try {
// FIXME - for now we don't have an appropriate display
// name so we use pid@hostname
} catch (AttachNotSupportedException x) {
} catch (IOException ioe) {
}
}
}
return list;
}
// enumerates processes using psapi's EnumProcesses
// indicates if a library of a given name has been loaded by a process
int processId);
// native functions in this library
static {
}
}