1 24 package org.objectweb.jalisto.se.jmx; 25 26 import org.objectweb.jalisto.se.JalistoFactory; 27 import org.objectweb.jalisto.se.api.internal.SessionInternal; 28 29 import java.util.HashMap ; 30 31 public class SessionProvider { 32 33 private SessionProvider() { 34 sessions = new HashMap (); 35 } 36 37 public SessionInternal getSessionForMbean(String propertiesPath) { 38 SessionInternal result = (SessionInternal) sessions.get(propertiesPath); 39 if (result == null) { 40 result = (SessionInternal) JalistoFactory.getSession(propertiesPath); 41 sessions.put(propertiesPath, result); 42 } 43 return result; 44 } 45 46 private HashMap sessions; 47 48 public static SessionProvider getInstance() { 49 if (instance == null) { 50 instance = new SessionProvider(); 51 } 52 return instance; 53 } 54 55 private static SessionProvider instance; 56 } 57 | Popular Tags |