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
00047
00048 public ActionForward executeAction(ActionMapping p_Mapping, ActionForm p_Form
00049 , HttpServletRequest p_Request, HttpServletResponse p_Response)
00050 throws IOException, ServletException {
00051
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
00060 initialize(p_Request);
00061
00062
00063
00064
00065
00066
00067
00068
00069
00070
00071
00072
00073
00074
00075
00076
00077
00078
00079
00080
00081
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 }