public abstract class AbstractService extends AbstractService
Modifier and Type | Field and Description |
---|---|
protected static Set<MatchingMethod> |
ALL_MATCHINGMETHODS |
protected static List<LanguagePair> |
EMPTY_LANGUAGEPAIRS |
protected static List<LanguagePath> |
EMPTY_LANGUAGEPATHS |
protected static List<Language> |
EMPTY_LANGUAGES |
protected static Set<MatchingMethod> |
MINIMUM_MATCHINGMETHODS |
Constructor and Description |
---|
AbstractService() |
AbstractService(ServiceContext serviceContext) |
Modifier and Type | Method and Description |
---|---|
protected void |
acquireSemaphore() |
protected void |
checkStartupException() |
protected LanguagePair[] |
convertLanguagePairs(Collection<LanguagePair> pairs) |
protected String[] |
convertLanguages(Collection<Language> languages) |
protected Calendar |
doGetLastUpdate() |
static ServiceContext |
getCurrentServiceContext() |
protected boolean |
getDoDoubleSearch() |
protected boolean |
getEliminateDuplicates() |
protected String |
getInitParameter(String parameterName) |
protected boolean |
getInitParameterBoolean(String parameterName,
boolean defaultValue) |
protected int |
getInitParameterInt(String parameterName,
int defaultValue) |
protected long |
getInitParameterLong(String parameterName,
long defaultValue) |
protected jp.go.nict.langrid.commons.parameter.ParameterContext |
getInitParameters() |
protected String |
getInitParameterString(String parameterName,
String defaultValue) |
protected <T> T |
getInitParameterUsingTransformer(String parameterName,
T defaultValue,
jp.go.nict.langrid.commons.transformer.Transformer<String,T> transformer) |
Calendar |
getLastUpdate() |
LogListener |
getLogListener() |
protected int |
getMaxResults() |
protected int |
getMaxWaitMillisForExternalProcess() |
protected MimeHeaders |
getRequestMimeHeaders() |
ServiceContext |
getServiceContext() |
protected File |
getWorkDirectory() |
protected File |
getWorkFile(String directoryName) |
void |
log(String message) |
protected Calendar |
parseDateMacro(String value) |
protected void |
processEnd() |
protected void |
processEnd(Runnable onThreasholdOver) |
protected long |
processLap(String message) |
protected void |
processStart() |
protected void |
releaseSemaphore() |
static void |
setCurrentServiceContext(ServiceContext context) |
void |
setDoubleSearchResults(boolean doubleSearchResults) |
void |
setEliminateDuplicates(boolean eliminateDuplicates) |
void |
setLogListener(LogListener logListener) |
void |
setMaxResults(int maxResults) |
void |
setMaxThreads(int maxThreads) |
void |
setMaxWaitMillisForExternalProcess(int maxWaitMillisForExternalProcess) |
void |
setMaxWaitMillisForThread(int maxWaitMillisForThread) |
void |
setMeasureProcessTime(boolean measureProcessTime) |
void |
setProcessTimeWarningThreasholdMillis(long processTimeWarningThreasholdMillis) |
protected void |
setStartupException(Exception exception) |
getComponentServiceFactory, getFile, getServiceName, setComponentServiceFactory, setServiceName
protected static final List<LanguagePair> EMPTY_LANGUAGEPAIRS
protected static final List<LanguagePath> EMPTY_LANGUAGEPATHS
protected static final Set<MatchingMethod> MINIMUM_MATCHINGMETHODS
protected static final Set<MatchingMethod> ALL_MATCHINGMETHODS
public AbstractService()
public AbstractService(ServiceContext serviceContext)
public static ServiceContext getCurrentServiceContext()
public static void setCurrentServiceContext(ServiceContext context)
public ServiceContext getServiceContext()
public void setLogListener(LogListener logListener)
public LogListener getLogListener()
public void log(String message)
public void setMaxResults(int maxResults)
public void setMaxThreads(int maxThreads)
public void setMaxWaitMillisForExternalProcess(int maxWaitMillisForExternalProcess)
public void setMaxWaitMillisForThread(int maxWaitMillisForThread)
public void setEliminateDuplicates(boolean eliminateDuplicates)
public void setDoubleSearchResults(boolean doubleSearchResults)
public void setMeasureProcessTime(boolean measureProcessTime)
public void setProcessTimeWarningThreasholdMillis(long processTimeWarningThreasholdMillis)
public Calendar getLastUpdate() throws AccessLimitExceededException, NoAccessPermissionException, NoValidEndpointsException, ProcessFailedException, ServerBusyException, ServiceNotActiveException, ServiceNotFoundException
protected int getMaxWaitMillisForExternalProcess()
protected int getMaxResults()
protected boolean getEliminateDuplicates()
protected boolean getDoDoubleSearch()
protected void checkStartupException() throws ProcessFailedException
ProcessFailedException
protected void setStartupException(Exception exception)
protected File getWorkDirectory()
protected jp.go.nict.langrid.commons.parameter.ParameterContext getInitParameters()
protected boolean getInitParameterBoolean(String parameterName, boolean defaultValue)
protected int getInitParameterInt(String parameterName, int defaultValue)
protected long getInitParameterLong(String parameterName, long defaultValue)
protected String getInitParameterString(String parameterName, String defaultValue)
protected <T> T getInitParameterUsingTransformer(String parameterName, T defaultValue, jp.go.nict.langrid.commons.transformer.Transformer<String,T> transformer)
protected MimeHeaders getRequestMimeHeaders()
protected LanguagePair[] convertLanguagePairs(Collection<LanguagePair> pairs)
protected String[] convertLanguages(Collection<Language> languages)
protected void acquireSemaphore() throws ProcessFailedException
ProcessFailedException
protected void releaseSemaphore()
protected void processStart()
protected long processLap(String message)
protected void processEnd()
protected void processEnd(Runnable onThreasholdOver)
protected Calendar doGetLastUpdate() throws ProcessFailedException
ProcessFailedException
protected Calendar parseDateMacro(String value) throws ProcessFailedException
ProcessFailedException