org.gudy.azureus2.platform
Interface PlatformManager

All Superinterfaces:
PlatformManager

public interface PlatformManager
extends PlatformManager

Author:
parg

Field Summary
static int PT_MACOSX
           
static int PT_OTHER
           
static int PT_UNIX
           
static int PT_WINDOWS
           
static int[] SD_ALL
           
static int SD_HIBERNATE
           
static int SD_SHUTDOWN
           
static int SD_SLEEP
           
static int USER_REQUEST_INFO
           
static int USER_REQUEST_QUESTION
           
static int USER_REQUEST_WARNING
           
 
Fields inherited from interface org.gudy.azureus2.plugins.platform.PlatformManager
LOC_DOCUMENTS, LOC_MUSIC, LOC_USER_DATA, LOC_VIDEO
 
Method Summary
 void addListener(PlatformManagerListener listener)
           
 void copyFilePermissions(String from_file_name, String to_file_name)
           
 void createProcess(String command_line, boolean inherit_handles)
           
 void dispose()
          Disposes system resources.
 String getApplicationCommandLine()
           
 String[] getExplicitVMOptions()
           
 int getMaxOpenFiles()
          This max-open-files concept here is from linux/osx where network connections are treated as 'files'
 int getPlatformType()
           
 boolean getPreventComputerSleep()
           
 boolean getRunAtLogin()
           
 int getShutdownTypes()
           
 String getUserDataDirectory()
           
 String getVersion()
           
 File getVMOptionFile()
           
 boolean hasCapability(PlatformManagerCapabilities capability)
          Gets whether the platform manager supports a capability
 boolean isApplicationRegistered()
           
 Class<?> loadClass(ClassLoader loader, String class_name)
          Gives a particular platform the ability to alter the class-loading method
 void performRecoverableFileDelete(String file_name)
           
 void ping(InetAddress interface_address, InetAddress target, PlatformManagerPingCallback callback)
           
 void registerApplication()
           
 void removeListener(PlatformManagerListener listener)
           
 void requestUserAttention(int type, Object data)
          Requests the user's attention such as bouncing the application icon on OSX
 void setExplicitVMOptions(String[] options)
           
 void setPreventComputerSleep(boolean prevent_it)
           
 void setRunAtLogin(boolean run)
           
 void setTCPTOSEnabled(boolean enabled)
          enable or disable the platforms support for TCP TOS
 void shutdown(int type)
           
 void startup(AzureusCore azureus_core)
           
 boolean testNativeAvailability(String name)
           
 void traceRoute(InetAddress interface_address, InetAddress target, PlatformManagerPingCallback callback)
           
 
Methods inherited from interface org.gudy.azureus2.plugins.platform.PlatformManager
getComputerName, getLocation, isAdditionalFileTypeRegistered, registerAdditionalFileType, showFile, unregisterAdditionalFileType
 

Field Detail

PT_WINDOWS

static final int PT_WINDOWS
See Also:
Constant Field Values

PT_OTHER

static final int PT_OTHER
See Also:
Constant Field Values

PT_MACOSX

static final int PT_MACOSX
See Also:
Constant Field Values

PT_UNIX

static final int PT_UNIX
See Also:
Constant Field Values

USER_REQUEST_INFO

static final int USER_REQUEST_INFO
See Also:
Constant Field Values

USER_REQUEST_WARNING

static final int USER_REQUEST_WARNING
See Also:
Constant Field Values

USER_REQUEST_QUESTION

static final int USER_REQUEST_QUESTION
See Also:
Constant Field Values

SD_SHUTDOWN

static final int SD_SHUTDOWN
See Also:
Constant Field Values

SD_HIBERNATE

static final int SD_HIBERNATE
See Also:
Constant Field Values

SD_SLEEP

static final int SD_SLEEP
See Also:
Constant Field Values

SD_ALL

static final int[] SD_ALL
Method Detail

getPlatformType

int getPlatformType()

getVersion

