ILOG JRules

ilog.rules.bres.model.mbean.util
Class IlrJmxMutableModel

java.lang.Object
  extended by ilog.rules.bres.model.mbean.util.IlrJmxMutableModel
All Implemented Interfaces:
IlrJmxModelMBean

public class IlrJmxMutableModel
extends Object
implements IlrJmxModelMBean

Provides a wrapper for the Rule Execution Server management model MBean. Allows access to local model MBeans as well as through a J2EE cluster (retrieve automatically the Rule Execution Server management model MBean in the cluster). Cannot be used outside the application server.

Provides a default implementation based on JMX 1.0 for local MBean access and a specific implementation for BEA WebLogic, IBM WebSphere, JBoss, and Oracle clusters.


Field Summary
 
Fields inherited from interface ilog.rules.bres.model.mbean.IlrJmxModelMBean
VALUE_TYPE
 
Constructor Summary
IlrJmxMutableModel()
          Creates the entry to manage the Rule Execution Server model.
IlrJmxMutableModel(Properties properties)
          Creates the entry to manage the Rule Execution Server model.
 
Method Summary
 ObjectName addRuleApp(String ruleAppName, String ruleAppVersion)
          Adds a RuleApp to the model with the specified RuleApp name and version.
 long getErrorCount()
          Returns the number of errors that occurred in all Execution Units (XU).
 IlrJmxMutableRuleApp getGreatestRuleApp(String ruleAppName)
          Returns the greatest versioned RuleApp in the model with the name equal to ruleAppName.
 ObjectName getGreatestRuleAppObjectName(String ruleAppName)
          Returns the greatest versioned RuleApp in the model with the name equal to ruleAppName.
 IlrJmxMutableRuleApp getRuleApp(String ruleAppName, String ruleAppVersion)
          Retrieves the RuleApp that matches the name ruleAppName and the version ruleAppVersion.
 ObjectName getRuleAppObjectName(String ruleAppName, String ruleAppVersion)
          Returns the RuleApp that matches the name ruleAppName and the version ruleAppVersion.
 Set getRuleAppObjectNames()
          Returns all RuleApp objectNames in the model.
 Set getRuleAppObjectNames(String ruleAppName)
          Returns all RuleApp objectNames in the model with the name equal to ruleAppName.
 Set getRuleApps()
          Returns all RuleApps in the model.
 Set getRuleApps(String ruleAppName)
          Returns all RuleApps in the model with the name equal to ruleAppName.
 long getWarningCount()
          Returns the number of warnings that occurred in all Execution Units (XU).
 Set importRuleApps(byte[] ruleAppArchive, String mergingPolicy, String versioningPolicy)
          Imports a RuleApp archive.
 boolean removeRuleApp(String ruleAppName, String ruleAppVersion)
          Removes the specified RuleApp.
 void resetErrorCount()
          Resets the error count for all XU MBeans.
 void resetWarningCount()
          Resets the warning count for all XU MBeans.
 IlrJmxMutableRuleApp wrapRuleApp(ObjectName ruleAppObjectName)
          Creates an IlrJmxMutableRuleApp from an objectName of a RuleApp MBean.
 IlrJmxMutableRuleset wrapRuleset(ObjectName rulesetObjectName)
          Creates an IlrJmxMutableRuleset from an objectName of a ruleset MBean.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

IlrJmxMutableModel

public IlrJmxMutableModel()
                   throws Exception
Creates the entry to manage the Rule Execution Server model.

Throws:
Exception - If an error occurred during the search for the MBean server.

IlrJmxMutableModel

public IlrJmxMutableModel(Properties properties)
                   throws Exception
Creates the entry to manage the Rule Execution Server model.

Properties are used if a lookup is used to retrieve the MBean server. Currently useful for WebLogic only.

Throws:
Exception - If an error occurred during the search of the MBean server.
Parameters:
properties - Properties used for a lookup to override the default properties.
Method Detail

wrapRuleApp

public IlrJmxMutableRuleApp wrapRuleApp(ObjectName ruleAppObjectName)
Creates an IlrJmxMutableRuleApp from an objectName of a RuleApp MBean.

Parameters:
ruleAppObjectName - The objectName of a RuleApp MBean. Cannot be null.
Returns:
The wrapper on the RuleApp MBean specified by the ruleAppObjectName.

wrapRuleset

public IlrJmxMutableRuleset wrapRuleset(ObjectName rulesetObjectName)
Creates an IlrJmxMutableRuleset from an objectName of a ruleset MBean.

