org.aselect.agent
Class ASelectAgent

java.lang.Object
  extended by org.aselect.agent.ASelectAgent

public class ASelectAgent
extends java.lang.Object

A-Select Agent Main Class.

Description:
The A-Select Agent is a lightweight server that offers an convenient API for applications to make use of the services of multiple A-Select Servers.

The A-Select Agent also offers advanced session management that applications may use. The A-Select Agent only accepts connections from applications that run on the same host.

Currently, the A-Select Agent supports the following API requests:


Concurrency issues:
None.

Author:
Alfa & Ariss

Field Summary
static java.lang.String MODULE
          Module string.
static java.lang.String VERSION
          Version string.
 
Constructor Summary
ASelectAgent()
          Constructor for the A-Select Agent class.
 
Method Summary
 void destroy()
          Clean up Agent.
 void destroyGui()
          Clean up Agent GUI recourses if applicable.
 int getAdminPort()
          Returns the TCP/IP portnumber of the A-Select Agent's Admin interface.
 void init()
          Initializes the A-Select Agent.
 boolean isActive()
          Returns whether A-Select Agent is active.
 boolean isInGuiMode()
          Returns The A-Select Agent GUI mode.
static void main(java.lang.String[] saArgs)
          Main entry point for starting the Agent in console mode.
 void startServices()
          Starts the services of the A-Select Agent.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

MODULE

public static final java.lang.String MODULE
Module string.

See Also:
Constant Field Values

VERSION

public static final java.lang.String VERSION
Version string.

See Also:
Constant Field Values
Constructor Detail

ASelectAgent

public ASelectAgent()
Constructor for the A-Select Agent class.

Method Detail

main

public static void main(java.lang.String[] saArgs)
Main entry point for starting the Agent in console mode.

Description:
The main function instantiates an A-Select Agent and lets it start. It does this by calling the init() method and then the startServices() method.

If the A-Select Agent cannot start, a System.exit(1) is returned.

Concurrency issues:
None.

Preconditions:
None.

Postconditions:
None.

Parameters:
saArgs - Commandline parameters; currently not used.

init

public void init()
          throws ASelectException
Initializes the A-Select Agent.

Description:
The A-Select Agent initializes itself by reading its configuration, getting the handles to essential objects and initializing the logging system.

Concurrency issues:
None.

Preconditions:
None.

Postconditions:
None.

Throws:
ASelectException - if initialization was unsuccessful.

destroy

public void destroy()
Clean up Agent.

Description:
Concurrency issues:
Should be called once.

Preconditions:
-

Postconditions:
All resources are cleared.


destroyGui

public void destroyGui()
Clean up Agent GUI recourses if applicable.

Description:
Checks if GUI mode is enabled. Calls the Window.dispose() method which disposes the Agent GUI.

Warning: Should be called as the last method in the destroying process because after calling dispose() the Java virtual machine (VM) may terminate.
Concurrency issues:
-

Preconditions:
-

Postconditions:
The GUI is disposed, the virtual machine may terminate.


startServices

public void startServices()
                   throws java.lang.Exception
Starts the services of the A-Select Agent.

Description:
This method initializes the services and tries to allocate the listening sockets for the A-Select Agent's services. This method also starts the GUI A-Select Monitor if it was specified in the configuration options.

After allocating the services the request handler threads are started.

Concurrency issues:
None.

Preconditions:
None.

Postconditions:
None.

Throws:
java.lang.Exception - if the services could not be started.

getAdminPort

public int getAdminPort()
Returns the TCP/IP portnumber of the A-Select Agent's Admin interface.

Returns:
the portnumber of the Admin interface.

isActive

public boolean isActive()
Returns whether A-Select Agent is active.

Returns:
true if A-Select Agent is active, otherwise false.

isInGuiMode

public boolean isInGuiMode()
Returns The A-Select Agent GUI mode.

Returns:
true if the A-Select Agent GUI is active, otherwise false.


Copyright © 2008 SURFnet BV. All Rights Reserved.