|
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 |
| package org.objectweb.easybeans.deployment.annotations.helper.bean; |
|
27 |
| |
|
28 |
| import org.objectweb.easybeans.deployment.annotations.exceptions.ResolverException; |
|
29 |
| import org.objectweb.easybeans.deployment.annotations.impl.JLocal; |
|
30 |
| import org.objectweb.easybeans.deployment.annotations.impl.JRemote; |
|
31 |
| import org.objectweb.easybeans.deployment.annotations.metadata.ClassAnnotationMetadata; |
|
32 |
| import org.objectweb.easybeans.deployment.annotations.metadata.EjbJarAnnotationMetadata; |
|
33 |
| |
|
34 |
| |
|
35 |
| |
|
36 |
| |
|
37 |
| |
|
38 |
| |
|
39 |
| public final class InterfaceAnnotatedHelper { |
|
40 |
| |
|
41 |
| |
|
42 |
| |
|
43 |
| |
|
44 |
0
| private InterfaceAnnotatedHelper() {
|
|
45 |
| } |
|
46 |
| |
|
47 |
| |
|
48 |
| |
|
49 |
| |
|
50 |
| |
|
51 |
| |
|
52 |
31
| public static void resolve(final ClassAnnotationMetadata sessionBean) throws ResolverException {
|
|
53 |
| |
|
54 |
31
| EjbJarAnnotationMetadata ejbJarAnnotationMetadata = sessionBean.getEjbJarAnnotationMetadata();
|
|
55 |
| |
|
56 |
| |
|
57 |
31
| JLocal currentLocalInterfaces = sessionBean.getLocalInterfaces();
|
|
58 |
31
| JRemote currentRemoteInterfaces = sessionBean.getRemoteInterfaces();
|
|
59 |
| |
|
60 |
| |
|
61 |
31
| String[] interfaces = sessionBean.getInterfaces();
|
|
62 |
31
| for (String itf : interfaces) {
|
|
63 |
35
| ClassAnnotationMetadata itfAnnotationMetadata = ejbJarAnnotationMetadata.getClassAnnotationMetadata(itf);
|
|
64 |
| |
|
65 |
| |
|
66 |
35
| if (itfAnnotationMetadata != null) {
|
|
67 |
| |
|
68 |
35
| JLocal jLocal = itfAnnotationMetadata.getLocalInterfaces();
|
|
69 |
35
| if (jLocal != null) {
|
|
70 |
0
| if (currentLocalInterfaces == null) {
|
|
71 |
0
| currentLocalInterfaces = new JLocal();
|
|
72 |
0
| sessionBean.setLocalInterfaces(currentLocalInterfaces);
|
|
73 |
| } |
|
74 |
0
| String itfName = itfAnnotationMetadata.getClassName();
|
|
75 |
0
| if (!currentLocalInterfaces.getInterfaces().contains(itfName)) {
|
|
76 |
0
| currentLocalInterfaces.addInterface(itfName);
|
|
77 |
| } |
|
78 |
| } |
|
79 |
| |
|
80 |
| |
|
81 |
35
| JRemote jRemote = itfAnnotationMetadata.getRemoteInterfaces();
|
|
82 |
35
| if (jRemote != null) {
|
|
83 |
0
| if (currentRemoteInterfaces == null) {
|
|
84 |
0
| currentRemoteInterfaces = new JRemote();
|
|
85 |
0
| sessionBean.setRemoteInterfaces(currentRemoteInterfaces);
|
|
86 |
| } |
|
87 |
0
| String itfName = itfAnnotationMetadata.getClassName();
|
|
88 |
0
| if (!currentRemoteInterfaces.getInterfaces().contains(itfName)) {
|
|
89 |
0
| currentRemoteInterfaces.addInterface(itfName);
|
|
90 |
| } |
|
91 |
| } |
|
92 |
| } |
|
93 |
| } |
|
94 |
| } |
|
95 |
| |
|
96 |
| } |