Java Doc for StandardApplication.java in  » J2EE » Enhydra-Application-Framework » com » lutris » appserver » server » Java Source Code / Java DocumentationJava Source Code and Java Documentation

Java Source Code / Java Documentation
1. 6.0 JDK Core
2. 6.0 JDK Modules
3. 6.0 JDK Modules com.sun
4. 6.0 JDK Modules com.sun.java
5. 6.0 JDK Modules sun
6. 6.0 JDK Platform
7. Ajax
8. Apache Harmony Java SE
9. Aspect oriented
10. Authentication Authorization
11. Blogger System
12. Build
13. Byte Code
14. Cache
15. Chart
16. Chat
17. Code Analyzer
18. Collaboration
19. Content Management System
20. Database Client
21. Database DBMS
22. Database JDBC Connection Pool
23. Database ORM
24. Development
25. EJB Server geronimo
26. EJB Server GlassFish
27. EJB Server JBoss 4.2.1
28. EJB Server resin 3.1.5
29. ERP CRM Financial
30. ESB
31. Forum
32. GIS
33. Graphic Library
34. Groupware
35. HTML Parser
36. IDE
37. IDE Eclipse
38. IDE Netbeans
39. Installer
40. Internationalization Localization
41. Inversion of Control
42. Issue Tracking
43. J2EE
44. JBoss
45. JMS
46. JMX
47. Library
48. Mail Clients
49. Net
50. Parser
51. PDF
52. Portal
53. Profiler
54. Project Management
55. Report
56. RSS RDF
57. Rule Engine
58. Science
59. Scripting
60. Search Engine
61. Security
62. Sevlet Container
63. Source Control
64. Swing Library
65. Template Engine
66. Test Coverage
67. Testing
68. UML
69. Web Crawler
70. Web Framework
71. Web Mail
72. Web Server
73. Web Services
74. Web Services apache cxf 2.0.1
75. Web Services AXIS2
76. Wiki Engine
77. Workflow Engines
78. XML
79. XML UI
Java
Java Tutorial
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
Photoshop Tutorials
Maya Tutorials
Flash Tutorials
3ds-Max Tutorials
Illustrator Tutorials
GIMP Tutorials
C# / C Sharp
C# / CSharp Tutorial
C# / CSharp Open Source
ASP.Net
ASP.NET Tutorial
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
Ruby
PHP
Python
Python Tutorial
Python Open Source
SQL Server / T-SQL
SQL Server / T-SQL Tutorial
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
Flash / Flex / ActionScript
VBA / Excel / Access / Word
XML
XML Tutorial
Microsoft Office PowerPoint 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Microsoft Office Word 2007 Tutorial
Java Source Code / Java Documentation » J2EE » Enhydra Application Framework » com.lutris.appserver.server 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


java.lang.Object
   com.lutris.appserver.server.StandardApplication

StandardApplication
abstract public class StandardApplication implements Application(Code)
Default application implementation. This class provides standard start/stop services. This can be used as a base class to derive Application objects.
version:
   $Revision: 1.5 $
author:
   Mark Diekhans

Inner Class :public static class ContextMBean implements DynamicMBean

Field Summary
protected  ApplicationConfigMBeanappConfigMBean
    
protected  StringappName
     The name of the application; defaults to the unqualified class name.
protected  Configconfig
     This applications config object.
protected  ContextMBeancontextMBean
    
protected  ApplicationDatadata
     Application Data accessable through Jolt Fields.
protected  DatabaseManagerdatabaseManager
     Database manager instance for application.
protected  StringdefaultUrl
     Default URL used for application if defined in Config file.
protected  JivanFactoryjivanFactory
     Jivan Factory.
protected  LogChannellogChannel
     The log channel for this application to write to.
protected  Loggerlogger
    
protected static  LogChannelloggerSys
     The logger that logs on System.out.
protected  ResponsePostProcessingManagerpostProcessingManager
     Response Post Processing Manager instance for application.
protected  RequestPreProcessingManagerpreProcessingManager
     Request Pre Processing Manager instance for application.
protected  HttpPresentationManagerpresentationManager
     Presentation manager instance for application.
protected  PresentationManagerMBeanpresentationManagerMBean
    
