private CIMObjectPath createInstance(String className,String name,CIMProperty<?>[] properties) throws WBEMException {
  CIMProperty<?>[] array=new CIMProperty<?>[properties.length + 1];
  System.arraycopy(properties,0,array,0,properties.length);
  array[properties.length]=new CIMProperty<String>(CimConstants.NAME_KEY,CIMDataType.STRING_T,name);
  properties=array;
  try {
    return createInstance(className,properties);
  }
 catch (  WBEMException e) {
    if (e.getID() == WBEMException.CIM_ERR_ALREADY_EXISTS) {
      CIMInstance instance=getInstance(className,name);
      if (instance != null) {
        return instance.getObjectPath();
      }
    }
    throw e;
  }
}

private CIMObjectPath createInstance ( String className , String name , CIMProperty < ? > [ ] properties ) throws WBEMException { CIMProperty < ? > [ ] array = new CIMProperty < ? > [ properties . length + 1 ] ; System . arraycopy ( properties , 0 , array , 0 , properties . length ) ; array [ properties . length ] = new CIMProperty < String > ( CimConstants . NAME_KEY , CIMDataType . STRING_T , name ) ; properties = array ; try { return createInstance ( className , properties ) ; } catch ( WBEMException e ) { if ( e . getID ( ) == WBEMException . CIM_ERR_ALREADY_EXISTS ) { CIMInstance instance = getInstance ( className , name ) ; if ( instance != null ) { return instance . getObjectPath ( ) ; } } throw e ; } }
creates an instance in the cimom . if the instance already exists , its object path is returned .
