|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectcom.phoenix_int.aserver.monitors.PHXMonitorableStream
public class PHXMonitorableStream
This class represents a stream of data which may be monitored by a client which supports progress monitors. To use this class, implement the IPHXMonitorable interface and return instances of this class.
public class monitorableComp implements IPHXAnalysis, IPHXMonitorable
{
private PHXMonitorableStream mon1 = new PHXMonitorableStream();
private PHXMonitorableStream mon2 = new PHXMonitorableStream();
.
.
.
public execute() throws Exception
{
//Do Stuff
mon1.clear();
mon2.clear();
mon1.append("Starting");
Writer w = mon2.getWriter();
w.write("Beginning first phase");
...
}
public PHXProcessInfo[] listProcesses() throws IOException
{
throws IOException("Not supported");
}
public String[] listMonitorableFiles() throws IOException;
{
String[] mons = new String[2];
mons[0] = "monitor1";
mons[1] = "monitor2";
return mons;
}
public Object getMonitor(String m)
throws PHXNoSuchObjectException;
{
if ( "monitor1".equals(m) )
return mon1;
if ( "monitor2".equals(m) )
return mon2;
throw new PHXNoSuchObjectException(m);
}
| Nested Class Summary | |
|---|---|
class |
PHXMonitorableStream.MonitorWriter
|
| Constructor Summary | |
|---|---|
PHXMonitorableStream()
Default Constructor |
|
| Method Summary | |
|---|---|
void |
addMonitorListener(IPHXFileCallback cb)
Adds a listener which gets events based on changes to this monitor |
void |
append(java.lang.String text)
Appends a string to this monitor |
void |
clear()
Clears the contents of this monitor |
java.lang.String |
getString()
Gets the current contents of the stream |
java.io.Writer |
getWriter()
Gets a java.io.Writer which when written to appends onto this monitor |
void |
removeMonitorListener(IPHXFileCallback cb)
Removes a listener from this monitor |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public PHXMonitorableStream()
| Method Detail |
|---|
public void addMonitorListener(IPHXFileCallback cb)
public void removeMonitorListener(IPHXFileCallback cb)
public java.io.Writer getWriter()
public void clear()
public java.lang.String getString()
public void append(java.lang.String text)
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||