public class SystemPropertyInstanceIdGenerator extends Object implements InstanceIdGenerator
system property
to configure the scheduler. The default system property name to use the value of SYSTEM_PROPERTY
, but
can be specified via the "systemPropertyName" property.
You can also set the properties "postpend" and "prepend" to String values that will be added to the beginning
or end (respectively) of the value found in the system property.
If no value set for the property, a SchedulerException
is thrownModifier and Type | Field and Description |
---|---|
static String |
SYSTEM_PROPERTY
System property to read the instanceId from
|
Constructor and Description |
---|
SystemPropertyInstanceIdGenerator() |
Modifier and Type | Method and Description |
---|---|
String |
generateInstanceId()
Returns the cluster wide value for this scheduler instance's id, based on a system property
|
String |
getPostpend()
A String of text to postpend (add to the end) to the instanceId
found in the system property.
|
String |
getPrepend()
A String of text to prepend (add to the beginning) to the instanceId
found in the system property.
|
String |
getSystemPropertyName()
The name of the system property from which to obtain the instanceId.
|
void |
setPostpend(String postpend)
A String of text to postpend (add to the end) to the instanceId
found in the system property.
|
void |
setPrepend(String prepend)
A String of text to prepend (add to the beginning) to the instanceId
found in the system property.
|
void |
setSystemPropertyName(String systemPropertyName)
The name of the system property from which to obtain the instanceId.
|
public static final String SYSTEM_PROPERTY
public String generateInstanceId() throws SchedulerException
generateInstanceId
in interface InstanceIdGenerator
getSystemPropertyName()
- which defaults
to SYSTEM_PROPERTY
.SchedulerException
- Shouldn't a value be foundpublic String getPrepend()
public void setPrepend(String prepend)
prepend
- the value to prepend, or null if none is desired.public String getPostpend()
public void setPostpend(String postpend)
postpend
- the value to postpend, or null if none is desired.public String getSystemPropertyName()
SYSTEM_PROPERTY
.public void setSystemPropertyName(String systemPropertyName)
SYSTEM_PROPERTY
.systemPropertyName
- the system property nameCopyright 2001-2019, Terracotta, Inc.