com.genesyslab.ail.applicationblocks.connector
Class Connector

java.lang.Object
  extended bycom.genesyslab.ail.applicationblocks.connector.Connector

public class Connector
extends java.lang.Object

This is the entry point and the manager of the underlying AIL library. This class is a bootstrap for AIL connection and management.


Nested Class Summary
 class Connector.ServiceStatusListenerAdapter
          Implements ServiceListener.
 
Constructor Summary
Connector()
          Creates a new instance of Connector
 
Method Summary
 com.genesyslab.ail.AilFactory getAIL()
          Instantiates and returns the AilFactory.
 void init(ApplicationParameters applicationParameters)
          Initializes the connector with application parameters and connects to the AIL Library.
 void release()
          Releases the AIL Library instance and all the objects made available through this connector.
 void setLicense(java.lang.String license)
          Sets license file when given as application parameter rather than option of config.
 void setLog(java.lang.String file, java.lang.String path)
          Sets the default log file location and default log file name.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Connector

public Connector()
Creates a new instance of Connector

Method Detail

init

public void init(ApplicationParameters applicationParameters)
          throws com.genesyslab.ail.exception.RequestFailedException
Initializes the connector with application parameters and connects to the AIL Library.

Parameters:
applicationParameters - the application parameters See ApplicationParameters.
Throws:
com.genesyslab.ail.exception.RequestFailedException - thrown if problems occured during initialisation.

release

public void release()
             throws com.genesyslab.ail.exception.RequestFailedException
Releases the AIL Library instance and all the objects made available through this connector.

Throws:
com.genesyslab.ail.exception.RequestFailedException - thrown if problems occured during release.

setLog

public void setLog(java.lang.String file,
                   java.lang.String path)
            throws com.genesyslab.ail.exception.RequestFailedException
Sets the default log file location and default log file name. This location and this file name are for the bootstrap log file only, real location is set in the Configuration Layer, in the options of the application.

Parameters:
file - the name of the log file.
path - the fully-qualified path to the log file ; it can be either absolute or relative.
Throws:
com.genesyslab.ail.exception.RequestFailedException - thrown if problems occured during setting.

setLicense

public void setLicense(java.lang.String license)
                throws com.genesyslab.ail.exception.RequestFailedException
Sets license file when given as application parameter rather than option of config. Must be done before getAIL() which tries to get the licenses.

Parameters:
license - The license file (one or several filepath|port@host separated by semicolon).
Throws:
com.genesyslab.ail.exception.RequestFailedException - if license was already set with a different value.

getAIL

public com.genesyslab.ail.AilFactory getAIL()
                                     throws com.genesyslab.ail.exception.RequestFailedException
Instantiates and returns the AilFactory. If the AIlFactory was not initialized, returns null. In case of error while initializing the connection to the config server, returns null.

Returns:
the AilFactory or null in case of error.
Throws:
com.genesyslab.ail.exception.RequestFailedException - thrown if problems occured during setting.