JAC project
AOPSYS
CEDRIC & LIP6 labs

org.objectweb.jac.core
Class Application

java.lang.Object
  |
  +--org.objectweb.jac.core.Application
All Implemented Interfaces:
Serializable

public class Application
extends Object
implements Serializable

This class represents the JAC applications.

Before it is actually started, each application must define a name, some path informations, and a set of aspect configurations (one for each aspect the application needs to use) by instantiating and configuring this class. Then, the system registers the new application instance into the application repository of the system.

At a user-level, an application configuration is described in application descriptor files (*.acc). A typical application descriptor is:

 // file myApp.acc
 applicationName: myApp
 lauchingClass: myPath.Run
 aspects: \
     rtti rtti.acc true \
     session session.acc false \
     persistence persistence.acc true \
     gui gui.acc true
 

See Also:
Application(String,String,String,String[]), addAcConfiguration(ACConfiguration), ACConfiguration.ACConfiguration(Application,String,String,boolean), ApplicationRepository, Serialized Form

Constructor Summary
Application(String name, String path, String constructorClass, String[] arguments)
          Creates a new application.
 
Method Summary
 void addAcConfiguration(ACConfiguration configuration)
          Adds an aspect component configuration for this application.
 boolean configures(String acName)
          Tells if this application configures a given aspect component.
 ACConfiguration getAcConfiguration(String name)
          Gets a configurations from its name (the name of the aspect as defined in the jac.prop file.
 Collection getAcConfigurations()
          Returns all the configurations for the current application.
 String getConstructorClass()
          Gets the path of the launching class (that implements the static main(String[]) method).
 String getName()
          Gets the name of the application.
 String getPath()
          Gets the path of the application (its root directory).
 void init()
          Inits the application by creating and weaving the aspects configuration that are not woven on demand.
 boolean realizes(String acName)
          Tells if this application currently realizes a given aspect component.
 void removeAcConfiguration(ACConfiguration configuration)
          Removes an aspect component configuration for this application.
 void setConstructorClass(String constructorClass)
          Gets the path of the launching class (that implements the static main(String[]) method).
 void setName(String name)
          Sets the application's name.
 void setPath(String path)
          The path's setter.
 void start()
          Starts the application with its current aspect component configurations.
 String toString()
          Returns a string representation of this application.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Application

public Application(String name,
                   String path,
                   String constructorClass,
                   String[] arguments)
Creates a new application.

Parameters:
name - the name of the application
path - the path of the application (root directory). If it's null, the current directory is used
constructorClass - the path of the launching class accessible within the current class path)
arguments - the launching arguments
Method Detail

init

public void init()
Inits the application by creating and weaving the aspects configuration that are not woven on demand.


getName

public String getName()
Gets the name of the application.

Returns:
the application's name

setName

public void setName(String name)
Sets the application's name.

Parameters:
name - the application's name

getPath

public String getPath()
Gets the path of the application (its root directory).

Returns:
the application's path
See Also:
setPath(String)

setPath

public void setPath(String path)
The path's setter.

Parameters:
path - the new application root directory
See Also:
getPath()

getConstructorClass

public String getConstructorClass()
Gets the path of the launching class (that implements the static main(String[]) method).

Returns:
the launching class

setConstructorClass

public void setConstructorClass(String constructorClass)
Gets the path of the launching class (that implements the static main(String[]) method).

Parameters:
constructorClass - the launching class

realizes

public boolean realizes(String acName)
Tells if this application currently realizes a given aspect component. Not available yet.

Parameters:
acName - the aspect component name
Returns:
true if the application realizes the given aspect

configures

public boolean configures(String acName)
Tells if this application configures a given aspect component. Not available yet.

Parameters:
acName - the aspect component name
Returns:
true if the application configures the given aspect

addAcConfiguration

public void addAcConfiguration(ACConfiguration configuration)
Adds an aspect component configuration for this application.

Parameters:
configuration - the new configuration

removeAcConfiguration

public void removeAcConfiguration(ACConfiguration configuration)
Removes an aspect component configuration for this application.

Parameters:
configuration - the configuration to remove

getAcConfigurations

public Collection getAcConfigurations()
Returns all the configurations for the current application.

Returns:
a collection of configurations

getAcConfiguration

public ACConfiguration getAcConfiguration(String name)
Gets a configurations from its name (the name of the aspect as defined in the jac.prop file.

Parameters:
name - the aspect name
Returns:
the corresponding configuration

start

public void start()
Starts the application with its current aspect component configurations.

If the application is already instantiated or if the launching path is not found, then do nothing.


toString

public String toString()
Returns a string representation of this application.

Overrides:
toString in class Object
Returns:
a string

Contact JAC development team:
Renaud Pawlak
Lionel Seinturier
Laurent Martelli