• Ingen resultater fundet

This is a bean class that contains the data of a client. It illustrates how labels are assigned to data types that are used in information exchanges. Please note that some data is labelled as accessible only to thePost principal, and some to both thePostand theCompanyprinciples. Any mix of labels is allowed as long as it is usable in the context of an application.

1 package dk . dtu . s 0 9 4 7 5 8 . shop ;

B.3 Bean object 75

2

3 public c l a s s C l i e n t { 4

5 private S t r i n g{Company<−∗ meet Post<−∗} p e r s o n a l I d ; 6 private S t r i n g{Company<−∗ meet Post<−∗} f i r s t N a m e ; 7 private S t r i n g{Company<−∗ meet Post<−∗} lastName ; 8 private S t r i n g{Post<−∗} c i t y ;

9 private S t r i n g{Post<−∗} s t r e e t ; 10 private i n t{Post<−∗} s tr e e tN u m b e r ; 11

12 public S t r i n g{Post<−∗} g e t C i t y ( ) { 13 return c i t y ;

14 }

15

16 public void s e t C i t y{Post<−∗}( S t r i n g{Post<−∗} c i t y ) { 17 t h i s. c i t y = c i t y ;

18 }

19

20 public S t r i n g{Company<−∗ meet Post<−∗} g e tF i r s tN a m e ( ) { 21 return f i r s t N a m e ;

22 }

23

24 public void s e tF i r s tN a m e{Company<−∗ meet Post<−∗}( S t r i n g{ Company<−∗ meet Post<−∗} f i r s t N a m e ) {

25 t h i s. f i r s t N a m e = f i r s t N a m e ;

26 }

27

28 public S t r i n g{Company<−∗ meet Post<−∗} getLastName ( ) {

29 return lastName ;

30 }

31

32 public void setLastName{Company<−∗ meet Post<−∗}( S t r i n g{Company

<−∗ meet Post<−∗} lastName ) { 33 t h i s. lastName = lastName ;

34 }

35

36 public S t r i n g{Company<−∗ meet Post<−∗} g e t P e r s o n a l I d ( ) { 37 return p e r s o n a l I d ;

38 }

39

40 public void s e t P e r s o n a l I d{Company<−∗ meet Post<−∗}( S t r i n g{ Company<−∗ meet Post<−∗} p e r s o n a l I d ) {

41 t h i s. p e r s o n a l I d = p e r s o n a l I d ;

42 }

43

44 public S t r i n g{Post<−∗} g e t S t r e e t ( ) { 45 return s t r e e t ;

46 }

47

48 public void s e t S t r e e t{Post<−∗}( S t r i n g{Post<−∗} s t r e e t ) { 49 t h i s. s t r e e t = s t r e e t ;

50 }

51

52 public i n t{Post<−∗} g e tS tr e e tN u m b e r ( ) { 53 return s tr e e tN u m b e r ;

54 } 55

56 public void s e tS tr e e tN u m b e r{Post<−∗}(i n t{Post<−∗} s tr e e tN u m b e r ) {

57 t h i s. s tr e e tN u m b e r = s tr e e tN u m b e r ;

58 }

59 }

Listing B.3: Labelled bean class

Appendix C

Experimental code

This appendix contains experimental code that was written as proof-of-concept, but is not part of the final solution.

C.1 Annotation processor

This is a Java annotation processor that parses a custom-annotated Web service class, and generated additional code according to annotations. It uses Java reflection API to extract the information from original code; the source code is never parsed.

It is a proof-of-concept of how meta-data could be exchanged via Web services in a fairly transparent way form the point of view of a developer.

1 package dk . dtu . s 0 9 4 7 5 8 . l i b . p r o c e s s o r ; 2

3 import dk . dtu . s 0 9 4 7 5 8 . l i b . e x c e p t i o n . C l a s s i f i c a t i o n E x c e p t i o n ; 4 import dk . dtu . s 0 9 4 7 5 8 . l i b . c r e d e n t i a l s . C l a s s i f i c a t i o n L e v e l ; 5 import dk . dtu . s 0 9 4 7 5 8 . l i b . c r e d e n t i a l s . A c c e s s C r e d e n t i a l s ; 6 import dk . dtu . s 0 9 4 7 5 8 . l i b . a n n o t a t i o n . C l a s s i f i e d We b Me th o d ; 7 import dk . dtu . s 0 9 4 7 5 8 . l i b . a n n o t a t i o n . C l a s s i f i e d W e b S e r v i c e ; 8 import dk . dtu . s 0 9 4 7 5 8 . l i b . model . C l a s s i f i e d V a r i a b l e ;

