public abstract class ProcessEnvironment extends Object
Modifier and Type | Field and Description |
---|---|
static String |
JBOSS_DOMAIN_UUID
The special process name value that triggers calculation of a UUID
|
protected static String |
KERNEL_DIR
The name of the directory used to store WildFly kernel specific files
|
static AttributeDefinition |
NAME
AttributeDefinition for the name attribute for a processes root resource |
protected static String |
UUID_FILE
The name of the file used to store the process UUID
|
Constructor and Description |
---|
ProcessEnvironment() |
Modifier and Type | Method and Description |
---|---|
abstract String |
getHostControllerName()
Get the name of this server's host controller.
|
abstract String |
getHostName()
Get the local host name detected at server startup.
|
abstract UUID |
getInstanceUuid()
Get the UUID of this process.
|
protected abstract String |
getProcessName()
Gets the resolved name of this process; a value previously passed to
setProcessName(String) or
a value derived from the environment. |
OperationStepHandler |
getProcessNameReadHandler()
Gets an
OperationStepHandler that can read the name attribute for a processes root resource |
OperationStepHandler |
getProcessNameWriteHandler()
Gets an
OperationStepHandler that can write the name attribute for a processes root resource |
abstract String |
getQualifiedHostName()
Get the fully-qualified host name detected at server startup.
|
abstract RunningModeControl |
getRunningModeControl()
Get the
RunningModeControl containing the current running mode of the server |
protected abstract boolean |
isRuntimeSystemPropertyUpdateAllowed(String propertyName,
String propertyValue,
boolean bootTime)
Gets whether updating the runtime system properties with the given property is allowed.
|
protected UUID |
obtainProcessUUID(Path filePath,
String assignedValue)
Obtain the unique management id for this process and persist it for reuse if the process is restarted.
|
protected static String |
resolveGUID(String unresolvedName) |
protected abstract void |
setProcessName(String processName)
Sets the process name.
|
protected abstract void |
systemPropertyUpdated(String propertyName,
String propertyValue)
Notifies this
ProcessEnvironment that the runtime value of the given system property has been updated,
allowing it to update any state that was originally set via the system property during primordial process boot. |
protected static final String UUID_FILE
protected static final String KERNEL_DIR
public static final String JBOSS_DOMAIN_UUID
public static final AttributeDefinition NAME
AttributeDefinition
for the name
attribute for a processes root resourcepublic OperationStepHandler getProcessNameReadHandler()
OperationStepHandler
that can read the name
attribute for a processes root resourcepublic OperationStepHandler getProcessNameWriteHandler()
OperationStepHandler
that can write the name
attribute for a processes root resourceprotected abstract String getProcessName()
setProcessName(String)
or
a value derived from the environment.null
protected abstract void setProcessName(String processName)
getProcessNameWriteHandler()
; its visibility is protected only because subclasses need to implement it.processName
- the process name. May be null
in which case a default process name should be used.protected abstract boolean isRuntimeSystemPropertyUpdateAllowed(String propertyName, String propertyValue, boolean bootTime) throws OperationFailedException
propertyName
- the name of the property. Cannot be null
propertyValue
- the value of the property. May be null
bootTime
- true
if the process is currently bootingtrue
if the update can be applied to the runtime system properties; false if it
should just be stored in the persistent configuration and the process should be put into
reload-required state
.OperationFailedException
- if a change to the given property is not allowed at all; e.g. changing
jboss.server.base.dir
after primordial boot is not allowed; the
property can only be set from the command lineprotected abstract void systemPropertyUpdated(String propertyName, String propertyValue)
ProcessEnvironment
that the runtime value of the given system property has been updated,
allowing it to update any state that was originally set via the system property during primordial process boot.
This method should only be invoked after a call to isRuntimeSystemPropertyUpdateAllowed(String, String, boolean)
has returned true
.propertyName
- the name of the property. Cannot be null
propertyValue
- the value of the property. May be null
public abstract UUID getInstanceUuid()
public abstract String getQualifiedHostName()
public abstract String getHostName()
host controller name
. Defaults to the portion of
the qualified host name
following the first '.'.public abstract RunningModeControl getRunningModeControl()
RunningModeControl
containing the current running mode of the serverpublic abstract String getHostControllerName()
null
.null
if running in standalone
modeprotected final UUID obtainProcessUUID(Path filePath, String assignedValue) throws IOException
assignedValue
is not null
, it will be used.filePath
, the persisted value will be usedfilePath
- filesystem location where the uuid is to be persisted and may have already been persisted. Cannot be null
assignedValue
- value to use for the uuid. May be null
null
IOException
- if there is a problem reading from or writing to filePath
Copyright © 2023 JBoss by Red Hat. All rights reserved.