Decision Management (ODM,ADS)

 View Only

ODM 8.10 | How to retrieve the XU memory usage from a J2SE session

  • 1.  ODM 8.10 | How to retrieve the XU memory usage from a J2SE session

    Posted Wed March 08, 2023 11:08 AM

    Hi All,

    In the source code below for a J2SE session, how can I retrieve an IlrRulesetUsageInformationMonitor instance?

    	public void run() throws RulesetExecutionException {
    		IlrJ2SESessionFactory factory = getFactory();
    		String rulesetPath = getRulesetPath();
    
    		try {
    			IlrSessionRequest request = factory.createRequest();
    
    			request.setRulesetPath(IlrPath.parsePath(getRulesetPath()));
    			initRequest(request);
    
    			IlrSessionResponse response;
    			IlrStatelessSession session = factory.createStatelessSession();
    
    			response = session.execute(request);
    			handleResponse(response);
    
    		} catch (Exception e) {
    			String rulesetName = rulesetPath.substring(rulesetPath.lastIndexOf("/"));
    			throw new RulesetExecutionException(rulesetName, e);
    		} finally {
    			if (factory != null) {
    				factory.release();
    			}
    		}
    	}
    
    	private synchronized IlrJ2SESessionFactory getFactory() {
    		if (sessionFactory == null) {
    			IlrSessionFactoryConfig config = IlrJ2SESessionFactory.createDefaultConfig();
    			config.getXUConfig().getPersistenceConfig().setPersistenceType(IlrPersistenceType.FILE);
    			config.getXUConfig().getPersistenceConfig().getFilePersistenceConfig()
    					.setDirectory(new File(RULE_APP_DIRECTORY));
    			PrintWriter writer = new PrintWriter(System.out);
    			config.getXUConfig().setLogWriter(writer);
    
    			sessionFactory = new IlrJ2SESessionFactory(config);
    		}
    		return sessionFactory;
    	}
    

    As you can see, in the product documentation, the sample code for the recovery of an IlrRulesetUsageInformationMonitor instance is omitted.



    ------------------------------
    Charo Álvarez Martínez
    Automation Architect
    DECIDE
    Madrid
    ------------------------------