org.qedeq.kernel.bo.service.internal
Class ModuleArbiterImpl

java.lang.Object
  extended by org.qedeq.kernel.bo.service.internal.ModuleArbiterImpl
All Implemented Interfaces:
ModuleArbiter

public class ModuleArbiterImpl
extends java.lang.Object
implements ModuleArbiter

Get locks for modules. TODO 20130508 m31: Currently we make no difference between read and write locks. We also lock a module during the whole plugin processing for that module. This could be limited to status changes only.

Author:
Michael Meyling

Constructor Summary
ModuleArbiterImpl()
          Constructor.
 
Method Summary
 QedeqBoSet getBlockedModules(ServiceJob process)
          Get all blocked modules from given process.
 boolean lockRequiredModule(InternalModuleServiceCall call)
          Lock QEDEQ module for exclusive read and write access.
 boolean unlockRequiredModule(InternalModuleServiceCall call)
          Unlock module again.
 boolean unlockRequiredModule(ServiceJob process, QedeqBo qedeq)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ModuleArbiterImpl

public ModuleArbiterImpl()
Constructor.

Method Detail

lockRequiredModule

public boolean lockRequiredModule(InternalModuleServiceCall call)
                           throws InterruptException
Description copied from interface: ModuleArbiter
Lock QEDEQ module for exclusive read and write access.

Specified by:
lockRequiredModule in interface ModuleArbiter
Parameters:
call - This service call acquires the lock.
Returns:
The call locked this module newly. Before this call the module was not locked.
Throws:
InterruptException - Lock acquirement interrupted.

unlockRequiredModule

public boolean unlockRequiredModule(InternalModuleServiceCall call)
Description copied from interface: ModuleArbiter
Unlock module again.

Specified by:
unlockRequiredModule in interface ModuleArbiter
Parameters:
call - This call must have acquired the lock.
Returns:
Was this module even locked?

unlockRequiredModule

public boolean unlockRequiredModule(ServiceJob process,
                                    QedeqBo qedeq)

getBlockedModules

public QedeqBoSet getBlockedModules(ServiceJob process)
Description copied from interface: ModuleArbiter
Get all blocked modules from given process.

Specified by:
getBlockedModules in interface ModuleArbiter
Parameters:
process - Get all modules blocked by this job.
Returns:
Set of blocked modules.


Copyright © 2014. All Rights Reserved.