All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.bagri.server.hazelcast.task.doc.DocumentQueueCounter Maven / Gradle / Ivy

The newest version!
package com.bagri.server.hazelcast.task.doc;

import static com.bagri.server.hazelcast.serialize.TaskSerializationFactory.cli_factory_id;
import static com.bagri.server.hazelcast.serialize.TaskSerializationFactory.cli_CountUpdatingDocumentsTask;

import java.io.IOException;
import java.util.concurrent.Callable;

//import org.slf4j.Logger;
//import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;

import com.bagri.server.hazelcast.impl.PopulationManagementImpl;
import com.bagri.server.hazelcast.impl.SchemaRepositoryImpl;
import com.hazelcast.nio.ObjectDataInput;
import com.hazelcast.nio.ObjectDataOutput;
import com.hazelcast.nio.serialization.IdentifiedDataSerializable;
import com.hazelcast.spring.context.SpringAware;

@SpringAware
public class DocumentQueueCounter implements Callable, IdentifiedDataSerializable { 
	
	//private static final transient Logger logger = LoggerFactory.getLogger(DocumentQueueCounter.class);

	private transient SchemaRepositoryImpl xdmRepo;
    
    @Autowired
	public void setRepository(SchemaRepositoryImpl xdmRepo) {
		this.xdmRepo = xdmRepo;
	}

	@Override
	public Integer call() throws Exception {
		return ((PopulationManagementImpl) xdmRepo.getPopulationManagement()).getUpdatingDocumentCount();
	}

	@Override
	public int getFactoryId() {
		return cli_factory_id;
	}

	@Override
	public int getId() {
		return cli_CountUpdatingDocumentsTask;
	}

	@Override
	public void readData(ObjectDataInput in) throws IOException {
		// TODO nothing to read
	}

	@Override
	public void writeData(ObjectDataOutput out) throws IOException {
		// nothing to write
	}

}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy