Download Graffica System Development Kit User Guide GSDK PLATFORM

Transcript
Graffica System Development Kit
Reference GL/GSDK/TN/2
21 June 2004
D:\Continuus\ccm_wa\ino\eDEP_Documentation-2004A\eDEP_Documentation\guides\eDEP_DevelopersGuide.doc
*/
public ComponentController createController( ApplicationContext context );
/**
* When the application is started, this method is invoked to allow
* any user defined processing to be performed.
* @param context the application context details.
*/
public void start( ApplicationContext context );
/**
* When the application is shutdown, this method is invoked to allow
* any user defined processing to be performed.
* @param context the application context details.
*/
public void shutdown( ApplicationContext context );
6.3 CREATING AND RUNNING A GSDK PROCESS
The following examples show how a GSDK process can be initialised with one or more component
applications running on separate threads within the single virtual machine. Each example defines the
required main method.
The first example shows how a simple system with a single application can be created. Notice that the
first statement creates the middleware discovery server. This provides the lookup/discovery
functionality that allows the application to search for other applications that it might wish to exchange
data with either as a client or a server. The GSDK object is created using the command line arguments
passed to the main method. These arguments will be parsed to provide a set of system parameters, that
may be used in the initialisation and configuration of the system and its applications. A single
example application is added, with the name EXAMPLE, before the toolkit is started.
public class ExampleMain
{
public static void main( String[] args )
{
try {
DiscoveryServer.main(null);
// create the discovery server
GSDK gsdk = new GSDK( args );
gsdk.addApplication( new DefaultApplication(), "EXAMPLE" );
gsdk.startToolkit(); }
catch ( Exception e ) { e.printStackTrace(); };
} // End method main
} // End class ExampleMain
Page 21 of 42