public Statistic[] getStatistics() { return genericStatsDelegate.getStatistics(); }
public IiopService getIiopService() { assertServer(); return iiopService; }
public String[] getStatisticNames() { return genericStatsDelegate.getStatisticNames(); }
private GlassFishORBHelper getHelper() { IIOPUtils iiopUtils = IIOPUtils.getInstance(); return iiopUtils.getHabitat().getService( GlassFishORBHelper.class); }
private void populateGetterMap() { // Fix for Bugs 5045435, 6172088 //final Method[] apis = statsInterface.getDeclaredMethods(); //all of these should be PUBLIC. final Method[] m = statsInterface.getMethods(); // exclude methods that belong to the javax.management.j2ee.Stats final Method[] apis = filterStatsMethods(m); final Method[] methods = getGetters(apis); final String[] names = methods2Statistics(methods); assert (names.length == methods.length) : ("Statistic names array is not having same length as that of array of getters"); int i; for (i = 0 ; i < names.length ; i++) { getters.put(names[i], methods[i]); } assert (getters.size() == i) : ("Getters map is incorrect, names.length = " + names.length + " methods.length = " + methods.length); }
/** Constructs a new instance of this class for a given interface and its implementation. * It is mandatory that following contract is satisfied to call this satisfactorily: * <ul> * <li> None of the parameters are null. </li> * <li> Given statsProvider implements the given statsInterface. </li> * <li> Given statsInterface has to extend the @{link Stats} interface. </li> * </ul> * Note that it is expected (though not mandatory) to have a getXXX method that * does not return an instance of {@link Statistic} interface. * @throws NullPointerException if any of the given parameters are null * @throws IllegalArgumentException if the contract is not satisfied by given parameters */ public GenericStatsImpl(Class statsInterface, Object statsProvider) { if (!implementsInterface(statsInterface, statsProvider) || ! extendsStatsInterface(statsInterface)) { throw new IllegalArgumentException("Contract violation: invalid interface-implementation pair"); } this.statsProvider = statsProvider; this.statsInterface = statsInterface; this.getters = new HashMap(); populateGetterMap(); }
public static void setThreadPoolManager() { threadpoolMgr = S1ASThreadPoolManager.getThreadPoolManager(); }
public ThreadPoolStatsImpl(ThreadPool threadPool) throws NoSuchWorkQueueException { this.threadPool = threadPool; this.threadPoolName = threadPool.getName(); getWorkQueueForThreadPool(); initializeStats(); }
S1ASThreadPoolManager() { try { _iiopUtils = Globals.getDefaultHabitat().getByType(IIOPUtils.class); Collection<com.sun.grizzly.config.dom.ThreadPool> tpCol = _iiopUtils.getAllThreadPools(); com.sun.grizzly.config.dom.ThreadPool[] allThreadPools = tpCol.toArray(new com.sun.grizzly.config.dom.ThreadPool[tpCol.size()]); for (int i = 0; i < allThreadPools.length; i++) { createThreadPools(allThreadPools[i], i); } defaultID = (String) indexToIdTable.get(new Integer(0)); } catch (NullPointerException npe) { _logger.log(Level.FINE, "Server Context is NULL. Ignoring and proceeding."); } }
public Statistic getStatistic(String statName) { return genericStatsDelegate.getStatistic(statName); }
public Statistic[] getStatistics() { return ( getStatisticsOneByOne() ); //invokes sequentially }
protected void initialize(String statInterfaceName) { try{ genericStatsDelegate = new GenericStatsImpl(statInterfaceName, this); } catch(ClassNotFoundException cnfEx) { throw new RuntimeException(statInterfaceName + " not found", cnfEx); } }
/** * Returns the first instance of ThreadPool in the ThreadPoolManager */ public ThreadPool getDefaultThreadPool() { try { return getThreadPool(0); } catch (NoSuchThreadPoolException nstpe) { if (_logger.isLoggable(Level.WARNING)) { _logger.log(Level.WARNING, "No default ThreadPool defined ", nstpe); } } return null; }
private Method[] getGetters(Method[] all) { final ArrayList l = new ArrayList(); for (int i = 0 ; i < all.length ; i++) { final Method am = all[i]; if (isValidGetter(am)) { l.add(am); } } final Method[] m = new Method[l.size()]; return ( (Method[])l.toArray(m) ); }
private Method[] filterStatsMethods(Method[] m) { ArrayList methodList = new ArrayList(); for(int i = 0; i < m.length; i++) { if(! isStatsInterfaceMethod(m[i].getName())) methodList.add(m[i]); } final Method[] methods = new Method[methodList.size()]; return (Method[])methodList.toArray(methods); } }
@Override public void postConstruct() { gfORBManager = new GlassFishORBManager(habitat); IIOPUtils.setInstance(iiopUtils); //iiopUtils.setGlassFishORBManager(gfORBManager); }
public Collection<ThreadPool> getAllThreadPools() { assertServer(); return threadPools; }
private Statistic[] getStatisticsOneByOne() { final Iterator iter = getters.keySet().iterator(); final Statistic[] stats = new Statistic[getters.keySet().size()]; int i = 0; while (iter.hasNext()) { final String sn = (String) iter.next(); stats[i++] = this.getStatistic(sn); } assert (stats.length == i); return ( stats ); }
public Collection<ServerRef> getServerRefs() { assertServer(); return serverRefs; }
public List<IiopListener> getIiopListeners() { assertServer(); return iiopService.getIiopListener(); }