Class Q2
java.lang.Object
org.jpos.q2.Q2
- All Implemented Interfaces:
FileFilter, Runnable
-
Nested Class Summary
Nested Classes -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final byte[]static final Stringstatic final Stringstatic final Stringstatic final intstatic final long -
Constructor Summary
ConstructorsConstructorDescriptionQ2()Constructs a newQ2instance with no command-line arguments and the default class loader.Constructs a newQ2instance with the specified deployment directory and the default class loader.Constructs a newQ2instance with the specified command-line arguments and the default class loader.Q2(String[] args, ClassLoader classLoader) Constructs a newQ2instance with the specified command-line arguments and class loader. -
Method Summary
Modifier and TypeMethodDescriptionbooleanprotected org.jdom2.Documentdecrypt(org.jdom2.Document doc) voiddeployElement(org.jdom2.Element e, String fileName, boolean encrypt, boolean isTransient) voiddeployTemplate(String template, String filename, String prefix) voidprotected org.jdom2.Documentencrypt(org.jdom2.Document doc) String[]environmentArgs(String[] args) static Stringstatic Stringstatic StringString[]protected byte[]getKey()getLog()io.micrometer.core.instrument.MeterRegistryio.micrometer.prometheusmetrics.PrometheusMeterRegistrystatic Q2getQ2()static Q2getQ2(long timeout) static Stringstatic Stringstatic Stringstatic Stringbooleanstatic voidstatic intnode()booleanready()booleanready(long millis) voidrelax()voidrelax(long sleep) voidrun()booleanrunning()voidshutdown()voidshutdown(boolean join) voidstart()voidstop()
-
Field Details
-
DEFAULT_DEPLOY_DIR
- See Also:
-
JMX_NAME
-
LOGGER_NAME
- See Also:
-
REALM
-
LOGGER_CONFIG
- See Also:
-
QBEAN_NAME
- See Also:
-
Q2_CLASS_LOADER
- See Also:
-
DUPLICATE_EXTENSION
- See Also:
-
ERROR_EXTENSION
- See Also:
-
ENV_EXTENSION
- See Also:
-
LICENSEE
-
PUBKEYHASH
-
PROTECTED_QBEAN
- See Also:
-
SCAN_INTERVAL
- See Also:
-
SHUTDOWN_TIMEOUT
- See Also:
-
-
Constructor Details
-
Q2
Constructs a newQ2instance with the specified command-line arguments and class loader. This constructor initializes various configurations, processes command-line arguments, sets up directories, and registers necessary components for the application.- Parameters:
args- an array ofStringcontaining the command-line arguments.classLoader- theClassLoaderto be used by the application. Ifnull, the class loader of the current class is used.Key Initialization Steps:
- Parses the command-line arguments twice: once before environment variable substitution and once after.
- Initializes the deployment directory and library directory (`lib`).
- Generates a unique instance identifier for the application instance.
- Sets the application start time to the current moment.
- Registers MicroMeter metrics and Q2-specific components.
Note: The
deployDirdirectory is created if it does not already exist.- See Also:
-
Q2
Constructs a newQ2instance with the specified command-line arguments and the default class loader.- Parameters:
args- an array ofStringcontaining the command-line arguments. If no arguments are provided, the application initializes with default settings.This constructor delegates to
Q2(String[], ClassLoader)with anullclass loader, causing the default class loader to be used.- See Also:
-
Q2
public Q2()Constructs a newQ2instance with no command-line arguments and the default class loader.This constructor is equivalent to calling
Q2(new String[]{}). It initializes the application with default settings.- See Also:
-
Q2
Constructs a newQ2instance with the specified deployment directory and the default class loader.- Parameters:
deployDir- aStringspecifying the path to the deployment directory. This is passed as a command-line argument using the-doption.This constructor is equivalent to calling
Q2(new String[]{"-d", deployDir}). It sets the deployment directory and initializes the application.- See Also:
-
-
Method Details
-
start
-
stop
-
getMeterRegistry
-
getPrometheusMeterRegistry
-
run
-
shutdown
-
running
-
ready
-
ready
-
shutdown
-
getLoader
-
getFactory
-
getCommandLineArgs
-
accept
- Specified by:
acceptin interfaceFileFilter
-
getDeployDir
-
getWatchServiceClassname
-
getQ2
-
getQ2
-
node
-
relax
-
relax
-
getLog
-
getMBeanServer
-
getUptime
-
displayVersion
-
getInstanceId
-
getVersionString
-
deployElement
public void deployElement(org.jdom2.Element e, String fileName, boolean encrypt, boolean isTransient) throws ISOException, IOException, GeneralSecurityException -
getKey
-
encrypt
protected org.jdom2.Document encrypt(org.jdom2.Document doc) throws GeneralSecurityException, IOException - Throws:
GeneralSecurityExceptionIOException
-
decrypt
protected org.jdom2.Document decrypt(org.jdom2.Document doc) throws GeneralSecurityException, IOException, org.jdom2.JDOMException - Throws:
GeneralSecurityExceptionIOExceptionorg.jdom2.JDOMException
-
main
-
getVersion
-
getRevision
-
getBranch
-
getBuildTimestamp
-
getRelease
-
getAppVersionString
-
isDisableDynamicClassloader
-
deployTemplate
public void deployTemplate(String template, String filename, String prefix) throws IOException, org.jdom2.JDOMException, GeneralSecurityException, ISOException, NullPointerException - Throws:
IOExceptionorg.jdom2.JDOMExceptionGeneralSecurityExceptionISOExceptionNullPointerException
-
environmentArgs
-