Package com.complexible.common.rdf.rio
Class ProcessorContext
- java.lang.Object
-
- com.complexible.common.rdf.rio.ProcessorContext
-
public abstract class ProcessorContext extends java.lang.Object
Class to manage the number of concurrent producer and consumer tasks across multipleRDFStreamProcessor
instances. Use the methodshared()
to get a context with the globalSharedExecutor
used as executor and a globally enforced limit ofDEFAULT_MAX_PARSER_COUNT
andDEFAULT_MAX_HANDLER_COUNT
-
-
Field Summary
Fields Modifier and Type Field Description static int
DEFAULT_MAX_HANDLER_COUNT
static int
DEFAULT_MAX_PARSER_COUNT
protected java.util.concurrent.atomic.AtomicInteger
mConsumersRunning
protected int
mMaxConsumers
protected int
mMaxProducers
protected java.util.concurrent.atomic.AtomicInteger
mProducersRunning
-
Constructor Summary
Constructors Modifier Constructor Description protected
ProcessorContext(int maxProducers, int maxConsumers)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description int
maxConsumerCount()
int
maxProducerCount()
boolean
mayStartConsumer()
boolean
mayStartProducer()
boolean
mustStopConsumer()
static ProcessorContext
shared()
int
startedConsumer()
int
startedProducer()
void
stoppedConsumer()
int
stoppedProducer()
-
-
-
Field Detail
-
DEFAULT_MAX_PARSER_COUNT
public static final int DEFAULT_MAX_PARSER_COUNT
-
DEFAULT_MAX_HANDLER_COUNT
public static final int DEFAULT_MAX_HANDLER_COUNT
-
mProducersRunning
protected final java.util.concurrent.atomic.AtomicInteger mProducersRunning
-
mConsumersRunning
protected final java.util.concurrent.atomic.AtomicInteger mConsumersRunning
-
mMaxProducers
protected int mMaxProducers
-
mMaxConsumers
protected int mMaxConsumers
-
-
Method Detail
-
maxProducerCount
public int maxProducerCount()
-
maxConsumerCount
public int maxConsumerCount()
-
mayStartProducer
public boolean mayStartProducer()
-
mayStartConsumer
public boolean mayStartConsumer()
-
mustStopConsumer
public boolean mustStopConsumer()
-
startedProducer
public int startedProducer()
-
startedConsumer
public int startedConsumer()
-
stoppedProducer
public int stoppedProducer()
-
stoppedConsumer
public void stoppedConsumer()
-
shared
public static ProcessorContext shared()
- Returns:
- Default stream processor context
-
-