Package com.pnfsoftware.jeb.client
Class AbstractContext
java.lang.Object
com.pnfsoftware.jeb.util.events.EventSource
com.pnfsoftware.jeb.client.AbstractContext
- All Implemented Interfaces:
IEventSource
- Direct Known Subclasses:
AbstractClientContext
Base context for client contexts and core contexts. Basic variables are set up (eg, paths). This
class is not configuration-aware.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final StringCompany name.static final StringCopyright year range.static final StringPrimary domain name.static final StringLicensing contact email address.static final StringSupport contact email address.static final StringSoftware update contact email address.static final StringBackup licensing service URL.static final StringProduct name.static final StringApplication URI scheme.static final StringAPI documentation URL.static final StringChangelog URL.static final StringCommunity chat sign-up URL.static final StringPrimary update-check endpoint URL.static final StringBackup update-check endpoint URL.static final StringDeveloper portal URL.static final StringDonation page URL.static final StringFAQ URL.static final StringFAQ entry about memory usage.static final StringFile-upload page URL.static final StringCommunity forum URL.static final StringProgrammatic license-key generation endpoint URL.static final StringBackup programmatic license-key generation endpoint URL.static final StringManual license-key generation page URL.static final StringPNF Software GitHub organization URL.static final StringGitHub sample-code repository URL.static final StringGitHub sample scripts URL.static final StringProduct manual URL.static final StringMessage-of-the-day URL.static final StringPurchase page URL.static final StringError-log upload endpoint URL.static final VersionGlobal JEB software version.static final StringPrimary website URL.static booleanIndicates whether the current build is a demo build.protected booleanTrue when a runtime integrity check failed.protected booleanTrue when the current installation was just updated from an older build.Fields inherited from class com.pnfsoftware.jeb.util.events.EventSource
onEventCallCount -
Constructor Summary
ConstructorsConstructorDescriptionCreate an abstract context and resolve the key JEB runtime paths. -
Method Summary
Modifier and TypeMethodDescriptionfinal StringGet the JEB app directory, typically $JEB/bin/app.final StringGet the JEB base directory.static StringGet the current pre-release channel name.final StringGet the current directory.final FileGet the location of JEB classes.final StringGet the JEB program directory, typically $JEB/bin/.final VersionRetrieve the global software version.final intGet the program start date in seconds.protected static StringThis method is used by all JEB contexts (including client contexts) to handle exceptions reaching theglobal uncaught exception handler.protected static NetinitNetworkUtility(String proxyString) The global proxy settings will be updated/erased.static booleanDetermine whether this build is a pre-release build.static final voidTerminate the program.Methods inherited from class com.pnfsoftware.jeb.util.events.EventSource
addListener, countListeners, getListeners, getParentSource, insertListener, notifyListeners, notifyListeners, notifyListeners, relay, removeListener, setParentSource
-
Field Details
-
app_ver
Global JEB software version. -
app_name
Product name.- See Also:
-
app_company
Company name.- See Also:
-
app_dates
Copyright year range.- See Also:
-
app_domain
Primary domain name.- See Also:
-
app_website
Primary website URL.- See Also:
-
app_licensing_backup
Backup licensing service URL.- See Also:
-
app_url_purchase
Purchase page URL.- See Also:
-
app_url_donate
Donation page URL.- See Also:
-
app_url_manual
Product manual URL.- See Also:
-
app_url_faq
FAQ URL.- See Also:
-
app_url_faqmem
FAQ entry about memory usage.- See Also:
-
app_url_apidoc
API documentation URL.- See Also:
-
app_url_devportal
Developer portal URL.- See Also:
-
app_url_changelog
Changelog URL.- See Also:
-
app_url_motd
Message-of-the-day URL.- See Also:
-
app_url_uploaderrorlog
Error-log upload endpoint URL.- See Also:
-
app_url_fileuploader
File-upload page URL.- See Also:
-
app_url_github
PNF Software GitHub organization URL.- See Also:
-
app_url_github_samples
GitHub sample-code repository URL.- See Also:
-
app_url_github_samples_scripts
GitHub sample scripts URL.- See Also:
-
app_email_support
Support contact email address.- See Also:
-
app_email_licensing
Licensing contact email address.- See Also:
-
app_email_updates
Software update contact email address.- See Also:
-
app_url_forum
Community forum URL.- See Also:
-
app_url_chat
Community chat sign-up URL.- See Also:
-
app_url_check_update
Primary update-check endpoint URL.- See Also:
-
app_url_check_update_backup
Backup update-check endpoint URL.- See Also:
-
app_url_genlk
Manual license-key generation page URL.- See Also:
-
app_url_genkey
Programmatic license-key generation endpoint URL.- See Also:
-
app_url_genkey_backup
Backup programmatic license-key generation endpoint URL.- See Also:
-
app_uri
Application URI scheme.- See Also:
-
just_updated
protected boolean just_updatedTrue when the current installation was just updated from an older build. -
integrity_failed
protected boolean integrity_failedTrue when a runtime integrity check failed. -
demo
public static boolean demoIndicates whether the current build is a demo build.
-
-
Constructor Details
-
AbstractContext
public AbstractContext()Create an abstract context and resolve the key JEB runtime paths.
-
-
Method Details
-
handleUncaughtException
This method is used by all JEB contexts (including client contexts) to handle exceptions reaching theglobal uncaught exception handler.Custom client may set a handler of their own, as such:
static { Thread.setDefaultUncaughtExceptionHandler((t, e) -> { var msg = handleUncaughtException(t, e); // call the AbstractContext handler if(msg == null) { return; } // custom handling goes here // ... }); ...- Parameters:
t- threade- exception- Returns:
- a non-null message if the exception is deemed relevant and its stacktrace was sent to the logger; null otherwise (it is recommended clients ignore the exception)
-
isPreRelease
public static boolean isPreRelease()Determine whether this build is a pre-release build.- Returns:
- true if the current build channel is not
Version.RELEASE
-
getChannelName
Get the current pre-release channel name.- Returns:
"Beta","Alpha", or null for release builds
-
getStartTimestamp
public final int getStartTimestamp()Get the program start date in seconds.- Returns:
- a Unix timestamp
-
getJebClassesLocation
Get the location of JEB classes.- Returns:
- a jar file (
jeb.jar), or abin/folder containing classfiles
-
getCurrentDirectory
Get the current directory.- Returns:
- the current working directory
-
getBaseDirectory
Get the JEB base directory.- Returns:
- the base directory
-
getProgramDirectory
Get the JEB program directory, typically $JEB/bin/.- Returns:
- the program directory
-
getAppDirectory
Get the JEB app directory, typically $JEB/bin/app.- Returns:
- the application directory
-
getSoftwareVersion
Retrieve the global software version.- Returns:
- the software version
-
terminate
public static final void terminate()Terminate the program. -
initNetworkUtility
The global proxy settings will be updated/erased.- Parameters:
proxyString- serialized proxy settings; may be null or empty to disable the proxy- Returns:
- a network helper configured with the global proxy settings and JEB user-agent
-