Example #1
0
  /** @return a name for a policy. The name depends of the actual type of the policy. */
  public static String getNameOfPolicy(org.omg.CORBA.Policy pol) {
    try {
      ManagementPolicy manage = ManagementPolicyHelper.narrow(pol);
      return manage.short_description();
    } catch (org.omg.CORBA.BAD_PARAM bp) {
    }

    try {
      PropertyPolicy prop = PropertyPolicyHelper.narrow(pol);
      return prop.name();
    } catch (org.omg.CORBA.BAD_PARAM bp) {
    }

    return "Type " + Integer.toString(pol.policy_type());
  }
Example #2
0
 /** returns a string which can be used as a key for a policy in a domain */
 public static String getNamedKeyOfPolicy(org.omg.CORBA.Policy pol) {
   return getNameOfPolicy(pol) + Integer.toString(pol.policy_type());
 }