9 import dk . dtu . s 0 9 4 7 5 8 . l i b . ws . S u p p o r t s C l a s s i f i c a t i o n ;

10 import j a v a . i o . IOException ; 11 import j a v a . i o . Wr i te r ;

12 import j a v a . l a n g . r e f l e c t . I n v o c a t i o n T a r g e t E x c e p t i o n ; 13 import j a v a . l a n g . r e f l e c t . Method ;

14 import j a v a . u t i l . I t e r a t o r ; 15 import j a v a . u t i l . L i s t ; 16 import j a v a . u t i l . Map ; 17 import j a v a . u t i l . Map . Entry ; 18 import j a v a . u t i l . S e t ;

19 import j a v a . u t i l . l o g g i n g . L e v e l ; 20 import j a v a . u t i l . l o g g i n g . Logger ; 21 import j a v a x . a n n o t a t i o n . Generated ;

22 import j a v a x . a n n o t a t i o n . p r o c e s s i n g . A b s t r a c t P r o c e s s o r ; 23 import j a v a x . a n n o t a t i o n . p r o c e s s i n g . F i l e r ;

24 import j a v a x . a n n o t a t i o n . p r o c e s s i n g . Messager ;

25 import j a v a x . a n n o t a t i o n . p r o c e s s i n g . P r o c e s s i n g E n v i r o n m e n t ; 26 import j a v a x . a n n o t a t i o n . p r o c e s s i n g . RoundEnvironment ;

27 import j a v a x . a n n o t a t i o n . p r o c e s s i n g . SupportedAnn o tatio n Ty p es ; 28 import j a v a x . a n n o t a t i o n . p r o c e s s i n g . S u p p o r t e d S o u r c e V e r s i o n ; 29 import j a v a x . j w s . WebMethod ;

30 import j a v a x . j w s . WebService ;

31 import j a v a x . l a n g . model . S o u r c e V e r s i o n ; 32 import j a v a x . l a n g . model . e l e m e n t . Element ;

33 import j a v a x . l a n g . model . e l e m e n t . E x e c u ta b l e E l e m e n t ; 34 import j a v a x . l a n g . model . e l e m e n t . M o d i f i e r ;

35 import j a v a x . l a n g . model . e l e m e n t . Name ;

36 import j a v a x . l a n g . model . e l e m e n t . PackageElement ; 37 import j a v a x . l a n g . model . e l e m e n t . TypeElement ; 38 import j a v a x . l a n g . model . e l e m e n t . V a r i a b l e E l e m e n t ; 39 import j a v a x . l a n g . model . ty p e . TypeMirror ;

40 import j a v a x . l a n g . model . u t i l . E l e m e n t F i l t e r ; 41 import j a v a x . l a n g . model . u t i l . Elements ; 42 import j a v a x . t o o l s . J a v a F i l e O b j e c t ; 43

44 /∗ ∗

45

46 @author l i n a s

47 ∗/

48 @SupportedAnnotationTypes ( v a l u e = {” dk . dtu . s 0 9 4 7 5 8 . l i b . a n n o t a t i o n . C l a s s i f i e d W e b S e r v i c e ”})

49 @ S u p p o r te d S o u r c e V e r s i o n ( S o u r c e V e r s i o n . RELEASE 6 ) 50 public c l a s s W e b S e r v i c e C l a s s i f i c a t i o n P r o c e s s o r extends

