Package com.biglybt.core.impl
Class CoreImpl
java.lang.Object
com.biglybt.core.impl.CoreImpl
- All Implemented Interfaces:
Core
-
Field Summary
FieldsModifier and TypeFieldDescription(package private) long
(package private) long
(package private) boolean
protected static final AEMonitor
(package private) static List<CoreRunningListener>
Listeners that will be fired after core has completed initializationprivate final long
private final CryptoManager
static final boolean
private static final String
private FileLock
(package private) GlobalManager
private final ClientInstanceManager
private boolean
private static long
private final CopyOnWriteList<CoreLifecycleListener>
private boolean
private static final boolean
(package private) static final LogIDs
(package private) static final AEMonitor
private final NATTraverser
private final List<CoreOperationListener>
private final CopyOnWriteList<CoreOperation>
(package private) final PluginInitializer
private final CopyOnWriteList<PowerManagementListener>
private boolean
private long
private long
private boolean
(package private) boolean
protected static Core
(package private) SpeedManager
(package private) long
private boolean
(package private) boolean
(package private) final AESemaphore
private final AEMonitor
Fields inherited from interface com.biglybt.core.Core
CA_HIBERNATE, CA_QUIT_VUZE, CA_SHUTDOWN, CA_SLEEP
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic void
void
void
void
void
protected void
announceAll
(boolean force) boolean
canStart
(int max_wait_secs) protected void
protected boolean
void
checks if restart operation is supported - if not an alert will be raised and an exception thrownprotected void
static Core
create()
void
executeCloseAction
(String action, String reason) private void
executeCloseActionSupport
(boolean obey_reset, boolean download_trigger, String action, String reason) private void
executeInternalCloseAction
(boolean obey_reset, boolean download_trigger, String action, String reason) void
executeOperation
(int type, CoreOperationTask task) (package private) void
executeScript
(String script, String action, boolean download_trigger) long
static Core
static boolean
static boolean
boolean
boolean
boolean
boolean
private static void
void
void
void
void
void
request a restart of the system - currently only available for com.biglybt.ui.swt based systemsvoid
ask lifecycle listeners to perform a stop.void
restart()
restart the systemvoid
restart
(CoreOperationTask.ProgressCallback callback) private void
void
(package private) void
setPreventComputerSleep
(PlatformManager platform, boolean prevent_sleep, String prevent_reason) (package private) void
void
start()
void
stop()
stop the core and inform lifecycle listeners of stoppingvoid
stop
(CoreOperationTask.ProgressCallback callback) (package private) void
stopSupport
(boolean for_restart, boolean apply_updates, CoreOperationTask.ProgressCallback callback) void
triggerLifeCycleComponentCreated
(CoreComponent component)
-
Field Details
-
DEBUG_STARTUPTIME
public static final boolean DEBUG_STARTUPTIME -
LOGID
-
singleton
-
class_mon
-
DM_ANNOUNCE_KEY
- See Also:
-
LOAD_PLUGINS_IN_OTHER_THREAD
private static final boolean LOAD_PLUGINS_IN_OTHER_THREAD- See Also:
-
coreRunningListeners
Listeners that will be fired after core has completed initialization -
mon_coreRunningListeners
-
lastDebugTime
private static long lastDebugTime -
pi
-
global_manager
GlobalManager global_manager -
instance_manager
-
speed_manager
SpeedManager speed_manager -
crypto_manager
-
nat_traverser
-
create_time
private final long create_time -
started
private volatile boolean started -
stopped
volatile boolean stopped -
restarting
volatile boolean restarting -
lifecycle_listeners
-
ll_started
private boolean ll_started -
operation_listeners
-
operations
-
power_listeners
-
stopping_sem
-
this_mon
-
ca_shutdown_computer_after_stop
boolean ca_shutdown_computer_after_stop -
ca_last_time_downloading
long ca_last_time_downloading -
ca_last_time_seeding
long ca_last_time_seeding -
ra_restarting
private boolean ra_restarting -
ra_last_total_data
private long ra_last_total_data -
ra_last_data_time
private long ra_last_data_time -
prevent_sleep_remove_trigger
private boolean prevent_sleep_remove_trigger -
file_lock
-
start
long start -
js_plugin_install_tried
private boolean js_plugin_install_tried
-
-
Constructor Details
-
CoreImpl
protected CoreImpl()
-
-
Method Details
-
create
- Throws:
CoreException
-
isCoreAvailable
public static boolean isCoreAvailable() -
isCoreRunning
public static boolean isCoreRunning() -
getSingleton
- Throws:
CoreException
-
logTime
-
getCreateTime
public long getCreateTime()- Specified by:
getCreateTime
in interfaceCore
-
announceAll
protected void announceAll(boolean force) -
getLocaleUtil
- Specified by:
getLocaleUtil
in interfaceCore
-
getLockFile
- Specified by:
getLockFile
in interfaceCore
-
canStart
public boolean canStart(int max_wait_secs) -
start
- Specified by:
start
in interfaceCore
- Throws:
CoreException
-
isInitThread
public boolean isInitThread()- Specified by:
isInitThread
in interfaceCore
-
isStarted
public boolean isStarted() -
triggerLifeCycleComponentCreated
- Specified by:
triggerLifeCycleComponentCreated
in interfaceCore
-
runNonDaemon
- Throws:
CoreException
-
stop
Description copied from interface:Core
stop the core and inform lifecycle listeners of stopping- Specified by:
stop
in interfaceCore
- Throws:
CoreException
-
stop
- Specified by:
stop
in interfaceCore
- Throws:
CoreException
-
stopSupport
void stopSupport(boolean for_restart, boolean apply_updates, CoreOperationTask.ProgressCallback callback) throws CoreException - Throws:
CoreException
-
requestStop
Description copied from interface:Core
ask lifecycle listeners to perform a stop. they may veto this by throwing an exception, or do nothing if nothing is done then it will be stopped as per "stop" above- Specified by:
requestStop
in interfaceCore
- Throws:
CoreException
-
restart
Description copied from interface:Core
restart the system- Specified by:
restart
in interfaceCore
- Throws:
CoreException
-
restart
- Specified by:
restart
in interfaceCore
- Throws:
CoreException
-
requestRestart
Description copied from interface:Core
request a restart of the system - currently only available for com.biglybt.ui.swt based systems- Specified by:
requestRestart
in interfaceCore
- Throws:
CoreException
-
isStopping
public boolean isStopping()- Specified by:
isStopping
in interfaceCore
-
isRestarting
public boolean isRestarting()- Specified by:
isRestarting
in interfaceCore
-
checkRestartSupported
Description copied from interface:Core
checks if restart operation is supported - if not an alert will be raised and an exception thrown- Specified by:
checkRestartSupported
in interfaceCore
- Throws:
CoreException
-
saveState
public void saveState() -
getGlobalManager
- Specified by:
getGlobalManager
in interfaceCore
- Throws:
CoreException
-
getTrackerHost
- Specified by:
getTrackerHost
in interfaceCore
- Throws:
CoreException
-
getPluginManagerDefaults
- Specified by:
getPluginManagerDefaults
in interfaceCore
- Throws:
CoreException
-
getPluginManager
- Specified by:
getPluginManager
in interfaceCore
- Throws:
CoreException
-
getIpFilterManager
- Specified by:
getIpFilterManager
in interfaceCore
- Throws:
CoreException
-
getInstanceManager
- Specified by:
getInstanceManager
in interfaceCore
-
getSpeedManager
- Specified by:
getSpeedManager
in interfaceCore
-
getCryptoManager
- Specified by:
getCryptoManager
in interfaceCore
-
getNATTraverser
- Specified by:
getNATTraverser
in interfaceCore
-
setupSleepAndCloseActions
void setupSleepAndCloseActions() -
checkSleepActions
protected void checkSleepActions() -
setPreventComputerSleep
void setPreventComputerSleep(PlatformManager platform, boolean prevent_sleep, String prevent_reason) -
checkRestartAction
protected boolean checkRestartAction() -
checkCloseActions
protected void checkCloseActions() -
executeCloseAction
- Specified by:
executeCloseAction
in interfaceCore
-
executeInternalCloseAction
-
executeCloseActionSupport
-
executeScript
-
executeOperation
- Specified by:
executeOperation
in interfaceCore
-
addOperation
- Specified by:
addOperation
in interfaceCore
-
removeOperation
- Specified by:
removeOperation
in interfaceCore
-
getOperations
- Specified by:
getOperations
in interfaceCore
-
addLifecycleListener
- Specified by:
addLifecycleListener
in interfaceCore
-
removeLifecycleListener
- Specified by:
removeLifecycleListener
in interfaceCore
-
addOperationListener
- Specified by:
addOperationListener
in interfaceCore
-
removeOperationListener
- Specified by:
removeOperationListener
in interfaceCore
-
addCoreRunningListener
-
addPowerManagementListener
- Specified by:
addPowerManagementListener
in interfaceCore
-
removePowerManagementListener
- Specified by:
removePowerManagementListener
in interfaceCore
-