Package com.biglybt.platform.unix
Class PlatformManagerImpl
java.lang.Object
com.biglybt.platform.unix.PlatformManagerImpl
- All Implemented Interfaces:
PlatformManager
,PlatformManager
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final HashSet
protected static AEMonitor
private static final LogIDs
private static final Object
protected static PlatformManagerImpl
Fields inherited from interface com.biglybt.pif.platform.PlatformManager
LOC_DOCUMENTS, LOC_DOWNLOADS, LOC_MUSIC, LOC_USER_DATA, LOC_VIDEO
Fields inherited from interface com.biglybt.platform.PlatformManager
ERR_UNSUPPORTED, PT_MACOSX, PT_OTHER, PT_UNIX, PT_WINDOWS, SD_ALL, SD_HIBERNATE, SD_SHUTDOWN, SD_SLEEP, USER_REQUEST_INFO, USER_REQUEST_QUESTION, USER_REQUEST_WARNING
-
Constructor Summary
ConstructorsConstructorDescriptionCreates a new PlatformManager and initializes its capabilities -
Method Summary
Modifier and TypeMethodDescriptionvoid
addListener
(PlatformManagerListener listener) private void
checkCapability
(PlatformManagerCapabilities capability) void
copyFilePermissions
(String from_file_name, String to_file_name) void
createProcess
(String command_line, boolean inherit_handles) void
dispose()
Disposes system resources.String[]
getLocation
(long location_id) Get a well-known location, if defined for the platformint
This max-open-files concept here is from linux/osx where network connections are treated as 'files'int
boolean
boolean
int
static PlatformManagerImpl
Gets the platform manager singleton, which was already initializedboolean
hasCapability
(PlatformManagerCapabilities capability) Gets whether the platform manager supports a capabilityprivate boolean
private static void
Instantiates the singletonboolean
isAdditionalFileTypeRegistered
(String name, String type) Checks to see if the supplied file type is registered with this applicationboolean
Class<?>
loadClass
(ClassLoader loader, String class_name) Gives a particular platform the ability to alter the class-loading methodvoid
performRecoverableFileDelete
(String file_name) void
ping
(InetAddress interface_address, InetAddress target, PlatformManagerPingCallback callback) void
registerAdditionalFileType
(String name, String description, String type, String content_type) Registers a file type with this applicationvoid
void
removeListener
(PlatformManagerListener listener) void
requestUserAttention
(int type, Object data) Requests the user's attention such as bouncing the application icon on OSXvoid
setExplicitVMOptions
(String[] options) void
setPreventComputerSleep
(boolean b) void
setRunAtLogin
(boolean run) void
setTCPTOSEnabled
(boolean enabled) enable or disable the platforms support for TCP TOSvoid
Reveals the file or directory with the platform's default browservoid
shutdown
(int type) void
boolean
testNativeAvailability
(String name) void
traceRoute
(InetAddress interface_address, InetAddress target, PlatformManagerPingCallback callback) void
unregisterAdditionalFileType
(String name, String type) Removes a file-type registrationMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface com.biglybt.platform.PlatformManager
setUseSystemTheme
-
Field Details
-
LOGID
-
singleton
-
class_mon
-
capabilitySet
-
migrate_lock
-
-
Constructor Details
-
PlatformManagerImpl
public PlatformManagerImpl()Creates a new PlatformManager and initializes its capabilities
-
-
Method Details
-
getSingleton
Gets the platform manager singleton, which was already initialized -
initializeSingleton
private static void initializeSingleton()Instantiates the singleton -
hasVMOptions
private boolean hasVMOptions() -
copyFilePermissions
public void copyFilePermissions(String from_file_name, String to_file_name) throws PlatformManagerException - Specified by:
copyFilePermissions
in interfacePlatformManager
- Throws:
PlatformManagerException
-
createProcess
public void createProcess(String command_line, boolean inherit_handles) throws PlatformManagerException - Specified by:
createProcess
in interfacePlatformManager
- Throws:
PlatformManagerException
-
dispose
public void dispose()Description copied from interface:PlatformManager
Disposes system resources. This method is optional.- Specified by:
dispose
in interfacePlatformManager
-
getApplicationCommandLine
- Specified by:
getApplicationCommandLine
in interfacePlatformManager
- Throws:
PlatformManagerException
-
getPlatformType
public int getPlatformType()- Specified by:
getPlatformType
in interfacePlatformManager
-
getUserDataDirectory
- Specified by:
getUserDataDirectory
in interfacePlatformManager
- Throws:
PlatformManagerException
-
getComputerName
- Specified by:
getComputerName
in interfacePlatformManager
- Returns:
- null if can't be found
-
getVersion
- Specified by:
getVersion
in interfacePlatformManager
- Throws:
PlatformManagerException
-
hasCapability
Description copied from interface:PlatformManager
Gets whether the platform manager supports a capability
Users of PlatformManager should check for supported capabilities before calling the corresponding methods
Note that support for a particular capability may change arbitrarily in the duration of the application session, but the manager will cache where necessary.
- Specified by:
hasCapability
in interfacePlatformManager
- Parameters:
capability
- A platform manager capability- Returns:
- True if the manager supports the capability
-
isApplicationRegistered
- Specified by:
isApplicationRegistered
in interfacePlatformManager
- Throws:
PlatformManagerException
-
performRecoverableFileDelete
- Specified by:
performRecoverableFileDelete
in interfacePlatformManager
- Throws:
PlatformManagerException
-
ping
public void ping(InetAddress interface_address, InetAddress target, PlatformManagerPingCallback callback) throws PlatformManagerException - Specified by:
ping
in interfacePlatformManager
- Throws:
PlatformManagerException
-
getMaxOpenFiles
Description copied from interface:PlatformManager
This max-open-files concept here is from linux/osx where network connections are treated as 'files'- Specified by:
getMaxOpenFiles
in interfacePlatformManager
- Returns:
- Throws:
PlatformManagerException
-
registerApplication
- Specified by:
registerApplication
in interfacePlatformManager
- Throws:
PlatformManagerException
-
addListener
- Specified by:
addListener
in interfacePlatformManager
-
removeListener
- Specified by:
removeListener
in interfacePlatformManager
-
getVMOptionFile
- Specified by:
getVMOptionFile
in interfacePlatformManager
- Throws:
PlatformManagerException
-
checkCapability
private void checkCapability(PlatformManagerCapabilities capability) throws PlatformManagerException - Throws:
PlatformManagerException
-
getExplicitVMOptions
- Specified by:
getExplicitVMOptions
in interfacePlatformManager
- Throws:
PlatformManagerException
-
setExplicitVMOptions
- Specified by:
setExplicitVMOptions
in interfacePlatformManager
- Throws:
PlatformManagerException
-
getRunAtLogin
- Specified by:
getRunAtLogin
in interfacePlatformManager
- Throws:
PlatformManagerException
-
setRunAtLogin
- Specified by:
setRunAtLogin
in interfacePlatformManager
- Throws:
PlatformManagerException
-
startup
- Specified by:
startup
in interfacePlatformManager
- Throws:
PlatformManagerException
-
getShutdownTypes
public int getShutdownTypes()- Specified by:
getShutdownTypes
in interfacePlatformManager
-
shutdown
- Specified by:
shutdown
in interfacePlatformManager
- Throws:
PlatformManagerException
-
setPreventComputerSleep
- Specified by:
setPreventComputerSleep
in interfacePlatformManager
- Throws:
PlatformManagerException
-
getPreventComputerSleep
public boolean getPreventComputerSleep()- Specified by:
getPreventComputerSleep
in interfacePlatformManager
-
setTCPTOSEnabled
Description copied from interface:PlatformManager
enable or disable the platforms support for TCP TOS- Specified by:
setTCPTOSEnabled
in interfacePlatformManager
- Throws:
PlatformManagerException
-
testNativeAvailability
- Specified by:
testNativeAvailability
in interfacePlatformManager
- Throws:
PlatformManagerException
-
traceRoute
public void traceRoute(InetAddress interface_address, InetAddress target, PlatformManagerPingCallback callback) throws PlatformManagerException - Specified by:
traceRoute
in interfacePlatformManager
- Throws:
PlatformManagerException
-
getLocation
Description copied from interface:PlatformManager
Get a well-known location, if defined for the platform- Specified by:
getLocation
in interfacePlatformManager
- Parameters:
location_id
- from above LOC_constants- Returns:
- Throws:
PlatformManagerException
-
isAdditionalFileTypeRegistered
public boolean isAdditionalFileTypeRegistered(String name, String type) throws PlatformManagerException Description copied from interface:PlatformManager
Checks to see if the supplied file type is registered with this application- Specified by:
isAdditionalFileTypeRegistered
in interfacePlatformManager
- Returns:
- Throws:
PlatformManagerException
-
registerAdditionalFileType
public void registerAdditionalFileType(String name, String description, String type, String content_type) throws PlatformManagerException Description copied from interface:PlatformManager
Registers a file type with this application- Specified by:
registerAdditionalFileType
in interfacePlatformManager
- Throws:
PlatformManagerException
-
showFile
Description copied from interface:PlatformManager
Reveals the file or directory with the platform's default browser- Specified by:
showFile
in interfacePlatformManager
- Parameters:
file_name
- The full path to a file or directory- Throws:
PlatformManagerException
- If this operation fails
-
unregisterAdditionalFileType
Description copied from interface:PlatformManager
Removes a file-type registration- Specified by:
unregisterAdditionalFileType
in interfacePlatformManager
- Throws:
PlatformManagerException
-
getAzComputerID
- Throws:
PlatformManagerException
-
requestUserAttention
Description copied from interface:PlatformManager
Requests the user's attention such as bouncing the application icon on OSX- Specified by:
requestUserAttention
in interfacePlatformManager
- Throws:
PlatformManagerException
-
loadClass
Description copied from interface:PlatformManager
Gives a particular platform the ability to alter the class-loading method- Specified by:
loadClass
in interfacePlatformManager
- Returns:
- Throws:
PlatformManagerException
-