A b s t r a c t P r o c e s s o r { 51

52 private F i l e r f i l e r ; 53 private Messager m e s s a g e r ; 54 private Elements e l e m e n t U t i l s ; 55

56 @Override

57 public void i n i t ( P r o c e s s i n g E n v i r o n m e n t p r o c e s s i n g E n v ) { 58 super. i n i t ( p r o c e s s i n g E n v ) ;

59 f i l e r = p r o c e s s i n g E n v . g e t F i l e r ( ) ; 60 m e s s a g e r = p r o c e s s i n g E n v . g e t M e s s a g e r ( ) ;

61 e l e m e n t U t i l s = p r o c e s s i n g E n v . g e t E l e m e n t U t i l s ( ) ;

62 }

C.1 Annotation processor 79

63

64 @Override

65 public boolean p r o c e s s ( Set<? extends TypeElement> a n n o t a t i o n s ,

RoundEnvironment roundEnvironment) {

66

67 System . out . p r i n t l n ( ” P r o c e s s i n g c l a s s i f i c a t i o n a n n o t a t i o n s . . . ” ) ;

68

69 Set<? extends Element> a n n o ta te d We b S e r v i c e s = roundEnvironment . getElementsAnnotatedWith ( C l a s s i f i e d W e b S e r v i c e .c l a s s) ;

70

71 f o r ( Element a n n o ta te d We b S e r v i c e : a n n o ta te d We b S e r v i c e s ) { 72

73 PackageElement packageElement = e l e m e n t U t i l s .

getPackage O f ( a n n o ta te d We b S e r v i c e ) ; 74

75 Name packageName = packageElement . g e tQ u a l i f i e d N a m e ( ) ; 76 S t r i n g c l a s s i f i e d P a c k a g e N a m e = packageName + ” .

c l a s s i f i e d ” ; 77

78 Name className = a n n o ta te d We b S e r v i c e . getSimpleName ( ) ; 79 Element f u l l C l a s s N a m e = a n n o ta te d We b S e r v i c e ;

80

81 J a v a F i l e O b j e c t j a v a F i l e = n u l l;

82 try {

83 j a v a F i l e = f i l e r . c r e a t e S o u r c e F i l e (

c l a s s i f i e d P a c k a g e N a m e + ” . ” + className ) ;

84 } catch ( IOException ex ) {

85 Logger . g e t L o g g e r ( W e b S e r v i c e C l a s s i f i c a t i o n P r o c e s s o r . c l a s s. getName ( ) ) . l o g ( L e v e l . SEVERE, nul l, ex ) ;

86 }

87

88 Wr i te r w r i t e r = n u l l;

89 try {

90 w r i t e r = j a v a F i l e . o p e n Wr i te r ( ) ; 91

92 w r i t e r . w r i t e ( ” package ” + c l a s s i f i e d P a c k a g e N a m e + ”

;\n” ) ;

93 w r i t e r . w r i t e ( ”\n” ) ;

94

95 C l a s s i f i e d W e b S e r v i c e c l a s s i f i e d W e b S e r v i c e = a n n o ta te d We b S e r v i c e . g e t A n n o t a t i o n ( C l a s s i f i e d W e b S e r v i c e .c l a s s) ;

96 S t r i n g ta r g e tN a m e s p a c e = c l a s s i f i e d W e b S e r v i c e . ta r g e tN a m e s p a c e ( ) ;

97 S t r i n g s e r v i c e N a m e = c l a s s i f i e d W e b S e r v i c e . s e r v i c e N a m e ( ) ;

98 S t r i n g portName = c l a s s i f i e d W e b S e r v i c e . portName ( ) ; 99 S t r i n g w s d l L o c a t i o n = c l a s s i f i e d W e b S e r v i c e .

w s d l L o c a t i o n ( ) ; 100

101 w r i t e r . w r i t e ( ”@” + Generated .c l a s s. getName ( ) + ” (\

” + packageName + ” . ” + className + ”\” )\n” ) ; 102 w r i t e r . w r i t e ( ”@” + S u p p o r t s C l a s s i f i c a t i o n .c l a s s.

getName ( ) + ” ( )\n” ) ;

103 w r i t e r . w r i t e ( ”@” + WebService .c l a s s. getName ( ) + ” ( ta r g e tN a m e s p a c e = \” ” + ta r g e tN a m e s p a c e + ”\” , s e r v i c e N a m e = \” ” + s e r v i c e N a m e + ”\” , portName

= \” ” + portName + ”\” , w s d l L o c a t i o n = \” ” + w s d l L o c a t i o n + ”\” )\n” ) ;

104 w r i t e r . w r i t e ( ” p u b l i c c l a s s ” + className + ” e x t e n d s ” + f u l l C l a s s N a m e + ” {\n” ) ;

105 w r i t e r . w r i t e ( ”\n” ) ;

106

107 f o r ( E x e c u ta b l e E l e m e n t method : E l e m e n t F i l t e r . methodsIn ( a n n o ta te d We b S e r v i c e .

g e t E n c l o s e d E l e m e n t s ( ) ) ) { 108

109 Name methodName = method . getSimpleName ( ) ;

110 TypeMirror r e tu r n T y p e = method . getReturnType ( ) ;

111

112 S t r i n g m o d i f i e r s S t r i n g = b u i l d M o d i f i e r s S t r i n g ( method . g e t M o d i f i e r s ( ) ) ;

113 S t r i n g m e th o d P a r a m e te r s S tr i n g =

b u i l d M e t h o d P a r a m e t e r s S t r i n g ( method . g e t P a r a m e t e r s ( ) ) ;

114 S t r i n g c a l l P a r a m e t e r s S t r i n g =

b u i l d C a l l P a r a m e t e r s S t r i n g ( method . g e t P a r a m e t e r s ( ) ) ;

115

116 C l a s s i f i e d We b Me th o d c l a s s i f i e d W e b M e t h o d = method . g e t A n n o t a t i o n ( C l a s s i f i e d We b M e tho d . c l a s s) ;

117 S t r i n g operationName = c l a s s i f i e d W e b M e t h o d . operationName ( ) ;

118 S t r i n g a c t i o n = c l a s s i f i e d W e b M e t h o d . a c t i o n ( ) ; 119 Boolean e x c l u d e = c l a s s i f i e d W e b M e t h o d . e x c l u d e ( )

;

120 C l a s s i f i c a t i o n L e v e l c l a s s i f i c a t i o n L e v e l = c l a s s i f i e d W e b M e t h o d . c l a s s i f i c a t i o n L e v e l ( ) ; 121

122 w r i t e r . w r i t e ( ” @” + Generated .c l a s s. getName

( ) + ” (\” ” + packageName + ” . ” + className + ” . ” + methodName + ” ( )\” )\n” ) ;

123 w r i t e r . w r i t e ( ” @” + WebMethod .c l a s s. getName

( ) + ” ( operationName = \” ” + operationName + ”\” , a c t i o n = \” ” + a c t i o n + ”\” , e x c l u d e

= ” + e x c l u d e + ” )\n” ) ; 124

125 w r i t e r . w r i t e ( ” ” + m o d i f i e r s S t r i n g + ” ” +

r e tu r n T y p e + ” ” + methodName + ” ( ” + m e th o d P a r a m e te r s S tr i n g + ” ) th r o w s ” + C l a s s i f i c a t i o n E x c e p t i o n .c l a s s. getName ( ) + ”

{\n” ) ;

126 w r i t e r . w r i t e ( ”\n” ) ;

127

128 w r i t e r . w r i t e ( ” ” + C l a s s i f i c a t i o n L e v e l . c l a s s. getName ( ) + ” c l a s s i f i c a t i o n L e v e l = a c c e s s C r e d e n t i a l s . g e t C l a s s i f i c a t i o n L e v e l ( )

C.1 Annotation processor 81

;\n” ) ;

129 w r i t e r . w r i t e ( ”\n” ) ;

130

131 w r i t e r . w r i t e ( ” i f ( c l a s s i f i c a t i o n L e v e l . getNumericValue ( ) < ” + C l a s s i f i c a t i o n L e v e l .c l a s s. getName ( ) + ” . ” +

c l a s s i f i c a t i o n L e v e l . t o S t r i n g ( ) + ” . getNumericValue ( ) ) {\n” ) ;

132 w r i t e r . w r i t e ( ” throw new ” +

C l a s s i f i c a t i o n E x c e p t i o n .c l a s s. getName ( ) + ” ( ) ;\n” ) ;

133 w r i t e r . w r i t e ( ” }\n” ) ;

134 w r i t e r . w r i t e ( ”\n” ) ;

135

136 w r i t e r . w r i t e ( ” ” + r e tu r n T y p e + ”

r e tu r n D a ta = s u p e r . ” + methodName + ” ( ” + c a l l P a r a m e t e r s S t r i n g + ” ) ;\n” ) ;

137 w r i t e r . w r i t e ( ”\n” ) ;

138

139 w r i t e r . w r i t e ( ” C l a s s<? e x t e n d s ” +

r e tu r n T y p e + ”> r e t u r n C l a s s = r e tu r n D a ta . g e t C l a s s ( ) ;\n” ) ;

140 w r i t e r . w r i t e ( ” ” + Method .c l a s s. getName

( ) + ” [ ] methods = r e t u r n C l a s s . getMethods ( )

;\n” ) ;

141 w r i t e r . w r i t e ( ” ” + Map .c l a s s. getName ( ) +

<” + S t r i n g .c l a s s. getName ( ) + ” , ” + C l a s s i f i e d V a r i a b l e .c l a s s. getName ( ) + ”>

c l a s s i f i e d V a r i a b l e M a p = ” +

W e b S e r v i c e C l a s s i f i c a t i o n U t i l s .c l a s s. getName ( ) + ” . b u i l d C l a s s i f i e d V a r i a b l e M a p ( methods )

;\n” ) ;

142 w r i t e r . w r i t e ( ”\n” ) ;

143 w r i t e r . w r i t e ( ” f o r ( ” + I t e r a t o r .c l a s s.

getName ( ) + ”<” + Entry .c l a s s.

getCanonicalName ( ) + ”<” + S t r i n g .c l a s s. getName ( ) + ” , ” + C l a s s i f i e d V a r i a b l e .c l a s s

. getName ( ) + ”>> i t e r a t o r =

c l a s s i f i e d V a r i a b l e M a p . e n t r y S e t ( ) . i t e r a t o r ( )

; i t e r a t o r . hasNext ( ) ; ) {\n” ) ;

144 w r i t e r . w r i t e ( ”\n” ) ;

145 w r i t e r . w r i t e ( ” ” + Entry .c l a s s.

getCanonicalName ( ) + ”<” + S t r i n g .c l a s s. getName ( ) + ” , ” + C l a s s i f i e d V a r i a b l e .c l a s s

. getName ( ) + ”> e n t r y = i t e r a t o r . n e x t ( ) ;\n”

) ;

146 w r i t e r . w r i t e ( ” ” +

C l a s s i f i e d V a r i a b l e .c l a s s. getName ( ) + ” c l a s s i f i e d V a r i a b l e = e n t r y . g e tV a l u e ( ) ;\n” ) ;

147 w r i t e r . w r i t e ( ”\n” ) ;

148 w r i t e r . w r i t e ( ” i f (

c l a s s i f i e d V a r i a b l e . g e t C l a s s i f i e d G e t t e r ( ) . g e t C l a s s i f i c a t i o n L e v e l ( ) . getNumericValue ( )\ n” ) ;

149 w r i t e r . w r i t e ( ” >

c l a s s i f i e d V a r i a b l e . g e t C l a s s i f i e d S e t t e r ( ) . g e t C l a s s i f i c a t i o n L e v e l ( ) . getNumericValue ( ) )

{\n” ) ;

150 w r i t e r . w r i t e ( ”\n” ) ;

151 w r i t e r . w r i t e ( ” throw new ” +

C l a s s i f i c a t i o n E x c e p t i o n .c l a s s. getName ( ) + ” ( ) ;\n” ) ;

152 w r i t e r . w r i t e ( ” }\n” ) ;

153 w r i t e r . w r i t e ( ”\n” ) ;

154 w r i t e r . w r i t e ( ” i f (

c l a s s i f i e d V a r i a b l e . g e t C l a s s i f i e d G e t t e r ( ) . g e t C l a s s i f i c a t i o n L e v e l ( ) . getNumericValue ( )\ n” ) ;

155 w r i t e r . w r i t e ( ” > ” +

C l a s s i f i c a t i o n L e v e l .c l a s s. getName ( ) + ” . ” + c l a s s i f i c a t i o n L e v e l . t o S t r i n g ( ) + ” .

getNumericValue ( ) ) {\n” ) ;

156 w r i t e r . w r i t e ( ”\n” ) ;

157 w r i t e r . w r i t e ( ” ” + Method .c l a s s.

getName ( ) + ” method = c l a s s i f i e d V a r i a b l e . g e t C l a s s i f i e d S e t t e r ( ) . getMethod ( ) ;\n” ) ;

158 w r i t e r . w r i t e ( ” ” + O b j e c t .c l a s s.

getName ( ) + ” n u l l O b j e c t = n u l l ;\n” ) ;

159 w r i t e r . w r i t e ( ”\n” ) ;

160 w r i t e r . w r i t e ( ” t r y {\n” ) ;

161 w r i t e r . w r i t e ( ” method . i n v o k e

( r e tu r n D a ta , n u l l O b j e c t ) ;\n” ) ;

162 w r i t e r . w r i t e ( ” } c a t c h ( ” +

I l l e g a l A c c e s s E x c e p t i o n .c l a s s. getName ( ) + ” ex ) {\n” ) ;

163 w r i t e r . w r i t e ( ” throw new ” +

C l a s s i f i c a t i o n E x c e p t i o n .c l a s s. getName ( ) +

” ( ) ;\n” ) ;

164 w r i t e r . w r i t e ( ” } c a t c h ( ” +

I l l e g a l A r g u m e n t E x c e p t i o n .c l a s s. getName ( ) +

” ex ) {\n” ) ;

165 w r i t e r . w r i t e ( ” throw new ” +

C l a s s i f i c a t i o n E x c e p t i o n .c l a s s. getName ( ) +

” ( ) ;\n” ) ;

166 w r i t e r . w r i t e ( ” } c a t c h ( ” +

I n v o c a t i o n T a r g e t E x c e p t i o n .c l a s s. getName ( ) +

” ex ) {\n” ) ;

167 w r i t e r . w r i t e ( ” throw new ” +

C l a s s i f i c a t i o n E x c e p t i o n .c l a s s. getName ( ) +

” ( ) ;\n” ) ;

168 w r i t e r . w r i t e ( ” }\n” ) ;

169 w r i t e r . w r i t e ( ” }\n” ) ;

170 w r i t e r . w r i t e ( ” }\n” ) ;

171 w r i t e r . w r i t e ( ”\n” ) ;

172

173 w r i t e r . w r i t e ( ” r e t u r n r e tu r n D a ta ;\n” ) ;

174 w r i t e r . w r i t e ( ” }\n” ) ;

175 }

176

177 w r i t e r . w r i t e ( ”}\n” ) ;

C.1 Annotation processor 83

178

179 w r i t e r . f l u s h ( ) ;

180 w r i t e r . c l o s e ( ) ;

181

182 } catch ( IOException ex ) {

183 Logger . g e t L o g g e r ( W e b S e r v i c e C l a s s i f i c a t i o n P r o c e s s o r . c l a s s. getName ( ) ) . l o g ( L e v e l . SEVERE, nul l, ex ) ;

184 }

185 }

186

187 return true;

188 }

189

190 private S t r i n g b u i l d M o d i f i e r s S t r i n g ( Set<M o d i f i e r> m o d i f i e r s ) { 191

192 S t r i n g B u i l d e r m o d i f i e r S t r i n g B u i l d e r = new S t r i n g B u i l d e r ( ) ; 193

194 i f ( ! m o d i f i e r s . isEmpty ( ) ) { 195

196 f o r ( M o d i f i e r m o d i f i e r : m o d i f i e r s ) {

197 m o d i f i e r S t r i n g B u i l d e r . append ( m o d i f i e r . t o S t r i n g ( ) ) ; 198 m o d i f i e r S t r i n g B u i l d e r . append ( ” ” ) ;

199 }

200

201 m o d i f i e r S t r i n g B u i l d e r . d e l e te C h a r A t ( m o d i f i e r S t r i n g B u i l d e r . l e n g t h ( ) 1 ) ;

202 }

203

204 return m o d i f i e r S t r i n g B u i l d e r . t o S t r i n g ( ) ;

205 }

206

207 private S t r i n g b u i l d M e t h o d P a r a m e t e r s S t r i n g ( L i s t<? extends V a r i a b l e E l e m e n t> p a r a m e te r s ) {

208

209 S t r i n g B u i l d e r p a r a m e t e r S t r i n g B u i l d e r = new S t r i n g B u i l d e r ( ) ; 210

211 i f ( ! p a r a m e te r s . isEmpty ( ) ) { 212

213 f o r ( V a r i a b l e E l e m e n t p a r a m e te r : p a r a m e te r s ) { 214

215 S t r i n g parameterName = p a r a m e te r . getSimpleName ( ) .

t o S t r i n g ( ) ;

216 S t r i n g parameterType = p a r a m e te r . asType ( ) . t o S t r i n g ( ) ;

217

218 p a r a m e t e r S t r i n g B u i l d e r . append ( parameterType ) ; 219 p a r a m e t e r S t r i n g B u i l d e r . append ( ” ” ) ;

220 p a r a m e t e r S t r i n g B u i l d e r . append ( parameterName ) ; 221 p a r a m e t e r S t r i n g B u i l d e r . append ( ” , ” ) ;

222 }

223 }

224

225 p a r a m e t e r S t r i n g B u i l d e r . append ( A c c e s s C r e d e n t i a l s .c l a s s. getName ( ) ) ;

226 p a r a m e t e r S t r i n g B u i l d e r . append ( ” ” ) ;

227 p a r a m e t e r S t r i n g B u i l d e r . append ( ” a c c e s s C r e d e n t i a l s ” ) ; 228

229 return p a r a m e t e r S t r i n g B u i l d e r . t o S t r i n g ( ) ;

230 }

231

232 private S t r i n g b u i l d C a l l P a r a m e t e r s S t r i n g ( L i s t<? extends V a r i a b l e E l e m e n t> p a r a m e te r s ) {

233

234 S t r i n g B u i l d e r p a r a m e t e r S t r i n g B u i l d e r = new S t r i n g B u i l d e r ( ) ; 235

236 i f ( ! p a r a m e te r s . isEmpty ( ) ) { 237

238 f o r ( V a r i a b l e E l e m e n t p a r a m e te r : p a r a m e te r s ) { 239

240 S t r i n g parameterName = p a r a m e te r . getSimpleName ( ) .

t o S t r i n g ( ) ; 241

242 p a r a m e t e r S t r i n g B u i l d e r . append ( parameterName ) ; 243 p a r a m e t e r S t r i n g B u i l d e r . append ( ” , ” ) ;

244 }

245

246 p a r a m e t e r S t r i n g B u i l d e r . d e l e t e ( p a r a m e t e r S t r i n g B u i l d e r . l e n g t h ( ) 2 , p a r a m e t e r S t r i n g B u i l d e r . l e n g t h ( ) ) ;

247 }

248

249 return p a r a m e t e r S t r i n g B u i l d e r . t o S t r i n g ( ) ;

250 }

251 }

