org.drools
Interface StatelessSessionResult

All Known Implementing Classes:
ReteStatelessSessionResult

public interface StatelessSessionResult

StatelessSessionResults allow inspection of session after it has executed. Querries can still be executed, unless you serialise at which point the WorkingMemory and RuleBase it references to execute thosa querries are lost due to being transient. Globals must be explicitely imported into the StatelessSessionResult to be accessible, otherwise getGlobal and getGlobalResolver return null.


Method Summary
 Object getGlobal(String identifier)
          Retrieves the global value for the given identifier, note that globals must be exported from the StatelessSession to be accessible.
 GlobalResolver getGlobalResolver()
          The GlobalResolver returned from the GlobalExporter by the StatelessSessoin
 QueryResults getQueryResults(String query)
          Retrieve the QueryResults of the specified query.
 QueryResults getQueryResults(String query, Object[] arguments)
          Allows for parameters to be passed to a query.
 Iterator iterateObjects()
          Iterator all Objects inserted into the StatelessSession.
 Iterator iterateObjects(org.drools.runtime.ObjectFilter filter)
          Iterate only those objects that match the provided ObjectFilter.
 

Method Detail

iterateObjects

Iterator iterateObjects()
Iterator all Objects inserted into the StatelessSession.

Returns:
java.util.Iterators.

iterateObjects

Iterator iterateObjects(org.drools.runtime.ObjectFilter filter)
Iterate only those objects that match the provided ObjectFilter.

Parameters:
filter - The ObjectFilter instance.
Returns:
java.util.Iterators.

getQueryResults

QueryResults getQueryResults(String query)
Retrieve the QueryResults of the specified query.

Parameters:
query - The name of the query.
Returns:
The QueryResults of the specified query. If no results match the query it is empty..
Throws:
IllegalArgumentException. - if no query named "query" is found in the rulebase.

getQueryResults

QueryResults getQueryResults(String query,
                             Object[] arguments)
Allows for parameters to be passed to a query.

Parameters:
query - The name of the query.
arguments - The Object[] of arguments to pass to the query's parameters.
Returns:
java.util.Iterator.

getGlobal

Object getGlobal(String identifier)
Retrieves the global value for the given identifier, note that globals must be exported from the StatelessSession to be accessible.

Parameters:
identifier - The global identifier.
Returns:
The instance the global identifier points to.

getGlobalResolver

GlobalResolver getGlobalResolver()
The GlobalResolver returned from the GlobalExporter by the StatelessSessoin

Returns:
The GlobalResolver used for this StatelessSessionResult


Copyright © 2001-2012 JBoss by Red Hat. All Rights Reserved.