protected  booleansendCookieForNewSession
     Determines if a cookie with the session id is sent to the client.
protected  MBeanServerserver
    
protected  SessionManagersessionManager
     Session manager for all application sessions.
protected  SessionManagerMBeansessionManagerMBean
    
protected  intstate
     Current state of the application.
protected  XMLCFactoryxmlcFactory
     XMLC Factory.

Constructor Summary
public  StandardApplication()
     A constructor with no arguments is required.

Method Summary
protected  DatabaseManagercreateDatabaseManager(Config databaseMgrConfig)
     Create the database manager to be used by this application.
protected  ResponsePostProcessingManagercreatePostProcessingManager(Config ppConfig)
     Create the response post-processing manager to be used by this application.
protected  RequestPreProcessingManagercreatePreProcessingManager(Config ppConfig)
     Create the request pre-processing manager to be used by this application.
protected  SessioncreateSession(HttpPresentationComms comms)
     Create a new session for application.
protected  SessionManagercreateSessionManager(Config sessionMgrConfig)
     Create the session manager to be used by this application.
public  StringencodeUrl(String url, String sessionKey)
    
public  StringencodeUrl(String url, String sessionKey, String appName)
    
protected  voidensureSession(HttpPresentationComms comms)
     Default method used by requestPreprocessor to ensure that a session exists and initialize the session and sessionData fields in the HttpPresentationComms object. New sessions are only created on requests to presentation objects, not requests for other types of files (such as gifs). This avoids allocating multiple sessions when a browser makes multiple requests for HREFs.
public  ConfiggetConfig()
     Get the application's config object.
public  DatabaseManagergetDatabaseManager()
     Get the DatabaseManager associated with this application.
public  HttpPresentationManagergetHttpPresentationManager()
     Get the HttpPresentationManager associated with this application.
public  JivanFactorygetJivanFactory()
     Get the Jivan factory object being used by the application.
public  LogChannelgetLogChannel()
     Get the LogChannel associated with this application.
public  StringgetName()
     Get the application symbolic name.
public  SessionManagergetSessionManager()
     Get the SessionManager associated with this application.
public  intgetState()
     Get the application state. N.B.
public  XMLCFactorygetXMLCFactory()
     Get the XMLC factory object being used by the application.
public  voidinitDodsAsyncCaches()
    
public  voidinitDodsAsyncCaches(int threadNumber)
    
protected  voidinitializeNewSession(HttpPresentationComms comms)
     This is called when no valid session is found in an incoming request. A new session is created and added to comms.
public  voidprintCopyrightHeader()
    
public  voidrequestPostProcessor(HttpPresentationComms comms)
     Calls application session manager's passivateSession method for the session associated with this request.
public  booleanrequestPreprocessor(HttpPresentationComms comms)
     Default application request preprocessor.
public synchronized  voidrestartup(Config appConfig)
     Continue the startup up process with the application is in the INCOMPLETE state.
public  booleanservletRequestPreprocessor(Servlet servlet, ServletContext context, HttpServletRequest request, HttpServletResponse response)
     This is a hook that allows applications to act on requests before they enter the Enhydra framework.
public  voidsetCookieForNewSession(boolean flag)
     Tells the application if a cookie is used to bind new sessions to a client.
public  voidsetHttpPresentationManager(HttpPresentationManager pm)
     Tells the application about the Presentation Manager running it.
public  voidsetJivanFactory(boolean reload)
     Initializes the Jivan factory object which can be used by application.
public  voidsetLogChannel(LogChannel chan)
     Set the LogChannel associated with this application.
public  voidsetName(String applName)
     Set the application name.
public  voidsetXMLCFactory()
     Set the XMLC factory based on the deferred parsing option.
public synchronized  voidshutdown()
     Shutdown the application.
public synchronized  voidshutdownWithoutMBeanUnRegistration()
     Shutdown the application.
public synchronized  voidstartup(Config appConfig)
     Start the application.
public  StringtoHtml()
     Get the Application Info HTML presentation.

Field Detail
appConfigMBean
protected ApplicationConfigMBean appConfigMBean(Code)



appName
protected String appName(Code)
The name of the application; defaults to the unqualified class name.



config
protected Config config(Code)
This applications config object. Every application has a configuration object that is created from the application configuration file.
See Also:   Config