Listing C.1: Annotation processor

Bibliography

[1] SpringSource a division of VMware. Enterprise Java development tools.

http://www.springsource.com/developer/spring.

[2] Aslan Askarov and Andrei Sabelfeld. Secure implementation of crypto-graphic protocols: A case study of mutual distrust. In In ESORICS.

Springer-Verlag, 2005.

[3] David E Bell and Leonard LaPadula. Secure computer system: Unified exposition and multics interpretation. Technical Report, 44(5):134, 1976.

[4] Paul V. Biron and Ashok Malhotra. XML schema part 2: Datatypes, W3C recommendation. http://www.w3.org/TR/xmlschema-2/, October 2004.

[5] David Booth, Hugo Haas, Francis McCabe, Eric Newcomer, Michael Cham-pion, Chris Ferris, and David Orchard. Web services architecture, W3C working group note 11. http://www.w3.org/TR/ws-arch/, February 2004.

[6] Roberto Chinnici, Marc Hadley, and Rajiv Mordani. The Java API for XML-Based Web Services (JAX-WS) 2.0. Sun Microsystems Inc., 4150 Network Circle Santa Clara, CA 95054 USA, final release edition, April 2006.

[7] Stephen Chong, Jed Liu, Andrew C. Myers, Xin Qi, K. Vikram, Lantian Zheng, and Xin Zheng. Secure web applications via automatic partitioning.

