Class DefaultProcessContextRegistry
java.lang.Object
de.hybris.platform.mediaconversion.os.process.impl.DefaultProcessContextRegistry
- All Implemented Interfaces:
ProcessContextRegistry
Simple (but effective)
ProcessContextRegistry implementation based on a ConcurrentHashMap and an
AtomicInteger for pid generation.-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionintregister(ProcessContext context) Registers the givenProcessContext, creates a new internal id for it and returns it.retrieve(int pid) Retrieves theProcessContextuniquely identified by the passedpid.voidunregister(int pid) Unregisters (removes) theProcessContextidentified by the given pid.
-
Constructor Details
-
DefaultProcessContextRegistry
public DefaultProcessContextRegistry()
-
-
Method Details
-
register
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:
-
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:
-
retrieve
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:
-