SetupWhereAreYouAction.java

00001 
00026 package org.objectweb.jonas.webapp.jonasadmin;
00027 
00028 import java.io.IOException;
00029 
00030 import javax.servlet.ServletException;
00031 import javax.servlet.http.HttpServletRequest;
00032 import javax.servlet.http.HttpServletResponse;
00033 
00034 import org.apache.struts.action.ActionError;
00035 import org.apache.struts.action.ActionForm;
00036 import org.apache.struts.action.ActionForward;
00037 import org.apache.struts.action.ActionMapping;
00038 import org.objectweb.jonas.jmx.JonasManagementRepr;
00039 
00044 public class SetupWhereAreYouAction extends JonasBaseAction {
00045 
00046 // --------------------------------------------------------- Public Methods
00047 
00048     public ActionForward executeAction(ActionMapping p_Mapping, ActionForm p_Form
00049         , HttpServletRequest p_Request, HttpServletResponse p_Response)
00050         throws IOException, ServletException {
00051         // nothing to do
00052         return null;
00053     }
00054 
00055     public ActionForward execute(ActionMapping p_Mapping, ActionForm p_Form
00056         , HttpServletRequest p_Request, HttpServletResponse p_Response)
00057         throws IOException, ServletException {
00058 
00059         // Initialize the instance variables
00060         initialize(p_Request);
00061 
00062         // Initialize WhereAreYou
00063         /*
00064                  if (JonasManagementRepr.reprNull() == false) {
00065             if (m_WhereAreYou == null) {
00066                 m_WhereAreYou = new WhereAreYou();
00067                 m_WhereAreYou.initialize(getServlet(), p_Request);
00068                 m_Session.setAttribute(WhereAreYou.SESSION_NAME, m_WhereAreYou);
00069             }
00070             else {
00071                 m_WhereAreYou.refreshServers(p_Request);
00072             }
00073             return (p_Mapping.findForward("Frame Main"));
00074                  }
00075                  else {
00076             String message = m_Resources.getMessage("error.jmx.management");
00077             getServlet().log(message);
00078             m_Errors.add("error.jmx.management", new ActionError("error.jmx.management"));
00079             saveErrors(p_Request, m_Errors);
00080                  }
00081                  return (p_Mapping.findForward("Global Error"));
00082          */
00083 
00084         try {
00085             if (JonasManagementRepr.reprNull() == true) {
00086                 throw new JonasAdminException(WhereAreYou.EXCEPTION_MBEANSERVER_NOTFOUND);
00087             }
00088             if (m_WhereAreYou == null) {
00089                 m_WhereAreYou = new WhereAreYou();
00090                 m_WhereAreYou.initialize(getServlet(), p_Request);
00091                 m_Session.setAttribute(WhereAreYou.SESSION_NAME, m_WhereAreYou);
00092             }
00093             else {
00094                 m_WhereAreYou.refreshServers(p_Request);
00095             }
00096         }
00097         catch (JonasAdminException e) {
00098 
00099             String message = m_Resources.getMessage(e.getId());
00100             getServlet().log(message);
00101             m_Errors.add(e.getId(), new ActionError(e.getId()));
00102             saveErrors(p_Request, m_Errors);
00103             return (p_Mapping.findForward("Global Error"));
00104         }
00105         return (p_Mapping.findForward("Frame Main"));
00106     }
00107 
00108 }

Generated on Tue Feb 15 15:05:34 2005 for JOnAS by  doxygen 1.3.9.1