contextMBean
protected ContextMBean contextMBean(Code)



data
protected ApplicationData data(Code)
Application Data accessable through Jolt Fields.



databaseManager
protected DatabaseManager databaseManager(Code)
Database manager instance for application. The database manager manages logical database and is responsible for allocating connection, create transactions, etc.



defaultUrl
protected String defaultUrl(Code)
Default URL used for application if defined in Config file. This is used to redirect the user to the preferred start page if a URL equal to the root of this application is given. By setting this to index.html, it behaves in the same way as a http server.



jivanFactory
protected JivanFactory jivanFactory(Code)
Jivan Factory.



logChannel
protected LogChannel logChannel(Code)
The log channel for this application to write to.



logger
protected Logger logger(Code)



loggerSys
protected static LogChannel loggerSys(Code)
The logger that logs on System.out.



postProcessingManager
protected ResponsePostProcessingManager postProcessingManager(Code)
Response Post Processing Manager instance for application. It handles additional http response processing.



preProcessingManager
protected RequestPreProcessingManager preProcessingManager(Code)
Request Pre Processing Manager instance for application. It handles additional http request processing.



presentationManager
protected HttpPresentationManager presentationManager(Code)
Presentation manager instance for application. The presentation manager handles incomming http requests.



presentationManagerMBean
protected PresentationManagerMBean presentationManagerMBean(Code)



sendCookieForNewSession
protected boolean sendCookieForNewSession(Code)
Determines if a cookie with the session id is sent to the client.



server
protected MBeanServer server(Code)



sessionManager
protected SessionManager sessionManager(Code)
Session manager for all application sessions. A session manager manages the creation, deletion and assocation of sessions with a user.



sessionManagerMBean
protected SessionManagerMBean sessionManagerMBean(Code)



state
protected int state(Code)
Current state of the application. Only modified by the derived application.



xmlcFactory
protected XMLCFactory xmlcFactory(Code)
XMLC Factory.




Constructor Detail
StandardApplication
public StandardApplication()(Code)
A constructor with no arguments is required.




Method Detail
createDatabaseManager
protected DatabaseManager createDatabaseManager(Config databaseMgrConfig) throws ApplicationException(Code)
Create the database manager to be used by this application. By default this will return the Lutris StandardDatabaseManager. This method can be overwritten to create a custom session manager.
Parameters:
  databaseMgrConfig - Configuration object containing "DatabaseManager" keys.
exception:
  ApplicationException - If an error occurs in creating a database manager.



createPostProcessingManager
protected ResponsePostProcessingManager createPostProcessingManager(Config ppConfig)(Code)
Create the response post-processing manager to be used by this application. This method can be overwritten to create a custom response post-processing manager.
Parameters:
  ppConfig - Configuration object containing "ResponsePostProcessor" keys.This can be null to use none.The response post-processor.



createPreProcessingManager
protected RequestPreProcessingManager createPreProcessingManager(Config ppConfig)(Code)
Create the request pre-processing manager to be used by this application. This method can be overwritten to create a custom request pre-processing manager.
Parameters:
  ppConfig - Configuration object containing "RequestPreProcessor" keys.This can be null to use none.The request pre-processor.



createSession
protected Session createSession(HttpPresentationComms comms) throws ApplicationException(Code)
Create a new session for application. By default this will create the Lutris StandardSession. This method can be overwritten to create a custom session.
Parameters:
  comms - Object containing request, response and redirect objects.Warning: comms.session and comms.sessionData will be null.they are filled in after this method returns.The session.
exception:
  ApplicationException - If an error occurs in creating the session.



createSessionManager
protected SessionManager createSessionManager(Config sessionMgrConfig) throws ApplicationException(Code)
Create the session manager to be used by this application. By default this will return the Lutris standard session manager. This method can be overwritten to create a custom session manager.
Parameters:
  sessionMgrConfig - Configuration object containing "SessionManager" keys.This can be null to use defaults.
exception:
  ApplicationException - If an error occurs in creating a session manager.The session manager.



encodeUrl
public String encodeUrl(String url, String sessionKey) throws ApplicationException(Code)
Returns the specified url rewritten to include the sessionId
Parameters:
  url - String to urlencode the param url rewritten to contain the sessionId



