org.globus.ogsa.impl.base.providers.servicedata.impl
Class AsyncDocumentProvider

java.lang.Object
  extended byorg.globus.ogsa.impl.base.providers.servicedata.impl.AsyncDocumentProvider
All Implemented Interfaces:
AsyncDataProvider, java.lang.Runnable, SimpleDataProvider

public class AsyncDocumentProvider
extends java.lang.Object
implements AsyncDataProvider, java.lang.Runnable

This provider can be used to simulate an asyncronous provider for testing. It periodically reads the xml file specified by the -f argument at the interval specified by the -i argument and performs an async provider callback with the result DOM document.


Field Summary
 
Fields inherited from interface org.globus.ogsa.impl.base.providers.servicedata.AsyncDataProvider
PROVIDER_ERROR, PROVIDER_IDLE, PROVIDER_RUNNING, PROVIDER_TERMINATED
 
Constructor Summary
AsyncDocumentProvider()
          Creates a new instance of AsyncXMLDocumentProvider
 
Method Summary
 java.lang.String getDefaultArgs()
          If the provider has a set of default arguments, they can be retrieved with this function.
 java.lang.String getDescription()
          Returns a description of the provider's functionality.
 java.lang.String getErrorString()
          The provider should return a string representation of the current error, if any
 java.lang.String getName()
          Returns the display name of the provider.
 int getState()
          Retrieve the current state
static void main(java.lang.String[] args)
           
 void output(java.io.OutputStream outStream)
           
protected  void parseArgs(java.lang.String args)
           
 void run()
           
 void run(java.lang.String args, java.io.OutputStream outStream)
          Triggers the execution of the provider, updating the provider's internal state and sending the output to the specified OutputStream.
 void run(java.lang.String args, java.lang.String callbackName, ServiceDataProviderDocumentCallback callback, java.lang.Object context)
          Triggers the asynchronous execution of the provider, sending the output to the specified callback Object.
 void setSampleFile(java.lang.String fileName)
           
 void setSampleRefresh(long millis)
           
 void terminate()
          Signals the provider to shutdown, cease data callbacks and free any associated resources
 void update(java.lang.String argStr)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AsyncDocumentProvider

public AsyncDocumentProvider()
Creates a new instance of AsyncXMLDocumentProvider

Method Detail

main

public static void main(java.lang.String[] args)

getDefaultArgs

public java.lang.String getDefaultArgs()
If the provider has a set of default arguments, they can be retrieved with this function.

Specified by:
getDefaultArgs in interface SimpleDataProvider

getDescription

public java.lang.String getDescription()
Returns a description of the provider's functionality.

Specified by:
getDescription in interface SimpleDataProvider

getErrorString

public java.lang.String getErrorString()
The provider should return a string representation of the current error, if any

Specified by:
getErrorString in interface SimpleDataProvider

getState

public int getState()
Description copied from interface: AsyncDataProvider
Retrieve the current state

Specified by:
getState in interface AsyncDataProvider

getName

public java.lang.String getName()
Returns the display name of the provider.

Specified by:
getName in interface SimpleDataProvider

setSampleFile

public void setSampleFile(java.lang.String fileName)

setSampleRefresh

public void setSampleRefresh(long millis)

run

public void run(java.lang.String args,
                java.lang.String callbackName,
                ServiceDataProviderDocumentCallback callback,
                java.lang.Object context)
         throws java.lang.Exception
Triggers the asynchronous execution of the provider, sending the output to the specified callback Object. Context is defined by the calling thread.

Specified by:
run in interface AsyncDataProvider
Throws:
java.lang.Exception

run

public void run()
Specified by:
run in interface java.lang.Runnable

terminate

public void terminate()
Description copied from interface: AsyncDataProvider
Signals the provider to shutdown, cease data callbacks and free any associated resources

Specified by:
terminate in interface AsyncDataProvider

update

public void update(java.lang.String argStr)
            throws java.lang.Exception
Throws:
java.lang.Exception

parseArgs

protected void parseArgs(java.lang.String args)
                  throws java.lang.Exception
Throws:
java.lang.Exception

output

public void output(java.io.OutputStream outStream)
            throws java.lang.Exception
Throws:
java.lang.Exception

run

public void run(java.lang.String args,
                java.io.OutputStream outStream)
         throws java.lang.Exception
Description copied from interface: SimpleDataProvider
Triggers the execution of the provider, updating the provider's internal state and sending the output to the specified OutputStream.

Specified by:
run in interface SimpleDataProvider
Throws:
java.lang.Exception