Circular dependency between Entitler and *Pool classes
Ajay Kumar
ajaykumarns at gmail.com
Fri Jul 2 19:23:25 UTC 2010
Hello everyone,
Bryan wanted me to move the revocation code fragment present in
OwnerResource#refreshEntitlementPools
if (log.isInfoEnabled()) {
log.info("No of entitlements to revoke: #" + toRevoke.size());
}
for (Entitlement e : toRevoke) {
this.entitler.revokeEntitlement(e);
}
into the PoolCurator#refreshPools so that it can be re-used by other classes.
However, moving this into PoolCurator requires that Entitler be
injected into the PoolCurator class.
But, Entitler has the following constructor:
protected Entitler(PoolCurator epCurator,
EntitlementCurator entitlementCurator, ConsumerCurator consumerCurator,
Enforcer enforcer, EntitlementCertServiceAdapter entCertAdapter,
SubscriptionServiceAdapter subAdapter,
EventFactory eventFactory,
EventSink sink,
PostEntHelper postEntHelper){
....
}
As you can see, Entitler requires almost all the Curators and this
prevents the Entitler to be re-used within
various Curator classes.(the vicious circle)
What are your views on this issue? How do you think it can be resolved?
--
with regards
Ajay Kumar.N.S
http://www.linkedin.com/in/ajaykumarns
More information about the candlepin
mailing list