encodeUrl
public String encodeUrl(String url, String sessionKey, String appName) throws ApplicationException(Code)
Returns the specified url rewritten to include the sessionId
Parameters:
  url - String to urlencode the param url rewritten to contain the sessionId



ensureSession
protected void ensureSession(HttpPresentationComms comms) throws ApplicationException(Code)
Default method used by requestPreprocessor to ensure that a session exists and initialize the session and sessionData fields in the HttpPresentationComms object. New sessions are only created on requests to presentation objects, not requests for other types of files (such as gifs). This avoids allocating multiple sessions when a browser makes multiple requests for HREFs. If the session already exist, it is alwasy set in comms

This normally looks up the session using a session key from a cookie.
Parameters:
  comms - Object containing request, response and redirect objects.
exception:
  ApplicationException - If an error occurs setting up the session.




getConfig
public Config getConfig()(Code)
Get the application's config object. The application's config object.



getDatabaseManager
public DatabaseManager getDatabaseManager()(Code)
Get the DatabaseManager associated with this application. The database manager or null if the applicationdoesn't have a DatabaseManager.



getHttpPresentationManager
public HttpPresentationManager getHttpPresentationManager()(Code)
Get the HttpPresentationManager associated with this application. The presentation manager.



getJivanFactory
public JivanFactory getJivanFactory()(Code)
Get the Jivan factory object being used by the application.



getLogChannel
public LogChannel getLogChannel()(Code)
Get the LogChannel associated with this application. The log channel or null if this applicationdoes not have one.



getName
public String getName()(Code)
Get the application symbolic name. This is normally the package name of this application class.

N.B. Purposely not syncronized for speed. The symbolic name.




getSessionManager
public SessionManager getSessionManager()(Code)
Get the SessionManager associated with this application. The session manager or null if the applicationdoesn't have a SessionManager.



getState
public int getState()(Code)
Get the application state. N.B. Purposely not syncronized for speed. The application's state code.



getXMLCFactory
public XMLCFactory getXMLCFactory()(Code)
Get the XMLC factory object being used by the application.



initDodsAsyncCaches
public void initDodsAsyncCaches() throws ApplicationException(Code)
Initialize Asynchronous DODS Caches!
throws:
  ApplicationException - If an error occurs restart the application.



initDodsAsyncCaches
public void initDodsAsyncCaches(int threadNumber) throws ApplicationException(Code)
Initialize Asynchronous DODS Caches!
Parameters:
  threadNumber - Number of parallel cache loading threads
throws:
  ApplicationException - If an error occurs restart the application.



initializeNewSession
protected void initializeNewSession(HttpPresentationComms comms) throws ApplicationException(Code)
This is called when no valid session is found in an incoming request. A new session is created and added to comms. If sending session cookies is enabled, a cookie is created and added to the response, so future requests will be associated with the newly created session. If sending session cookies is disabled, it is the application's responsibility to include the session ID in URLs to associate further requests with the session.

Warning: At first comms.session and comms.sessionData are null. This method initializes them both.
Parameters:
  comms - Object containing request, response and redirect objects. Sessionand SessionData objects are initialized.
exception:
  ApplicationException - If an error occurs setting up the session.
See Also:   StandardApplication.setCookieForNewSession




printCopyrightHeader
public void printCopyrightHeader()(Code)



requestPostProcessor
public void requestPostProcessor(HttpPresentationComms comms) throws ApplicationException(Code)
Calls application session manager's passivateSession method for the session associated with this request.
Parameters:
  comms - Object containing request, response and redirect objects.
exception:
  ApplicationException - If the session manager was unable to "passivate" the session.
See Also:   com.lutris.appserver.server.session.SessionManager.passivateSession



requestPreprocessor
public boolean requestPreprocessor(HttpPresentationComms comms) throws Exception(Code)
Default application request preprocessor. This method sets up a session data structure if a cookie is not set for the application. It doesn't require a login however. The unauthenticated session is useful for persistence in simple applications. It is possible to later force a login. If the URL is not a reference to a presentation object, then a session will not be allocated if it does not already exist. This prevents allocation of multiple sessions when a browser is requesting other objects, such as gifs, in parallel. Thus, after this function is called, it is possible for session to be null.

