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 import java.util.Iterator ; 28 import java.util.List ; 29 30 import javax.management.ObjectName ; 31 import javax.servlet.ServletException ; 32 import javax.servlet.http.HttpServletRequest ; 33 import javax.servlet.http.HttpServletResponse ; 34 35 import org.apache.struts.action.ActionForm; 36 import org.apache.struts.action.ActionForward; 37 import org.apache.struts.action.ActionMapping; 38 import org.objectweb.jonas.jmx.JonasManagementRepr; 39 import org.objectweb.jonas.jmx.JoramObjectName; 40 import org.objectweb.jonas.webapp.jonasadmin.JonasAdminJmx; 41 import org.objectweb.jonas.webapp.jonasadmin.WhereAreYou; 42 43 47 48 public class EditJoramLocalServerAction extends EditJoramBaseAction { 49 50 52 public ActionForward executeAction(ActionMapping pMapping, ActionForm pForm 53 , HttpServletRequest pRequest, HttpServletResponse pResponse) 54 throws IOException , ServletException { 55 56 String id = pRequest.getParameter("id"); 57 58 initRefs(); 61 62 m_WhereAreYou.selectNameNode(getTreeBranchName(DEPTH_DOMAIN) + WhereAreYou.NODE_SEPARATOR 64 + "joramplatform", true); 66 67 try { 68 ObjectName joramAdapterON = (ObjectName ) JonasManagementRepr.queryNames(JoramObjectName.joramAdapter()).iterator().next(); 69 boolean isAdapterLoaded = JonasManagementRepr.isRegistered(joramAdapterON); 70 ObjectName joramAdminON = JoramObjectName.joramAdmin(); 71 72 ArrayList destinationsArray = new ArrayList (); 73 Iterator destinationsList = ((List ) JonasManagementRepr.getAttribute(joramAdminON, "Destinations")).iterator(); 74 for (; destinationsList.hasNext(); ) { 75 String destinationString = (String ) destinationsList.next(); 76 ItemDestination destinationItem = getDestinationItem(destinationString); 77 ObjectName destOn = destinationItem.getOn(); 78 if (destOn != null) { 79 destinationsArray.add(destinationItem); 80 } 82 } 83 Iterator usersList= ((List ) JonasManagementRepr.getAttribute(joramAdapterON, "LocalUsers")).iterator(); 84 for (; usersList.hasNext(); ) { 85 String destinationString = (String ) usersList.next(); 86 } 87 88 Collections.sort(destinationsArray, new ItemDestinationByName()); 89 m_Session.setAttribute("destinations", destinationsArray); 90 } catch (Throwable t) { 91 return (treatError(t, pMapping, pRequest)); 92 } 93 94 return (pMapping.findForward("JoramLocalDestinations")); 96 } 97 98 } 99 | Popular Tags |