org.objectweb.jac.core
Class ApplicationRepository

java.lang.Object
  extended byorg.objectweb.jac.core.ApplicationRepository

public class ApplicationRepository
extends Object

This class is a repository for all the applications defined in the JAC system.

See Also:
Application

Constructor Summary
ApplicationRepository()
           
 
Method Summary
 void addApplication(Application app)
          Adds an application within the repository.
 void extend(String applicationName, String aspectName)
          Extends an application with a given aspect (only if this application has a configuration for this aspect and if this aspect is not yet woven).
static ApplicationRepository get()
          Gets the sole instance of the application repository within the local JAC system.
 Application getApplication(String name)
          Gets an application from its name.
 HashMap getApplications()
          Returns the applications that have been added to the repository.
static Application getCurrentApplication()
          Returns the application of the current thread.
static Application getOwningApplication(Wrappee wrappee, ClassItem cl)
           
static String getOwningApplicationName(Wrappee wrappee, ClassItem cl)
           
static void launchProgram(String[] args)
          Launches a JAC program.
static void main(String[] args)
          Launches and initializes the application repository (this method is called by the system).
static void setOwningApplication(Wrappee wrappee, ClassItem cl, Application application)
           
 void unextend(String applicationName, String aspectName)
          Un-extends an application with a given aspect (only if this application has a configuration for this aspect and if this aspect is woven).
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ApplicationRepository

public ApplicationRepository()
Method Detail

getOwningApplication

public static Application getOwningApplication(Wrappee wrappee,
                                               ClassItem cl)

getOwningApplicationName

public static String getOwningApplicationName(Wrappee wrappee,
                                              ClassItem cl)

setOwningApplication

public static void setOwningApplication(Wrappee wrappee,
                                        ClassItem cl,
                                        Application application)

getCurrentApplication

public static Application getCurrentApplication()
Returns the application of the current thread.

Returns:
an application, null if none

launchProgram

public static void launchProgram(String[] args)
Launches a JAC program.

Parameters:
args - the program arguments (first is the .jac file)

main

public static void main(String[] args)
                 throws Throwable
Launches and initializes the application repository (this method is called by the system).

Parameters:
args - the launching arguments of JAC
Throws:
Throwable

get

public static ApplicationRepository get()
Gets the sole instance of the application repository within the local JAC system.

Returns:
the application repository

addApplication

public void addApplication(Application app)
Adds an application within the repository.

When added, the application is initialized so that the needed aspects are woven.

Parameters:
app - the application to add

getApplications

public HashMap getApplications()
Returns the applications that have been added to the repository.

Returns:
a hash map (application's name -> application)
See Also:
addApplication(org.objectweb.jac.core.Application)

getApplication

public Application getApplication(String name)
Gets an application from its name.

Parameters:
name - the application's name
Returns:
the application named name
See Also:
getApplications()

extend

public void extend(String applicationName,
                   String aspectName)
Extends an application with a given aspect (only if this application has a configuration for this aspect and if this aspect is not yet woven).

Parameters:
applicationName - the application's name
aspectName - the aspect's name

unextend

public void unextend(String applicationName,
                     String aspectName)
Un-extends an application with a given aspect (only if this application has a configuration for this aspect and if this aspect is woven).

Parameters:
applicationName - the application's name
aspectName - the aspect's name