feat(renderer): Add copy method to RenderingBoPool interface and implement in RenderingBoPoolImpl

This commit is contained in:
extio-de
2025-12-25 15:36:16 +01:00
parent 3ce76decff
commit fffa2b773f
3 changed files with 536 additions and 2 deletions

View File

@@ -16,12 +16,13 @@ public interface RenderingBoPool {
* Acquires a rendering business object by type from the pool.
*/
<T extends RenderingBo> T acquire(String id, Class<T> clazz);
<T extends RenderingBo> T copy(T original);
/**
* Releases a rendering business object back to the pool. This is usually managed by the renderer.
*/
void release(RenderingBo obj);
void setRendererData(RendererData rendererData);
}

View File

@@ -90,6 +90,13 @@ public class RenderingBoPoolImpl implements RenderingBoPool {
return instance;
}
@Override
public <T extends RenderingBo> T copy(final T original) {
final T copy = this.acquire(original.getId(), (Class<T>) original.getClass());
copy.apply(original);
return copy;
}
@Override
public synchronized void release(final RenderingBo obj) {
try {