org.apache.empire.jsf2.app
Class FacesApplication

java.lang.Object
  extended by javax.faces.application.Application
      extended by com.sun.faces.application.ApplicationImpl
          extended by org.apache.empire.jsf2.app.FacesApplication

public abstract class FacesApplication
extends com.sun.faces.application.ApplicationImpl


Field Summary
static String APPLICATION_ATTRIBUTE
           
protected  TextResolver[] textResolvers
           
 
Fields inherited from class com.sun.faces.application.ApplicationImpl
defaultRenderKitId, THIS_LIBRARY
 
Constructor Summary
protected FacesApplication()
           
protected FacesApplication(AppStartupListener startupListener)
           
 
Method Summary
 void addJavascriptCall(javax.faces.context.FacesContext fc, String function)
           
 javax.faces.component.UIComponent findComponent(javax.faces.context.FacesContext fc, String componentId, javax.faces.component.UIComponent nearComponent)
          finds a component from with a given id from a given start component
protected abstract  DataSource getAppDataSource(DBDatabase db)
           
protected  Connection getConnection(DBDatabase db)
          returns a connection from the connection pool
 Connection getConnectionForRequest(javax.faces.context.FacesContext fc, DBDatabase db)
          Returns a connection for the current Request Method should only be called by BeforeRestoreViewListener once per request!
 Locale getContextLocale(javax.faces.context.FacesContext ctx)
          returns the active locale for a given FacesContext
 String getDefaultControlType(DataType dataType)
          returns the default control type for a given data Type
 ResourceBundle getResourceBundle(javax.faces.context.FacesContext fc, String var)
           
 TextResolver getTextResolver(javax.faces.context.FacesContext ctx)
           
 TextResolver getTextResolver(Locale locale)
           
 String getWebRoot()
          returns the web context path as returned from ServletContext.getContextPath()
 boolean hasError(javax.faces.context.FacesContext fc)
          checks if the current context contains an error
protected abstract  void init(javax.servlet.ServletContext fc)
           
protected  void initComplete(javax.servlet.ServletContext servletContext)
           
protected  void initTextResolvers()
           
 void onChangeView(javax.faces.context.FacesContext fc, String viewId)
           
 void releaseAllConnections(javax.faces.context.FacesContext fc)
           
 void releaseAllConnections(javax.faces.context.FacesContext fc, boolean commit)
          Releases the current request connection
protected  void releaseConnection(DBDatabase db, Connection conn, boolean commit)
          releases a connection from the connection pool
 void releaseConnection(javax.faces.context.FacesContext fc, DBDatabase db)
           
 void releaseConnection(javax.faces.context.FacesContext fc, DBDatabase db, boolean commit)
           
 
Methods inherited from class com.sun.faces.application.ApplicationImpl
addBehavior, addComponent, addConverter, addConverter, addDefaultValidatorId, addELContextListener, addELResolver, addValidator, createBehavior, createComponent, createComponent, createComponent, createComponent, createComponent, createComponent, createConverter, createConverter, createConverterBasedOnClass, createMethodBinding, createValidator, createValueBinding, evaluateExpressionGet, getActionListener, getApplicationELResolvers, getBehaviorIds, getComponentTypes, getConverterIds, getConverterTypes, getDefaultLocale, getDefaultRenderKitId, getDefaultValidatorInfo, getELContextListeners, getELResolver, getExpressionFactory, getMessageBundle, getNavigationHandler, getProjectStage, getPropertyResolver, getResourceHandler, getStateManager, getSupportedLocales, getValidatorIds, getVariableResolver, getViewHandler, newConverter, newThing, publishEvent, publishEvent, removeELContextListener, setActionListener, setDefaultLocale, setDefaultRenderKitId, setMessageBundle, setNavigationHandler, setPropertyResolver, setResourceHandler, setStateManager, setSupportedLocales, setVariableResolver, setViewHandler, subscribeToEvent, subscribeToEvent, unsubscribeFromEvent, unsubscribeFromEvent
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

APPLICATION_ATTRIBUTE

public static String APPLICATION_ATTRIBUTE

textResolvers

protected TextResolver[] textResolvers
Constructor Detail

FacesApplication

protected FacesApplication(AppStartupListener startupListener)

FacesApplication

protected FacesApplication()
Method Detail

getAppDataSource

protected abstract DataSource getAppDataSource(DBDatabase db)

init

protected abstract void init(javax.servlet.ServletContext fc)

initComplete

protected void initComplete(javax.servlet.ServletContext servletContext)

onChangeView

public void onChangeView(javax.faces.context.FacesContext fc,
                         String viewId)

addJavascriptCall

public void addJavascriptCall(javax.faces.context.FacesContext fc,
                              String function)

getWebRoot

public String getWebRoot()
returns the web context path as returned from ServletContext.getContextPath()


getContextLocale

public Locale getContextLocale(javax.faces.context.FacesContext ctx)
returns the active locale for a given FacesContext


hasError

public boolean hasError(javax.faces.context.FacesContext fc)
checks if the current context contains an error

Parameters:
fc - the FacesContext
Returns:
true if the context has an error set or false otherwise

findComponent

public javax.faces.component.UIComponent findComponent(javax.faces.context.FacesContext fc,
                                                       String componentId,
                                                       javax.faces.component.UIComponent nearComponent)
finds a component from with a given id from a given start component

Parameters:
fc - the FacesContext
componentId -
nearComponent - a component within the same naming container
Returns:

getDefaultControlType

public String getDefaultControlType(DataType dataType)
returns the default control type for a given data Type

Parameters:
dataType -
Returns:

initTextResolvers

protected void initTextResolvers()

getTextResolver

public TextResolver getTextResolver(Locale locale)

getTextResolver

public TextResolver getTextResolver(javax.faces.context.FacesContext ctx)

getResourceBundle

public ResourceBundle getResourceBundle(javax.faces.context.FacesContext fc,
                                        String var)
Overrides:
getResourceBundle in class com.sun.faces.application.ApplicationImpl
See Also:
Application.getResourceBundle(javax.faces.context.FacesContext, String)

getConnection

protected Connection getConnection(DBDatabase db)
returns a connection from the connection pool

Returns:

releaseConnection

protected void releaseConnection(DBDatabase db,
                                 Connection conn,
                                 boolean commit)
releases a connection from the connection pool


getConnectionForRequest

public Connection getConnectionForRequest(javax.faces.context.FacesContext fc,
                                          DBDatabase db)
Returns a connection for the current Request Method should only be called by BeforeRestoreViewListener once per request!


releaseAllConnections

public void releaseAllConnections(javax.faces.context.FacesContext fc,
                                  boolean commit)
Releases the current request connection

Parameters:
fc -
commit -

releaseAllConnections

public void releaseAllConnections(javax.faces.context.FacesContext fc)

releaseConnection

public void releaseConnection(javax.faces.context.FacesContext fc,
                              DBDatabase db,
                              boolean commit)

releaseConnection

public void releaseConnection(javax.faces.context.FacesContext fc,
                              DBDatabase db)


Copyright © 2008-2012 Apache Software Foundation. All Rights Reserved.