SIGOPS Oper. Syst. Rev., 41:31–44, October 2007.

[8] Stephen Chong, Andrew C. Myers, K. Vikram, and Lantian Zheng. Jif ref-erence manual. http://www.cs.cornell.edu/jif/doc/jif-3.3.0/manual.html, February 2009.

[9] Stephen Chong, K. Vikram, and Andrew C. Myers. Sif: enforcing confiden-tiality and integrity in web applications. InProceedings of 16th USENIX Se-curity Symposium on USENIX SeSe-curity Symposium, pages 1:1–1:16, Berke-ley, CA, USA, 2007. USENIX Association.

[10] Luc Clement, Andrew Hately, Claus von Riegen, Tony Rogers, Tom Bell-wood, Steve Capell, Luc Clement, John Colgrave, Matthew J. Dovey, Daniel Feygin, Andrew Hately, Rob Kochman, Paul Macias, Mirek Novotny, Massimo Paolucci, Claus von Riegen, Tony Rogers, Katia Sycara, Pete Wenzeland, and Zhe Wu. UDDI Version 3.0.2, UDDI Spec Technical Committee Draft. UDDI Spec TC, OASIS, 10 2004.

[11] Dorothy E. Denning and Peter J. Denning. Certification of programs for secure information flow. Commun. ACM, 20:504–513, July 1977.

