|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.openejb.webadmin.WebAdminBean
This is the template web admin bean to extend from. It contains all the functionality for the webadministration. To use
this class, simply sub-class it:
public class MyBean extends WebAdminBean {
...
}
and declare the following methods:
public void ejbCreate() {}
public void preProcess(HttpRequest request, HttpResponse response) throws IOException {}
public void postProcess(HttpRequest request, HttpResponse response) throws IOException {}
public void writeBody(PrintWriter body) throws IOException {}
public void writeHtmlTitle(PrintWriter body) throws IOException {}
public void writePageTitle(PrintWriter body) throws IOException {}
public void writeSubMenuItems(PrintWriter body) throws IOException {}
Field Summary | |
protected javax.ejb.SessionContext |
ejbContext
used for the session context |
protected static String |
footer
the footer |
static String |
HTML_TITLE
the standard title |
protected HttpRequest |
request
the HTTP request |
protected HttpResponse |
response
the HTTP response |
protected String |
section
the menu section |
static HashMap |
sections
the navigation sections |
static int |
SUBSTITUTE
the substitue |
Constructor Summary | |
WebAdminBean()
|
Method Summary | |
void |
ejbActivate()
called on a stateful sessionbean after the bean is deserialized from storage and put back into use. |
void |
ejbCreate()
called with the bean is created |
void |
ejbPassivate()
called on a stateful sessionbean before the bean is removed from memory and serialized to a temporary store. |
void |
ejbRemove()
called when the bean is about to be garbage collected |
String |
formatSubMenuItem(String itemName,
String url)
formats a sub menu item for the left navigation |
static String |
getFooter()
gets a footer for the document |
InputStream |
getTemplate()
gets an html template which is the content of the pages written to the browser |
HashMap |
initNavSections()
initalizes the left and top menu navigation |
void |
onMessage(HttpRequest request,
HttpResponse response)
the main method of this bean, it takes care of the processing |
abstract void |
postProcess(HttpRequest request,
HttpResponse response)
called after all content is written to the browser |
abstract void |
preProcess(HttpRequest request,
HttpResponse response)
called before any content is written to the browser |
protected void |
printRow(String col1,
String col2,
PrintWriter out)
prints a table row similar to this <tr> <td>some info</td> <td>some more info</td> </tr> |
protected void |
printRow(String col1,
String col2,
String col3,
PrintWriter out)
prints a table row similar to this <tr> <td>some info</td> <td>some more info</td> <td>yet some more info</td> </tr> |
void |
setSessionContext(javax.ejb.SessionContext sessionContext)
sets the session context |
abstract void |
writeBody(PrintWriter body)
writes the main body content to the broswer. |
void |
writeFooter(PrintWriter body)
Write the footer |
abstract void |
writeHtmlTitle(PrintWriter body)
Write the TITLE of the HTML document. |
void |
writeLeftNavBar(PrintWriter body)
Write the left navigation bar of the page. |
abstract void |
writePageTitle(PrintWriter body)
Write the title of the page. |
void |
writeTemplate(PrintWriter out,
InputStream template)
writes a template from the input stream to the output stream |
void |
writeTopNavBar(PrintWriter body)
Write the top navigation bar of the page. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
protected javax.ejb.SessionContext ejbContext
public static final int SUBSTITUTE
public static HashMap sections
protected String section
protected HttpRequest request
protected HttpResponse response
public static final String HTML_TITLE
protected static String footer
Constructor Detail |
public WebAdminBean()
Method Detail |
public void onMessage(HttpRequest request, HttpResponse response) throws IOException
onMessage
in interface HttpBean
request
- the http requestresponse
- the http response
IOException
- if an exception is thrownpublic abstract void preProcess(HttpRequest request, HttpResponse response) throws IOException
request
- the http requestresponse
- the http response
IOException
- if an exception is thrownpublic abstract void postProcess(HttpRequest request, HttpResponse response) throws IOException
request
- the http requestresponse
- the http response
IOException
- if an exception is thrownpublic abstract void writeHtmlTitle(PrintWriter body) throws IOException
<head><title>
</title></head>
tags
body
- the output to write to
IOException
- of an exception is thrownpublic abstract void writePageTitle(PrintWriter body) throws IOException
body
- the output to write to
IOException
- if an exception is thrownpublic void writeTopNavBar(PrintWriter body) throws IOException
<a href="system?show=server">
<span class="menuTopOff">Remote Server</span>
</a>
<a href="system?show=containers">
<span class="menuTopOff">Containers</span>
</a>
<a href="system?show=deployments">
<span class="menuTopOff">Deployments</span>
</a>
<a href="system?show=logs">
<span class="menuTopOff">Logs</span>
</a>
body
- the output to write to
IOException
- if an exception is thrownpublic void writeLeftNavBar(PrintWriter body) throws IOException
<tr>
<td valign="top" align="left">
<span class="subMenuOn">
Admin
</span>
</td>
</tr>
<tr>
<td valign="top" align="left">
<a href="system?show=status"><span class="subMenuOff">
Status
</span>
</a></td>
</tr>
<tr>
<<td valign="top" align="left">
<a href="system?show=deployments"><span class="subMenuOff">
Deployments
</span>
</a></td>
</tr>
body
- the output to write to
IOException
- if an exception is thrownpublic String formatSubMenuItem(String itemName, String url)
itemName
- the name for displayurl
- the url to link
public abstract void writeBody(PrintWriter body) throws IOException
<p>
block
body
- the output to write to
IOException
- if an exception is thrownpublic void writeFooter(PrintWriter body) throws IOException
body
- the output to write to
IOException
- if an exception is thrownpublic static String getFooter()
public void writeTemplate(PrintWriter out, InputStream template) throws IOException
out
- the output to write totemplate
- the template to read
IOException
- if an exception is thrownpublic InputStream getTemplate() throws IOException
IOException
- if an exception is thrownpublic HashMap initNavSections()
protected void printRow(String col1, String col2, PrintWriter out) throws IOException
col1
- the first columncol2
- the second columnout
- the output to write to
IOException
- if an exception is thrownprotected void printRow(String col1, String col2, String col3, PrintWriter out) throws IOException
col1
- the first columncol2
- the second columncol3
- the third columnout
- the output to write to
IOException
- if an exception is thrownpublic void ejbCreate() throws javax.ejb.CreateException
javax.ejb.CreateException
- if the bean cannot be createdpublic void ejbActivate()
ejbActivate
in interface javax.ejb.SessionBean
public void ejbPassivate()
ejbPassivate
in interface javax.ejb.SessionBean
public void ejbRemove()
ejbRemove
in interface javax.ejb.SessionBean
public void setSessionContext(javax.ejb.SessionContext sessionContext)
setSessionContext
in interface javax.ejb.SessionBean
sessionContext
- the session context
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |