info.aduna.gee.spectacle.gee
Class Application

java.lang.Object
  extended by info.aduna.gee.spectacle.gee.Application
Direct Known Subclasses:
EmbeddedApplication

public abstract class Application
extends Object

Class Application implements a common way of starting and executing an application that uses the onto API. The most important feature offered by this abstract class is Exception handling. Run an onto application from the commandline by extending this class in e.g. MyApplication in package com.mycompany.myproject. MyApplication's main method should read:

 
                public static void main(String[] args) {
                        Application.main("com.mycompany.myproject.MyApplication", args);
                }
        
MyApplication must support the following constructor:
                public MyApplication(String[] args) {
                        super(args);
                        ...
                }
        
And MyApplication must override the abstract execute() method.


Field Summary
protected  String[] _args
          The command-line arguments provided to this application.
protected  String _server
          The server this application is communicating with.
protected  String _serverPath
          The server path this application is communicating with.
 
Constructor Summary
Application(String[] args)
          Construct the application.
 
Method Summary
abstract  void execute()
          Execute the application.
 String getServer()
           
 String getServerPath()
           
static void main(String applicationClassName, String[] args)
          Run an application from the commandline by extending this class and defining a main method that contains: Application.main("SubclassName", args);
 void setServer(String server)
          Set the server this application is communicating with.
static void start(String applicationClassName, Object args)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

_serverPath

protected String _serverPath
The server path this application is communicating with.


_server

protected String _server
The server this application is communicating with.


_args

protected String[] _args
The command-line arguments provided to this application.

Constructor Detail

Application

public Application(String[] args)
Construct the application. By default, the first argument is assumed to be the name of the server.

See Also:
setServer(java.lang.String)
Method Detail

getServer

public String getServer()
Returns:
the server this application is communicating with.

getServerPath

public String getServerPath()
Returns:
the server path this application is communicating with.

setServer

public void setServer(String server)
Set the server this application is communicating with.

Parameters:
server - either a server ("myhost") or already a serverPath ("https://www.mysecurehost.com:9898/")

execute

public abstract void execute()
                      throws ChannelException
Execute the application.

Throws:
ChannelException

start

public static void start(String applicationClassName,
                         Object args)

main

public static void main(String applicationClassName,
                        String[] args)
Run an application from the commandline by extending this class and defining a main method that contains: Application.main("SubclassName", args);



Copyright © 1997-2008 Aduna. All Rights Reserved.