public static class StaticModbusExport.Builder extends Object
Modifier and Type | Method and Description |
---|---|
void |
addExport(String itemId,
int offset,
SourceType type)
Add an export (source definition) to the current set
|
ModbusExport |
build()
Build a new modbus export instance based on the current builder state
Note: The call is responsible for disposing the created instance using ModbusExport.dispose() . |
void |
setDefinitions(Collection<SourceDefinition> definitions)
Set (replace) all current source definitions
|
void |
setHiveProperies(Properties hiveProperies)
Set the hive session creation properties (e.g.
|
void |
setIoProcessor(org.apache.mina.core.service.IoProcessor<org.apache.mina.transport.socket.nio.NioSession> processor)
Set a custom IO processor
|
void |
setPort(int port) |
void |
setReadTimeout(int readTimeout)
Set a new read timeout in milliseconds
The default read timeout is 30000ms (30 seconds) |
void |
setSlaveId(short slaveId) |
void |
setThreadFactory(ThreadFactory threadFactory)
Set a custom thread factory
If the thread factory is null , or not set then a default
thread factory will be used |
public Builder(Hive hive)
public void setHiveProperies(Properties hiveProperies)
hiveProperies
- the hive session creation propertiespublic void setReadTimeout(int readTimeout)
readTimeout
- the new read timeoutpublic void setPort(int port)
public void setSlaveId(short slaveId)
public void setThreadFactory(ThreadFactory threadFactory)
null
, or not set then a default
thread factory will be usedthreadFactory
- the thread factory to usepublic void setIoProcessor(org.apache.mina.core.service.IoProcessor<org.apache.mina.transport.socket.nio.NioSession> processor)
processor
- public void setDefinitions(Collection<SourceDefinition> definitions)
definitions
- the new source definitionspublic void addExport(String itemId, int offset, SourceType type)
itemId
- the ID of the itemoffset
- the offset (in bytes) were to map the item totype
- the data type providerpublic ModbusExport build()
ModbusExport.dispose()
.