* @author Thomas Pantelis
*/
class DistributedEntityOwnershipCandidateRegistration extends AbstractEntityOwnershipCandidateRegistration {
+ private final DistributedEntityOwnershipService service;
- DistributedEntityOwnershipCandidateRegistration(EntityOwnershipCandidate candidate, Entity entity) {
+ DistributedEntityOwnershipCandidateRegistration(EntityOwnershipCandidate candidate, Entity entity,
+ DistributedEntityOwnershipService service) {
super(candidate, entity);
+ this.service = service;
}
@Override
- public void close() {
- // TODO - need to send unregister message.
+ protected void removeRegistration() {
+ service.unregisterCandidate(getEntity(), getInstance());
}
+
+ @Override
+ public String toString() {
+ return "DistributedEntityOwnershipCandidateRegistration [entity=" + getEntity() + ", candidate="
+ + getInstance() + "]";
+ }
+
+
}