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