public class Configuration extends Object
| 构造器和说明 |
|---|
Configuration() |
Configuration(Configuration other) |
Configuration(String configLocation) |
| 限定符和类型 | 方法和说明 |
|---|---|
protected String |
get(String name)
Get the value of the
name property, null if no such property exists. |
protected String |
get(String name,
String defaultValue)
Get the value of the
name property, defaultValue if no such property exists. |
protected boolean |
getBoolean(String name,
boolean defaultValue)
Get the value of the
name property as a boolean . |
int |
getConnectTimeout()
the connect timeout to get,default is 3 seconds.
|
protected float |
getFloat(String name,
float defaultValue)
Get the value of the
name property as a float. |
protected int |
getInt(String name,
int defaultValue)
Get the value of the
name property as an int. |
int |
getJobMaxSize()
the jobMaxSize to get,default is 65536.
|
protected long |
getLong(String name,
long defaultValue)
Get the value of the
name property as a long. |
int |
getOperationTimeout()
the operationTimeout to get,default is 10 seconds.
|
String |
getProtocolCharset()
protocol charset is 'ASCII'.
|
int |
getReadTimeout()
the read timeout to get,default is 3 seconds.
|
String |
getServiceHost()
get service host
|
int |
getServicePort()
get service port,default is 11300.
|
void |
loadConfiguration(String location)
load config file from classpath.
|
Configuration |
merge(Configuration other) |
protected void |
set(String name,
String value)
Set the
value of the name property. |
protected void |
setBoolean(String name,
boolean value)
Set the value of the
name property to a boolean . |
void |
setConnectTimeout(int timeout)
the connect timeout to set
|
protected void |
setFloat(String name,
float value)
Set the value of the
name property to a float. |
protected void |
setInt(String name,
int value)
Set the value of the
name property to an int. |
void |
setJobMaxSize(int jobMaxSize)
the jobMaxSize to set
|
protected void |
setLong(String name,
long value)
Set the value of the
name property to a long. |
void |
setOperationTimeout(int operationTimeout)
the operationTimeout to set
|
void |
setReadTimeout(int timeout)
the read timeout to set
|
void |
setServiceHost(String host)
set service host
|
void |
setServicePort(int port)
set remote port
|
String |
toString() |
void |
writeConfiguration(OutputStream out) |
public Configuration()
public Configuration(Configuration other)
public Configuration(String configLocation)
public Configuration merge(Configuration other)
public void writeConfiguration(OutputStream out)
public void loadConfiguration(String location)
location - protected String get(String name)
name property, null if no such property exists.name - protected String get(String name, String defaultValue)
name property, defaultValue if no such property exists.name - defaultValue - protected void set(String name, String value)
value of the name property.name - property name.value - property value.protected int getInt(String name, int defaultValue)
name property as an int. If no such property exists, or if the
specified value is not a valid int, then defaultValue is returned.name - defaultValue - protected void setInt(String name, int value)
name property to an int.name - property name.value - int value of the property.protected long getLong(String name, long defaultValue)
name property as a long. If no such property is specified, or if
the specified value is not a valid long, then defaultValue is returned.name - property name.defaultValue - default value.long, or defaultValue.protected void setLong(String name, long value)
name property to a long.name - property name.value - long value of the property.protected float getFloat(String name, float defaultValue)
name property as a float. If no such property is specified, or if
the specified value is not a valid float, then defaultValue is returned.name - property name.defaultValue - default value.float, or defaultValue.protected void setFloat(String name, float value)
name property to a float.name - property name.value - property value.protected boolean getBoolean(String name, boolean defaultValue)
name property as a boolean . If no such property is specified, or
if the specified value is not a valid boolean, then defaultValue is returned.name - property name.defaultValue - default value.boolean, or defaultValue.protected void setBoolean(String name, boolean value)
name property to a boolean .name - property name.value - boolean value of the property.public String getServiceHost()
public void setServiceHost(String host)
host - public int getServicePort()
public void setServicePort(int port)
port - public int getJobMaxSize()
public void setJobMaxSize(int jobMaxSize)
jobMaxSize - Configuration#jobMaxSizepublic int getOperationTimeout()
Configuration#operationTimeoutpublic void setOperationTimeout(int operationTimeout)
operationTimeout - Configuration#operationTimeoutpublic int getConnectTimeout()
CONNECT_TIMEOUTpublic void setConnectTimeout(int timeout)
timeout - CONNECT_TIMEOUTpublic int getReadTimeout()
READ_TIMEOUTpublic void setReadTimeout(int timeout)
timeout - READ_TIMEOUTpublic String getProtocolCharset()
public String toString()
toString 在类中 ObjectObject.toString()Copyright © 2012~2016–2019 dinstone. All rights reserved.