IdentifiantMot de passe
Loading...
Mot de passe oublié ?Je m'inscris ! (gratuit)
Navigation

Inscrivez-vous gratuitement
pour pouvoir participer, suivre les réponses en temps réel, voter pour les messages, poser vos propres questions et recevoir la newsletter

Collection et Stream Java Discussion :

Fuites mémoire dans une classe "java.util.HashMap$Entry"


Sujet :

Collection et Stream Java

Vue hybride

Message précédent Message précédent   Message suivant Message suivant
  1. #1
    Membre du Club
    Femme Profil pro
    Étudiant
    Inscrit en
    Février 2012
    Messages
    9
    Détails du profil
    Informations personnelles :
    Sexe : Femme
    Localisation : France, Val de Marne (Île de France)

    Informations professionnelles :
    Activité : Étudiant
    Secteur : High Tech - Matériel informatique

    Informations forums :
    Inscription : Février 2012
    Messages : 9
    Par défaut Fuites mémoire dans une classe "java.util.HashMap$Entry"
    Bonjour,

    Après avoir lu ce topic (http://www.developpez.net/forums/d54...fuite-memoire/) je comprends un peu ce qu'est une fuite mémoire ou pas. Mais moi je rencontre une énorme fuite mémoire sur mon programme que j'ai analysé avec memory analyser tool. Ce profiler m'a indiqué la classe qui a un problème mais je n'arrive pas à comprendre cet histoire de référencement. Je pense que c'est une map qui se remplie et qui gonfle ma mémoire mais pas sur. Je mets un bout de mon code :
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    public class PCCACalculator {
     
    	private static Logger log = Logger.getLogger(PCCACalculator.class);
     
    	private static PCCACalculator INSTANCE;
    	private static Map<String, FormulaContextResolver> mapFormulaContextResolver;
    	private static Map<String, OperandContextResolver> mapOperandContextResolver;
     
     
    	public PCCACalculator()  throws PCCACalculatorException, PCCAException {
    		final String METH = ".PCCACalculator(): ";
     
    		mapFormulaContextResolver = new HashMap<String, FormulaContextResolver>();
    		mapOperandContextResolver = new HashMap<String, OperandContextResolver>();
     
     
    public static PCCACalculator getInstance() throws PCCACalculatorException, PCCAException {
    		if (INSTANCE == null) {
    			INSTANCE = new PCCACalculator();
    		}
    		return INSTANCE;
    	}
    Je pense que c'est aux accès deux niveaux qu'il y a un problème de GC qui finit pas son travail sur l'instance. Pourriez vous m'aidez SVP ?

    Je suis sous Eclipse JDK 1.6

  2. #2
    Modérateur

    Avatar de Robin56
    Homme Profil pro
    Architecte de système d'information
    Inscrit en
    Juin 2009
    Messages
    5 297
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : France, Ille et Vilaine (Bretagne)

    Informations professionnelles :
    Activité : Architecte de système d'information

    Informations forums :
    Inscription : Juin 2009
    Messages : 5 297
    Par défaut
    Ton code joint ne nous donne pas assez d'information puisqu'il ne s'agit seulement que de l'initialisation des Map. Ce que je peux remarquer en tout cas c'est que tu as un Singleton avec des Map en static également mais c'est difficile d'en conclure quelque chose avec ces seuls éléments.
    Responsable Java de Developpez.com (Twitter et Facebook)
    Besoin d'un article/tutoriel/cours sur Java, consulter la page cours
    N'hésitez pas à consulter la FAQ Java et à poser vos questions sur les forums d'entraide Java
    --------
    Architecte Solution
    LinkedIn : https://www.linkedin.com/in/nicolascaudard/

  3. #3
    Modérateur

    Profil pro
    Inscrit en
    Septembre 2004
    Messages
    12 582
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations forums :
    Inscription : Septembre 2004
    Messages : 12 582
    Par défaut
    Citation Envoyé par ladyingold Voir le message
    Je pense que c'est une map qui se remplie et qui gonfle ma mémoire mais pas sur.
    Ben, ça se tient.

    Vérifie où et quand tu mets des choses dans ces maps.
    Vérifie si tu ne passes pas ton temps à y mettre sans arrêt de nouvelles choses (auquel cas, ce n'est pas une fuite mémoire, c'est juste que tu mets de plus en plus de choses en mémoire et qu'à un moment il n'y en a plus assez.)
    Vérifie si tu penses à en enlever tout ce qui ne sert plus.
    N'oubliez pas de consulter les FAQ Java et les cours et tutoriels Java

  4. #4
    Membre du Club
    Femme Profil pro
    Étudiant
    Inscrit en
    Février 2012
    Messages
    9
    Détails du profil
    Informations personnelles :
    Sexe : Femme
    Localisation : France, Val de Marne (Île de France)

    Informations professionnelles :
    Activité : Étudiant
    Secteur : High Tech - Matériel informatique

    Informations forums :
    Inscription : Février 2012
    Messages : 9
    Par défaut
    Alors j'ai regardé le moment ou les maps se remplissent et en effet je remplis les maps mais de "value" mais pour ce remplissage n'est pas indéfini...
    Comment libère t'on une map sil te plait?

  5. #5
    Modérateur

    Avatar de Robin56
    Homme Profil pro
    Architecte de système d'information
    Inscrit en
    Juin 2009
    Messages
    5 297
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : France, Ille et Vilaine (Bretagne)

    Informations professionnelles :
    Activité : Architecte de système d'information

    Informations forums :
    Inscription : Juin 2009
    Messages : 5 297
    Par défaut
    Citation Envoyé par ladyingold Voir le message
    je remplis les maps mais de "value" mais pour ce remplissage n'est pas indéfini...
    Voir le code de ton remplissage de Map nous aiderait davantage car je n'ai pas saisis cette partie de ta phrase.
    Responsable Java de Developpez.com (Twitter et Facebook)
    Besoin d'un article/tutoriel/cours sur Java, consulter la page cours
    N'hésitez pas à consulter la FAQ Java et à poser vos questions sur les forums d'entraide Java
    --------
    Architecte Solution
    LinkedIn : https://www.linkedin.com/in/nicolascaudard/

  6. #6
    Membre du Club
    Femme Profil pro
    Étudiant
    Inscrit en
    Février 2012
    Messages
    9
    Détails du profil
    Informations personnelles :
    Sexe : Femme
    Localisation : France, Val de Marne (Île de France)

    Informations professionnelles :
    Activité : Étudiant
    Secteur : High Tech - Matériel informatique

    Informations forums :
    Inscription : Février 2012
    Messages : 9
    Par défaut
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    31
    32
    33
    34
    35
    36
    37
    38
    39
    40
    41
    42
    43
    44
    45
    46
    47
    48
    49
    50
    51
    52
    53
    54
    55
    56
    57
    58
    59
    60
    61
    62
    63
    64
    65
    66
    67
    68
    69
    70
    71
    72
    73
    74
    75
    76
    77
    78
    79
    80
    81
    82
    83
    84
    85
    86
    87
    88
    89
    90
    91
    92
    93
    94
    95
    96
    97
    98
    99
    100
    101
    102
    103
    104
    105
    106
    107
    108
    109
    110
    111
    112
    113
    114
    115
    116
    117
    118
    119
    120
    121
    122
    123
    124
    125
    126
    127
    128
    129
    130
    131
    132
    133
    134
    135
    136
    137
    138
    139
    140
    141
    142
    143
    144
    145
    146
    147
    148
    149
    150
    151
    152
    153
    154
    155
    156
    157
    158
    159
    160
    161
    162
    163
    164
    165
    166
    167
    168
    169
    170
    171
    172
    173
    174
    175
    176
    177
    178
    179
    180
    181
    182
    183
    184
    185
    186
    187
    188
    189
    190
    191
    192
    193
    194
    195
    196
    197
    198
    199
    200
    201
    202
    203
    204
    205
    206
    207
    208
    209
    210
    211
    212
    213
    214
    215
    216
    217
    218
    219
    220
    221
    222
    223
    224
    225
    226
    227
    228
    229
    230
    231
    232
    233
    234
    235
    236
    237
    238
    239
    240
    241
    242
    243
    244
    245
    246
    247
    248
    249
    250
    251
    252
    253
    254
    255
    256
    257
    258
    259
    260
    261
    262
    263
    264
    265
    266
    267
    268
    269
    270
    271
    272
    273
    274
    275
    276
    277
    278
    279
    280
    281
    282
    283
    284
    285
    286
    287
    288
    289
    290
    291
    292
    293
    294
    295
    296
    297
    298
    299
    300
    301
    302
    303
    304
    305
    306
    307
    308
    309
    310
    311
    312
    313
    314
    315
    316
    317
    318
    319
    320
    321
    322
    323
    324
    325
    326
    327
    328
    329
    330
    331
    332
    333
    334
    335
    336
    337
    338
    339
    340
    341
    342
    343
    344
    345
    346
    347
    348
    349
    350
    351
    352
    353
    354
    355
    356
    357
    358
    359
    360
    361
    362
    363
    364
    365
    366
    367
    368
    369
    370
    371
    372
    373
    374
    375
    376
    377
    378
    379
    380
    381
    382
    383
    384
    385
    386
    387
    388
    389
    390
    391
    392
    393
    394
    395
    396
    397
    398
    399
    400
    401
    402
    403
    404
    405
    406
    407
    408
    409
    410
    411
    412
    413
    414
    415
    416
    417
    418
    419
    420
    421
    422
    423
    424
    425
    426
    427
    428
    429
    430
    431
    432
    433
    434
    435
    436
    437
    438
    439
    440
    441
    442
    443
    444
    445
    446
    447
    448
    449
    450
    451
    452
    453
    454
    455
    456
    457
    458
    459
    460
    461
    462
    463
    464
    465
    466
    467
    468
    469
    470
    471
    472
    473
    474
    475
    476
    477
    478
    479
    480
    481
    482
    483
    484
    485
    486
    487
    488
    489
    490
    491
    492
    493
    494
    495
    496
    497
    498
    499
    500
    501
    502
    503
    504
    505
    506
    507
    508
    509
    510
    511
    512
    513
    514
    515
    516
    517
    518
    519
    520
    521
    522
    523
    524
    525
    526
    527
    528
    529
    530
    531
    532
    533
    534
    535
    536
    537
    538
    539
    540
    541
    542
    543
    544
    545
    546
    547
    548
    549
    550
    551
    552
    553
    554
    555
    556
    557
    558
    559
    560
    561
    562
    563
    564
    565
    566
    567
    568
    569
    570
    571
    572
    573
    574
    575
    576
    577
    578
    579
    580
    581
    582
    583
    584
    585
    586
    587
    588
    589
    590
    591
    592
    593
    594
    595
    596
    597
    598
    599
    600
    601
    602
    603
    604
    605
    606
    607
    608
    609
    610
    611
    612
    613
    614
    615
    616
    617
    618
    public class PCCACalculator {
     
    	private static Logger log = Logger.getLogger(PCCACalculator.class);
     
    	private static PCCACalculator INSTANCE;
    	private static Map<String, FormulaContextResolver> mapFormulaContextResolver;
    	private static Map<String, OperandContextResolver> mapOperandContextResolver;
     
     
    	public PCCACalculator()  throws PCCACalculatorException, PCCAException {
    		final String METH = ".PCCACalculator(): ";
     
    		mapFormulaContextResolver = new HashMap<String, FormulaContextResolver>();
    		mapOperandContextResolver = new HashMap<String, OperandContextResolver>();
     
    		// Configuration de calcul Attribut OI (Order Intake) - uniquement cumul agregat
    		configCalculWithEmptyFormula(AttributName.OrderIntake.value());
    		// Configuration de calcul Attribut R (Revenue) - uniquement cumul agregat
    		configCalculWithEmptyFormula(AttributName.Revenue.value());
    		// Configuration de calcul Attribut CV (Cost Variance) - uniquement cumul agregat
    		configCalculWithEmptyFormula(AttributName.CostVariance.value());
    		// Configuration de calcul Attribut WOI (Weighted Order Intake), avec attribut operande : OI (Order Intake) 
    		configCalculWithWeightingFormula(AttributName.WeightedOrderIntake.value(), AttributName.OrderIntake.value());
    		// Configuration de calcul Attribut WR (Weighted Revenue), avec attribut operande : R (Revenue) 
    		configCalculWithWeightingFormula(AttributName.WeightedRevenue.value(), AttributName.Revenue.value());
    		// Configuration de calcul Attribut OB (OrderBook), avec attributs operandes : WOI (Weighted Order Intake), WR (Weighted Revenue) 
    		configCalculWithApplicatorCumulationOrderBookFormula(AttributName.OrderBook.value(), AttributName.WeightedOrderIntake.value(), AttributName.WeightedRevenue.value());
    		// Configuration de calcul Attribut WOIGM (Gross Margin on Order Intake weighted), avec attribut operande : WOI (Weighted Order Intake) 
    		configCalculWithGrossMarginFormula(AttributName.WeightedOrderIntakeGM.value(), AttributName.WeightedOrderIntake.value());
    		// Configuration de calcul Attribut WRGM (Gross Margin on Revenue weighted), avec attribut operande : WR (Weighted Revenue) 
    		configCalculWithGrossMarginFormula(AttributName.WeightedRevenueGM.value(), AttributName.WeightedRevenue.value());
    		// Configuration de calcul Attribut WCV (Weighted Cost Variance on GM), avec attribut operande : CV (CostVariance), WR (Weighted Revenue) 
    		configCalculWithWeightingCostVarianceFormula(AttributName.WeightedCostVariance.value(), AttributName.CostVariance.value(), AttributName.WeightedRevenue.value());
    		// Configuration de calcul Attribut AWRGM (Adjusted Gross Margin on Revenue balanced), avec attributs operandes : WRGM (Gross Margin on Revenue weighted), WCV (WeeightedCostVariance) 
    		configCalculWithSumFormula(AttributName.AdjustedWeightedRevenueGM.value(), AttributName.WeightedRevenueGM.value(), AttributName.WeightedCostVariance.value());	
    		// Configuration de calcul Attribut isWR (internal somme Weighted Revenue), avec attribut operande : (WR) Weighted Revenue 
    		configCalculWithApplicatorCumulationIdemFormula(AttributName.internalsommeWeightedRevenue.value(), AttributName.WeightedRevenue.value());
    		// Configuration de calcul Attribut isWCV (internal somme Weighted Cost Variance on GM), avec attribut operande : WCV (Weighted Cost Variance on GM) 
    		configCalculWithApplicatorCumulationIdemFormula(AttributName.internalsommeWeightedCostVariance.value(), AttributName.WeightedCostVariance.value());		
    		// Configuration de calcul Attribut AGM% (Adjusted Gross Margin to calculate current & future), avec attributs operandes : isWCV (Weighted Cost Variance on GM), isWR (Weighted Revenue) 
    		configCalculWithPercentAdjustedGrossMarginFormula(AttributName.AdjustedGrossMargin.value(), AttributName.internalsommeWeightedCostVariance.value(), AttributName.internalsommeWeightedRevenue.value());	
     
    		log.debug(METH+"mapFormulaContextResolver:"+mapFormulaContextResolver.toString());
    		log.debug(METH+"mapOperandContextResolver:"+mapOperandContextResolver.toString());
    	}
     
    	public static PCCACalculator getInstance() throws PCCACalculatorException, PCCAException {
    		if (INSTANCE == null) {
    			INSTANCE = new PCCACalculator();
    		}
    		return INSTANCE;
    	}	
     
     
     
    	public void loadOrCalculPCCAProgram(PCCAResult pccaResult, EntityManager em) throws PCCAException, CalculatorException, PCCACalculatorException, PCCADataException, PCCADataRulesException, ContextResolverException
    	{
    		// Si le flag concerne dans la base de donnee est a 0 on fait les calculs
    		if( PCCAAdmin.getSingletonPCCAAdmin(em).getPersistAttribCalculPastOn() )
    			this.loadPCCAProgram( pccaResult, em );
    		else
    			this.calculPCCAProgram( pccaResult, em );
    	}
     
     
    	public void calculPCCAProgram(final PCCAResult pccaResult, EntityManager em) throws PCCACalculatorException, PCCAException, PCCADataException, CalculatorException, ContextResolverException, PCCADataRulesException {
    		if (null != pccaResult) {
    			// Reinitialisation de l'indicteur de calcul
    			pccaResult.getPeriodCalculStatus().resetFullIsCalculated(em);
     
    			this.calculParamAndAttributes( pccaResult, em );
    		}
    	}		
     
    	public void loadOrCalculPCCAPrograms(final PCCASynthesis pccaSynthesis, EntityManager em) throws PCCACalculatorException, PCCAException, PCCADataException, CalculatorException, ContextResolverException, PCCADataRulesException {
    		final String METH = ".calculPCCAPrograms(): ";
    		log.debug(METH+"begin");
    		if (null != pccaSynthesis && !pccaSynthesis.getMapPCCAResult().isEmpty()) {
     
    			// Calcul du PCCAResult de chaque Program
    			for (String progNumber : pccaSynthesis.getMapPCCAResult().keySet()) {
    				loadOrCalculPCCAProgram(pccaSynthesis.getPCCAResult(progNumber), em);
    			}
     
    			// Calcul des Agregats de periodes pour l'ensemble des programs
    			final Map<String, List<Map<String, Float>>> mapPCCAProgramsGrpByAttribut = getMapPCCAProgramsGrpByAttribut(pccaSynthesis.getMapPCCAResult(), em);
    			for (String attributName : mapPCCAProgramsGrpByAttribut.keySet()) {
    				if (!AttributName.isInternalCalcul(attributName) && !(attributName.equals(AttributName.WeightedOrderIntakeGM.value()))) {
    					final List<Map<String, Float>> mapValuesPrograms = mapPCCAProgramsGrpByAttribut.get(attributName);
    					if (null != mapValuesPrograms && !mapValuesPrograms.isEmpty()) {
    						Map<String, Float> mapAgregatPeriodForAttribut = Calculator.sommeContentMapByKey(mapValuesPrograms);
    						pccaSynthesis.setMapSynth(attributName, mapAgregatPeriodForAttribut);
    					}
    				}
    			}
     
    		}
    		log.debug(METH+"end");
    	}
     
    	/**
             * Author : t0110926
             * Date : 06/12/10
             * 
             * Methode permettant d'affecter a pccaResult les valeurs chargees depuis la base de donnes pour le passe
             * et de calculer la valeur pour le futur
             * 
             * Resolution anomalie Mantis 101
             * @param pccaResult
             * @param em
             * @throws PCCAException 
             * @throws ContextResolverException 
             * @throws PCCADataRulesException 
             * @throws PCCADataException 
             * @throws PCCACalculatorException 
             * @throws CalculatorException 
             */
    	public void loadPCCAProgram(PCCAResult pccaResult, EntityManager em) throws PCCAException, CalculatorException, PCCACalculatorException, PCCADataException, PCCADataRulesException, ContextResolverException {
    		if (null != pccaResult) {
    			// Reinitialisation de l'indicteur de calcul
    			pccaResult.getPeriodCalculStatus().resetFullIsCalculated(em);
    			Map<String,Map<String,Float>> map = pccaResult.loadMapDataCalculated(em);
     
    			// On charge les donnes pour la periode passee et on valide le fait qu'ils sont calcules
    			for (String attribut : map.keySet()){
    				pccaResult.setMapData(map.get(attribut), attribut);
    				pccaResult.getPeriodCalculStatus().setIsCalculatedForPastPeriods(pccaResult.getPeriodResolver(), attribut);
    			}
     
    			this.calculParamAndAttributes( pccaResult, em );
    		}
     
    	}
     
    	private void calculParamAndAttributes( PCCAResult pccaResult, EntityManager em )
    			throws PCCAException, CalculatorException, PCCACalculatorException, PCCADataException, PCCADataRulesException, ContextResolverException
    	{
    		if (checkAttributsContents(pccaResult, em)) { 
    			if( ProgramUtils.isOpportunity( pccaResult.getProgNumber() ) )
    				setParamWithParam(ParamName.InitialGrossMargin.value(), ParamName.CurrentAdjustedGrossMargin.value(), pccaResult, em);
    			// Calcul Attribut OI (Order Intake) - uniquement cumul agregat
    			calculAttribut(AttributName.OrderIntake.value(), pccaResult, em);
    			// Calcul Attribut R (Revenue) - uniquement cumul agregat
    			calculAttribut(AttributName.Revenue.value(), pccaResult, em);
    			// Calcul Attribut CV (Cost Variance) - uniquement cumul agregat
    			calculAttribut(AttributName.CostVariance.value(), pccaResult, em);
    			// Calcul Attribut WOI (Weighted Order Intake)
    			calculAttribut(AttributName.WeightedOrderIntake.value(), pccaResult, em);			
    			// Calcul Attribut WR (WeightedRevenue)
    			calculAttribut(AttributName.WeightedRevenue.value(), pccaResult, em);
    			// Calcul Attribut OB (Order Book)
    			calculAttribut(AttributName.OrderBook.value(), pccaResult, em);
    			// Calcul Attribut WOIGM (Gross Margin on Order Intake weighted)
    			calculAttribut(AttributName.WeightedOrderIntakeGM.value(), pccaResult, em);
    			// Calcul Attribut WRGM (Gross Margin on Revenue weighted)
    			calculAttribut(AttributName.WeightedRevenueGM.value(), pccaResult, em);
    			// Calcul Attribut WCV (Weighted Cost Variance on GM)
    			calculAttribut(AttributName.WeightedCostVariance.value(), pccaResult, em);
    			// Calcul Attribut AWRGM (Adjusted Gross Margin on Revenue balanced)
    			calculAttribut(AttributName.AdjustedWeightedRevenueGM.value(), pccaResult, em);
    			// Calcul Attribut isWR (internal somme Weighted Revenue)
    			calculAttribut(AttributName.internalsommeWeightedRevenue.value(), pccaResult, em);
    			// Calcul Attribut isWCV (internal somme Weighted Cost Variance on GM)
    			calculAttribut(AttributName.internalsommeWeightedCostVariance.value(), pccaResult, em);
    			// Calcul Attribut AGM% (Adjusted Gross Margin to calculate current & future)
    			calculAttribut(AttributName.AdjustedGrossMargin.value(), pccaResult, em);
    			// Affectation Attribut AGM% (Adjusted Gross Margin to calculate current & future) periode Passee au Parametre CAGM (Current Adjusted Gross Margin)
    			//setParamWithAttribut(AttributName.AdjustedGrossMargin.value(), PeriodResolver.getKeyPeriodAgregatPast(), ParamName.CurrentAdjustedGrossMargin.value(), pccaResult, em);
    			// Affectation Attribut AGM% (Adjusted Gross Margin to calculate current & future) periode agregat Ensemble Program au Parametre FAGM (FutureAdjustedGrossMargin)
    			setParamWithAttribut(AttributName.AdjustedGrossMargin.value(), PeriodResolver.getKeyPeriodAgregatRootProg(), ParamName.FutureAdjustedGrossMargin.value(), pccaResult, em);
    		}
    	}
     
    	private Map<String, List<Map<String, Float>>> getMapPCCAProgramsGrpByAttribut(final Map<String, PCCAResult> mapPCCAResult, EntityManager em) throws PCCACalculatorException, PCCADataException, PCCAException, PCCADataRulesException {
    		final String METH = ".getMapPCCAProgramsGrpByAttributAndPeriod(): ";
    		log.debug(METH+"begin");
    		final Map<String, List<Map<String, Float>>> mapValuesPrograms = new HashMap<String, List<Map<String, Float>>>();
    		if ( mapPCCAResult != null && !mapPCCAResult.isEmpty()) {
    			for (AttributName attributName : AttributName.getListAllWithoutInternalCalculs()) {
    				final List<Map<String, Float>> listMapsPeriodValuesProgramsForAttribut = getListMapsPeriodValuesProgramsForAttribut(attributName.value(), mapPCCAResult, em);
    				mapValuesPrograms.put(attributName.value(), listMapsPeriodValuesProgramsForAttribut);
    			}
    		}
    		log.debug(METH+"end");
    		return mapValuesPrograms;
    	}
     
    	private List<Map<String, Float>> getListMapsPeriodValuesProgramsForAttribut(final String attributName, final Map<String, PCCAResult> mapPCCAResult, EntityManager em) throws PCCACalculatorException, PCCADataException, PCCAException, PCCADataRulesException {
    		final String METH = ".getMapAgregatAttribut(): ";
    		log.debug(METH+"begin");
    		final List<Map<String, Float>> listMapsPeriodValuesPrograms = new ArrayList<Map<String, Float>>();
    		if ( mapPCCAResult != null && !mapPCCAResult.isEmpty()){
    			for (String progNumber : mapPCCAResult.keySet()) {
    				Map<String, Float> mapDataAttributProgram = new HashMap<String, Float>();
    				mapDataAttributProgram = mapPCCAResult.get(progNumber).getMapData(attributName, em);
    				if (null != mapDataAttributProgram && !mapDataAttributProgram.isEmpty()) {
    					listMapsPeriodValuesPrograms.add(mapDataAttributProgram);
    				}
    			}
    		}
    		log.debug(METH+"end");
    		return listMapsPeriodValuesPrograms;
    	}	
     
    	private boolean checkAttributsContents(final PCCAResult pccaResult,EntityManager em) throws PCCACalculatorException, PCCADataException, PCCAException, PCCADataRulesException {
    		final String METH = ".checkAttributsContents(): ";
    		log.debug(METH+"begin");
    		boolean isCheckAttributsContentsValid = true;
     
    		/**
     
                     * 10/11/2010 : Modification
     
                     *
     
                     * Prise en compte des exigences EB_F05-Capture, EB_F07-Capture, EB_F08-Capture, EB_F09-Capture et EB_F10-Capture
                     * Traitement de l'anomalie 71 definie dans Mantis
     
                     * Suppression de la condition liste vide sur les "if"
                     * Le calcul doit pouvoir etre lance meme si aucune valeur n'est renseignee pour OI, R ou CV
     
                     */
     
    		// Verification existance Attribut OI (Order Intake)
    		//if (null == pccaResult.getMapData(AttributName.OrderIntake.value(), em) || pccaResult.getMapData(AttributName.OrderIntake.value(), em).isEmpty()) {
    		if (null == pccaResult.getMapData(AttributName.OrderIntake.value(), em)) {
    			isCheckAttributsContentsValid = false;
    		}
    		// Verification existance Attribut R (Revenue)
    		//if (null == pccaResult.getMapData(AttributName.Revenue.value(), em) || pccaResult.getMapData(AttributName.Revenue.value(), em).isEmpty()) {
    		if (null == pccaResult.getMapData(AttributName.Revenue.value(), em)) {
    			isCheckAttributsContentsValid = false;
    		}
    		// Verification existance Attribut CV (Cost Variance)
    		//if (null == pccaResult.getMapData(AttributName.CostVariance.value(), em) || pccaResult.getMapData(AttributName.CostVariance.value(), em).isEmpty()) {
    		if (null == pccaResult.getMapData(AttributName.CostVariance.value(), em)) {	
    			isCheckAttributsContentsValid = false;
    		}
    		// Si attributs, Verification Params
    		if (isCheckAttributsContentsValid) {
    			pccaResult.checkMapParamForCalcul();
    		}
    		log.debug(METH+"end-isCheckAttributsContentsValid:"+isCheckAttributsContentsValid);
    		return isCheckAttributsContentsValid;
    	}		
     
     
    	private void setParamWithAttribut(final String attribKey, final String periodKey, final String paramKey , PCCAResult pccaResult, EntityManager em) throws PCCACalculatorException, PCCADataException, PCCAException, PCCADataRulesException {
    		final String METH = ".setParamWithAttribut(): ";
    		log.debug(METH+"begin-attribKey:"+attribKey+", periodKey:"+periodKey+", paramKey:"+paramKey);
    		Float value = null;
    		//Modification pour le calcul de FAGM
    		// fait par T0125118 le 12/07/11
    		if(paramKey.equalsIgnoreCase("FAGM"))
    			value = calculFAGM(pccaResult, em) ;
    		// Recuperation valeur attribut
    		else{
    			if (null != pccaResult.getMapData(attribKey, em) || !pccaResult.getMapData(attribKey, em).isEmpty()) {
    				value = pccaResult.getMapData(attribKey, em).get(periodKey);	
    			}
    		}
    		log.debug(METH+"value:"+value);
    		// Affectation du Parametre
    		pccaResult.setValueParam(value, paramKey);
    		log.debug(METH+"end-value:"+pccaResult.getValueParam(paramKey, em));
    	}	
     
    	/**
             * @author t0125118
             * @brief La fonction calcule la Futur Adjust Gross Margin en sommant les CV et les R conformément à la formule
             *              donnée dans les specs
             * @param pccaResult
             *              La map de données
             * @param em
             *              Entity Manager pour la persistence
             * @return
             *              La FAGM
             * @throws PCCADataException
             * @throws PCCAException
             * @throws PCCADataRulesException
             */
     
     
    	private Float calculFAGM(PCCAResult pccaResult, EntityManager em) throws PCCADataException, PCCAException, PCCADataRulesException {
     
    		/* 
     
    		 L'objectif de cette fonction est de calculer la formule : 
    		  	FAGM = InitialMargin + Somme des WCV / Somme des WR
     
    		  	Avec : 
    		  	- Somme des WCV = CV depuis le debut du projet + (p1 x p2) x WCV futurs
    		  	- Somme des WR  = R  depuis le debut du projet + (p1 x p2) x WR  futurs
     
    		 */
    		Float cvMc,cvA1,cvA2,rMc,rA1,rA2;
     
    		Map<String,Float> mapCV = pccaResult.getMapData("CV", em);
    		Map<String,Float> mapR  = pccaResult.getMapData("R", em);
     
     
    		// AGM
    		Float intialMargin    = pccaResult.getMapParam(em).get(ParamName.InitialGrossMargin.value());
     
    		// CAGM
    		Float currentMargin   = pccaResult.getMapParam(em).get(ParamName.CurrentAdjustedGrossMargin.value());
     
    		// AGM - CAGM
    		Float rapportMargin   = currentMargin/100 - intialMargin;
     
    		//P1
    		Float p1   			  = pccaResult.getMapParam(em).get(ParamName.POne.value());
    		//P2
    		Float p2		      = pccaResult.getMapParam(em).get(ParamName.PTwo.value());
     
     
    		if(mapCV.containsKey("Agr_MC-M12_A00"))
    			cvMc = Float.valueOf(mapCV.get("Agr_MC-M12_A00"));
    		else
    			cvMc = new Float(0);
     
    		if(mapCV.containsKey("Agr_A01")){
    			cvA1 = Float.valueOf(mapCV.get("Agr_A01"));
    		}
    		else{
    			cvA1 = new Float(0);
    		}
    		if(mapCV.containsKey("A02"))
    			cvA2 = Float.valueOf(mapCV.get("A02"));
    		else
    			cvA2 = new Float(0);
     
    		if(mapR.containsKey("Agr_MC-M12_A00"))
    			rMc = Float.valueOf(mapR.get("Agr_MC-M12_A00"));
    		else
    			rMc = new Float(0);
    		if(mapR.containsKey("Agr_A01")){
    			rA1 = Float.valueOf(mapR.get("Agr_A01"));
    		}
    		else{
    			rA1 = new Float(0);
    		}
    		if(mapR.containsKey("A02"))
    			rA2 = Float.valueOf(mapR.get("A02"));
    		else
    			rA2 = new Float(0);	
     
     
    		Float total_WCV =  Float.valueOf(mapCV.get("Agr_Prog-MC")) + //total CV passés
    						  (p1 * p2 ) *( rapportMargin *  rMc  + cvMc ) + //total CV année courante
    						  (p1 * p2 ) *( rapportMargin *  rA1  + cvA1 ) + //total CV année n+1
    						  (p1 * p2 ) *( rapportMargin *  rA2  + cvA2 ); //total CV année n+2
     
    		Float total_WR  =  Float.valueOf(mapR.get( "Agr_Prog-MC")) + //total R passés
    						  (p1 * p2 ) * rMc + //total R  année courante
    						  (p1 * p2 ) * rA1 + //total R année n+1
    						  (p1 * p2 ) * rA2; //total R année n+2
     
     
    		if ( total_WR != 0)
    			return intialMargin + (total_WCV/total_WR);
    		else
    			return intialMargin; 
     
     
     
    	}
     
     
    	private void setParamWithParam( final String paramSourceKey, final String paramTargetKey, PCCAResult pccaResult, EntityManager em )
    			throws PCCACalculatorException, PCCADataException, PCCAException, PCCADataRulesException
    	{
    		final String METH = ".setParamWithParam(): ";
    		log.debug(METH+"begin-paramSourceKey:"+paramSourceKey+", paramTargetKey:"+paramTargetKey);
    		// Recuperation valeur parametre source
    		float sourceValue = pccaResult.getValueParam(paramSourceKey, em);
    		log.debug(METH+"sourceValue:"+sourceValue);
    		if( ParamName.InitialGrossMargin.value().equals( paramSourceKey ) )
    			sourceValue *= 100;
    		if( ParamName.InitialGrossMargin.value().equals( paramTargetKey ) )
    			sourceValue /= 100;
    		log.debug(METH+"targetValue:"+sourceValue);
    		// Affectation du parametre cible
    		pccaResult.setValueParam(sourceValue, paramTargetKey);
    		log.debug(METH+"end");
    	}	
     
    	private void calculAttribut(String aKey, PCCAResult pccaResult, EntityManager em) throws PCCACalculatorException, CalculatorException, ContextResolverException, PCCADataException, PCCAException, PCCADataRulesException {
    		final String METH = ".calculAttribut(): ";
    		log.debug(METH+"///////////////////////////////////////////////////////////////////////////");
    		log.debug(METH+"begin-Calcul:"+aKey);
    		// Calcul Attribut
    		AttributCalculator attribCalcul = new AttributCalculator(aKey, mapFormulaContextResolver.get(aKey), mapOperandContextResolver.get(aKey), pccaResult);
    		attribCalcul.calcul(pccaResult.getPeriodResolver(), em);
    		log.debug(METH+"end-Calcul:"+aKey);
    		log.debug(METH+"///////////////////////////////////////////////////////////////////////////");
    	}	
     
    	// Configuration du Calcul des Attributs
    	////////////////////////////////////////
     
    	private void configCalculWithEmptyFormula(final String aKey) throws PCCACalculatorException {
    		// Configuration de calcul Attribut sans formule - uniquement cumul agregat
    		FormulaContextResolver formulaContextResolver = new FormulaContextResolver(aKey);
    		mapFormulaContextResolver.put(aKey, formulaContextResolver);
     
    		// Configuration de l'algorithme par defaut : EmptyFormula - c'est-a-dire pas de formule
    		FormulaDescriptor formulaDescriptor = new FormulaDescriptor(FormulaName.Empty.value()); 
    		FormulaCtxDescriptor formulaCtxDescriptor = new FormulaCtxDescriptor(formulaDescriptor);
    		formulaContextResolver.setCtxDefault(formulaCtxDescriptor);
    	}	
     
    	private void configCalculWithWeightingFormula(final String aKey, final String aOperKey) throws PCCACalculatorException, PCCAException {
    		final String METH = ".configCalculWithWeightingFormula(): ";	
    		// Configuration de calcul Attribut avec formule Weighting		
    		FormulaContextResolver formulaContextResolver = new FormulaContextResolver(aKey);
    		mapFormulaContextResolver.put(aKey, formulaContextResolver);
    		OperandContextResolver operandContextResolver = new OperandContextResolver(aKey);
    		mapOperandContextResolver.put(aKey, operandContextResolver);
     
    		// Configuration de l'algorithme par defaut : WeightingFormula, avec les parametres P1 et P2
    		FormulaDescriptor formulaDescriptorDefault = new FormulaDescriptor(FormulaName.Weighting.value(), ParamName.POne.value(), ParamName.PTwo.value()); 
    		log.debug(METH+"formulaDescriptorDefault:"+((formulaDescriptorDefault==null)?"null":formulaDescriptorDefault.toString()));
    		FormulaCtxDescriptor formulaCtxDescriptorDefault = new FormulaCtxDescriptor(formulaDescriptorDefault);
    		formulaContextResolver.setCtxDefault(formulaCtxDescriptorDefault);
    		// Configuration de l'operande associee a l'algorithme par defaut : attribut operande : aOperKey 
    		ListOrderedOperAttributDesc listOrderedOperAttributDescDefault = new ListOrderedOperAttributDesc();
    		listOrderedOperAttributDescDefault.addKeyAttribut(aOperKey);
    		operandContextResolver.setCtxDefault(listOrderedOperAttributDescDefault);
     
    		// Configuration de l'algorithme explicite pour les periodes du passe, selectionnees par Selecteur PastPeriodSelector : WeightingFormula, avec le parametre scalaire 1 (representant P1=P2=1)
    		//     On a donc pour le passe : WR = R, WOI = OI, etc ...
    		FormulaDescriptor formulaDescriptorPeriodSelector = new FormulaDescriptor(FormulaName.Weighting.value(), ParamName.ScalaireValueOne.value(), ParamName.ScalaireValueOne.value());
    		log.debug(METH+"formulaDescriptorPeriodSelector:"+((formulaDescriptorPeriodSelector==null)?"null":formulaDescriptorPeriodSelector.toString()));
    		FormulaCtxDescriptor formulaCtxDescriptorPeriodSelector = new FormulaCtxDescriptor(formulaDescriptorPeriodSelector);
    		formulaContextResolver.addCtxForPeriodSelector(PeriodSelectorName.PastPeriodSelector.value(), formulaCtxDescriptorPeriodSelector);		
    	}	
     
    	private void configCalculWithWeightingCostVarianceFormula( final String registeredKey, final String operCVKey, final String operWRKey ) throws PCCACalculatorException, PCCAException
    	{
    		final String METH = ".configCalculWithWeightingCostVarianceFormula(): ";
    		// Configuration de calcul Attribut avec formule WeightingCostVariance
    		FormulaContextResolver formulaContextResolver = new FormulaContextResolver( registeredKey );
    		mapFormulaContextResolver.put( registeredKey, formulaContextResolver );
    		OperandContextResolver operandContextResolver = new OperandContextResolver( registeredKey );
    		mapOperandContextResolver.put( registeredKey, operandContextResolver );
     
    		// Configuration de l'algorithme par defaut : WeightingCostVarianceFormula, avec les parametres P1, P2, GM, CAGM
    		FormulaDescriptor formulaDescriptorDefault = new FormulaDescriptor( FormulaName.WeightingCostVariance.value(),
    				ParamName.POne.value(), ParamName.PTwo.value(), ParamName.InitialGrossMargin.value(), ParamName.CurrentAdjustedGrossMargin.value() );
    		log.debug(METH+"formulaDescriptorDefault:"+((formulaDescriptorDefault==null)?"null":formulaDescriptorDefault.toString()));
    		FormulaCtxDescriptor formulaCtxDescriptorDefault = new FormulaCtxDescriptor( formulaDescriptorDefault );
    		formulaContextResolver.setCtxDefault( formulaCtxDescriptorDefault );
    		// Configuration des operandes associees a l'algorithme par defaut : attribut operande : operCVKey, operWRKey (CV, WR)
    		ListOrderedOperAttributDesc listOrderedOperAttributDescDefault = new ListOrderedOperAttributDesc();
    		listOrderedOperAttributDescDefault.addKeyAttribut( operCVKey );
    		listOrderedOperAttributDescDefault.addKeyAttribut( operWRKey );
    		operandContextResolver.setCtxDefault( listOrderedOperAttributDescDefault );
     
    		// Configuration de l'algorithme explicite pour les periodes du passe, selectionnees par Selecteur PastPeriodSelector :
    		//     WeightingFormula, avec le parametre scalaire 1 pour P1 et P2
    		//     On a donc pour le passe : WCV = CV
    		FormulaDescriptor formulaDescriptorPeriodSelector = new FormulaDescriptor( FormulaName.Weighting.value(), ParamName.ScalaireValueOne.value(), ParamName.ScalaireValueOne.value() );
    		log.debug(METH+"formulaDescriptorPeriodSelector:"+((formulaDescriptorPeriodSelector==null)?"null":formulaDescriptorPeriodSelector.toString()));
    		FormulaCtxDescriptor formulaCtxDescriptorPeriodSelector = new FormulaCtxDescriptor(formulaDescriptorPeriodSelector);
    		formulaContextResolver.addCtxForPeriodSelector(PeriodSelectorName.PastPeriodSelector.value(), formulaCtxDescriptorPeriodSelector);
    		// Configuration des operandes associees a l'algorithme explicite pour les periodes du passe : attribut operande : operCVKey (CV)
    		ListOrderedOperAttributDesc listOrderedOperAttributDescPeriodSelector = new ListOrderedOperAttributDesc();
    		listOrderedOperAttributDescPeriodSelector.addKeyAttribut( operCVKey );
    		operandContextResolver.addCtxForPeriodSelector(PeriodSelectorName.PastPeriodSelector.value(), listOrderedOperAttributDescPeriodSelector);
    	}
     
    	private void configCalculWithApplicatorCumulationOrderBookFormula(final String aKey, final String aOperXKey, final String aOperYKey) throws PCCACalculatorException, PCCAException {
    		final String METH = ".configCalculWithApplicatorCumulationOrderBookFormula(): ";
    		// Configuration de calcul Attribut avec formule applicateur Cumulation et formule OrdersBooked
    		FormulaContextResolver formulaContextResolver = new FormulaContextResolver(aKey);
    		mapFormulaContextResolver.put(aKey, formulaContextResolver);
    		OperandContextResolver operandContextResolver = new OperandContextResolver(aKey);
    		mapOperandContextResolver.put(aKey, operandContextResolver);
     
    		// Configuration de l'algorithme par defaut : OrdersBooked		
    		FormulaDescriptor formulaDescriptorDefault = new FormulaDescriptor(FormulaName.OrdersBooked.value()); 
    		log.debug(METH+"formulaDescriptorDefault:"+((formulaDescriptorDefault==null)?"null":formulaDescriptorDefault.toString()));
    		ExpressionFormApplicatorDescriptor formApplicatorDescriptor = new ExpressionFormApplicatorDescriptor(FormulaApplicatorName.ExpressionCumulation.value()); 
    		log.debug(METH+"formApplicatorDescriptor:"+((formApplicatorDescriptor==null)?"null":formApplicatorDescriptor.toString()));
    		FormulaCtxDescriptor formulaCtxDescriptorDefault = new FormulaCtxDescriptor(formulaDescriptorDefault, formApplicatorDescriptor);
    		formulaContextResolver.setCtxDefault(formulaCtxDescriptorDefault);
    		// Configuration des operandes associees a l'algorithme par defaut : attributs operandes : WOI (Weighted Order Intake), WR (Weighted Revenue) 
    		ListOrderedOperAttributDesc listOrderedOperAttributDescDefault = new ListOrderedOperAttributDesc();
    		listOrderedOperAttributDescDefault.addKeyAttribut(aOperXKey);
    		listOrderedOperAttributDescDefault.addKeyAttribut(aOperYKey);
    		operandContextResolver.setCtxDefault(listOrderedOperAttributDescDefault);
     
    		// Configuration de l'algorithme explicite pour les periodes type Agregat, selectionnees par Selecteur AgregatPeriodSelector : IdemFormula
    		FormulaDescriptor formulaDescriptorPeriodSelector = new FormulaDescriptor(FormulaName.Idem.value());
    		log.debug(METH+"formulaDescriptorPeriodSelector:"+((formulaDescriptorPeriodSelector==null)?"null":formulaDescriptorPeriodSelector.toString()));
    		FormulaCtxDescriptor formulaCtxDescriptorPeriodSelector = new FormulaCtxDescriptor(formulaDescriptorPeriodSelector);
    		formulaContextResolver.addCtxForPeriodSelector(PeriodSelectorName.AgregatPeriodSelector.value(), formulaCtxDescriptorPeriodSelector);
    		// Configuration des operandes associees a l'algorithme explicite pour les periodes type Agregat : attribut operande : OB (Orders Booked) 
    		ListOrderedOperAttributDesc listOrderedOperAttributDescPeriodSelector1 = new ListOrderedOperAttributDesc();
    		listOrderedOperAttributDescPeriodSelector1.addOperAttribValuesDescriptor(new OperAttribValuesDescriptor(aKey, PeriodSelectorName.LastChildPeriodWithSameParentSelector));
    		operandContextResolver.addCtxForPeriodSelector(PeriodSelectorName.AgregatPeriodSelector.value(), listOrderedOperAttributDescPeriodSelector1);
     
    		// Configuration des operandes explicites associees a l'algorithme par defaut pour les periodes selectionnees par le Selecteur FirstChildPeriodSelector:
    		// attributs operandes : OB (Orders Booked)   WOI (Weighted Order Intake), WR (Weighted Revenue)
    		ListOrderedOperAttributDesc listOrderedOperAttributDescPeriodSelector2 = new ListOrderedOperAttributDesc();
    		listOrderedOperAttributDescPeriodSelector2.addOperAttribValuesDescriptor(new OperAttribValuesDescriptor(aKey, PeriodSelectorName.LastPeriodAgregatPredecesorSelector));
    		listOrderedOperAttributDescPeriodSelector2.addKeyAttribut(aOperXKey);
    		listOrderedOperAttributDescPeriodSelector2.addKeyAttribut(aOperYKey);
    		operandContextResolver.addCtxForPeriodSelector(PeriodSelectorName.FirstChildPeriodSelector.value(), listOrderedOperAttributDescPeriodSelector2);		
    	}
     
    	private void configCalculWithGrossMarginFormula(final String aKey, final String aOperKey) throws PCCACalculatorException {
    		final String METH = ".configCalculWithGrossMarginFormula(): ";
    		// Configuration de calcul Attribut avec formule GrossMargin		
    		FormulaContextResolver formulaContextResolver = new FormulaContextResolver(aKey);
    		mapFormulaContextResolver.put(aKey, formulaContextResolver);
    		OperandContextResolver operandContextResolver = new OperandContextResolver(aKey);
    		mapOperandContextResolver.put(aKey, operandContextResolver);
     
    		// Configuration de l'algorithme par defaut : GrossMarginFormula, avec le parametre (Initial Gross Margin)
    		FormulaDescriptor formulaDescriptorDefault = new FormulaDescriptor(FormulaName.GrossMargin.value(), ParamName.InitialGrossMargin.value()); 
    		log.debug(METH+"formulaDescriptorDefault:"+((formulaDescriptorDefault==null)?"null":formulaDescriptorDefault.toString()));
    		FormulaCtxDescriptor formulaCtxDescriptorDefault = new FormulaCtxDescriptor(formulaDescriptorDefault);
    		formulaContextResolver.setCtxDefault(formulaCtxDescriptorDefault);
    		// Configuration de l'operande associee a l'algorithme par defaut : attribut operande : aOperKey 
    		ListOrderedOperAttributDesc listOrderedOperAttributDescDefault = new ListOrderedOperAttributDesc();
    		listOrderedOperAttributDescDefault.addKeyAttribut(aOperKey);
    		operandContextResolver.setCtxDefault(listOrderedOperAttributDescDefault);
    	}	
     
    	private void configCalculWithSumFormula(final String aKey, final String aOperXKey, final String aOperYKey) throws PCCACalculatorException {
    		final String METH = ".configCalculWithSumFormula(): ";	
    		// Configuration de calcul Attribut avec formule Sum		
    		FormulaContextResolver formulaContextResolver = new FormulaContextResolver(aKey);
    		mapFormulaContextResolver.put(aKey, formulaContextResolver);
    		OperandContextResolver operandContextResolver = new OperandContextResolver(aKey);
    		mapOperandContextResolver.put(aKey, operandContextResolver);
     
    		// Configuration de l'algorithme par defaut : SumFormula
    		FormulaDescriptor formulaDescriptorDefault = new FormulaDescriptor(FormulaName.Sum.value()); 
    		log.debug(METH+"formulaDescriptorDefault:"+((formulaDescriptorDefault==null)?"null":formulaDescriptorDefault.toString()));
    		FormulaCtxDescriptor formulaCtxDescriptorDefault = new FormulaCtxDescriptor(formulaDescriptorDefault);
    		formulaContextResolver.setCtxDefault(formulaCtxDescriptorDefault);
    		// Configuration des operandes associees a l'algorithme par defaut : attributs operandes : aOperXKey, aOperYKey  
    		ListOrderedOperAttributDesc listOrderedOperAttributDescDefault = new ListOrderedOperAttributDesc();
    		listOrderedOperAttributDescDefault.addKeyAttribut(aOperXKey);
    		listOrderedOperAttributDescDefault.addKeyAttribut(aOperYKey);
    		operandContextResolver.setCtxDefault(listOrderedOperAttributDescDefault);		
    	}
     
    	private void configCalculWithApplicatorCumulationIdemFormula(final String aKey, final String aOperXKey) throws PCCACalculatorException, PCCAException {
    		final String METH = ".configCalculWithApplicatorCumulationIdemFormula(): ";
    		// Configuration de calcul Attribut avec formule applicateur Cumulation et formule Idem
    		FormulaContextResolver formulaContextResolver = new FormulaContextResolver(aKey);
    		mapFormulaContextResolver.put(aKey, formulaContextResolver);
    		OperandContextResolver operandContextResolver = new OperandContextResolver(aKey);
    		mapOperandContextResolver.put(aKey, operandContextResolver);
     
    		// Configuration de l'algorithme par defaut : Idem		
    		FormulaDescriptor formulaDescriptorDefault = new FormulaDescriptor(FormulaName.Idem.value()); 
    		log.debug(METH+"formulaDescriptorDefault:"+((formulaDescriptorDefault==null)?"null":formulaDescriptorDefault.toString()));
    		ExpressionFormApplicatorDescriptor formApplicatorDescriptor = new ExpressionFormApplicatorDescriptor(FormulaApplicatorName.ExpressionCumulation.value()); 
    		log.debug(METH+"formApplicatorDescriptor:"+((formApplicatorDescriptor==null)?"null":formApplicatorDescriptor.toString()));
    		FormulaCtxDescriptor formulaCtxDescriptorDefault = new FormulaCtxDescriptor(formulaDescriptorDefault, formApplicatorDescriptor);
    		formulaContextResolver.setCtxDefault(formulaCtxDescriptorDefault);
    		// Configuration des operandes associees a l'algorithme par defaut : attribut operande : WR (Weighted Revenue) ou WCV (Weighted Cost Variance on GM)  
    		ListOrderedOperAttributDesc listOrderedOperAttributDescDefault = new ListOrderedOperAttributDesc();
    		listOrderedOperAttributDescDefault.addKeyAttribut(aOperXKey);
    		operandContextResolver.setCtxDefault(listOrderedOperAttributDescDefault);
     
    		// Configuration de l'algorithme explicite pour les periodes type Agregat, selectionnees par Selecteur AgregatPeriodSelector : IdemFormula
    		FormulaDescriptor formulaDescriptorPeriodSelector = new FormulaDescriptor(FormulaName.Idem.value());
    		log.debug(METH+"formulaDescriptorPeriodSelector:"+((formulaDescriptorPeriodSelector==null)?"null":formulaDescriptorPeriodSelector.toString()));
    		FormulaCtxDescriptor formulaCtxDescriptorPeriodSelector = new FormulaCtxDescriptor(formulaDescriptorPeriodSelector);
    		formulaContextResolver.addCtxForPeriodSelector(PeriodSelectorName.AgregatPeriodSelector.value(), formulaCtxDescriptorPeriodSelector);
    		// Configuration des operandes associees a l'algorithme explicite pour les periodes type Agregat : attribut operande : (attribut courant) 
    		ListOrderedOperAttributDesc listOrderedOperAttributDescPeriodSelector1 = new ListOrderedOperAttributDesc();
    		listOrderedOperAttributDescPeriodSelector1.addOperAttribValuesDescriptor(new OperAttribValuesDescriptor(aKey, PeriodSelectorName.LastChildPeriodWithSameParentSelector));
    		operandContextResolver.addCtxForPeriodSelector(PeriodSelectorName.AgregatPeriodSelector.value(), listOrderedOperAttributDescPeriodSelector1);
     
    		// Configuration des operandes explicites associees a l'algorithme par defaut pour les periodes selectionnees par le Selecteur FirstChildPeriodSelector:
    		// attributs operandes :  (attribut courant), WR (Weighted Revenue) ou WCV (Weighted Cost Variance on GM)
    		ListOrderedOperAttributDesc listOrderedOperAttributDescPeriodSelector2 = new ListOrderedOperAttributDesc();
    		listOrderedOperAttributDescPeriodSelector2.addOperAttribValuesDescriptor(new OperAttribValuesDescriptor(aKey, PeriodSelectorName.LastPeriodAgregatPredecesorSelector));
    		listOrderedOperAttributDescPeriodSelector2.addKeyAttribut(aOperXKey);
    		operandContextResolver.addCtxForPeriodSelector(PeriodSelectorName.FirstChildPeriodSelector.value(), listOrderedOperAttributDescPeriodSelector2);		
    	}	
     
    	private void configCalculWithPercentAdjustedGrossMarginFormula(final String aKey, final String aOperXKey, final String aOperYKey) throws PCCACalculatorException, PCCAException {
    		final String METH = ".configCalculWithPercentAdjustedGrossMarginFormula(): ";
    		// Configuration de calcul Attribut avec formule PercentAdjustedGrossMargin
    		FormulaContextResolver formulaContextResolver = new FormulaContextResolver(aKey);
    		mapFormulaContextResolver.put(aKey, formulaContextResolver);
    		OperandContextResolver operandContextResolver = new OperandContextResolver(aKey);
    		mapOperandContextResolver.put(aKey, operandContextResolver);
     
    		// Configuration de l'algorithme par defaut : PercentAdjustedGrossMargin	
    		FormulaDescriptor formulaDescriptorDefault = new FormulaDescriptor(FormulaName.PercentAdjustedGrossMargin.value(), ParamName.InitialGrossMargin.value()); 
    		log.debug(METH+"formulaDescriptorDefault:"+((formulaDescriptorDefault==null)?"null":formulaDescriptorDefault.toString()));
    		FormulaCtxDescriptor formulaCtxDescriptorDefault = new FormulaCtxDescriptor(formulaDescriptorDefault);
    		formulaContextResolver.setCtxDefault(formulaCtxDescriptorDefault);
    		// Configuration des operandes associees a l'algorithme par defaut : attributs operandes : isWCV (Weighted Cost Variance on GM), isWR (Weighted Revenue) 
    		ListOrderedOperAttributDesc listOrderedOperAttributDescDefault = new ListOrderedOperAttributDesc();
    		listOrderedOperAttributDescDefault.addKeyAttribut(aOperXKey);
    		listOrderedOperAttributDescDefault.addKeyAttribut(aOperYKey);
    		operandContextResolver.setCtxDefault(listOrderedOperAttributDescDefault);
     
    		// Configuration de l'algorithme explicite pour les periodes type Agregat, selectionnees par Selecteur AgregatPeriodSelector : IdemFormula
    		FormulaDescriptor formulaDescriptorPeriodSelector = new FormulaDescriptor(FormulaName.Idem.value());
    		log.debug(METH+"formulaDescriptorPeriodSelector:"+((formulaDescriptorPeriodSelector==null)?"null":formulaDescriptorPeriodSelector.toString()));
    		FormulaCtxDescriptor formulaCtxDescriptorPeriodSelector = new FormulaCtxDescriptor(formulaDescriptorPeriodSelector);
    		formulaContextResolver.addCtxForPeriodSelector(PeriodSelectorName.AgregatPeriodSelector.value(), formulaCtxDescriptorPeriodSelector);
    		// Configuration des operandes associees a l'algorithme explicite pour les periodes type Agregat : attribut operande : (attribut courant) 
    		ListOrderedOperAttributDesc listOrderedOperAttributDescPeriodSelector1 = new ListOrderedOperAttributDesc();
    		listOrderedOperAttributDescPeriodSelector1.addOperAttribValuesDescriptor(new OperAttribValuesDescriptor(aKey, PeriodSelectorName.LastChildPeriodWithSameParentSelector));
    		operandContextResolver.addCtxForPeriodSelector(PeriodSelectorName.AgregatPeriodSelector.value(), listOrderedOperAttributDescPeriodSelector1);	
    	}
    J'ai mis mon code en entier j'espere que tu comprendra mieux . Quand je parle de value c'est parce que une Hashmap c'est une cle et une valeur....

  7. #7
    Modérateur

    Profil pro
    Inscrit en
    Septembre 2004
    Messages
    12 582
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations forums :
    Inscription : Septembre 2004
    Messages : 12 582
    Par défaut
    Citation Envoyé par ladyingold Voir le message
    Comment libère t'on une map sil te plait?
    La JavaDoc de Map est assez claire.
    Pour enlever des entrées, c'est les méthodes remove() ou keySet().removeAll()/retainAll().
    Pour enlever toutes les entrées, c'est la méthode clear().
    N'oubliez pas de consulter les FAQ Java et les cours et tutoriels Java

  8. #8
    Membre du Club
    Femme Profil pro
    Étudiant
    Inscrit en
    Février 2012
    Messages
    9
    Détails du profil
    Informations personnelles :
    Sexe : Femme
    Localisation : France, Val de Marne (Île de France)

    Informations professionnelles :
    Activité : Étudiant
    Secteur : High Tech - Matériel informatique

    Informations forums :
    Inscription : Février 2012
    Messages : 9
    Par défaut
    MErci de ces precisions thelvin... En parcourant mon code tu penses que c'estd e la que viendrait le problème?

  9. #9
    Modérateur

    Profil pro
    Inscrit en
    Septembre 2004
    Messages
    12 582
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations forums :
    Inscription : Septembre 2004
    Messages : 12 582
    Par défaut
    Citation Envoyé par ladyingold Voir le message
    MErci de ces precisions thelvin... En parcourant mon code tu penses que c'estd e la que viendrait le problème?
    Je n'en sais rien. Je ne sais pas s'il y a un problème, et s'il y en a un je ne sais pas ce qu'il est ni où il est.
    Il y a trop de code, si tu veux que je fasse un audit dessus, arrange-toi avec mon commercial pour m'embaucher. Et il faudra alors me montrer absolument tout ce que vous avez, comment vous vous en servez, comment le lancer avec quels outils, etc. Pas juste ce petit bout de code.
    N'oubliez pas de consulter les FAQ Java et les cours et tutoriels Java

Discussions similaires

  1. Fuite mémoire sur une classe template.
    Par robinsondesbois dans le forum Langage
    Réponses: 17
    Dernier message: 11/07/2013, 16h38
  2. Passer un selected item dans une classe connexion java
    Par cisco.nat dans le forum Général Java
    Réponses: 14
    Dernier message: 12/06/2013, 18h54
  3. Fuite mémoire dans une fonction
    Par medkyl dans le forum Débuter
    Réponses: 7
    Dernier message: 30/12/2009, 16h19
  4. Fuite mémoire dans une appli dev avec vc++6
    Par devconf77 dans le forum Windows
    Réponses: 1
    Dernier message: 26/08/2008, 08h58

Partager

Partager
  • Envoyer la discussion sur Viadeo
  • Envoyer la discussion sur Twitter
  • Envoyer la discussion sur Google
  • Envoyer la discussion sur Facebook
  • Envoyer la discussion sur Digg
  • Envoyer la discussion sur Delicious
  • Envoyer la discussion sur MySpace
  • Envoyer la discussion sur Yahoo