1
2
3
4
5 package org.andromda.cartridges.ejb.metafacades;
6
7 import java.util.Collection;
8 import org.andromda.core.common.Introspector;
9 import org.andromda.core.metafacade.MetafacadeBase;
10 import org.andromda.core.metafacade.MetafacadeFactory;
11 import org.andromda.core.metafacade.ModelValidationMessage;
12 import org.andromda.metafacades.uml.ClassifierFacade;
13 import org.andromda.metafacades.uml.ConstraintFacade;
14 import org.andromda.metafacades.uml.DependencyFacade;
15 import org.andromda.metafacades.uml.ModelElementFacade;
16 import org.andromda.metafacades.uml.ModelFacade;
17 import org.andromda.metafacades.uml.OperationFacade;
18 import org.andromda.metafacades.uml.PackageFacade;
19 import org.andromda.metafacades.uml.ParameterFacade;
20 import org.andromda.metafacades.uml.StateMachineFacade;
21 import org.andromda.metafacades.uml.StereotypeFacade;
22 import org.andromda.metafacades.uml.TaggedValueFacade;
23 import org.andromda.metafacades.uml.TemplateParameterFacade;
24 import org.andromda.metafacades.uml.TypeMappings;
25
26
27
28
29
30
31
32 public abstract class EJBOperationFacadeLogic
33 extends MetafacadeBase
34 implements EJBOperationFacade
35 {
36
37
38
39
40 protected Object metaObject;
41
42
43
44
45
46 protected EJBOperationFacadeLogic(Object metaObjectIn, String context)
47 {
48 super(metaObjectIn, getContext(context));
49 this.superOperationFacade =
50 (OperationFacade)
51 MetafacadeFactory.getInstance().createFacadeImpl(
52 "org.andromda.metafacades.uml.OperationFacade",
53 metaObjectIn,
54 getContext(context));
55 this.metaObject = metaObjectIn;
56 }
57
58
59
60
61
62
63 private static String getContext(String context)
64 {
65 if (context == null)
66 {
67 context = "org.andromda.cartridges.ejb.metafacades.EJBOperationFacade";
68 }
69 return context;
70 }
71
72 private OperationFacade superOperationFacade;
73 private boolean superOperationFacadeInitialized = false;
74
75
76
77
78
79 private OperationFacade getSuperOperationFacade()
80 {
81 if (!this.superOperationFacadeInitialized)
82 {
83 ((MetafacadeBase)this.superOperationFacade).setMetafacadeContext(this.getMetafacadeContext());
84 this.superOperationFacadeInitialized = true;
85 }
86 return this.superOperationFacade;
87 }
88
89
90
91
92
93 @Override
94 public void resetMetafacadeContext(String context)
95 {
96 if (!this.contextRoot)
97 {
98 context = getContext(context);
99 setMetafacadeContext (context);
100 if (this.superOperationFacadeInitialized)
101 {
102 ((MetafacadeBase)this.superOperationFacade).resetMetafacadeContext(context);
103 }
104 }
105 }
106
107
108
109
110
111 public boolean isEJBOperationFacadeMetaType()
112 {
113 return true;
114 }
115
116
117
118
119
120
121
122 protected abstract String handleGetTransactionType();
123
124 private String __transactionType1a;
125 private boolean __transactionType1aSet = false;
126
127
128
129
130
131 public final String getTransactionType()
132 {
133 String transactionType1a = this.__transactionType1a;
134 if (!this.__transactionType1aSet)
135 {
136
137 transactionType1a = handleGetTransactionType();
138
139 this.__transactionType1a = transactionType1a;
140 if (isMetafacadePropertyCachingEnabled())
141 {
142 this.__transactionType1aSet = true;
143 }
144 }
145 return transactionType1a;
146 }
147
148
149
150
151
152 protected abstract boolean handleIsBusinessOperation();
153
154 private boolean __businessOperation2a;
155 private boolean __businessOperation2aSet = false;
156
157
158
159
160
161 public final boolean isBusinessOperation()
162 {
163 boolean businessOperation2a = this.__businessOperation2a;
164 if (!this.__businessOperation2aSet)
165 {
166
167 businessOperation2a = handleIsBusinessOperation();
168
169 this.__businessOperation2a = businessOperation2a;
170 if (isMetafacadePropertyCachingEnabled())
171 {
172 this.__businessOperation2aSet = true;
173 }
174 }
175 return businessOperation2a;
176 }
177
178
179
180
181
182 protected abstract boolean handleIsSelectMethod();
183
184 private boolean __selectMethod3a;
185 private boolean __selectMethod3aSet = false;
186
187
188
189
190
191 public final boolean isSelectMethod()
192 {
193 boolean selectMethod3a = this.__selectMethod3a;
194 if (!this.__selectMethod3aSet)
195 {
196
197 selectMethod3a = handleIsSelectMethod();
198
199 this.__selectMethod3a = selectMethod3a;
200 if (isMetafacadePropertyCachingEnabled())
201 {
202 this.__selectMethod3aSet = true;
203 }
204 }
205 return selectMethod3a;
206 }
207
208
209
210
211
212 public boolean isOperationFacadeMetaType()
213 {
214 return true;
215 }
216
217
218
219
220
221 public boolean isModelElementFacadeMetaType()
222 {
223 return true;
224 }
225
226
227
228
229
230
231 public void copyTaggedValues(ModelElementFacade element)
232 {
233 this.getSuperOperationFacade().copyTaggedValues(element);
234 }
235
236
237
238
239
240
241 public Object findTaggedValue(String tagName)
242 {
243 return this.getSuperOperationFacade().findTaggedValue(tagName);
244 }
245
246
247
248
249
250
251 public Collection<Object> findTaggedValues(String tagName)
252 {
253 return this.getSuperOperationFacade().findTaggedValues(tagName);
254 }
255
256
257
258
259
260
261
262 public String getBindedFullyQualifiedName(ModelElementFacade bindedElement)
263 {
264 return this.getSuperOperationFacade().getBindedFullyQualifiedName(bindedElement);
265 }
266
267
268
269
270
271 public Collection<ConstraintFacade> getConstraints()
272 {
273 return this.getSuperOperationFacade().getConstraints();
274 }
275
276
277
278
279
280
281 public Collection<ConstraintFacade> getConstraints(String kind)
282 {
283 return this.getSuperOperationFacade().getConstraints(kind);
284 }
285
286
287
288
289
290
291
292 public String getDocumentation(String indent)
293 {
294 return this.getSuperOperationFacade().getDocumentation(indent);
295 }
296
297
298
299
300
301
302
303
304 public String getDocumentation(String indent, int lineLength)
305 {
306 return this.getSuperOperationFacade().getDocumentation(indent, lineLength);
307 }
308
309
310
311
312
313
314
315 public String getDocumentation(String indent, int lineLength, boolean htmlStyle)
316 {
317 return this.getSuperOperationFacade().getDocumentation(indent, lineLength, htmlStyle);
318 }
319
320
321
322
323
324 public String getFullyQualifiedName()
325 {
326 return this.getSuperOperationFacade().getFullyQualifiedName();
327 }
328
329
330
331
332
333
334
335
336 public String getFullyQualifiedName(boolean modelName)
337 {
338 return this.getSuperOperationFacade().getFullyQualifiedName(modelName);
339 }
340
341
342
343
344
345
346 public String getFullyQualifiedNamePath()
347 {
348 return this.getSuperOperationFacade().getFullyQualifiedNamePath();
349 }
350
351
352
353
354
355 public String getId()
356 {
357 return this.getSuperOperationFacade().getId();
358 }
359
360
361
362
363
364
365
366
367
368 public Collection<String> getKeywords()
369 {
370 return this.getSuperOperationFacade().getKeywords();
371 }
372
373
374
375
376
377 public String getLabel()
378 {
379 return this.getSuperOperationFacade().getLabel();
380 }
381
382
383
384
385
386 public TypeMappings getLanguageMappings()
387 {
388 return this.getSuperOperationFacade().getLanguageMappings();
389 }
390
391
392
393
394
395
396 public ModelFacade getModel()
397 {
398 return this.getSuperOperationFacade().getModel();
399 }
400
401
402
403
404
405 public String getName()
406 {
407 return this.getSuperOperationFacade().getName();
408 }
409
410
411
412
413
414 public ModelElementFacade getPackage()
415 {
416 return this.getSuperOperationFacade().getPackage();
417 }
418
419
420
421
422
423 public String getPackageName()
424 {
425 return this.getSuperOperationFacade().getPackageName();
426 }
427
428
429
430
431
432
433 public String getPackageName(boolean modelName)
434 {
435 return this.getSuperOperationFacade().getPackageName(modelName);
436 }
437
438
439
440
441
442 public String getPackagePath()
443 {
444 return this.getSuperOperationFacade().getPackagePath();
445 }
446
447
448
449
450
451
452
453
454 public String getQualifiedName()
455 {
456 return this.getSuperOperationFacade().getQualifiedName();
457 }
458
459
460
461
462
463 public PackageFacade getRootPackage()
464 {
465 return this.getSuperOperationFacade().getRootPackage();
466 }
467
468
469
470
471
472 public Collection<DependencyFacade> getSourceDependencies()
473 {
474 return this.getSuperOperationFacade().getSourceDependencies();
475 }
476
477
478
479
480
481
482 public StateMachineFacade getStateMachineContext()
483 {
484 return this.getSuperOperationFacade().getStateMachineContext();
485 }
486
487
488
489
490
491 public Collection<String> getStereotypeNames()
492 {
493 return this.getSuperOperationFacade().getStereotypeNames();
494 }
495
496
497
498
499
500 public Collection<StereotypeFacade> getStereotypes()
501 {
502 return this.getSuperOperationFacade().getStereotypes();
503 }
504
505
506
507
508
509 public Collection<TaggedValueFacade> getTaggedValues()
510 {
511 return this.getSuperOperationFacade().getTaggedValues();
512 }
513
514
515
516
517
518 public Collection<DependencyFacade> getTargetDependencies()
519 {
520 return this.getSuperOperationFacade().getTargetDependencies();
521 }
522
523
524
525
526
527 public Object getTemplateParameter(String parameterName)
528 {
529 return this.getSuperOperationFacade().getTemplateParameter(parameterName);
530 }
531
532
533
534
535
536 public Collection<TemplateParameterFacade> getTemplateParameters()
537 {
538 return this.getSuperOperationFacade().getTemplateParameters();
539 }
540
541
542
543
544
545
546 public String getVisibility()
547 {
548 return this.getSuperOperationFacade().getVisibility();
549 }
550
551
552
553
554
555
556 public boolean hasExactStereotype(String stereotypeName)
557 {
558 return this.getSuperOperationFacade().hasExactStereotype(stereotypeName);
559 }
560
561
562
563
564
565
566 public boolean hasKeyword(String keywordName)
567 {
568 return this.getSuperOperationFacade().hasKeyword(keywordName);
569 }
570
571
572
573
574
575
576
577
578
579
580
581
582
583 public boolean hasStereotype(String stereotypeName)
584 {
585 return this.getSuperOperationFacade().hasStereotype(stereotypeName);
586 }
587
588
589
590
591
592
593 public boolean isBindingDependenciesPresent()
594 {
595 return this.getSuperOperationFacade().isBindingDependenciesPresent();
596 }
597
598
599
600
601
602 public boolean isConstraintsPresent()
603 {
604 return this.getSuperOperationFacade().isConstraintsPresent();
605 }
606
607
608
609
610
611 public boolean isDocumentationPresent()
612 {
613 return this.getSuperOperationFacade().isDocumentationPresent();
614 }
615
616
617
618
619
620 public boolean isReservedWord()
621 {
622 return this.getSuperOperationFacade().isReservedWord();
623 }
624
625
626
627
628
629
630 public boolean isTemplateParametersPresent()
631 {
632 return this.getSuperOperationFacade().isTemplateParametersPresent();
633 }
634
635
636
637
638
639
640
641 public boolean isValidIdentifierName()
642 {
643 return this.getSuperOperationFacade().isValidIdentifierName();
644 }
645
646
647
648
649
650
651
652 public String translateConstraint(String name, String translation)
653 {
654 return this.getSuperOperationFacade().translateConstraint(name, translation);
655 }
656
657
658
659
660
661 public String[] translateConstraints(String translation)
662 {
663 return this.getSuperOperationFacade().translateConstraints(translation);
664 }
665
666
667
668
669
670 public String[] translateConstraints(String kind, String translation)
671 {
672 return this.getSuperOperationFacade().translateConstraints(kind, translation);
673 }
674
675
676
677
678
679
680 public ParameterFacade findParameter(String name)
681 {
682 return this.getSuperOperationFacade().findParameter(name);
683 }
684
685
686
687
688
689
690
691 public Object findTaggedValue(String name, boolean follow)
692 {
693 return this.getSuperOperationFacade().findTaggedValue(name, follow);
694 }
695
696
697
698
699
700 public String getArgumentNames()
701 {
702 return this.getSuperOperationFacade().getArgumentNames();
703 }
704
705
706
707
708
709 public String getArgumentTypeNames()
710 {
711 return this.getSuperOperationFacade().getArgumentTypeNames();
712 }
713
714
715
716
717
718
719
720
721
722 public Collection<ParameterFacade> getArguments()
723 {
724 return this.getSuperOperationFacade().getArguments();
725 }
726
727
728
729
730
731 public String getCall()
732 {
733 return this.getSuperOperationFacade().getCall();
734 }
735
736
737
738
739
740
741
742 public String getConcurrency()
743 {
744 return this.getSuperOperationFacade().getConcurrency();
745 }
746
747
748
749
750
751
752 public String getExceptionList()
753 {
754 return this.getSuperOperationFacade().getExceptionList();
755 }
756
757
758
759
760
761
762 public String getExceptionList(String initialExceptions)
763 {
764 return this.getSuperOperationFacade().getExceptionList(initialExceptions);
765 }
766
767
768
769
770
771 public Collection<ModelElementFacade> getExceptions()
772 {
773 return this.getSuperOperationFacade().getExceptions();
774 }
775
776
777
778
779
780 public String getGetterSetterReturnTypeName()
781 {
782 return this.getSuperOperationFacade().getGetterSetterReturnTypeName();
783 }
784
785
786
787
788
789
790 public int getLower()
791 {
792 return this.getSuperOperationFacade().getLower();
793 }
794
795
796
797
798
799 public String getMethodBody()
800 {
801 return this.getSuperOperationFacade().getMethodBody();
802 }
803
804
805
806
807
808 public OperationFacade getOverriddenOperation()
809 {
810 return this.getSuperOperationFacade().getOverriddenOperation();
811 }
812
813
814
815
816
817 public ClassifierFacade getOwner()
818 {
819 return this.getSuperOperationFacade().getOwner();
820 }
821
822
823
824
825
826 public Collection<ParameterFacade> getParameters()
827 {
828 return this.getSuperOperationFacade().getParameters();
829 }
830
831
832
833
834
835 public String getPostconditionName()
836 {
837 return this.getSuperOperationFacade().getPostconditionName();
838 }
839
840
841
842
843
844 public Collection<ConstraintFacade> getPostconditions()
845 {
846 return this.getSuperOperationFacade().getPostconditions();
847 }
848
849
850
851
852
853 public String getPreconditionCall()
854 {
855 return this.getSuperOperationFacade().getPreconditionCall();
856 }
857
858
859
860
861
862 public String getPreconditionName()
863 {
864 return this.getSuperOperationFacade().getPreconditionName();
865 }
866
867
868
869
870
871 public String getPreconditionSignature()
872 {
873 return this.getSuperOperationFacade().getPreconditionSignature();
874 }
875
876
877
878
879
880 public Collection<ConstraintFacade> getPreconditions()
881 {
882 return this.getSuperOperationFacade().getPreconditions();
883 }
884
885
886
887
888
889 public ParameterFacade getReturnParameter()
890 {
891 return this.getSuperOperationFacade().getReturnParameter();
892 }
893
894
895
896
897
898 public ClassifierFacade getReturnType()
899 {
900 return this.getSuperOperationFacade().getReturnType();
901 }
902
903
904
905
906
907
908 public String getSignature()
909 {
910 return this.getSuperOperationFacade().getSignature();
911 }
912
913
914
915
916
917
918
919 public String getSignature(boolean withArgumentNames)
920 {
921 return this.getSuperOperationFacade().getSignature(withArgumentNames);
922 }
923
924
925
926
927
928
929 public String getSignature(String argumentModifier)
930 {
931 return this.getSuperOperationFacade().getSignature(argumentModifier);
932 }
933
934
935
936
937
938 public String getTypedArgumentList()
939 {
940 return this.getSuperOperationFacade().getTypedArgumentList();
941 }
942
943
944
945
946
947
948 public String getTypedArgumentList(String modifier)
949 {
950 return this.getSuperOperationFacade().getTypedArgumentList(modifier);
951 }
952
953
954
955
956
957
958 public int getUpper()
959 {
960 return this.getSuperOperationFacade().getUpper();
961 }
962
963
964
965
966
967 public boolean isAbstract()
968 {
969 return this.getSuperOperationFacade().isAbstract();
970 }
971
972
973
974
975
976 public boolean isExceptionsPresent()
977 {
978 return this.getSuperOperationFacade().isExceptionsPresent();
979 }
980
981
982
983
984
985
986 public boolean isLeaf()
987 {
988 return this.getSuperOperationFacade().isLeaf();
989 }
990
991
992
993
994
995
996 public boolean isMany()
997 {
998 return this.getSuperOperationFacade().isMany();
999 }
1000
1001
1002
1003
1004
1005
1006 public boolean isOrdered()
1007 {
1008 return this.getSuperOperationFacade().isOrdered();
1009 }
1010
1011
1012
1013
1014
1015
1016
1017 public boolean isOverriding()
1018 {
1019 return this.getSuperOperationFacade().isOverriding();
1020 }
1021
1022
1023
1024
1025
1026 public boolean isPostconditionsPresent()
1027 {
1028 return this.getSuperOperationFacade().isPostconditionsPresent();
1029 }
1030
1031
1032
1033
1034
1035 public boolean isPreconditionsPresent()
1036 {
1037 return this.getSuperOperationFacade().isPreconditionsPresent();
1038 }
1039
1040
1041
1042
1043
1044 public boolean isQuery()
1045 {
1046 return this.getSuperOperationFacade().isQuery();
1047 }
1048
1049
1050
1051
1052
1053
1054 public boolean isReturnTypePresent()
1055 {
1056 return this.getSuperOperationFacade().isReturnTypePresent();
1057 }
1058
1059
1060
1061
1062
1063 public boolean isStatic()
1064 {
1065 return this.getSuperOperationFacade().isStatic();
1066 }
1067
1068
1069
1070
1071
1072
1073 public boolean isUnique()
1074 {
1075 return this.getSuperOperationFacade().isUnique();
1076 }
1077
1078
1079
1080
1081 @Override
1082 public void initialize()
1083 {
1084 this.getSuperOperationFacade().initialize();
1085 }
1086
1087
1088
1089
1090
1091 @Override
1092 public Object getValidationOwner()
1093 {
1094 Object owner = this.getSuperOperationFacade().getValidationOwner();
1095 return owner;
1096 }
1097
1098
1099
1100
1101
1102 @Override
1103 public String getValidationName()
1104 {
1105 String name = this.getSuperOperationFacade().getValidationName();
1106 return name;
1107 }
1108
1109
1110
1111
1112
1113 @Override
1114 public void validateInvariants(Collection<ModelValidationMessage> validationMessages)
1115 {
1116 this.getSuperOperationFacade().validateInvariants(validationMessages);
1117 }
1118
1119
1120
1121
1122 private static final String NAME_PROPERTY = "name";
1123 private static final String FQNAME_PROPERTY = "fullyQualifiedName";
1124
1125
1126
1127
1128 @Override
1129 public String toString()
1130 {
1131 final StringBuilder toString = new StringBuilder(this.getClass().getName());
1132 toString.append("[");
1133 try
1134 {
1135 toString.append(Introspector.instance().getProperty(this, FQNAME_PROPERTY));
1136 }
1137 catch (final Throwable tryAgain)
1138 {
1139 try
1140 {
1141 toString.append(Introspector.instance().getProperty(this, NAME_PROPERTY));
1142 }
1143 catch (final Throwable ignore)
1144 {
1145
1146 }
1147 }
1148 toString.append("]");
1149 return toString.toString();
1150 }
1151 }