Retrieve user-defined component properties

You can add user defined properties for your components using the Advanced tab in the Component Properties page in the Management Console. To access these properties at run time, use the Jaguar::Repository API as shown in the example below. For details on this API, see the generated reference documentation in the html/ir subdirectory of your installation. The function below returns an array of Jaguar::Property instances that contain the properties defined for the currently executing component:

public static Property[] getMyComponentProps() { 
    Repository theRep; 
    Property[] myProps; 
    try { 
        java.util.Properties orbProps = new java.util.Properties(); 
        orbProps.put("org.omg.CORBA.ORBClass", 
                 "com.sybase.CORBA.ORB"); 
        ORB theOrb = ORB.init((java.lang.String[])null, orbProps); 
        theRep = RepositoryHelper.narrow 
           (theOrb.string_to_object("Jaguar/Repository")); 
    } catch (Exception e) { 
        System.out.println("Exception instantiating Repository component:" 
                           + "\n" + e); 
        return null; 
    } 
    try { 
        String myPackage = JContext.getPackageName(); 
        String myComponent = myPackage + "/" + JContext.getComponentName(); 
        myProps = theRep.lookup("Component", myComponent); 
    } catch (Exception e) { 
        System.out.println("Exception getting component properties:" 
                           + "\n" + e); 
        return null; 
    }   
    return myProps;       
}