com.ibm.websphere.brb.mgmt
Class RuleMgmtHelper

java.lang.Object
  extended bycom.ibm.websphere.brb.mgmt.RuleMgmtHelper

public abstract class RuleMgmtHelper
extends java.lang.Object

This class provides useful methods for managing BRBeans rules and folders.


Constructor Summary
RuleMgmtHelper()
           
 
Method Summary
static IRuleFolder getRootFolder()
          Get the root IRuleFolder for the rule server.
static IRuleFolder getRootFolder(javax.naming.InitialContext ic)
          FOR IBM INTERNAL USE ONLY.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

RuleMgmtHelper

public RuleMgmtHelper()
Method Detail

getRootFolder

public static IRuleFolder getRootFolder()
                                 throws BusinessRuleBeansException
Get the root IRuleFolder for the rule server. The host and port for the name server can be specified in a BRBeans properties file, where the file can be specified on the command line as -DbrbPropertiesFile=file-name. If no BRBeans properties file is specified, then the name server specified for the container in which we are running will be used. The properties file can also be used to specify the JNDI names of the BRBeans EJBs if these names have not been set in the client container in which we are running. The properties file must be in the following format (entries can be specified in any order):
   host=host-name-for-name-server
   port=port-number-for-name-server
   RuleJndi=JNDI-name-for-Rule-EJB
   RuleFolderJndi=JNDI-name-for-RuleFolder-EJB
   RuleHelperJndi=JNDI-name-for-RuleHelper-EJB
 

A default properties file is shipped as \WebSphere\AppServer\bin\brbeansDefaultProperties. This default file contains default names that are used in the BRBeans.jar files that are shipped with BRBeans. This file can be used if that jar file is installed without changing the names. Note that the file name still must be specified even if you want to use the default file. There is no file that is used automatically if the brbPropertiesFile property is not set.

Returns:
the root IRuleFolder
Throws:
BusinessRuleBeansException - if the BRBeans EJB homes cannot be found for any reason.

getRootFolder

public static IRuleFolder getRootFolder(javax.naming.InitialContext ic)
                                 throws BusinessRuleBeansException
FOR IBM INTERNAL USE ONLY. Get the root IRuleFolder for the given javax.naming.InitialContext. An IllegalArgumentException is thrown if null is passed for the InitialContext.

The following example gets the root IRuleFolder connecting to the default factory for Websphere Advanced Edition where the server is running locally on port 2809:

   Properties props = new Properties();
   props.setProperty(javax.naming.Context.INITIAL_CONTEXT_FACTORY, 
                     "com.ibm.websphere.naming.WsnInitialContextFactory");
   props.setProperty(javax.naming.Context.PROVIDER_URL, 
                     "iiop://localhost:2809");
   InitialContext ic = new javax.naming.InitialContext(props);
   IRuleFolder root = RuleMgmtHelper.getRootFolder(ic);
 

Parameters:
ic - the initial context
Returns:
the root IRuleFolder
Throws:
java.lang.IllegalArgumentException - if null is passed for the InitialContext
BusinessRuleBeansException