N.B. Purposely not syncronized for speed/concurrency.
Parameters:
  comms - Object containing request, response and redirect objects.Always returns false, as request handling is not done.
exception:
  Exception - May throw any exception, as with a presentation object;including page redirects.




restartup
public synchronized void restartup(Config appConfig) throws ApplicationException(Code)
Continue the startup up process with the application is in the INCOMPLETE state. The default method generates an error, as the application should never be in the INCOMPLETE state if it doesn't implment this method.
Parameters:
  appConfig - The same appConfig object that was passed tostartup.
exception:
  ApplicationException - If an error occurs restarting the application.



servletRequestPreprocessor
public boolean servletRequestPreprocessor(Servlet servlet, ServletContext context, HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException(Code)
This is a hook that allows applications to act on requests before they enter the Enhydra framework. This implementation always returns false, so the request is processed normally. Do not override this unless you absolutly have to. Currently the only application that needs to is the debugger, because it needs to hand off requests to other non-Enhydra servlets.

In contrast, the method requestPreprocessor() is commonly overridden. It provides applications with a centeral place to put code that has to be run on every request before it is sent to the presentation objects.
Parameters:
  servlet - The servlet we are running in.
Parameters:
  context - The ServletContext that was used to initialize our servlet.
Parameters:
  request - The incomming request object.
Parameters:
  response - The incomming response object.True if this method handled the request, in which case nofurther action will be taken. Or false if normal processingshould continue.
exception:
  ServletException - You are allowed to throw the same exceptions that the servlet'sservice() method throws.
exception:
  IOException - You are allowed to throw the same exceptions that the servlet'sservice() method throws.




setCookieForNewSession
public void setCookieForNewSession(boolean flag)(Code)
Tells the application if a cookie is used to bind new sessions to a client. If no cookie is set, session ID's must be communicated by means of URL rewriting.
Parameters:
  flag - indicates whether to send a cookie or not.



setHttpPresentationManager
public void setHttpPresentationManager(HttpPresentationManager pm)(Code)
Tells the application about the Presentation Manager running it. This is necessary because the presentation manager is created before the application.
Parameters:
  pm - The HTTP presentation manager running this application.



setJivanFactory
public void setJivanFactory(boolean reload)(Code)
Initializes the Jivan factory object which can be used by application.
Parameters:
  reload - swich which indicates realoading status of Jivan generatedpages in presentation layer (true = reload is on, false = reload is off)



setLogChannel
public void setLogChannel(LogChannel chan)(Code)
Set the LogChannel associated with this application.
Parameters:
  The - LogChannel to write to.



setName
public void setName(String applName)(Code)
Set the application name.
Parameters:
  name - The new name for the application.



setXMLCFactory
public void setXMLCFactory()(Code)
Set the XMLC factory based on the deferred parsing option.



shutdown
public synchronized void shutdown()(Code)
Shutdown the application. The default method sets the state to STOPPED.



shutdownWithoutMBeanUnRegistration
public synchronized void shutdownWithoutMBeanUnRegistration()(Code)
Shutdown the application. The default method sets the state to STOPPED.



startup
public synchronized void startup(Config appConfig) throws ApplicationException(Code)
Start the application. The default method sets the state to RUNNING.
Parameters:
  appConfig - Application configuration object.
exception:
  ApplicationException - If an error occurs starting the application.



toHtml
public String toHtml()(Code)
Get the Application Info HTML presentation.



Methods inherited from java.lang.Object
native protected Object clone() throws CloneNotSupportedException(Code)(Java Doc)
public boolean equals(Object obj)(Code)(Java Doc)
protected void finalize() throws Throwable(Code)(Java Doc)
final native public Class getClass()(Code)(Java Doc)
native public int hashCode()(Code)(Java Doc)
final native public void notify()(Code)(Java Doc)
final native public void notifyAll()(Code)(Java Doc)
public String toString()(Code)(Java Doc)
final native public void wait(long timeout) throws InterruptedException(Code)(Java Doc)
final public void wait(long timeout, int nanos) throws InterruptedException(Code)(Java Doc)
final public void wait() throws InterruptedException(Code)(Java Doc)

www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.