ILOG JRules

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

java.lang.Object
  extended by ilog.rules.bres.model.mbean.util.IlrJmxMutableEntity
      extended by ilog.rules.bres.model.mbean.util.IlrJmxMutableRuleApp
All Implemented Interfaces:
IlrJmxEntityMBean, IlrJmxRuleAppMBean

public class IlrJmxMutableRuleApp
extends IlrJmxMutableEntity
implements IlrJmxRuleAppMBean

Provides a wrapper for RuleApp MBeans. Allows access to local RuleApp MBeans as well as through a J2EE cluster (retrieve automatically RuleApp MBeans 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.IlrJmxRuleAppMBean
KEY_NAME, KEY_VERSION, NOTIFICATION_PROPERTY_CHANGE, VALUE_TYPE
 
Method Summary
 ObjectName addRuleset(String rulesetName, String rulesetVersion, byte[] rulesetArchive)
          Adds a ruleset to the model with the specified ruleset name and version.
 ObjectName addRuleset(String rulesetName, String rulesetVersion, String irl)
          Deprecated. As of JRules 6.0, replaced by addRuleset(String, String, byte[]).
 byte[] export()
          Creates a RuleApp archive from this RuleApp.
 IlrJmxMutableRuleset getGreatestRuleset(String rulesetName)
          Returns the greatest versioned ruleset with the name equal to rulesetName.
 ObjectName getGreatestRulesetObjectName(String rulesetName)
          Returns the greatest versioned ruleset with the name equal to rulesetName.
 ObjectName getObjectName()
          Returns the objectName of this RuleApp MBean.
 Properties getProperties()
          Returns all ruleset properties.
 String getProperty(String key)
          Returns the property with the specified key.
 IlrJmxMutableRuleset getRuleset(String rulesetName, String rulesetVersion)
          Returns the ruleset in this RuleApp that match the rulesetName and the rulesetVersion.
 ObjectName getRulesetObjectName(String rulesetName, String rulesetVersion)
          Returns the ruleset objectName in this RuleApp that match the rulesetName and the rulesetVersion.
 Set getRulesetObjectNames()
          Returns all ruleset objectNames of this RuleApp.
 Set getRulesetObjectNames(String rulesetName)
          Returns all ruleset objectNames that match rulesetName.
 Set getRulesets()
          Returns all rulesets of this RuleApp.
 Set getRulesets(String rulesetName)
          Returns all rulesets of this RuleApp that match rulesetName.
 boolean removeRuleset(String rulesetName, String rulesetVersion)
          Removes the specified ruleset.
 void setProperty(String key, String value)
          Sets the value corresponding to a key.
 
Methods inherited from class ilog.rules.bres.model.mbean.util.IlrJmxMutableEntity
getCreationDate, getDescription, getDisplayName, getModelObjectName, getName, getVersion, setDescription, setDisplayName
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface ilog.rules.bres.model.mbean.IlrJmxEntityMBean
getCreationDate, getDescription, getDisplayName, getModelObjectName, getName, getVersion, setDescription, setDisplayName
 

Method Detail

getObjectName

public ObjectName getObjectName()
Returns the objectName of this RuleApp MBean.

Returns:
The RuleApp objectName.

getRulesetObjectNames

public Set getRulesetObjectNames()
                          throws IllegalStateException
Returns all ruleset objectNames of this RuleApp.

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

getRulesets

public Set getRulesets()
                throws IllegalStateException
Returns all rulesets of this RuleApp.

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

getRulesetObjectNames

public Set getRulesetObjectNames(String rulesetName)
                          throws IllegalStateException
Returns all ruleset objectNames that match rulesetName.

Specified by:
getRulesetObjectNames in interface IlrJmxRuleAppMBean
Throws:
IllegalStateException - If the MBean server is unavailable or an internal error occurred with the MBean server.
Parameters:
rulesetName - The ruleset name.
Returns:
A set of ObjectNames or an empty set if no ruleset exists with this name.
See Also:
IlrJmxRuleAppMBean.getRulesetObjectNames(String)

getRulesets

public Set getRulesets(String rulesetName)
                throws IllegalStateException
Returns all rulesets of this RuleApp that match rulesetName.

Throws:
IllegalStateException - If the MBean server is unavailable or an internal error occurred with the MBean server.
Parameters:
rulesetName - The ruleset name.
Returns:
A set of IlrJmxMutableRuleset or an empty set if no ruleset exists with this name.
See Also:
IlrJmxRuleAppMBean.getRulesetObjectNames(String)

getGreatestRulesetObjectName

public ObjectName getGreatestRulesetObjectName(String rulesetName)
Returns the greatest versioned ruleset with the name equal to rulesetName.

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

getGreatestRuleset

public IlrJmxMutableRuleset getGreatestRuleset(String rulesetName)
Returns the greatest versioned ruleset with the name equal to rulesetName.

Throws:
IllegalStateException - If the MBean server is unavailable or an internal error occurred with the MBean server.
Since:
JRules 6.0
Parameters:
rulesetName - The ruleset name.
Returns:
The ruleset found or null if does not exist.
See Also:
IlrJmxRuleAppMBean.getGreatestRulesetObjectName(String)

getRulesetObjectName

public ObjectName getRulesetObjectName(String rulesetName,
                                       String rulesetVersion)
                                throws IllegalStateException
Returns the ruleset objectName in this RuleApp that match the rulesetName and the rulesetVersion.

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

getRuleset

public IlrJmxMutableRuleset getRuleset(String rulesetName,
                                       String rulesetVersion)
                                throws IllegalStateException
Returns the ruleset in this RuleApp that match the rulesetName and the rulesetVersion.

Throws:
IllegalStateException - If the MBean server is unavailable or an internal error occurred with the MBean server.
Parameters:
rulesetName - The ruleset name.
rulesetVersion - The ruleset version.
Returns:
The ruleset found or null if it does not exist.
See Also:
IlrJmxRuleAppMBean.getRulesetObjectName(String, String)

addRuleset

public ObjectName addRuleset(String rulesetName,
                             String rulesetVersion,
                             String irl)
                      throws IllegalStateException,
                             InstanceAlreadyExistsException,
                             InvalidAttributeValueException,
                             OperationsException
Deprecated. As of JRules 6.0, replaced by addRuleset(String, String, byte[]).

Adds a ruleset to the model with the specified ruleset name and version.

Specified by:
addRuleset in interface IlrJmxRuleAppMBean
Throws:
InstanceAlreadyExistsException - If a ruleset 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:
rulesetName - The ruleset name.
rulesetVersion - The ruleset version.
irl - The ruleset.
Returns:
The new ruleset added to this RuleApp.
See Also:
IlrJmxRuleAppMBean.addRuleset(java.lang.String, java.lang.String, java.lang.String)

addRuleset

public ObjectName addRuleset(String rulesetName,
                             String rulesetVersion,
                             byte[] rulesetArchive)
                      throws IllegalStateException,
                             InstanceAlreadyExistsException,
                             InvalidAttributeValueException,
                             OperationsException
Adds a ruleset to the model with the specified ruleset name and version.

Specified by:
addRuleset in interface IlrJmxRuleAppMBean
Throws:
InstanceAlreadyExistsException - If a ruleset 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.
Since:
JRules 6.0
Parameters:
rulesetName - The ruleset name.
rulesetVersion - The ruleset version.
rulesetArchive - The ruleset archive JAR stored in a byte array.
Returns:
The new ruleset added to this RuleApp.
See Also:
IlrJmxRuleAppMBean.addRuleset(String, String, byte[])

removeRuleset

public boolean removeRuleset(String rulesetName,
                             String rulesetVersion)
                      throws IllegalStateException,
                             OperationsException
Removes the specified ruleset.

Specified by:
removeRuleset in interface IlrJmxRuleAppMBean
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:
rulesetName - The ruleset name.
rulesetVersion - The ruleset version.
Returns:
true if the ruleset exists and has been removed, otherwise it returns false.
See Also:
IlrJmxRuleAppMBean.removeRuleset(String, String)

getProperty

public String getProperty(String key)
                   throws OperationsException,
                          IllegalStateException
Returns the property with the specified key. The method returns null if the property is not found.

Specified by:
getProperty in interface IlrJmxRuleAppMBean
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.
Since:
JRules 6.0
Parameters:
key - The property key. Cannot be null.
Returns:
The value linked to the key.
See Also:
IlrJmxRuleAppMBean.getProperty(String)

getProperties

public Properties getProperties()
                         throws OperationsException,
                                IllegalStateException
Returns all ruleset properties.

Specified by:
getProperties in interface IlrJmxRuleAppMBean
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.
Since:
JRules 6.0
Returns:
All properties.
See Also:
IlrJmxRuleAppMBean.getProperties()

setProperty

public void setProperty(String key,
                        String value)
                 throws OperationsException,
                        IllegalStateException
Sets the value corresponding to a key.

Specified by:
setProperty in interface IlrJmxRuleAppMBean
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.
Since:
JRules 6.0
Parameters:
key - The property key.
value - The new value.
See Also:
IlrJmxRuleAppMBean.setProperty(String, String)

export

public byte[] export()
              throws OperationsException,
                     IllegalStateException
Creates a RuleApp archive from this RuleApp.

Specified by:
export in interface IlrJmxRuleAppMBean
Throws:
IOException - If an IOException occurred during the creation of 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.
Returns:
The RuleApp archive.
See Also:
IlrJmxRuleAppMBean.export()

ILOG JRules