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) booleanprotected static final AEMonitor(package private) static List<CoreRunningListener>Listeners that will be fired after core has completed initializationprivate final longprivate final CryptoManagerstatic final booleanprivate static final Stringprivate FileLock(package private) GlobalManagerprivate final ClientInstanceManagerprivate booleanprivate static longprivate final CopyOnWriteList<CoreLifecycleListener>private booleanprivate static final boolean(package private) static final LogIDs(package private) static final AEMonitorprivate final NATTraverserprivate final List<CoreOperationListener>private final CopyOnWriteList<CoreOperation>(package private) final PluginInitializerprivate final CopyOnWriteList<PowerManagementListener>private booleanprivate longprivate longprivate boolean(package private) booleanprotected static Core(package private) SpeedManager(package private) longprivate boolean(package private) boolean(package private) final AESemaphoreprivate final AEMonitorFields inherited from interface com.biglybt.core.Core
CA_HIBERNATE, CA_QUIT_VUZE, CA_SHUTDOWN, CA_SLEEP -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic voidvoidvoidvoidvoidprotected voidannounceAll(boolean force) booleancanStart(int max_wait_secs) protected voidprotected booleanvoidchecks if restart operation is supported - if not an alert will be raised and an exception thrownprotected voidstatic Corecreate()voidexecuteCloseAction(String action, String reason) private voidexecuteCloseActionSupport(boolean obey_reset, boolean download_trigger, String action, String reason) private voidexecuteInternalCloseAction(boolean obey_reset, boolean download_trigger, String action, String reason) voidexecuteOperation(int type, CoreOperationTask task) (package private) voidexecuteScript(String script, String action, boolean download_trigger) longstatic Corestatic booleanstatic booleanbooleanbooleanbooleanbooleanprivate static voidvoidvoidvoidvoidvoidrequest a restart of the system - currently only available for com.biglybt.ui.swt based systemsvoidask lifecycle listeners to perform a stop.voidrestart()restart the systemvoidrestart(CoreOperationTask.ProgressCallback callback) private voidvoid(package private) voidsetPreventComputerSleep(PlatformManager platform, boolean prevent_sleep, String prevent_reason) (package private) voidvoidstart()voidstop()stop the core and inform lifecycle listeners of stoppingvoidstop(CoreOperationTask.ProgressCallback callback) (package private) voidstopSupport(boolean for_restart, boolean apply_updates, CoreOperationTask.ProgressCallback callback) voidtriggerLifeCycleComponentCreated(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:
getCreateTimein interfaceCore
-
announceAll
protected void announceAll(boolean force) -
getLocaleUtil
- Specified by:
getLocaleUtilin interfaceCore
-
getLockFile
- Specified by:
getLockFilein interfaceCore
-
canStart
public boolean canStart(int max_wait_secs) -
start
- Specified by:
startin interfaceCore- Throws:
CoreException
-
isInitThread
public boolean isInitThread()- Specified by:
isInitThreadin interfaceCore
-
isStarted
public boolean isStarted() -
triggerLifeCycleComponentCreated
- Specified by:
triggerLifeCycleComponentCreatedin interfaceCore
-
runNonDaemon
- Throws:
CoreException
-
stop
Description copied from interface:Corestop the core and inform lifecycle listeners of stopping- Specified by:
stopin interfaceCore- Throws:
CoreException
-
stop
- Specified by:
stopin interfaceCore- Throws:
CoreException
-
stopSupport
void stopSupport(boolean for_restart, boolean apply_updates, CoreOperationTask.ProgressCallback callback) throws CoreException - Throws:
CoreException
-
requestStop
Description copied from interface:Coreask 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:
requestStopin interfaceCore- Throws:
CoreException
-
restart
Description copied from interface:Corerestart the system- Specified by:
restartin interfaceCore- Throws:
CoreException
-
restart
- Specified by:
restartin interfaceCore- Throws:
CoreException
-
requestRestart
Description copied from interface:Corerequest a restart of the system - currently only available for com.biglybt.ui.swt based systems- Specified by:
requestRestartin interfaceCore- Throws:
CoreException
-
isStopping
public boolean isStopping()- Specified by:
isStoppingin interfaceCore
-
isRestarting
public boolean isRestarting()- Specified by:
isRestartingin interfaceCore
-
checkRestartSupported
Description copied from interface:Corechecks if restart operation is supported - if not an alert will be raised and an exception thrown- Specified by:
checkRestartSupportedin interfaceCore- Throws:
CoreException
-
saveState
public void saveState() -
getGlobalManager
- Specified by:
getGlobalManagerin interfaceCore- Throws:
CoreException
-
getTrackerHost
- Specified by:
getTrackerHostin interfaceCore- Throws:
CoreException
-
getPluginManagerDefaults
- Specified by:
getPluginManagerDefaultsin interfaceCore- Throws:
CoreException
-
getPluginManager
- Specified by:
getPluginManagerin interfaceCore- Throws:
CoreException
-
getIpFilterManager
- Specified by:
getIpFilterManagerin interfaceCore- Throws:
CoreException
-
getInstanceManager
- Specified by:
getInstanceManagerin interfaceCore
-
getSpeedManager
- Specified by:
getSpeedManagerin interfaceCore
-
getCryptoManager
- Specified by:
getCryptoManagerin interfaceCore
-
getNATTraverser
- Specified by:
getNATTraverserin 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:
executeCloseActionin interfaceCore
-
executeInternalCloseAction
-
executeCloseActionSupport
-
executeScript
-
executeOperation
- Specified by:
executeOperationin interfaceCore
-
addOperation
- Specified by:
addOperationin interfaceCore
-
removeOperation
- Specified by:
removeOperationin interfaceCore
-
getOperations
- Specified by:
getOperationsin interfaceCore
-
addLifecycleListener
- Specified by:
addLifecycleListenerin interfaceCore
-
removeLifecycleListener
- Specified by:
removeLifecycleListenerin interfaceCore
-
addOperationListener
- Specified by:
addOperationListenerin interfaceCore
-
removeOperationListener
- Specified by:
removeOperationListenerin interfaceCore
-
addCoreRunningListener
-
addPowerManagementListener
- Specified by:
addPowerManagementListenerin interfaceCore
-
removePowerManagementListener
- Specified by:
removePowerManagementListenerin interfaceCore
-