Class DefaultProcessContextRegistry
- java.lang.Object
-
- de.hybris.platform.mediaconversion.os.process.impl.DefaultProcessContextRegistry
-
- All Implemented Interfaces:
ProcessContextRegistry
public class DefaultProcessContextRegistry extends java.lang.Object implements ProcessContextRegistry
Simple (but effective)ProcessContextRegistryimplementation based on aConcurrentHashMapand anAtomicIntegerfor pid generation.
-
-
Constructor Summary
Constructors Constructor Description DefaultProcessContextRegistry()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description intregister(ProcessContext context)Registers the givenProcessContext, creates a new internal id for it and returns it.ProcessContextretrieve(int pid)Retrieves theProcessContextuniquely identified by the passedpid.voidunregister(int pid)Unregisters (removes) theProcessContextidentified by the given pid.
-
-
-
Method Detail
-
register
public int register(ProcessContext context)
Registers the givenProcessContext, creates a new internal id for it and returns it.- Specified by:
registerin interfaceProcessContextRegistry- Parameters:
context- the context to register- Returns:
- a new locally unique id for the registered
ProcessContext - See Also:
ProcessContextRegistry.register(ProcessContext)
-
unregister
public void unregister(int pid)
Unregisters (removes) theProcessContextidentified by the given pid. If noProcessContextis registered for the specified id, calling this method has no effect; no exception is thrown.- Specified by:
unregisterin interfaceProcessContextRegistry- Parameters:
pid- the locally unique id of the registeredProcessContext.- See Also:
ProcessContextRegistry.unregister(int)
-
retrieve
public ProcessContext retrieve(int pid)
Retrieves theProcessContextuniquely identified by the passedpid.- Specified by:
retrievein interfaceProcessContextRegistry- Parameters:
pid- the locally unique id of the registeredProcessContext.- Returns:
- the
ProcessContextregistered for the specifiedpidornullif no such context is known. - See Also:
ProcessContextRegistry.retrieve(int)
-
-