Java Doc for Application.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) 


com.lutris.appserver.server.Application

All known Subclasses:   com.lutris.appserver.server.StandardApplication,
Application
public interface Application (Code)
Interface used to define a Lutris server application. Each application defines a class that implements this interface. The specific application class serves as an entry and control point for the application. This class is responsible for initializing any application specific resources, including instance of standard services that are needed. The class must have a constructor with a configuration file argument.

The class is instantiated from a presentation manager and is used to start and stop the application. This structure allows applications to be started on demand by URL reference, as is required for applications running under servlets in HTTPD virtual machines. If remote threads are part of the application, they are normally started from this object.

The application is in one of several states, documented below. The application state is used to determine what actions are take when a request is made for the application.

The following states are possible:

  • STOPPED - The application is not running and maybe started. This is the initial state and the state normally entered on a shutdown().
  • RUNNING - The application is currently running.
  • INCOMPLETE - The application is not completely running and the restartup() method maybe called to attempt to bring it into the RUNNING state. This state is normally used when a remote server that is required by the application is not available when startup() is called. Partial initialization will take place, but the request that caused the startup will fail. A subsequent requests will results in calls to restartup() until the application can be fully started. This eliminates startup order dependencies when initializing a distributed application. The state may also be entered by the application when a remote server fails.
  • DEAD - The application is in an fatal error state and can not be restarted.
  • HALTED - shutdown was called on the application and the application is not designed so that in can be restarted.
The state is under control of the application. Its is used by the server to know what actions are allowed, but never modified by the server. The simplest application enters the RUNNING state when startup() is called and the STOPPED state when shutdown() is called.

The server provides synchronization on state changes to the application; however multiple requests threats may enter the application at the same time.

Two configuration parameters are required to start an application. Under servlets, these are specified as init args for the presentation servlet. They are:

  • appClass - This is the class name of the application class. If not specified, the presentation servlet will run without an application object.
  • appConfig - An arbitrary string to pass to the startup(0 method. It normally contains the path or URL of a Config or properties file containing the application configuration. If not specified, null is passed to startup.

version:
   $Revision: 1.3 $
author:
   Mark Diekhans


Field Summary
final public static  intDEAD
     Dead state code.
final public static  intHALTED
    
final public static  intINCOMPLETE
     Incomplete state code.
final public static  intRUNNING
     Running state code.
final public static  intSTOPPED
     Stopped state code.


Method Summary
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.
public  XMLCFactorygetXMLCFactory()
     Get the XMLC factory object being used by the application.
public  voidrequestPostProcessor(HttpPresentationComms comms)
     Request post-processing method.
public  booleanrequestPreprocessor(HttpPresentationComms comms)
     Request preprocessing method.
public  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 preprocessor hook is called before the request/response pair is processed by the HttpPresentationServlet.
public  voidsetHttpPresentationManager(HttpPresentationManager pm)
     Called to tell the application about the presentation manager instance.
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 name)
     Set the application symbolic name.
public  voidsetXMLCFactory()
     Set the XMLC factory based on the deferred parsing option.
public  voidshutdown()
     Shutdown the application.
public  voidstartup(Config appConfig)
     Start the application.

Field Detail
DEAD
final public static int DEAD(Code)
Dead state code.



HALTED
final public static int HALTED(Code)



INCOMPLETE
final public static int INCOMPLETE(Code)
Incomplete state code.



RUNNING
final public static int RUNNING(Code)
Running state code.



STOPPED
final public static int STOPPED(Code)
Stopped state code.





Method Detail
getConfig
public Config getConfig()(Code)
Get the application's config object. The 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 used by this application.



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. 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. The application's state code.



getXMLCFactory
public XMLCFactory getXMLCFactory()(Code)
Get the XMLC factory object being used by the application. If one was not configured, a default one is created on the first call to this method.



requestPostProcessor
public void requestPostProcessor(HttpPresentationComms comms) throws Exception(Code)
Request post-processing method. All requests for URLs associated with this application go through this function. It may do any post-processing desired (e.g. saving sessions to persistent store).


Parameters:
  comms - Object containing request, response and redirect objects.
exception:
  Exception - Any exception can be thrown.PageRedirectExceptions are handled as with presentation object.Other exceptions are handled by searching for an error handlerstarting at the requested presentation object.




requestPreprocessor
public boolean requestPreprocessor(HttpPresentationComms comms) throws Exception(Code)
Request preprocessing method. All requests for URLs associated with this application go through this function. It may do any preprocessing desired, including handling the request or generating a page redirect. It can be used to force login, allocate session objects, restrict access, etc.

Page redirect requests also go through this method, so care must be taken not to generate an endless page redirect loop. ErrorHandler presentation objects do not go through this method if they are invoked from within the presentation manager. However, direct URL requests to ErrorHandler presentation objects will go through this function.

Note: unlike the method servletRequestPreprocessor(), this method is commonly used in most applications. It is the only place that the application has where all requests come through. So you could, for example, put a check for HTTP basic authentication here, and that would automatically protect your entire application. Or, if you were so inclined, you could have a counter that counts the total pages served by your application.
Parameters:
  comms - Object containing request, response and redirect objects.true if the request has been handled, false if normal requesthandling should continue.
exception:
  Exception - Any exception can be thrown.PageRedirectExceptions are handled as with presentation object.Other exceptions are handled by searching for an error handlerstarting at the requested presentation object.




restartup
public 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 implement this method.
Parameters:
  appConfig - The same appConfig object that was passed tostartup.
exception:
  ApplicationException - If an error occurs starting the application.



servletRequestPreprocessor
public boolean servletRequestPreprocessor(Servlet servlet, ServletContext context, HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException(Code)
This preprocessor hook is called before the request/response pair is processed by the HttpPresentationServlet. It gives the application a chance to work with the raw request/response pair before they are wrapped by HttpPresentationRequest and HttpPresentationResponse objects. Return false to indicate that the request should continue to be processed normally or true to indicate that this method has handled the request, and all processing of the request should stop, in which case it will not be passed on to the presentation manager etc... The default method in StandardApplication always returns false.

Almost all applications should not override this! The version provided by StandardApplication simply returns false. Currently the debugger is the only application that used this, to support the flow-through debugging of non-Enhydra servlets, it needs to pass the raw request/response pair to the target servlet.
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.




setHttpPresentationManager
public void setHttpPresentationManager(HttpPresentationManager pm)(Code)
Called to tell the application about the presentation manager instance. This is necessary because the Presentation Manager is created in parallel with the application by the HttpPresentationServlet.
Parameters:
  pm - The presentation manager responsible for running this application.



setJivanFactory
public void setJivanFactory(boolean reload)(Code)
Initializes the Jivan factory object which can be used by application.
Parameters:
  reload - switch which indicates reloading 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 name)(Code)
Set the application symbolic name.
Parameters:
  name - The application's name.



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



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



startup
public 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 theapplication.



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