1 21 22 package org.objectweb.jonas.webapp.jonasadmin.joramplatform; 23 24 import java.io.IOException ; 25 import java.util.ArrayList ; 26 import java.util.Collections ; 27 28 import javax.management.ObjectName ; 29 import javax.servlet.ServletException ; 30 import javax.servlet.http.HttpServletRequest ; 31 import javax.servlet.http.HttpServletResponse ; 32 33 import org.apache.struts.action.ActionForm; 34 import org.apache.struts.action.ActionForward; 35 import org.apache.struts.action.ActionMapping; 36 37 import org.objectweb.jonas.jmx.JonasManagementRepr; 38 import org.objectweb.jonas.jmx.JonasObjectName; 39 import org.objectweb.jonas.webapp.jonasadmin.WhereAreYou; 40 import org.objectweb.jonas.webapp.jonasadmin.service.ejb.EjbItem; 41 import org.objectweb.jonas.webapp.jonasadmin.service.ejb.EjbItemByNameComparator; 42 43 46 47 public class EditJoramLocalQueueAction extends EditJoramBaseAction { 48 49 51 public ActionForward executeAction(ActionMapping pMapping, ActionForm pForm 52 , HttpServletRequest pRequest, HttpServletResponse pResponse) 53 throws IOException , ServletException { 54 55 56 String name = pRequest.getParameter("name"); 57 58 m_WhereAreYou.selectNameNode(getTreeBranchName(DEPTH_DOMAIN) + WhereAreYou.NODE_SEPARATOR 60 + "joramplatform" + WhereAreYou.NODE_SEPARATOR 61 + "joramlocalserver" + WhereAreYou.NODE_SEPARATOR 62 + "joramlocalqueue" + name, true); 63 64 try { 65 JoramLocalQueueForm oForm = null; 67 if (name != null) { 68 oForm = new JoramLocalQueueForm(); 70 oForm.reset(pMapping, pRequest); 71 m_Session.setAttribute("joramLocalQueueForm", oForm); 73 ObjectName oObjectName = JonasObjectName.joramQueue(name); 75 oForm.setName(getStringAttribute(oObjectName, "JndiName")); 76 oForm.setId(getStringAttribute(oObjectName, "AgentId")); 77 } else { 78 oForm = (JoramLocalQueueForm) m_Session.getAttribute("joramLocalQueueForm"); 80 } 81 82 if (name != null) { 84 ArrayList al = new ArrayList (); 85 String [] asParam = new String [1]; 86 String [] asSignature = new String [1]; 87 asSignature[0] = "java.lang.String"; 88 asParam[0] = name; 89 ObjectName ejbServiceObjectName = JonasObjectName.ejbService(); 90 if (JonasManagementRepr.isRegistered(ejbServiceObjectName)) { 91 java.util.Iterator it = ((java.util.Set ) JonasManagementRepr.invoke( 92 ejbServiceObjectName, "getJmsDestinationDependence", asParam 93 , asSignature)).iterator(); 94 while (it.hasNext()) { 95 al.add(new EjbItem((ObjectName ) it.next())); 96 } 97 Collections.sort(al, new EjbItemByNameComparator()); 99 oForm.setListUsedByEjb(al); 101 } 102 } 103 } catch (Throwable t) { 104 return (treatError(t, pMapping, pRequest)); 105 } 106 107 return (pMapping.findForward("JoramLocalQueue")); 109 } 110 111 } 112 | Popular Tags |