[12] Dawson Engler.Static analysis versus model checking for bug finding, pages 1–1. Springer-Verlag, London, UK, 2005.

[13] eZ Systems AS. OpenESB community. http://openesb-community.org/.

[14] David C. Fallside and Priscilla Walmsley. XML schema part 0: Primer, W3C recommendation. http://www.w3.org/TR/xmlschema-0/, October 2004.

[15] Robert Bruce Findler and Matthias Felleisen. Contracts for higher-order functions. SIGPLAN Not., 37:48–59, September 2002.

[16] The Apache Software Foundation. Apache ode (orchestration director en-gine). http://ode. apache.org/.

[17] The Apache Software Foundation. Apache struts. http://struts.

apache.org/.

[18] The Eclipse Foundation. BPEL designer project. http://www.eclipse.

org/bpel/.

[19] The Eclipse Foundation. BPEL to Java (B2J) subproject.

http://www.eclipse.org/stp/b2j/.

[20] James Gosling, Bill Joy, Guy Steele, and Gilad Bracha.The Java Language Specification, Third Edition. Addison-Wesley Longman, Amsterdam, 3 edi-tion, June 2005.

[21] Hugo Haas and Allen Brown. Web services glossary, W3C working group note 11. http://www.w3.org/TR/ws-gloss/, February 2004.

