Modified: incubator/tuscany/tags/java/sdo/1.0-incubating/tools/src/test/java/com/example/simple/cs/impl/CSFactoryImpl.java URL: http://svn.apache.org/viewvc/incubator/tuscany/tags/java/sdo/1.0-incubating/tools/src/test/java/com/example/simple/cs/impl/CSFactoryImpl.java?view=diff&rev=559518&r1=559517&r2=559518 ============================================================================== --- incubator/tuscany/tags/java/sdo/1.0-incubating/tools/src/test/java/com/example/simple/cs/impl/CSFactoryImpl.java (original) +++ incubator/tuscany/tags/java/sdo/1.0-incubating/tools/src/test/java/com/example/simple/cs/impl/CSFactoryImpl.java Wed Jul 25 09:42:11 2007 @@ -28,18 +28,12 @@ import commonj.sdo.Property; import commonj.sdo.Type; -import org.apache.tuscany.sdo.SDOFactory; - import org.apache.tuscany.sdo.impl.FactoryBase; import org.apache.tuscany.sdo.model.ModelFactory; import org.apache.tuscany.sdo.model.impl.ModelFactoryImpl; -import org.apache.tuscany.sdo.model.internal.InternalFactory; - -import org.apache.tuscany.sdo.util.SDOUtil; - /** * <!-- begin-user-doc --> * An implementation of the model <b>Factory</b>. @@ -95,11 +89,17 @@ * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated - */ - public void register(HelperContext scope) { + */ + public void register(HelperContext scope) + { if(scope == null) { - throw new IllegalArgumentException("Scope can not be null"); - } + throw new IllegalArgumentException("Scope can not be null"); + } + + //Register dependent packages with provided scope + ModelFactory.INSTANCE.register(scope); + + // Initialize this package TypeHelperImpl th = (TypeHelperImpl)scope.getTypeHelper(); th.getExtendedMetaData().putPackage(NAMESPACE_URI, this); } @@ -157,29 +157,25 @@ } - private static boolean isInited = false; - + private static CSFactoryImpl instance = null; public static CSFactoryImpl init() { - if (isInited) return (CSFactoryImpl)FactoryBase.getStaticFactory(CSFactoryImpl.NAMESPACE_URI); - CSFactoryImpl theCSFactoryImpl = new CSFactoryImpl(); - isInited = true; - - // Initialize dependencies - SDOUtil.registerStaticTypes(SDOFactory.class); - SDOUtil.registerStaticTypes(ModelFactory.class); - SDOUtil.registerStaticTypes(InternalFactory.class); + if (instance != null ) return instance; + instance = new CSFactoryImpl(); + // Initialize dependent packages + ModelFactory ModelFactoryInstance = ModelFactory.INSTANCE; + // Create package meta-data objects - theCSFactoryImpl.createMetaData(); + instance.createMetaData(); // Initialize created meta-data - theCSFactoryImpl.initializeMetaData(); - + instance.initializeMetaData(); + // Mark meta-data to indicate it can't be changed //theCSFactoryImpl.freeze(); //FB do we need to freeze / should we freeze ???? - return theCSFactoryImpl; + return instance; } private boolean isCreated = false; @@ -190,7 +186,7 @@ isCreated = true; // Create types and their properties - quoteType = createType(false, QUOTE); + quoteType = createType(false, QUOTE); createProperty(true, quoteType,QuoteImpl.INTERNAL_SYMBOL); createProperty(true, quoteType,QuoteImpl.INTERNAL_COMPANY_NAME); createProperty(true, quoteType,QuoteImpl.INTERNAL_PRICE); @@ -200,7 +196,7 @@ createProperty(true, quoteType,QuoteImpl.INTERNAL_VOLUME); createProperty(true, quoteType,QuoteImpl.INTERNAL_CHANGE1); createProperty(false, quoteType,QuoteImpl.INTERNAL_QUOTES); - quoteBaseType = createType(false, QUOTE_BASE); + quoteBaseType = createType(false, QUOTE_BASE); createProperty(true, quoteBaseType,QuoteBaseImpl.INTERNAL_CHANGES); } @@ -212,7 +208,7 @@ isInitialized = true; // Obtain other dependent packages - ModelFactoryImpl theModelPackageImpl = (ModelFactoryImpl)FactoryBase.getStaticFactory(ModelFactoryImpl.NAMESPACE_URI); + ModelFactoryImpl theModelPackageImpl = (ModelFactoryImpl)ModelFactory.INSTANCE; Property property = null; // Add supertypes to types
Modified: incubator/tuscany/tags/java/sdo/1.0-incubating/tools/src/test/java/com/example/simple/cs/impl/QuoteBaseImpl.java URL: http://svn.apache.org/viewvc/incubator/tuscany/tags/java/sdo/1.0-incubating/tools/src/test/java/com/example/simple/cs/impl/QuoteBaseImpl.java?view=diff&rev=559518&r1=559517&r2=559518 ============================================================================== --- incubator/tuscany/tags/java/sdo/1.0-incubating/tools/src/test/java/com/example/simple/cs/impl/QuoteBaseImpl.java (original) +++ incubator/tuscany/tags/java/sdo/1.0-incubating/tools/src/test/java/com/example/simple/cs/impl/QuoteBaseImpl.java Wed Jul 25 09:42:11 2007 @@ -237,7 +237,7 @@ boolean oldChanges_set_ = changes_set_; changes_set_ = true; if (isNotifying()) - notify(ChangeKind.SET, CHANGES, oldChanges, changes, !oldChanges_set_); + notify(ChangeKind.SET, INTERNAL_CHANGES, oldChanges, changes, !oldChanges_set_); } /** @@ -252,7 +252,7 @@ changes = CHANGES_DEFAULT_; changes_set_ = false; if (isNotifying()) - notify(ChangeKind.UNSET, CHANGES, oldChanges, CHANGES_DEFAULT_, oldChanges_set_); + notify(ChangeKind.UNSET, INTERNAL_CHANGES, oldChanges, CHANGES_DEFAULT_, oldChanges_set_); } /** Modified: incubator/tuscany/tags/java/sdo/1.0-incubating/tools/src/test/java/com/example/simple/cs/impl/QuoteImpl.java URL: http://svn.apache.org/viewvc/incubator/tuscany/tags/java/sdo/1.0-incubating/tools/src/test/java/com/example/simple/cs/impl/QuoteImpl.java?view=diff&rev=559518&r1=559517&r2=559518 ============================================================================== --- incubator/tuscany/tags/java/sdo/1.0-incubating/tools/src/test/java/com/example/simple/cs/impl/QuoteImpl.java (original) +++ incubator/tuscany/tags/java/sdo/1.0-incubating/tools/src/test/java/com/example/simple/cs/impl/QuoteImpl.java Wed Jul 25 09:42:11 2007 @@ -470,7 +470,7 @@ boolean oldSymbol_set_ = symbol_set_; symbol_set_ = true; if (isNotifying()) - notify(ChangeKind.SET, SYMBOL, oldSymbol, symbol, !oldSymbol_set_); + notify(ChangeKind.SET, INTERNAL_SYMBOL, oldSymbol, symbol, !oldSymbol_set_); } /** @@ -485,7 +485,7 @@ symbol = SYMBOL_DEFAULT_; symbol_set_ = false; if (isNotifying()) - notify(ChangeKind.UNSET, SYMBOL, oldSymbol, SYMBOL_DEFAULT_, oldSymbol_set_); + notify(ChangeKind.UNSET, INTERNAL_SYMBOL, oldSymbol, SYMBOL_DEFAULT_, oldSymbol_set_); } /** @@ -519,7 +519,7 @@ boolean oldCompanyName_set_ = companyName_set_; companyName_set_ = true; if (isNotifying()) - notify(ChangeKind.SET, COMPANY_NAME, oldCompanyName, companyName, !oldCompanyName_set_); + notify(ChangeKind.SET, INTERNAL_COMPANY_NAME, oldCompanyName, companyName, !oldCompanyName_set_); } /** @@ -534,7 +534,7 @@ companyName = COMPANY_NAME_DEFAULT_; companyName_set_ = false; if (isNotifying()) - notify(ChangeKind.UNSET, COMPANY_NAME, oldCompanyName, COMPANY_NAME_DEFAULT_, oldCompanyName_set_); + notify(ChangeKind.UNSET, INTERNAL_COMPANY_NAME, oldCompanyName, COMPANY_NAME_DEFAULT_, oldCompanyName_set_); } /** @@ -568,7 +568,7 @@ boolean oldPrice_set_ = price_set_; price_set_ = true; if (isNotifying()) - notify(ChangeKind.SET, PRICE, oldPrice, price, !oldPrice_set_); + notify(ChangeKind.SET, INTERNAL_PRICE, oldPrice, price, !oldPrice_set_); } /** @@ -583,7 +583,7 @@ price = PRICE_DEFAULT_; price_set_ = false; if (isNotifying()) - notify(ChangeKind.UNSET, PRICE, oldPrice, PRICE_DEFAULT_, oldPrice_set_); + notify(ChangeKind.UNSET, INTERNAL_PRICE, oldPrice, PRICE_DEFAULT_, oldPrice_set_); } /** @@ -617,7 +617,7 @@ boolean oldOpen1_set_ = open1_set_; open1_set_ = true; if (isNotifying()) - notify(ChangeKind.SET, OPEN1, oldOpen1, open1, !oldOpen1_set_); + notify(ChangeKind.SET, INTERNAL_OPEN1, oldOpen1, open1, !oldOpen1_set_); } /** @@ -632,7 +632,7 @@ open1 = OPEN1_DEFAULT_; open1_set_ = false; if (isNotifying()) - notify(ChangeKind.UNSET, OPEN1, oldOpen1, OPEN1_DEFAULT_, oldOpen1_set_); + notify(ChangeKind.UNSET, INTERNAL_OPEN1, oldOpen1, OPEN1_DEFAULT_, oldOpen1_set_); } /** @@ -666,7 +666,7 @@ boolean oldHigh_set_ = high_set_; high_set_ = true; if (isNotifying()) - notify(ChangeKind.SET, HIGH, oldHigh, high, !oldHigh_set_); + notify(ChangeKind.SET, INTERNAL_HIGH, oldHigh, high, !oldHigh_set_); } /** @@ -681,7 +681,7 @@ high = HIGH_DEFAULT_; high_set_ = false; if (isNotifying()) - notify(ChangeKind.UNSET, HIGH, oldHigh, HIGH_DEFAULT_, oldHigh_set_); + notify(ChangeKind.UNSET, INTERNAL_HIGH, oldHigh, HIGH_DEFAULT_, oldHigh_set_); } /** @@ -715,7 +715,7 @@ boolean oldLow_set_ = low_set_; low_set_ = true; if (isNotifying()) - notify(ChangeKind.SET, LOW, oldLow, low, !oldLow_set_); + notify(ChangeKind.SET, INTERNAL_LOW, oldLow, low, !oldLow_set_); } /** @@ -730,7 +730,7 @@ low = LOW_DEFAULT_; low_set_ = false; if (isNotifying()) - notify(ChangeKind.UNSET, LOW, oldLow, LOW_DEFAULT_, oldLow_set_); + notify(ChangeKind.UNSET, INTERNAL_LOW, oldLow, LOW_DEFAULT_, oldLow_set_); } /** @@ -764,7 +764,7 @@ boolean oldVolume_set_ = volume_set_; volume_set_ = true; if (isNotifying()) - notify(ChangeKind.SET, VOLUME, oldVolume, volume, !oldVolume_set_); + notify(ChangeKind.SET, INTERNAL_VOLUME, oldVolume, volume, !oldVolume_set_); } /** @@ -779,7 +779,7 @@ volume = VOLUME_DEFAULT_; volume_set_ = false; if (isNotifying()) - notify(ChangeKind.UNSET, VOLUME, oldVolume, VOLUME_DEFAULT_, oldVolume_set_); + notify(ChangeKind.UNSET, INTERNAL_VOLUME, oldVolume, VOLUME_DEFAULT_, oldVolume_set_); } /** @@ -813,7 +813,7 @@ boolean oldChange1_set_ = change1_set_; change1_set_ = true; if (isNotifying()) - notify(ChangeKind.SET, CHANGE1, oldChange1, change1, !oldChange1_set_); + notify(ChangeKind.SET, INTERNAL_CHANGE1, oldChange1, change1, !oldChange1_set_); } /** @@ -828,7 +828,7 @@ change1 = CHANGE1_DEFAULT_; change1_set_ = false; if (isNotifying()) - notify(ChangeKind.UNSET, CHANGE1, oldChange1, CHANGE1_DEFAULT_, oldChange1_set_); + notify(ChangeKind.UNSET, INTERNAL_CHANGE1, oldChange1, CHANGE1_DEFAULT_, oldChange1_set_); } /** Modified: incubator/tuscany/tags/java/sdo/1.0-incubating/tools/src/test/java/com/example/simple/impl/QuoteImpl.java URL: http://svn.apache.org/viewvc/incubator/tuscany/tags/java/sdo/1.0-incubating/tools/src/test/java/com/example/simple/impl/QuoteImpl.java?view=diff&rev=559518&r1=559517&r2=559518 ============================================================================== --- incubator/tuscany/tags/java/sdo/1.0-incubating/tools/src/test/java/com/example/simple/impl/QuoteImpl.java (original) +++ incubator/tuscany/tags/java/sdo/1.0-incubating/tools/src/test/java/com/example/simple/impl/QuoteImpl.java Wed Jul 25 09:42:11 2007 @@ -470,7 +470,7 @@ boolean oldSymbol_set_ = symbol_set_; symbol_set_ = true; if (isNotifying()) - notify(ChangeKind.SET, SYMBOL, oldSymbol, symbol, !oldSymbol_set_); + notify(ChangeKind.SET, INTERNAL_SYMBOL, oldSymbol, symbol, !oldSymbol_set_); } /** @@ -485,7 +485,7 @@ symbol = SYMBOL_DEFAULT_; symbol_set_ = false; if (isNotifying()) - notify(ChangeKind.UNSET, SYMBOL, oldSymbol, SYMBOL_DEFAULT_, oldSymbol_set_); + notify(ChangeKind.UNSET, INTERNAL_SYMBOL, oldSymbol, SYMBOL_DEFAULT_, oldSymbol_set_); } /** @@ -519,7 +519,7 @@ boolean oldCompanyName_set_ = companyName_set_; companyName_set_ = true; if (isNotifying()) - notify(ChangeKind.SET, COMPANY_NAME, oldCompanyName, companyName, !oldCompanyName_set_); + notify(ChangeKind.SET, INTERNAL_COMPANY_NAME, oldCompanyName, companyName, !oldCompanyName_set_); } /** @@ -534,7 +534,7 @@ companyName = COMPANY_NAME_DEFAULT_; companyName_set_ = false; if (isNotifying()) - notify(ChangeKind.UNSET, COMPANY_NAME, oldCompanyName, COMPANY_NAME_DEFAULT_, oldCompanyName_set_); + notify(ChangeKind.UNSET, INTERNAL_COMPANY_NAME, oldCompanyName, COMPANY_NAME_DEFAULT_, oldCompanyName_set_); } /** @@ -568,7 +568,7 @@ boolean oldPrice_set_ = price_set_; price_set_ = true; if (isNotifying()) - notify(ChangeKind.SET, PRICE, oldPrice, price, !oldPrice_set_); + notify(ChangeKind.SET, INTERNAL_PRICE, oldPrice, price, !oldPrice_set_); } /** @@ -583,7 +583,7 @@ price = PRICE_DEFAULT_; price_set_ = false; if (isNotifying()) - notify(ChangeKind.UNSET, PRICE, oldPrice, PRICE_DEFAULT_, oldPrice_set_); + notify(ChangeKind.UNSET, INTERNAL_PRICE, oldPrice, PRICE_DEFAULT_, oldPrice_set_); } /** @@ -617,7 +617,7 @@ boolean oldOpen1_set_ = open1_set_; open1_set_ = true; if (isNotifying()) - notify(ChangeKind.SET, OPEN1, oldOpen1, open1, !oldOpen1_set_); + notify(ChangeKind.SET, INTERNAL_OPEN1, oldOpen1, open1, !oldOpen1_set_); } /** @@ -632,7 +632,7 @@ open1 = OPEN1_DEFAULT_; open1_set_ = false; if (isNotifying()) - notify(ChangeKind.UNSET, OPEN1, oldOpen1, OPEN1_DEFAULT_, oldOpen1_set_); + notify(ChangeKind.UNSET, INTERNAL_OPEN1, oldOpen1, OPEN1_DEFAULT_, oldOpen1_set_); } /** @@ -666,7 +666,7 @@ boolean oldHigh_set_ = high_set_; high_set_ = true; if (isNotifying()) - notify(ChangeKind.SET, HIGH, oldHigh, high, !oldHigh_set_); + notify(ChangeKind.SET, INTERNAL_HIGH, oldHigh, high, !oldHigh_set_); } /** @@ -681,7 +681,7 @@ high = HIGH_DEFAULT_; high_set_ = false; if (isNotifying()) - notify(ChangeKind.UNSET, HIGH, oldHigh, HIGH_DEFAULT_, oldHigh_set_); + notify(ChangeKind.UNSET, INTERNAL_HIGH, oldHigh, HIGH_DEFAULT_, oldHigh_set_); } /** @@ -715,7 +715,7 @@ boolean oldLow_set_ = low_set_; low_set_ = true; if (isNotifying()) - notify(ChangeKind.SET, LOW, oldLow, low, !oldLow_set_); + notify(ChangeKind.SET, INTERNAL_LOW, oldLow, low, !oldLow_set_); } /** @@ -730,7 +730,7 @@ low = LOW_DEFAULT_; low_set_ = false; if (isNotifying()) - notify(ChangeKind.UNSET, LOW, oldLow, LOW_DEFAULT_, oldLow_set_); + notify(ChangeKind.UNSET, INTERNAL_LOW, oldLow, LOW_DEFAULT_, oldLow_set_); } /** @@ -764,7 +764,7 @@ boolean oldVolume_set_ = volume_set_; volume_set_ = true; if (isNotifying()) - notify(ChangeKind.SET, VOLUME, oldVolume, volume, !oldVolume_set_); + notify(ChangeKind.SET, INTERNAL_VOLUME, oldVolume, volume, !oldVolume_set_); } /** @@ -779,7 +779,7 @@ volume = VOLUME_DEFAULT_; volume_set_ = false; if (isNotifying()) - notify(ChangeKind.UNSET, VOLUME, oldVolume, VOLUME_DEFAULT_, oldVolume_set_); + notify(ChangeKind.UNSET, INTERNAL_VOLUME, oldVolume, VOLUME_DEFAULT_, oldVolume_set_); } /** @@ -813,7 +813,7 @@ boolean oldChange1_set_ = change1_set_; change1_set_ = true; if (isNotifying()) - notify(ChangeKind.SET, CHANGE1, oldChange1, change1, !oldChange1_set_); + notify(ChangeKind.SET, INTERNAL_CHANGE1, oldChange1, change1, !oldChange1_set_); } /** @@ -828,7 +828,7 @@ change1 = CHANGE1_DEFAULT_; change1_set_ = false; if (isNotifying()) - notify(ChangeKind.UNSET, CHANGE1, oldChange1, CHANGE1_DEFAULT_, oldChange1_set_); + notify(ChangeKind.UNSET, INTERNAL_CHANGE1, oldChange1, CHANGE1_DEFAULT_, oldChange1_set_); } /** Modified: incubator/tuscany/tags/java/sdo/1.0-incubating/tools/src/test/java/com/example/simple/impl/SimpleFactoryImpl.java URL: http://svn.apache.org/viewvc/incubator/tuscany/tags/java/sdo/1.0-incubating/tools/src/test/java/com/example/simple/impl/SimpleFactoryImpl.java?view=diff&rev=559518&r1=559517&r2=559518 ============================================================================== --- incubator/tuscany/tags/java/sdo/1.0-incubating/tools/src/test/java/com/example/simple/impl/SimpleFactoryImpl.java (original) +++ incubator/tuscany/tags/java/sdo/1.0-incubating/tools/src/test/java/com/example/simple/impl/SimpleFactoryImpl.java Wed Jul 25 09:42:11 2007 @@ -28,18 +28,12 @@ import commonj.sdo.Property; import commonj.sdo.Type; -import org.apache.tuscany.sdo.SDOFactory; - import org.apache.tuscany.sdo.impl.FactoryBase; import org.apache.tuscany.sdo.model.ModelFactory; import org.apache.tuscany.sdo.model.impl.ModelFactoryImpl; -import org.apache.tuscany.sdo.model.internal.InternalFactory; - -import org.apache.tuscany.sdo.util.SDOUtil; - /** * <!-- begin-user-doc --> * An implementation of the model <b>Factory</b>. @@ -94,11 +88,17 @@ * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated - */ - public void register(HelperContext scope) { + */ + public void register(HelperContext scope) + { if(scope == null) { - throw new IllegalArgumentException("Scope can not be null"); - } + throw new IllegalArgumentException("Scope can not be null"); + } + + //Register dependent packages with provided scope + ModelFactory.INSTANCE.register(scope); + + // Initialize this package TypeHelperImpl th = (TypeHelperImpl)scope.getTypeHelper(); th.getExtendedMetaData().putPackage(NAMESPACE_URI, this); } @@ -138,29 +138,25 @@ } - private static boolean isInited = false; - + private static SimpleFactoryImpl instance = null; public static SimpleFactoryImpl init() { - if (isInited) return (SimpleFactoryImpl)FactoryBase.getStaticFactory(SimpleFactoryImpl.NAMESPACE_URI); - SimpleFactoryImpl theSimpleFactoryImpl = new SimpleFactoryImpl(); - isInited = true; - - // Initialize dependencies - SDOUtil.registerStaticTypes(SDOFactory.class); - SDOUtil.registerStaticTypes(ModelFactory.class); - SDOUtil.registerStaticTypes(InternalFactory.class); + if (instance != null ) return instance; + instance = new SimpleFactoryImpl(); + // Initialize dependent packages + ModelFactory ModelFactoryInstance = ModelFactory.INSTANCE; + // Create package meta-data objects - theSimpleFactoryImpl.createMetaData(); + instance.createMetaData(); // Initialize created meta-data - theSimpleFactoryImpl.initializeMetaData(); - + instance.initializeMetaData(); + // Mark meta-data to indicate it can't be changed //theSimpleFactoryImpl.freeze(); //FB do we need to freeze / should we freeze ???? - return theSimpleFactoryImpl; + return instance; } private boolean isCreated = false; @@ -171,7 +167,7 @@ isCreated = true; // Create types and their properties - quoteType = createType(false, QUOTE); + quoteType = createType(false, QUOTE); createProperty(true, quoteType,QuoteImpl.INTERNAL_SYMBOL); createProperty(true, quoteType,QuoteImpl.INTERNAL_COMPANY_NAME); createProperty(true, quoteType,QuoteImpl.INTERNAL_PRICE); @@ -191,7 +187,7 @@ isInitialized = true; // Obtain other dependent packages - ModelFactoryImpl theModelPackageImpl = (ModelFactoryImpl)FactoryBase.getStaticFactory(ModelFactoryImpl.NAMESPACE_URI); + ModelFactoryImpl theModelPackageImpl = (ModelFactoryImpl)ModelFactory.INSTANCE; Property property = null; // Add supertypes to types Modified: incubator/tuscany/tags/java/sdo/1.0-incubating/tools/src/test/java/com/example/subgroup/impl/BImpl.java URL: http://svn.apache.org/viewvc/incubator/tuscany/tags/java/sdo/1.0-incubating/tools/src/test/java/com/example/subgroup/impl/BImpl.java?view=diff&rev=559518&r1=559517&r2=559518 ============================================================================== --- incubator/tuscany/tags/java/sdo/1.0-incubating/tools/src/test/java/com/example/subgroup/impl/BImpl.java (original) +++ incubator/tuscany/tags/java/sdo/1.0-incubating/tools/src/test/java/com/example/subgroup/impl/BImpl.java Wed Jul 25 09:42:11 2007 @@ -147,7 +147,7 @@ boolean oldImInTypeB_set_ = imInTypeB_set_; imInTypeB_set_ = true; if (isNotifying()) - notify(ChangeKind.SET, IM_IN_TYPE_B, oldImInTypeB, imInTypeB, !oldImInTypeB_set_); + notify(ChangeKind.SET, INTERNAL_IM_IN_TYPE_B, oldImInTypeB, imInTypeB, !oldImInTypeB_set_); } /** @@ -162,7 +162,7 @@ imInTypeB = IM_IN_TYPE_B_DEFAULT_; imInTypeB_set_ = false; if (isNotifying()) - notify(ChangeKind.UNSET, IM_IN_TYPE_B, oldImInTypeB, IM_IN_TYPE_B_DEFAULT_, oldImInTypeB_set_); + notify(ChangeKind.UNSET, INTERNAL_IM_IN_TYPE_B, oldImInTypeB, IM_IN_TYPE_B_DEFAULT_, oldImInTypeB_set_); } /** Modified: incubator/tuscany/tags/java/sdo/1.0-incubating/tools/src/test/java/com/example/subgroup/impl/BprimeImpl.java URL: http://svn.apache.org/viewvc/incubator/tuscany/tags/java/sdo/1.0-incubating/tools/src/test/java/com/example/subgroup/impl/BprimeImpl.java?view=diff&rev=559518&r1=559517&r2=559518 ============================================================================== --- incubator/tuscany/tags/java/sdo/1.0-incubating/tools/src/test/java/com/example/subgroup/impl/BprimeImpl.java (original) +++ incubator/tuscany/tags/java/sdo/1.0-incubating/tools/src/test/java/com/example/subgroup/impl/BprimeImpl.java Wed Jul 25 09:42:11 2007 @@ -155,7 +155,7 @@ boolean oldImInTypeBprime_set_ = imInTypeBprime_set_; imInTypeBprime_set_ = true; if (isNotifying()) - notify(ChangeKind.SET, IM_IN_TYPE_BPRIME, oldImInTypeBprime, imInTypeBprime, !oldImInTypeBprime_set_); + notify(ChangeKind.SET, INTERNAL_IM_IN_TYPE_BPRIME, oldImInTypeBprime, imInTypeBprime, !oldImInTypeBprime_set_); } /** @@ -170,7 +170,7 @@ imInTypeBprime = IM_IN_TYPE_BPRIME_DEFAULT_; imInTypeBprime_set_ = false; if (isNotifying()) - notify(ChangeKind.UNSET, IM_IN_TYPE_BPRIME, oldImInTypeBprime, IM_IN_TYPE_BPRIME_DEFAULT_, oldImInTypeBprime_set_); + notify(ChangeKind.UNSET, INTERNAL_IM_IN_TYPE_BPRIME, oldImInTypeBprime, IM_IN_TYPE_BPRIME_DEFAULT_, oldImInTypeBprime_set_); } /** Modified: incubator/tuscany/tags/java/sdo/1.0-incubating/tools/src/test/java/com/example/subgroup/impl/SubgroupFactoryImpl.java URL: http://svn.apache.org/viewvc/incubator/tuscany/tags/java/sdo/1.0-incubating/tools/src/test/java/com/example/subgroup/impl/SubgroupFactoryImpl.java?view=diff&rev=559518&r1=559517&r2=559518 ============================================================================== --- incubator/tuscany/tags/java/sdo/1.0-incubating/tools/src/test/java/com/example/subgroup/impl/SubgroupFactoryImpl.java (original) +++ incubator/tuscany/tags/java/sdo/1.0-incubating/tools/src/test/java/com/example/subgroup/impl/SubgroupFactoryImpl.java Wed Jul 25 09:42:11 2007 @@ -28,18 +28,12 @@ import commonj.sdo.Property; import commonj.sdo.Type; -import org.apache.tuscany.sdo.SDOFactory; - import org.apache.tuscany.sdo.impl.FactoryBase; import org.apache.tuscany.sdo.model.ModelFactory; import org.apache.tuscany.sdo.model.impl.ModelFactoryImpl; -import org.apache.tuscany.sdo.model.internal.InternalFactory; - -import org.apache.tuscany.sdo.util.SDOUtil; - /** * <!-- begin-user-doc --> * An implementation of the model <b>Factory</b>. @@ -96,11 +90,17 @@ * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated - */ - public void register(HelperContext scope) { + */ + public void register(HelperContext scope) + { if(scope == null) { - throw new IllegalArgumentException("Scope can not be null"); - } + throw new IllegalArgumentException("Scope can not be null"); + } + + //Register dependent packages with provided scope + ModelFactory.INSTANCE.register(scope); + + // Initialize this package TypeHelperImpl th = (TypeHelperImpl)scope.getTypeHelper(); th.getExtendedMetaData().putPackage(NAMESPACE_URI, this); } @@ -176,29 +176,25 @@ } - private static boolean isInited = false; - + private static SubgroupFactoryImpl instance = null; public static SubgroupFactoryImpl init() { - if (isInited) return (SubgroupFactoryImpl)FactoryBase.getStaticFactory(SubgroupFactoryImpl.NAMESPACE_URI); - SubgroupFactoryImpl theSubgroupFactoryImpl = new SubgroupFactoryImpl(); - isInited = true; - - // Initialize dependencies - SDOUtil.registerStaticTypes(SDOFactory.class); - SDOUtil.registerStaticTypes(ModelFactory.class); - SDOUtil.registerStaticTypes(InternalFactory.class); + if (instance != null ) return instance; + instance = new SubgroupFactoryImpl(); + // Initialize dependent packages + ModelFactory ModelFactoryInstance = ModelFactory.INSTANCE; + // Create package meta-data objects - theSubgroupFactoryImpl.createMetaData(); + instance.createMetaData(); // Initialize created meta-data - theSubgroupFactoryImpl.initializeMetaData(); - + instance.initializeMetaData(); + // Mark meta-data to indicate it can't be changed //theSubgroupFactoryImpl.freeze(); //FB do we need to freeze / should we freeze ???? - return theSubgroupFactoryImpl; + return instance; } private boolean isCreated = false; @@ -209,12 +205,12 @@ isCreated = true; // Create types and their properties - aType = createType(false, A); + aType = createType(false, A); createProperty(true, aType,AImpl.INTERNAL_GE1_GROUP); createProperty(false, aType,AImpl.INTERNAL_GE1); - bType = createType(false, B); + bType = createType(false, B); createProperty(true, bType,BImpl.INTERNAL_IM_IN_TYPE_B); - bprimeType = createType(false, BPRIME); + bprimeType = createType(false, BPRIME); createProperty(true, bprimeType,BprimeImpl.INTERNAL_IM_IN_TYPE_BPRIME); } @@ -226,7 +222,7 @@ isInitialized = true; // Obtain other dependent packages - ModelFactoryImpl theModelPackageImpl = (ModelFactoryImpl)FactoryBase.getStaticFactory(ModelFactoryImpl.NAMESPACE_URI); + ModelFactoryImpl theModelPackageImpl = (ModelFactoryImpl)ModelFactory.INSTANCE; Property property = null; // Add supertypes to types Modified: incubator/tuscany/tags/java/sdo/1.0-incubating/tools/src/test/java/org/apache/tuscany/sdo/test/CreateTestClasses.java URL: http://svn.apache.org/viewvc/incubator/tuscany/tags/java/sdo/1.0-incubating/tools/src/test/java/org/apache/tuscany/sdo/test/CreateTestClasses.java?view=diff&rev=559518&r1=559517&r2=559518 ============================================================================== --- incubator/tuscany/tags/java/sdo/1.0-incubating/tools/src/test/java/org/apache/tuscany/sdo/test/CreateTestClasses.java (original) +++ incubator/tuscany/tags/java/sdo/1.0-incubating/tools/src/test/java/org/apache/tuscany/sdo/test/CreateTestClasses.java Wed Jul 25 09:42:11 2007 @@ -19,6 +19,7 @@ */ package org.apache.tuscany.sdo.test; +import org.apache.tuscany.sdo.generate.JavaGenerator; import org.apache.tuscany.sdo.generate.XSD2JavaGenerator; /** @@ -38,8 +39,16 @@ } private void run() { - - XSD2JavaGenerator.generateFromXMLSchema(getClass().getResource("/simpleWithChangeSummary.xsd").getFile(), "http://www.example.com/simpleCS", "src/test/java/", "org.example.simple.cs", "CS", 0); + XSD2JavaGenerator.generateFromXMLSchema(getClass().getResource("/CustomerAccount.xsd").getFile(), null, "src/test/java/", null, null, 0); + XSD2JavaGenerator.generateFromXMLSchema(getClass().getResource("/extensible/customer.xsd").getFile(), null, "src/test/java/", null, null, 0); + XSD2JavaGenerator.generateFromXMLSchema(getClass().getResource("/open.xsd").getFile(), null, "src/test/java/", null, null, 0); + XSD2JavaGenerator.generateFromXMLSchema(getClass().getResource("/simpleWithChangeSummary.xsd").getFile(), "http://www.example.com/simpleCS", "src/test/java/", "com.example.simple.cs", "CS", 0); + XSD2JavaGenerator.generateFromXMLSchema(getClass().getResource("/simple.xsd").getFile(), null, "src/test/java/", null, null, 0); + XSD2JavaGenerator.generateFromXMLSchema(getClass().getResource("/simple.xsd").getFile(), null, "src/test/java/", "com.example.noInterfaces.simple", null, JavaGenerator.OPTION_NO_INTERFACES); + + XSD2JavaGenerator.generateFromXMLSchema(getClass().getResource("/repeatingChoice.xsd").getFile(), null, "src/test/java/", null, null, 0); + XSD2JavaGenerator.generateFromXMLSchema(getClass().getResource("/sequences.xsd").getFile(), null, "src/test/java/", null, null, 0); + XSD2JavaGenerator.generateFromXMLSchema(getClass().getResource("/subgroup.xsd").getFile(), null, "src/test/java/", null, null, 0); } Modified: incubator/tuscany/tags/java/sdo/1.0-incubating/tools/templates/models/SDOClass.javajet URL: http://svn.apache.org/viewvc/incubator/tuscany/tags/java/sdo/1.0-incubating/tools/templates/models/SDOClass.javajet?view=diff&rev=559518&r1=559517&r2=559518 ============================================================================== --- incubator/tuscany/tags/java/sdo/1.0-incubating/tools/templates/models/SDOClass.javajet (original) +++ incubator/tuscany/tags/java/sdo/1.0-incubating/tools/templates/models/SDOClass.javajet Wed Jul 25 09:42:11 2007 @@ -189,9 +189,9 @@ int baseCount = base.getFeatureCount(); if (g < baseCount) { - featureValue = base.getClassName() + "." + genFeature.getUpperName(); + featureValue = base.getImportedClassName() + "." + genFeature.getUpperName(); } else { - String baseCountID = base.getClassName() + "." + "SDO_PROPERTY_COUNT"; + String baseCountID = base.getImportedClassName() + "." + "SDO_PROPERTY_COUNT"; featureValue = baseCountID + " + " + Integer.toString(declaredProperties.indexOf(genFeature.getEcoreFeature())); } }%> @@ -210,9 +210,9 @@ int baseCount = base.getFeatureCount(); if (g < baseCount) { - featureValue = base.getClassName() + "." + genFeature.getUpperName(); + featureValue = base.getImportedClassName() + "." + genFeature.getUpperName(); } else { - String baseCountID = base.getClassName() + "." + "EXTENDED_PROPERTY_COUNT"; + String baseCountID = base.getImportedClassName() + "." + "EXTENDED_PROPERTY_COUNT"; featureValue = baseCountID + " + " + Integer.toString(-1 - extendedProperties.indexOf(genFeature.getEcoreFeature())); } }%> @@ -227,7 +227,7 @@ <%featureCount = Integer.toString(declaredPropertiesCount);%> <%}%> <%else {%> - <%String baseCountID = base.getClassName() + "." + "SDO_PROPERTY_COUNT";%> + <%String baseCountID = base.getImportedClassName() + "." + "SDO_PROPERTY_COUNT";%> <%featureCount = baseCountID + " + " + Integer.toString(declaredPropertiesCount);%> <%}%> public final static int SDO_PROPERTY_COUNT = <%=featureCount%>; @@ -239,7 +239,7 @@ <%featureCount = Integer.toString(extendedPropertiesCount*-1);%> <%}%> <%else {%> - <%String baseCountID = base.getClassName() + "." + "EXTENDED_PROPERTY_COUNT";%> + <%String baseCountID = base.getImportedClassName() + "." + "EXTENDED_PROPERTY_COUNT";%> <%featureCount = baseCountID + " - " + Integer.toString(extendedPropertiesCount);%> <%}%> public final static int EXTENDED_PROPERTY_COUNT = <%=featureCount%>; @@ -264,9 +264,9 @@ <%int baseCount = base.getFeatureCount();%> <%if (g < baseCount)%> <%{%> - <%featureValue = base.getClassName() + ".INTERNAL_" + genFeature.getUpperName();%> + <%featureValue = base.getImportedClassName() + ".INTERNAL_" + genFeature.getUpperName();%> <%} else {%> - <%String baseCountID = base.getClassName() + "." + "INTERNAL_PROPERTY_COUNT";%> + <%String baseCountID = base.getImportedClassName() + "." + "INTERNAL_PROPERTY_COUNT";%> <%featureValue = baseCountID + " + " + Integer.toString(g - baseCount);%> <%}%> <%}%> @@ -287,7 +287,7 @@ featureCount = Integer.toString(genClass.getFeatureCount()); } else { - String baseCountID = base.getClassName() + "." + "INTERNAL_PROPERTY_COUNT"; + String baseCountID = base.getImportedClassName() + "." + "INTERNAL_PROPERTY_COUNT"; featureCount = baseCountID + " + " + Integer.toString(genClass.getFeatureCount() - base.getFeatureCount()); }%> public final static int INTERNAL_PROPERTY_COUNT = <%=featureCount%>; --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
