org.openejb.webadmin.httpd
Class DefaultHttpBean

java.lang.Object
  extended by org.openejb.webadmin.httpd.DefaultHttpBean
All Implemented Interfaces:
java.io.Serializable, javax.ejb.EnterpriseBean, javax.ejb.SessionBean, HttpBean

public class DefaultHttpBean
extends java.lang.Object
implements HttpBean

This is a webadmin bean which has default functionality such as genderating error pages and setting page content.

Author:
David Blevins
See Also:
Serialized Form

Constructor Summary
DefaultHttpBean()
           
 
Method Summary
 void do404(HttpRequest request, HttpResponse response)
          Creates a "Page not found" error screen
 void do500(HttpRequest request, HttpResponse response, java.lang.String message)
          Creates and "Internal Server Error" page
 void ejbActivate()
          called on a stateful sessionbean after the bean is deserialized from storage and put back into use.
 void ejbCreate()
          Creates a new instance
 void ejbPassivate()
          called on a stateful sessionbean before the bean is removed from memory and serialized to a temporary store.
 void ejbRemove()
          called by the ejb container when this bean is about to be garbage collected
 void onMessage(HttpRequest request, HttpResponse response)
          the main processing part of the this bean
 void setSessionContext(javax.ejb.SessionContext sessionContext)
          sets the session context for this bean
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DefaultHttpBean

public DefaultHttpBean()
Method Detail

ejbCreate

public void ejbCreate()
Creates a new instance


onMessage

public void onMessage(HttpRequest request,
                      HttpResponse response)
               throws java.io.IOException
the main processing part of the this bean

Specified by:
onMessage in interface HttpBean
Parameters:
request - the http request object
response - the http response object
Throws:
java.io.IOException - if an exception is thrown

do404

public void do404(HttpRequest request,
                  HttpResponse response)
Creates a "Page not found" error screen

Parameters:
request - the HTTP request object
response - the HTTP response object

do500

public void do500(HttpRequest request,
                  HttpResponse response,
                  java.lang.String message)
Creates and "Internal Server Error" page

Parameters:
request - the HTTP request object
response - the HTTP response object
message - the message to be sent back to the browser

ejbActivate

public void ejbActivate()
                 throws javax.ejb.EJBException,
                        java.rmi.RemoteException
called on a stateful sessionbean after the bean is deserialized from storage and put back into use.

Specified by:
ejbActivate in interface javax.ejb.SessionBean
Throws:
EJBException - if an exeption is thrown
RemoteException - if an exception is thrown

ejbPassivate

public void ejbPassivate()
                  throws javax.ejb.EJBException,
                         java.rmi.RemoteException
called on a stateful sessionbean before the bean is removed from memory and serialized to a temporary store. This method is never called on a stateless sessionbean

Specified by:
ejbPassivate in interface javax.ejb.SessionBean
Throws:
EJBException - if an exception is thrown
RemoteException - if an exception is thrown

ejbRemove

public void ejbRemove()
               throws javax.ejb.EJBException,
                      java.rmi.RemoteException
called by the ejb container when this bean is about to be garbage collected

Specified by:
ejbRemove in interface javax.ejb.SessionBean
Throws:
EJBException - if an exception is thrown
RemoteException - if an exception is thrown

setSessionContext

public void setSessionContext(javax.ejb.SessionContext sessionContext)
                       throws javax.ejb.EJBException,
                              java.rmi.RemoteException
sets the session context for this bean

Specified by:
setSessionContext in interface javax.ejb.SessionBean
Parameters:
sessionContext - the session context to be set
Throws:
EJBException - if an exception is thrown
RemoteException - if an exception is thrown


Copyright © 1999-2011 OpenEJB. All Rights Reserved.