[22] David Heinemeier Hansson and Rails core team. Ruby on rails.

http://rubyonrails.org/.

BIBLIOGRAPHY 87

[23] Facebook Inc. Facebook developers documentation. http://developers.

facebook.com/docs/.

[24] Google Inc. Google code apis & tools. http://code.google.com/more/.

[25] IBM iSeries Information Center.Eserver iSeries, Web services, WebSphere Application Server - Express Version 5.1. IBM, 2 edition, August 2005.

[26] Diane Jordan, John Evdemon, Alexandre Alves, Assaf Arkin, Sid Askary, Charlton Barreto, Ben Bloch, Francisco Curbera, Mark Ford, Yaron Goland, Alejandro Gu´ızar, Neelakantan Kartha, Canyang Kevin Liu, Rania Khalaf, Dieter K¨onig, Mike Marin, Vinkesh Mehta, Satish Thatte, Danny van der Rijn, Prasad Yendluri, and Alex Yiu. Web Services Business Pro-cess Execution Language Version 2.0, OASIS Standard. OASIS Web Ser-vices Business Process Execution Language (WSBPEL) Technical Commit-tee, April 2007.

[27] D. Kaye.Loosely Coupled: The Missing Pieces of Web Services. RDS Press, 2003.

[28] Henry George Liddell and Robert Scott. A Greek-English Lexicon. Claren-don Press, Oxford, 1940.

[29] Andrew C. Myers. JFlow: practical mostly-static information flow control.

InProceedings of the 26th ACM SIGPLAN-SIGACT symposium on Princi-ples of programming languages, POPL ’99, pages 228–241, New York, NY, USA, 1999. ACM.

[30] Andrew C. Myers. Mostly-Static Decentralized Information Flow Control.

PhD thesis, Massachusetts Institute of Technology, January 1999.

[31] Andrew C. Myers and Barbara Liskov. Complete, safe information flow with decentralized labels. In19th IEEE Symposium on Research in Security and Privacy (RSP), Oakland, California, May 1998.

[32] Andrew C. Myers and Barbara Liskov. Protecting privacy using the de-centralized label model. ACM Trans. Softw. Eng. Methodol., 9:410–442, October 2000.

[33] Flemming Nielson, Hanne R. Nielson, and Chris Hankin. Principles of Program Analysis. Springer-Verlag New York, Inc., Secaucus, NJ, USA, 1999.

[34] Geoffrey Smith and Dennis Volpano. Secure information flow in a multi-threaded imperative language. In IN PROC. ACM SYMP. ON PRINCI-PLES OF PROGRAMMING LANGUAGES, pages 355–364, 1998.