com.flexive.shared
Class FxDropApplication

java.lang.Object
  extended by com.flexive.shared.FxDropApplication
All Implemented Interfaces:
java.io.Serializable

public class FxDropApplication
extends java.lang.Object
implements java.io.Serializable

Information about a "drop application" deployed as part of the flexive EAR.

Some properties can be configured in a file called flexive-application.properties in the root folder of the application shared JAR file:

 # Application name
 name=hello-flexive
 displayName=Hello-World Application

 # Context root (must match the path specified in application.xml, used for the backend start page)
 contextRoot=war
 

Since:
3.0.2
Version:
$Rev: 2909 $
Author:
Daniel Lichtenberger (daniel.lichtenberger@flexive.com), UCS - unique computing solutions gmbh (http://www.ucs.at)
See Also:
Serialized Form

Constructor Summary
FxDropApplication(java.lang.String name)
          Create a new application descriptor.
FxDropApplication(java.lang.String name, java.lang.String contextRoot, java.lang.String displayName, java.net.URL resourceURL)
          Create a new application descriptor.
 
Method Summary
 java.lang.String getContextRoot()
          Return the context root of the web application.
 java.lang.String getDisplayName()
          Returns a human-readable name of the application.
 java.lang.String getName()
          Return the unique name of the application.
 java.lang.String getResourceJarURL()
          Returns the URL of the JAR file containing the resources of the drop application, usually the "shared" module (but it could be any JAR file).
 boolean isWebContextAvailable()
          Returns true when the drop application has a web context available (i.e.
 java.util.Map<java.lang.String,java.lang.String> loadTextResources(java.lang.String pathPrefix)
          Load text resources packaged with the drop.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

FxDropApplication

public FxDropApplication(java.lang.String name,
                         java.lang.String contextRoot,
                         java.lang.String displayName,
                         java.net.URL resourceURL)
Create a new application descriptor.

Parameters:
name - the unique name of the application
contextRoot - the context root of the web application
displayName - a human-readable name of the application
resourceURL - the URL that was used for loading flexive-application.properties
Since:
3.1

FxDropApplication

public FxDropApplication(java.lang.String name)
Create a new application descriptor. The application name will also be used for the display name and the context root path.

Parameters:
name - the unique name of the application
Method Detail

getName

public java.lang.String getName()
Return the unique name of the application. It should not contain spaces or non-alphanumeric characters (excluding "-" and "_").

Returns:
the unique name of the application

getContextRoot

public java.lang.String getContextRoot()
Return the context root of the web application. This defaults to the name, but can be customized in flexive-application.properties.

When an application uses

flexive-application.properties

but does not specify a contextRoot, it is assumed that the application does not provide a web context.

Returns:
the context root of the web application

isWebContextAvailable

public boolean isWebContextAvailable()
Returns true when the drop application has a web context available (i.e. a context root has been set).

Returns:
true when the drop application has a web context available (i.e. a context root has been set).
Since:
3.0.3

getDisplayName

public java.lang.String getDisplayName()
Returns a human-readable name of the application. This defaults to the name, but can be customized in flexive-application.properties.

Returns:
a human-readable name of the application

getResourceJarURL

public java.lang.String getResourceJarURL()
Returns the URL of the JAR file containing the resources of the drop application, usually the "shared" module (but it could be any JAR file).

Returns:
the URL of the JAR file containing the resources of the drop application

loadTextResources

public java.util.Map<java.lang.String,java.lang.String> loadTextResources(java.lang.String pathPrefix)
                                                                   throws java.io.IOException
Load text resources packaged with the drop.

Parameters:
pathPrefix - a path prefix (e.g. "scripts/")
Returns:
a map of filename (relative to the drop application package) -> file contents
Throws:
java.io.IOException - on I/O errors
Since:
3.1