planet.commonapi.factory
Interface ApplicationFactory

All Known Implementing Classes:
ApplicationFactoryImpl

public interface ApplicationFactory

This interface abstracts the task of generate new instances of Application. In this case, only one parameter exist:

There is a default value in the properties file:

Author:
Jordi Pujol
See Also:
Application

Method Summary
 Application build()
          Generates a new instance of the actual Application class.
 Application build(java.lang.String app)
          Generates a new instance of the Application class app.
 Application buildWithName(java.lang.String name)
          Generates a new instance of the actual Application class.
 Application buildWithName(java.lang.String app, java.lang.String name)
          Generates a new instance of the Application class app.
 java.lang.String getApplicationClass()
          Gets the actual Application class whose is generating the new instances of the application, in calls to the method build()
 void setApplicationClass(java.lang.String app)
          Sets the class of the Application to generate future instances.
 

Method Detail

build

Application build()
                  throws InitializationException
Generates a new instance of the actual Application class. The name of Application is setting the default one by its implementation.

Returns:
A new instance of the Application
Throws:
InitializationException
See Also:
Application

build

Application build(java.lang.String app)
                  throws InitializationException
Generates a new instance of the Application class app. This value must be an existing Application implementation. The Application's name is setting by the implementation owner.

Parameters:
app - Class completly defined of the Application to generate only by this method call.
Returns:
A new instance of Application. Its class is app
Throws:
InitializationException
See Also:
Application

buildWithName

Application buildWithName(java.lang.String name)
                          throws InitializationException
Generates a new instance of the actual Application class. The name of Application is overwriting by name.

Parameters:
name - Name for the application to generate.
Returns:
A new instance of the Application
Throws:
InitializationException
See Also:
Application

buildWithName

Application buildWithName(java.lang.String app,
                          java.lang.String name)
                          throws InitializationException
Generates a new instance of the Application class app. This value must be an existing Application implementation. The name of Application is overwriting by name.

Parameters:
app - Class completly defined of the Application to generate only by this method call.
name - Name for the application to generate.
Returns:
A new instance of Application. Its class is app
Throws:
InitializationException
See Also:
Application

getApplicationClass

java.lang.String getApplicationClass()
Gets the actual Application class whose is generating the new instances of the application, in calls to the method build()

Returns:
The class of the generated Applications in String format.
See Also:
build()

setApplicationClass

void setApplicationClass(java.lang.String app)
                         throws InitializationException
Sets the class of the Application to generate future instances.

Parameters:
app - Class of the Application in String format.
Throws:
InitializationException