public class ObjectPoolDataItemFactory extends Object implements ItemFactory
Constructor and Description |
---|
ObjectPoolDataItemFactory(Executor executor,
ManageableObjectPool<DataItem> objectPool,
String prefix) |
Modifier and Type | Method and Description |
---|---|
DataItemCommand |
createCommand(String localId,
Map<String,Variant> properties) |
DataItemInputChained |
createInput(String localId,
Map<String,Variant> properties) |
WriteHandlerItem |
createInputOutput(String localId,
Map<String,Variant> properties,
WriteHandler writeHandler) |
WriteHandlerItem |
createOutput(String localId,
Map<String,Variant> properties,
WriteHandler writeHandler) |
void |
dispose()
Dispose the factory
|
void |
disposeAllItems()
Dispose all items at once
|
void |
disposeItem(DataItem dataItem)
Dispose an item if it was created by this factory
|
protected String |
getId(String localId) |
protected void |
unregisterItem(DataItem dataItem) |
public ObjectPoolDataItemFactory(Executor executor, ManageableObjectPool<DataItem> objectPool, String prefix)
public DataItemCommand createCommand(String localId, Map<String,Variant> properties)
createCommand
in interface ItemFactory
public DataItemInputChained createInput(String localId, Map<String,Variant> properties)
createInput
in interface ItemFactory
public WriteHandlerItem createInputOutput(String localId, Map<String,Variant> properties, WriteHandler writeHandler)
createInputOutput
in interface ItemFactory
public WriteHandlerItem createOutput(String localId, Map<String,Variant> properties, WriteHandler writeHandler)
createOutput
in interface ItemFactory
protected void unregisterItem(DataItem dataItem)
public void dispose()
ItemFactory
All items that where created by this factory and where not disposed up to now are being disposed
After a call to this method it is not possible to create new items.
Multiple calls to ItemFactory.dispose()
or calls to
ItemFactory.disposeAllItems()
are possible.
dispose
in interface ItemFactory
public void disposeAllItems()
ItemFactory
After a call to this method it is still possible to create new items
disposeAllItems
in interface ItemFactory
public void disposeItem(DataItem dataItem)
ItemFactory
If the item was not created by this factory or was already disposed this is no error and no exception is thrown
disposeItem
in interface ItemFactory
dataItem
- data item to dispose