Parameters:
rulesetObjectName - The objectName of a ruleset MBean. Cannot be null.
Returns:
The wrapper on the ruleset MBean specified by the rulesetObjectName.

getRuleAppObjectNames

public Set getRuleAppObjectNames()
                          throws IllegalStateException
Returns all RuleApp objectNames in the model.

Specified by:
getRuleAppObjectNames in interface IlrJmxModelMBean
Throws:
IllegalStateException - If the MBean server is unavailable or an internal error occurred with the MBean server.
Returns:
A set of ObjectNames.
See Also:
IlrJmxModelMBean.getRuleAppObjectNames()

getRuleApps

public Set getRuleApps()
                throws IllegalStateException
Returns all RuleApps in the model.

Throws:
IllegalStateException - If the MBean server is unavailable or an internal error occurred with the MBean server.
Returns:
A set of IlrJmxMutableRuleApp.
See Also:
IlrJmxModelMBean.getRuleAppObjectNames()

getRuleAppObjectNames

public Set getRuleAppObjectNames(String ruleAppName)
                          throws IllegalStateException
Returns all RuleApp objectNames in the model with the name equal to ruleAppName.

Specified by:
getRuleAppObjectNames in interface IlrJmxModelMBean
Throws:
IllegalStateException - If the MBean server is unavailable or an internal error occurred with the MBean server.
Parameters:
ruleAppName - The RuleApp name.
Returns:
A set of ObjectNames or an empty set if no RuleApps exist with this name.
See Also:
IlrJmxModelMBean.getRuleAppObjectNames(String)

getRuleApps

public Set getRuleApps(String ruleAppName)
                throws IllegalStateException
Returns all RuleApps in the model with the name equal to ruleAppName.

Throws:
IllegalStateException - If the MBean server is unavailable or an internal error occurred with the MBean server.
Parameters:
ruleAppName - The RuleApp name.
Returns:
A set of IlrJmxMutableRuleApp or an empty set if no RuleApps exist with this name.
See Also:
IlrJmxModelMBean.getRuleAppObjectNames(String)

getGreatestRuleAppObjectName

public ObjectName getGreatestRuleAppObjectName(String ruleAppName)
Returns the greatest versioned RuleApp in the model with the name equal to ruleAppName.

Specified by:
getGreatestRuleAppObjectName in interface IlrJmxModelMBean
Throws:
IllegalStateException - If the MBean server is unavailable or an internal error occurred with the MBean server.
Since:
JRules 6.0
Parameters:
ruleAppName - The RuleApp name.
Returns:
The RuleApp objectName found or null if it does not exist.
See Also:
IlrJmxModelMBean.getGreatestRuleAppObjectName(String)

getGreatestRuleApp

public IlrJmxMutableRuleApp getGreatestRuleApp(String ruleAppName)
Returns the greatest versioned RuleApp in the model with the name equal to ruleAppName.

Throws:
IllegalStateException - If the MBean server is unavailable or an internal error occurred with the MBean server.
Since:
JRules 6.0
Parameters:
ruleAppName - The RuleApp name.
Returns:
The RuleApp found or null if it does not exist.
See Also:
IlrJmxModelMBean.getGreatestRuleAppObjectName(String)

getRuleAppObjectName

public ObjectName getRuleAppObjectName(String ruleAppName,
                                       String ruleAppVersion)
                                throws IllegalStateException
Returns the RuleApp that matches the name ruleAppName and the version ruleAppVersion.

Specified by:
getRuleAppObjectName in interface IlrJmxModelMBean
Throws:
IllegalStateException - If the MBean server is unavailable or an internal error occurred with the MBean server.
Parameters:
ruleAppName - The RuleApp name.
ruleAppVersion - The RuleApp version.
Returns:
The RuleApp objectName found or null if it does not exist.
See Also:
IlrJmxModelMBean.getRuleAppObjectName(String, String)

getRuleApp

public IlrJmxMutableRuleApp getRuleApp(String ruleAppName,
                                       String ruleAppVersion)
                                throws IllegalStateException
Retrieves the RuleApp that matches the name ruleAppName and the version ruleAppVersion.

Throws:
IllegalStateException - If the MBean server is unavailable or an internal error occurred with the MBean server.
Parameters:
ruleAppName - The RuleApp name.
ruleAppVersion - The RuleApp version.
Returns:
The RuleApp found or null if it does not exist.
See Also:
IlrJmxModelMBean.getRuleAppObjectName(String, String)