String getVersion()
                  throws PlatformManagerException
Throws:
PlatformManagerException

startup

void startup(AzureusCore azureus_core)
             throws PlatformManagerException
Throws:
PlatformManagerException

getUserDataDirectory

String getUserDataDirectory()
                            throws PlatformManagerException
Throws:
PlatformManagerException

isApplicationRegistered

boolean isApplicationRegistered()
                                throws PlatformManagerException
Throws:
PlatformManagerException

registerApplication

void registerApplication()
                         throws PlatformManagerException
Throws:
PlatformManagerException

getApplicationCommandLine

String getApplicationCommandLine()
                                 throws PlatformManagerException
Throws:
PlatformManagerException

getVMOptionFile

File getVMOptionFile()
                     throws PlatformManagerException
Throws:
PlatformManagerException

getExplicitVMOptions

String[] getExplicitVMOptions()
                              throws PlatformManagerException
Throws:
PlatformManagerException

setExplicitVMOptions

void setExplicitVMOptions(String[] options)
                          throws PlatformManagerException
Throws:
PlatformManagerException

getRunAtLogin

boolean getRunAtLogin()
                      throws PlatformManagerException
Throws:
PlatformManagerException

setRunAtLogin

void setRunAtLogin(boolean run)
                   throws PlatformManagerException
Throws:
PlatformManagerException

getShutdownTypes

int getShutdownTypes()

shutdown

void shutdown(int type)
              throws PlatformManagerException
Throws:
PlatformManagerException

setPreventComputerSleep

void setPreventComputerSleep(boolean prevent_it)
                             throws PlatformManagerException
Throws:
PlatformManagerException

getPreventComputerSleep

boolean getPreventComputerSleep()

createProcess

void createProcess(String command_line,
                   boolean inherit_handles)
                   throws PlatformManagerException
Throws:
PlatformManagerException

performRecoverableFileDelete

void performRecoverableFileDelete(String file_name)
                                  throws PlatformManagerException
Throws:
PlatformManagerException

setTCPTOSEnabled

void setTCPTOSEnabled(boolean enabled)
                      throws PlatformManagerException
enable or disable the platforms support for TCP TOS

Parameters:
enabled -
Throws:
PlatformManagerException

copyFilePermissions

void copyFilePermissions(String from_file_name,
                         String to_file_name)
                         throws PlatformManagerException
Throws:
PlatformManagerException

testNativeAvailability

boolean testNativeAvailability(String name)
                               throws PlatformManagerException
Throws:
PlatformManagerException

traceRoute

void traceRoute(InetAddress interface_address,
                InetAddress target,
                PlatformManagerPingCallback callback)
                throws PlatformManagerException
Throws:
PlatformManagerException

ping

void ping(InetAddress interface_address,
          InetAddress target,
          PlatformManagerPingCallback callback)
          throws PlatformManagerException
Throws:
PlatformManagerException

getMaxOpenFiles

int getMaxOpenFiles()
                    throws PlatformManagerException
This max-open-files concept here is from linux/osx where network connections are treated as 'files'

Returns:
Throws:
PlatformManagerException

loadClass

Class<?> loadClass(ClassLoader loader,
                   String class_name)
                   throws PlatformManagerException
Gives a particular platform the ability to alter the class-loading method

Parameters:
loader -
class_name -
Returns:
Throws:
PlatformManagerException

hasCapability

boolean hasCapability(PlatformManagerCapabilities capability)

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.

Parameters:
capability - A platform manager capability
Returns:
True if the manager supports the capability

dispose

void dispose()
Disposes system resources. This method is optional.


addListener

void addListener(PlatformManagerListener listener)

removeListener

void removeListener(PlatformManagerListener listener)

requestUserAttention

void requestUserAttention(int type,
                          Object data)
                          throws PlatformManagerException
Requests the user's attention such as bouncing the application icon on OSX

Parameters:
type -
data -
Throws:
PlatformManagerException