|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.neeve.root.RootObject
com.neeve.daemon.config.DmnConfigDescriptor
com.neeve.server.config.SrvConfigDescriptor
public final class SrvConfigDescriptor
Server configuration descriptor.
This class describes a Talon server and contains methods to persist and load descriptors to/from the platform configuration repositories.
Method Summary | |
---|---|
void |
addAcceptor(String descriptor)
Add a client acceptor to the acceptor set. |
void |
addApp(SrvConfigAppDescriptor app)
Add a server app to the app set. |
static SrvConfigDescriptor |
create(String name)
Create a default server descriptor instance. |
static SrvConfigDescriptor |
create(com.neeve.util.UtlAddressDescriptor descriptor)
Create a server descriptor from an address descriptor object |
static SrvConfigDescriptor |
createFromEnvironment()
Create a server descriptor instance initialized from the environment. |
void |
delete(IConfigRepository repo)
Delete a server descriptor from a configuration repository. |
Set<String> |
getAcceptors()
Get the configured list of client acceptors. |
SrvConfigAppDescriptor |
getApp(String appName)
Get a server app from the app set. |
Set<String> |
getAppNames()
Get the names of the configured list of server apps. |
Set<SrvConfigAppDescriptor> |
getApps()
Get the configured list of server apps. |
int |
getClientHandshakeTimeout()
Get the client handshake timeout. |
String |
getDiscoveryDescriptor()
Gets the server's discovery descriptor. |
String |
getGroup()
Implementation of IDmnConfigDescriptor.getGroup() . |
int |
getIOThreadCount()
Implementation of IDmnConfigDescriptor.getIOThreadCount() . |
long |
getIOThreadCPUAffinityMask(int threadId)
Implementation of IDmnConfigDescriptor.getIOThreadCPUAffinityMask(int) . |
long[] |
getIOThreadCPUAffinityMasks()
Implementation of IDmnConfigDescriptor.getIOThreadCPUAffinityMasks() . |
int |
getMaxOnDemandThreadCount()
Implementation of IDmnConfigDescriptor.getMaxOnDemandThreadCount() . |
int |
getMaxTraceHistory()
Get the maximum number of trace records to buffer in the server's trace history buffer. |
int |
getMemoryReservePct()
Implementation of IDmnConfigDescriptor.getMemoryReservePct() . |
String |
getName()
Implementation of IDmnConfigDescriptor.getName() . |
Properties |
getOtherProperties()
Get all non-server properties. |
String |
getOtherProperty(String name)
Get a non-server property |
short |
getVersion()
Implementation of IDmnConfigDescriptor.getVersion() . |
boolean |
isChecked()
Implementation of IDmnConfigDescriptor.isChecked() . |
boolean |
isMultiThreaded()
Implementation of IDmnConfigDescriptor.isMultiThreaded() . |
boolean |
isPrintDescriptor()
Implementation of IDmnConfigDescriptor.isPrintDescriptor() . |
static SrvConfigDescriptor |
load(IConfigRepository repo,
String name)
Create a server descriptor from a configuration repository. |
SrvConfigDescriptor |
load(Properties props,
boolean shortForm)
Load descriptor from properties in a property table. |
static SrvConfigDescriptor |
load(String name)
Create a server descriptor from the default configuration repository. |
static Set<SrvConfigDescriptor> |
loadAll()
Create server descriptors for all servers configured in the default configuration repository. |
static Set<SrvConfigDescriptor> |
loadAll(IConfigRepository repo)
Create server descriptors for all servers in a configuration repository. |
void |
removeAcceptor(String descriptor)
Remove a client acceptor from the acceptor set. |
void |
removeApp(String appName)
Remove a server app from the app set. |
void |
save()
Save a server descriptor to the default configuration repository. |
void |
save(IConfigRepository repo)
Save a server descriptor to a configuration repository. |
Properties |
save(Properties props,
boolean shortForm)
Save a server descriptor to a property table. |
void |
setClientHandshakeTimeout(int timeout)
Set the client handshake timeout. |
void |
setDiscoveryDescriptor(String discoveryDescriptor)
Sets the server's discovery descriptor. |
void |
setGroup(String group)
Implementation of IDmnConfigDescriptor.setGroup(java.lang.String) . |
void |
setIOThreadCount(int ioThreadCount)
Implementation of IDmnConfigDescriptor.setIOThreadCount(int) . |
void |
setIOThreadCPUAffinityMask(int threadId,
long mask)
Implementation of IDmnConfigDescriptor.setIOThreadCPUAffinityMask(int, long) . |
void |
setMaxOnDemandThreadCount(int maxOnDemandThreadCount)
Implementation of IDmnConfigDescriptor.setMaxOnDemandThreadCount(int) . |
void |
setMaxTraceHistory(int maxRecords)
Set the maximum number of trace records to buffer in the server's trace history buffer. |
void |
setMemoryReservePct(int pct)
Implementation of IDmnConfigDescriptor.setMemoryReservePct(int) . |
void |
setMultiThreaded(boolean multiThreaded)
Implementation of IDmnConfigDescriptor.setMultiThreaded(boolean) . |
void |
setOtherProperty(String name,
String val)
Set a non-server property. |
void |
setPrintDescriptor(boolean printDescriptor)
Implementation of IDmnConfigDescriptor.setPrintDescriptor(boolean) . |
String |
toString()
Return a string representation of this object |
Methods inherited from class com.neeve.daemon.config.DmnConfigDescriptor |
---|
setTraceLevel, toString |
Methods inherited from class com.neeve.root.RootObject |
---|
getChecked, getThreaded, getTracer, setChecked, setTracer |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Methods inherited from interface com.neeve.daemon.config.IDmnConfigDescriptor |
---|
setChecked |
Method Detail |
---|
public final String getName()
IDmnConfigDescriptor.getName()
.
This method returns the configured name of this daemon. The default name of a daemon is configured using the nv.app.name property.
public final short getVersion()
IDmnConfigDescriptor.getVersion()
.
This method returns the daemon implementation version.
public final void setGroup(String group)
IDmnConfigDescriptor.setGroup(java.lang.String)
.
group
- The daemon's new application group.public final String getGroup()
IDmnConfigDescriptor.getGroup()
.
This method returns the configured group of this daemon. The daemon group is configured using the nv.app.group property. The daemon group serves to partition applications into non-intersecting groups. The daemon does not allow connections from entities that are in a group different from its group.
public final boolean isChecked()
IDmnConfigDescriptor.isChecked()
.
This method returns whether the daemon is configured to operated in checked mode. When operating in checked mode, the daemon performs additional state and integrity checks.
public final void setMultiThreaded(boolean multiThreaded)
IDmnConfigDescriptor.setMultiThreaded(boolean)
.
multiThreaded
- Boolean value indicating whether the daemon should operate in
single or multi threaded mode.public final boolean isMultiThreaded()
IDmnConfigDescriptor.isMultiThreaded()
.
This method returns whether the daemon is configured to operate in multi-threaded mode.
public final void setPrintDescriptor(boolean printDescriptor)
IDmnConfigDescriptor.setPrintDescriptor(boolean)
.
printDescriptor
- Boolean value indicating whether the daemon should print its
descriptor on startup or not.public final boolean isPrintDescriptor()
IDmnConfigDescriptor.isPrintDescriptor()
.
This method returns whether the daemon is configured to print its descriptor object on startup. If true, the daemon will print its descriptor to System.out.
public final void setIOThreadCount(int ioThreadCount)
IDmnConfigDescriptor.setIOThreadCount(int)
.
ioThreadCount
- The number of I/O threads to start.public final int getIOThreadCount()
IDmnConfigDescriptor.getIOThreadCount()
.
This method returns the number of I/O threads to start in the daemon.
public final void setIOThreadCPUAffinityMask(int threadId, long mask)
IDmnConfigDescriptor.setIOThreadCPUAffinityMask(int, long)
.
threadId
- The IO thread id - 0 <= id < ioThreadCountmask
- The affinity mask to set.public final long getIOThreadCPUAffinityMask(int threadId)
IDmnConfigDescriptor.getIOThreadCPUAffinityMask(int)
.
threadId
- The IO thread id - 0 <= id < ioThreadCountpublic final long[] getIOThreadCPUAffinityMasks()
IDmnConfigDescriptor.getIOThreadCPUAffinityMasks()
.
public final void setMaxOnDemandThreadCount(int maxOnDemandThreadCount)
IDmnConfigDescriptor.setMaxOnDemandThreadCount(int)
.
maxOnDemandThreadCount
- The max number of on-demand threads that can be created.public final int getMaxOnDemandThreadCount()
IDmnConfigDescriptor.getMaxOnDemandThreadCount()
.
This method returns the maximum number of on-demand threads that can be created in the daemon. A value of -1 indicates an unlimited number of threads can be created.
public final void setMemoryReservePct(int pct)
IDmnConfigDescriptor.setMemoryReservePct(int)
.
pct
- Percentage of total memory to reservepublic final int getMemoryReservePct()
IDmnConfigDescriptor.getMemoryReservePct()
.
public final void setMaxTraceHistory(int maxRecords)
maxRecords
- The maximum number of trace records.public final int getMaxTraceHistory()
public void setDiscoveryDescriptor(String discoveryDescriptor)
discoveryDescriptor
- The discovery descriptor.public String getDiscoveryDescriptor()
public final void addAcceptor(String descriptor)
descriptor
- The acceptor descriptor to add.public final void removeAcceptor(String descriptor)
descriptor
- The acceptor descriptor to remove .public final Set<String> getAcceptors()
This method returns the list of acceptors to start in the server to accept incoming client connections.
public final void setClientHandshakeTimeout(int timeout)
timeout
- The handshake timeout to set (in seconds)public final int getClientHandshakeTimeout()
This method returns the configured client handshake timeout i.e. the maximum time (in seconds) that the server will wait for the handshake request to arrive from the client.
public final void addApp(SrvConfigAppDescriptor app)
app
- The app to add.public final SrvConfigAppDescriptor getApp(String appName)
appName
- The name of the app to retrieve.
public final void removeApp(String appName)
appName
- The name of the app to remove.public final Set<SrvConfigAppDescriptor> getApps()
This method returns the set of server apps to load at server startup.
public final Set<String> getAppNames()
This method returns the set of server apps to load at server startup.
public final void setOtherProperty(String name, String val)
name
- The property name.public final String getOtherProperty(String name)
name
- The property namepublic final Properties getOtherProperties()
public final SrvConfigDescriptor load(Properties props, boolean shortForm)
props
- The property table to load the descriptor from.shortForm
- This parameter indicates whether the method should
use the long or short for for property names in the table. the long
form of properties are of the form 'nv.server.public final Properties save(Properties props, boolean shortForm)
props
- The property table to save the descriptor to.shortForm
- This parameter indicates whether the method should
use the long or short for for property names when saving the descriptor
to the table. The long form are propertis of the form 'nv.server.ESrvConfigException
- Thrown in case an error in encountered during the
saving of the descriptor.public final void save(IConfigRepository repo) throws ESrvConfigException
repo
- The configuration respository to save the descriptor in.
ESrvConfigException
- Thrown in case an error in encountered during the
saving of the descriptor.This method saves a server descriptor to a configuration repository. The descriptor is saved in a format suitable for loading subsequently using any of the load methods offered by this class.
public final void save() throws ESrvConfigException
ESrvConfigException
This method saves a server descriptor to the default configuration respository. The descriptor is saved in a format suitable for loading subsequently using any of the load methods offered by this class.
public final void delete(IConfigRepository repo) throws ESrvConfigException
repo
- The configuration respository to delete the sever from.
ESrvConfigException
- Thrown in case an error in encountered during the
deletion of the descriptor.This method deletes a server descriptor from a configuration repository.
public final String toString()
toString
in class Object
public static SrvConfigDescriptor create(String name)
name
- The name of the server described by the created descriptor. The
server name can be specified as null. If so, the server name will be set to
the the value returned by XRuntime.getAppName()
public static SrvConfigDescriptor createFromEnvironment()
public static SrvConfigDescriptor create(com.neeve.util.UtlAddressDescriptor descriptor)
descriptor
- The address descriptor using which to create the server
descriptor.
This method creates and initializes a server descriptor from the an address
descriptor of the following form:
server://
public static SrvConfigDescriptor load(IConfigRepository repo, String name) throws ESrvConfigException
repo
- The configuration respository to create the descriptor from.name
- The name of the server whose descriptor is to be loaded.
ESrvConfigException
This method creates and initializes a server descriptor from a configuration repository.
public static Set<SrvConfigDescriptor> loadAll(IConfigRepository repo) throws ESrvConfigException
repo
- The configuration respository from where to create the servers.
This method creates and initializes server descriptors for each of the servers configured in a configuration repository.
ESrvConfigException
public static SrvConfigDescriptor load(String name) throws ESrvConfigException
name
- The name of the server whose descriptor is to be loaded.
ESrvConfigException
This method creates and initializes a server descriptor from the default configuration repository.
public static Set<SrvConfigDescriptor> loadAll() throws ESrvConfigException
This method creates and initializes server descriptors for all the servers configured in the default configuration repository.
ESrvConfigException
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |