|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Smart works by setting up simultaneous streams of data between the different components. The StreamModule interface defines the basic unit of development for Smart application code.
Stream modules --- also called simply modules --- are simply stream filters with zero or more inputs and zero or more outputs.
Outputs from one stream module are connected to inputs from the next. All stream modules run ``simultaneously'' in separate threads. The stream module API provides a select-type command to handle more than one input without polling.
Data passed between stream modules may come in any format. In general, we expect to pass serialized data.
Method Summary | |
java.io.InputStream |
getInput(int i)
Returns the stream attached to the ith input. |
int |
getNumInputs()
How many inputs does this stream module have? |
int |
getNumOutputs()
How many outputs does this stream module have? |
java.io.OutputStream |
getOutput(int i)
Returns the output stream attached to the ith output. |
void |
run(SMContext con)
Entry point --- should never exit. |
void |
setInput(int i,
java.io.InputStream fin)
Assigns input stream --- called by MIT code when connecting stream modules. |
void |
setOutput(int i,
java.io.OutputStream fout)
Assigns output stream --- called by MIT code when connecting stream modules. |
void |
stop()
Generally called from a separate thread from run(). |
Method Detail |
public int getNumInputs()
public int getNumOutputs()
public void setInput(int i, java.io.InputStream fin)
public java.io.InputStream getInput(int i)
public void setOutput(int i, java.io.OutputStream fout)
public java.io.OutputStream getOutput(int i)
public void stop()
public void run(SMContext con)
con
- a context object, containing any Smart system calls one wishes to provide to the Stream Modules.Session
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |