|
Lines 25-51
Link Here
|
| 25 |
|
25 |
|
| 26 |
private HtmlResponseWriter responseWriter; |
26 |
private HtmlResponseWriter responseWriter; |
| 27 |
private final Map attributes; |
27 |
private final Map attributes; |
|
|
28 |
private final Object lock; |
| 28 |
|
29 |
|
| 29 |
public ServiceStateInfo() { |
30 |
public ServiceStateInfo() { |
| 30 |
attributes = new HashMap(); |
31 |
attributes = new HashMap(); |
|
|
32 |
lock = new Object(); |
| 31 |
} |
33 |
} |
| 32 |
|
34 |
|
| 33 |
/** <p>Sets the given <code>responseWriter</code> for the current request. |
35 |
/** <p>Sets the given <code>responseWriter</code> for the current request. |
| 34 |
* </p> */ |
36 |
* </p> */ |
| 35 |
public void setResponseWriter( final HtmlResponseWriter responseWriter ) { |
37 |
public void setResponseWriter( final HtmlResponseWriter responseWriter ) { |
| 36 |
this.responseWriter = responseWriter; |
38 |
synchronized( lock ) { |
|
|
39 |
this.responseWriter = responseWriter; |
| 40 |
} |
| 37 |
} |
41 |
} |
| 38 |
|
42 |
|
| 39 |
/** <p>Returns the currently set responseWriter.</p> */ |
43 |
/** <p>Returns the currently set responseWriter.</p> */ |
| 40 |
public HtmlResponseWriter getResponseWriter() { |
44 |
public HtmlResponseWriter getResponseWriter() { |
| 41 |
return responseWriter; |
45 |
synchronized( lock ) { |
|
|
46 |
return responseWriter; |
| 47 |
} |
| 42 |
} |
48 |
} |
| 43 |
|
49 |
|
| 44 |
public Object getAttribute( final String key ) { |
50 |
public Object getAttribute( final String key ) { |
| 45 |
return attributes.get( key ); |
51 |
synchronized( lock ) { |
|
|
52 |
return attributes.get( key ); |
| 53 |
} |
| 46 |
} |
54 |
} |
| 47 |
|
55 |
|
| 48 |
public void setAttribute( final String key, final Object value ) { |
56 |
public void setAttribute( final String key, final Object value ) { |
| 49 |
attributes.put( key, value ); |
57 |
synchronized( lock ) { |
|
|
58 |
attributes.put( key, value ); |
| 59 |
} |
| 50 |
} |
60 |
} |
| 51 |
} |
61 |
} |