|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectinfo.sswap.ontologies.exec.impl.HotboxPollerImpl
public class HotboxPollerImpl
Implementation of a hotbox poller: the class "polls"--repeatedly checks after a pre-set delay--the contents of a "hotbox" directory. If files, subject to filename filtering, are newer than their associated file in another directory (the "public" or target directory), then a method is run on the files.
This poller checks for JSON formated Resource Description Graphs (
RDG
s); if one is found that is newer than its RDF/XML
RDG
, it is sent to the HTTP API /makeRDG
. On
success, this returns a valid RDG
which is placed in the target
directory.
Running the poller with the Exec package allows one to simply drop JSON pre-
RDG
s into the hotbox directory to stand-up semantic web
services.
Nested Class Summary | |
---|---|
private class |
HotboxPollerImpl.DaemonThread
|
private class |
HotboxPollerImpl.JSONFilenameFilter
|
private static class |
HotboxPollerImpl.SingletonHolder
|
Field Summary | |
---|---|
(package private) HotboxPollerImpl.DaemonThread |
daemonThread
|
(package private) long |
defaultSleepMilliSeconds
|
private java.lang.String |
fileNameExtensionFilter
|
private java.lang.String |
fileNameExtensionProperty
|
private HotboxPollerImpl.JSONFilenameFilter |
filenameFilter
|
private static java.io.File |
hotboxDir
|
private static java.lang.String |
hotboxPath
|
private static org.apache.log4j.Logger |
LOGGER
|
private static java.lang.String |
publicPath
|
(package private) long |
sleepMilliSeconds
|
(package private) java.lang.String |
sleepSecondsSystemProperty
|
Constructor Summary | |
---|---|
private |
HotboxPollerImpl()
|
Method Summary | |
---|---|
static HotboxPoller |
getInstance(java.lang.String hotboxPathStr,
java.lang.String publicPathStr)
|
boolean |
isRunning()
Check if the hotbox poller is running. |
void |
setInterval(int sleepSeconds)
Set the delay interval between directory scans. |
void |
start()
Start the hotbox directory polling. |
void |
stop()
Stop the hotbox directory polling. |
private void |
updatePublic(java.io.File[] jsonFiles)
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
private static final org.apache.log4j.Logger LOGGER
private static java.io.File hotboxDir
private static java.lang.String hotboxPath
private static java.lang.String publicPath
private java.lang.String fileNameExtensionFilter
private java.lang.String fileNameExtensionProperty
private HotboxPollerImpl.JSONFilenameFilter filenameFilter
long sleepMilliSeconds
long defaultSleepMilliSeconds
java.lang.String sleepSecondsSystemProperty
HotboxPollerImpl.DaemonThread daemonThread
Constructor Detail |
---|
private HotboxPollerImpl()
Method Detail |
---|
public static HotboxPoller getInstance(java.lang.String hotboxPathStr, java.lang.String publicPathStr) throws java.io.IOException
java.io.IOException
public void setInterval(int sleepSeconds)
HotboxPoller
setInterval
in interface HotboxPoller
sleepSeconds
- number of seconds to wait between pollingpublic void start()
HotboxPoller
start
in interface HotboxPoller
public void stop()
HotboxPoller
stop
in interface HotboxPoller
public boolean isRunning()
HotboxPoller
isRunning
in interface HotboxPoller
private void updatePublic(java.io.File[] jsonFiles)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |