info.sswap.impl.empire.io
Class ClosureBuilderFactory

java.lang.Object
  extended by info.sswap.impl.empire.io.ClosureBuilderFactory

public class ClosureBuilderFactory
extends java.lang.Object

Creates a ClosureBuilder and specifies the default parameters (if not provided by the caller)

Author:
Blazej Bulka

Field Summary
private  java.util.List<java.lang.String> ignoredNamespaces
          Namespaces for which closure will not be computed.
private  long maxBytes
          The byte limit for the generated closure builder.
private  int maxThreads
          The number of concurrent threads used to compute the closure.
private  long maxTime
          The time limit for the generated closure builder.
private static ModelCache MODEL_CACHE
          The default model cache shared by all builders, unless overridden for a specific builder.
private  ModelCache modelCache
          The model cache that will be used by the builder -- by default, MODEL_CACHE is used, unless overridden via setModelCache(ModelCache) method.
 
Constructor Summary
private ClosureBuilderFactory()
          A private constructor
 
Method Summary
 ClosureBuilderFactory addIgnoredNamespace(java.lang.String ns)
          Adds a new namespace to the ignore list for which closure will not be computed.
static ModelCache getDefaultModelCache()
          Gets the default model cache that is shared by all closure-builders (unless it is specifically overridden).
 long getMaxBytes()
          Gets the current byte limit
 int getMaxThreads()
          Gets the number of concurrent threads that will build the closure
 long getMaxTime()
          Gets the current time limit.
 ModelCache getModelCache()
          Gets the model cache that will be used by the ClosureBuilders
 ClosureBuilder newBuilder()
          Creates a ClosureBuilder with the currently set parameters
static ClosureBuilderFactory newInstance()
          Creates a new ClosureBuilderFactory
 ClosureBuilderFactory setMaxBytes(long maxBytes)
          Sets the current byte limit.
 ClosureBuilderFactory setMaxThreads(int maxThreads)
          Sets the number of concurrent threads that will build the closure
 ClosureBuilderFactory setMaxTime(long maxTime)
          Sets the new time limit (in milliseconds)
 void setModelCache(ModelCache modelCache)
          Sets a new model cache that will be used by ClosureBuilders
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

MODEL_CACHE

private static final ModelCache MODEL_CACHE
The default model cache shared by all builders, unless overridden for a specific builder.


maxBytes

private long maxBytes
The byte limit for the generated closure builder. The default is 512KB


maxTime

private long maxTime
The time limit for the generated closure builder. The default is 30 seconds


maxThreads

private int maxThreads
The number of concurrent threads used to compute the closure. The default is 2.


modelCache

private ModelCache modelCache
The model cache that will be used by the builder -- by default, MODEL_CACHE is used, unless overridden via setModelCache(ModelCache) method.


ignoredNamespaces

private final java.util.List<java.lang.String> ignoredNamespaces
Namespaces for which closure will not be computed.

Constructor Detail

ClosureBuilderFactory

private ClosureBuilderFactory()
A private constructor

Method Detail

newInstance

public static ClosureBuilderFactory newInstance()
Creates a new ClosureBuilderFactory

Returns:
a new ClosureBuilderFactory

newBuilder

public ClosureBuilder newBuilder()
Creates a ClosureBuilder with the currently set parameters

Returns:
the new ClosureBuilder

getMaxBytes

public long getMaxBytes()
Gets the current byte limit

Returns:
the current byte limit

setMaxBytes

public ClosureBuilderFactory setMaxBytes(long maxBytes)
Sets the current byte limit.

Parameters:
maxBytes - the new byte limit
Returns:
this factory

getMaxTime

public long getMaxTime()
Gets the current time limit.

Returns:
the time limit (in milliseconds)

setMaxTime

public ClosureBuilderFactory setMaxTime(long maxTime)
Sets the new time limit (in milliseconds)

Parameters:
maxTime - the time limit (in milliseconds)
Returns:
this factory

getMaxThreads

public int getMaxThreads()
Gets the number of concurrent threads that will build the closure

Returns:
the number of concurrent threads

setMaxThreads

public ClosureBuilderFactory setMaxThreads(int maxThreads)
Sets the number of concurrent threads that will build the closure

Parameters:
maxThreads - the number of concurrent threads
Returns:
this object

getModelCache

public ModelCache getModelCache()
Gets the model cache that will be used by the ClosureBuilders

Returns:
the modelCache the model cache

setModelCache

public void setModelCache(ModelCache modelCache)
Sets a new model cache that will be used by ClosureBuilders

Parameters:
modelCache - the modelCache to set

addIgnoredNamespace

public ClosureBuilderFactory addIgnoredNamespace(java.lang.String ns)
Adds a new namespace to the ignore list for which closure will not be computed. The standard namespaces for RDF, RDFS, OWL and XSD are always ignored and do not need to be added here explicitly.

Parameters:
ns - a new namespace
Returns:
this object

getDefaultModelCache

public static ModelCache getDefaultModelCache()
Gets the default model cache that is shared by all closure-builders (unless it is specifically overridden).

Returns:
a model cache


Copyright (c) 2011, iPlant Collaborative, University of Arizona, Cold Spring Harbor Laboratories, University of Texas at Austin.