001: /*
002: * Enhydra Java Application Server Project
003: *
004: * The contents of this file are subject to the Enhydra Public License
005: * Version 1.1 (the "License"); you may not use this file except in
006: * compliance with the License. You may obtain a copy of the License on
007: * the Enhydra web site ( http://www.enhydra.org/ ).
008: *
009: * Software distributed under the License is distributed on an "AS IS"
010: * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
011: * the License for the specific terms governing rights and limitations
012: * under the License.
013: *
014: * The Initial Developer of the Enhydra Application Server is Lutris
015: * Technologies, Inc. The Enhydra Application Server and portions created
016: * by Lutris Technologies, Inc. are Copyright Lutris Technologies, Inc.
017: * All Rights Reserved.
018: *
019: * Contributor(s):
020: *
021: * $Id: HttpPresentationComms.java,v 1.2 2006-06-15 13:44:07 sinisa Exp $
022: */
023:
024: package com.lutris.appserver.server.httpPresentation;
025:
026: import org.enhydra.util.jivan.JivanFactory;
027: import org.enhydra.xml.xmlc.XMLCFactory;
028:
029: import com.lutris.appserver.server.Application;
030: import com.lutris.appserver.server.session.Session;
031: import com.lutris.appserver.server.session.SessionData;
032:
033: /**
034: * Object passed to presentation objects that contains HTTP and Presentation
035: * Manager access and control objects.
036: */
037: public class HttpPresentationComms {
038: /**
039: * Object used to access HTTP request data.
040: */
041: public final HttpPresentationRequest request;
042:
043: /**
044: * Object used to generate HTTP responses.
045: */
046: public final HttpPresentationResponse response;
047:
048: /**
049: * Application object that this presentation is associated with.
050: * If null, no application is associated.
051: */
052: public final Application application;
053:
054: /**
055: * Session object that this presentation is associated with.
056: * If null, no session has been associated by the application.
057: */
058: public Session session;
059:
060: /**
061: * Session data object. This is a handy reference to
062: * <CODE>session.getSessionData()</CODE>
063: */
064: public SessionData sessionData;
065:
066: /**
067: * If an exception/error occured, this field is set to the exception
068: * object. This is only set for and used by `ErrorHandler' presentations.
069: */
070: public Throwable exception;
071:
072: /**
073: * Reference to the XMLC factory object contained in the application.
074: */
075: public XMLCFactory xmlcFactory;
076:
077: // vr -----------------------------------------------
078: /**
079: * Reference to the Jivan DocumentFactory object contained in the application.
080: */
081: public JivanFactory jivanFactory;
082:
083: // vr -----------------------------------------------
084:
085: /**
086: * Construct an object, setting all of its fields.
087: *
088: * @param request Object used to access HTTP request data.
089: * @param response Object used to generate HTTP responses.
090: * @param application Application object that this presentation is
091: * associated with or null if no application is associated.
092: */
093: protected HttpPresentationComms(HttpPresentationRequest request,
094: HttpPresentationResponse response, Application application) {
095: this .request = request;
096: this .response = response;
097: this .application = application;
098: this .xmlcFactory = application.getXMLCFactory();
099: // vr -----------------------------------------------
100: this .jivanFactory = application.getJivanFactory();
101: // vr -----------------------------------------------
102: }
103:
104: }
|