addRuleApp

public ObjectName addRuleApp(String ruleAppName,
                             String ruleAppVersion)
                      throws InstanceAlreadyExistsException,
                             InvalidAttributeValueException,
                             OperationsException,
                             IllegalStateException
Adds a RuleApp to the model with the specified RuleApp name and version.

Specified by:
addRuleApp in interface IlrJmxModelMBean
Throws:
InstanceAlreadyExistsException - If a RuleApp already exists in the model with this name and this version.
InvalidAttributeValueException - If an attribute has an invalid value.
OperationsException - If an error occurred in the MBean.
IllegalStateException - If the MBean server is unavailable or an internal error occurred with the MBean server.
Parameters:
ruleAppName - The RuleApp name.
ruleAppVersion - The RuleApp version.
Returns:
The new RuleApp objectName added to the model.
See Also:
IlrJmxModelMBean.addRuleApp(String, String)

removeRuleApp

public boolean removeRuleApp(String ruleAppName,
                             String ruleAppVersion)
                      throws OperationsException,
                             IllegalStateException
Removes the specified RuleApp.

Specified by:
removeRuleApp in interface IlrJmxModelMBean
Throws:
OperationsException - If an error occurred in the MBean.
IllegalStateException - If the MBean server is unavailable or an internal error occurred with the MBean server.
Parameters:
ruleAppName - The RuleApp name.
ruleAppVersion - The RuleApp version.
Returns:
true if the RuleApp exists and has been removed, otherwise it returns false.
See Also:
IlrJmxModelMBean.removeRuleApp(String, String)

importRuleApps

public Set importRuleApps(byte[] ruleAppArchive,
                          String mergingPolicy,
                          String versioningPolicy)
                   throws InvalidAttributeValueException,
                          IOException,
                          OperationsException,
                          IllegalStateException
Imports a RuleApp archive.

Specified by:
importRuleApps in interface IlrJmxModelMBean
Throws:
InvalidAttributeValueException - If an attribute has an invalid value.
IOException - If an IOException occurred on the RuleApp archive.
OperationsException - If an error occurred in the MBean.
IllegalStateException - If the MBean server is unavailable or an internal error occurred with the MBean server.
Parameters:
ruleAppArchive - The RuleApp archive.
mergingPolicy - The merging policy.
versioningPolicy - The versioning policy.
Returns:
A set of IlrJmxMutableRuleApp that has been successfully imported.
See Also:
IlrJmxModelMBean.importRuleApps(byte[], String, String)

getWarningCount

public long getWarningCount()
                     throws IllegalStateException
Description copied from interface: IlrJmxModelMBean
Returns the number of warnings that occurred in all Execution Units (XU). It is the sum of the warnings obtained from all the XU MBeans found.

Specified by:
getWarningCount in interface IlrJmxModelMBean
Throws:
IllegalStateException - If the MBean server is unavailable or an internal error occurred with the MBean server.
Returns:
The number of warnings for all XUs.
See Also:
IlrJmxModelMBean.getWarningCount()

getErrorCount

public long getErrorCount()
                   throws IllegalStateException
Description copied from interface: IlrJmxModelMBean
Returns the number of errors that occurred in all Execution Units (XU). It is the sum of errors obtained from all the XU MBeans found.

Specified by:
getErrorCount in interface IlrJmxModelMBean
Throws:
IllegalStateException - If the MBean server is unavailable or an internal error occurred with the MBean server.
Returns:
The number of errors for all XUs.
See Also:
IlrJmxModelMBean.getErrorCount()

resetWarningCount

public void resetWarningCount()
                       throws IllegalStateException
Description copied from interface: IlrJmxModelMBean
Resets the warning count for all XU MBeans.

Specified by:
resetWarningCount in interface IlrJmxModelMBean
Throws:
IllegalStateException - If the MBean server is unavailable or an internal error occurred with the MBean server.
See Also:
IlrJmxModelMBean.resetWarningCount()

resetErrorCount

public void resetErrorCount()
                     throws IllegalStateException
Description copied from interface: IlrJmxModelMBean
Resets the error count for all XU MBeans.

Specified by:
resetErrorCount in interface IlrJmxModelMBean
Throws:
IllegalStateException - If the MBean server is unavailable or an internal error occurred with the MBean server.
See Also:
IlrJmxModelMBean.resetErrorCount()

ILOG JRules