KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > javax > sound > sampled > AudioPermission


1 /*
2  * @(#)AudioPermission.java 1.17 03/12/19
3  *
4  * Copyright 2004 Sun Microsystems, Inc. All rights reserved.
5  * SUN PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
6  */

7
8 package javax.sound.sampled;
9
10 import java.security.BasicPermission JavaDoc;
11
12
13 /**
14  * The <code>AudioPermission</code> class represents access rights to the audio
15  * system resources. An <code>AudioPermission</code> contains a target name
16  * but no actions list; you either have the named permission or you don't.
17  * <p>
18  * The target name is the name of the audio permission (see the table below).
19  * The names follow the hierarchical property-naming convention. Also, an asterisk
20  * can be used to represent all the audio permissions.
21  * <p>
22  * The following table lists the possible <code>AudioPermission</code> target names.
23  * For each name, the table provides a description of exactly what that permission
24  * allows, as well as a discussion of the risks of granting code the permission.
25  * <p>
26  *
27  * <table border=1 cellpadding=5 summary="permission target name, what the permission allows, and associated risks">
28  * <tr>
29  * <th>Permission Target Name</th>
30  * <th>What the Permission Allows</th>
31  * <th>Risks of Allowing this Permission</th>
32  * </tr>
33  *
34  * <tr>
35  * <td>play</td>
36  * <td>Audio playback through the audio device or devices on the system.
37  * Allows the application to obtain and manipulate lines and mixers for
38  * audio playback (rendering).</td>
39  * <td>In some cases use of this permission may affect other
40  * applications because the audio from one line may be mixed with other audio
41  * being played on the system, or because manipulation of a mixer affects the
42  * audio for all lines using that mixer.</td>
43  *</tr>
44  *
45  * <tr>
46  * <td>record</td>
47  * <td>Audio recording through the audio device or devices on the system.
48  * Allows the application to obtain and manipulate lines and mixers for
49  * audio recording (capture).</td>
50  * <td>In some cases use of this permission may affect other
51  * applications because manipulation of a mixer affects the audio for all lines
52  * using that mixer.
53  * This permission can enable an applet or application to eavesdrop on a user.</td>
54  *</tr>
55  *</table>
56  *<p>
57  *
58  * @author Kara Kytle
59  * @version 1.17 03/12/19
60  * @since 1.3
61  */

62 /*
63  * (OLD PERMISSIONS TAKEN OUT FOR 1.2 BETA)
64  *
65  * <tr>
66  * <td>playback device access</td>
67  * <td>Direct access to the audio playback device(s), including configuration of the
68  * playback format, volume, and balance, explicit opening and closing of the device,
69  * etc.</td>
70  * <td>Changes the properties of a shared system device and therefore
71  * can affect other applications.</td>
72  * </tr>
73  *
74  * <tr>
75  * <td>playback device override</td>
76  * <td>Manipulation of the audio playback device(s) in a way that directly conflicts
77  * with use by other applications. This includes closing the device while it is in
78  * use by another application, changing the device format while another application
79  * is using it, etc. </td>
80  * <td>Changes the properties of a shared system device and therefore
81  * can affect other applications.</td>
82  * </tr>
83  *
84  * <tr>
85  * <td>record device access</td>
86  * <td>Direct access to the audio recording device(s), including configuration of the
87  * the record format, volume, and balance, explicit opening and closing of the device,
88  * etc.</td>
89  * <td>Changes the properties of a shared system device and therefore
90  * can affect other applications.</td>
91  * </tr>
92  *
93  * <tr>
94  * <td>record device override</td>
95  * <td>Manipulation of the audio recording device(s) in a way that directly conflicts
96  * with use by other applications. This includes closing the device while it is in
97  * use by another application, changing the device format while another application
98  * is using it, etc. </td>
99  * <td>Changes the properties of a shared system device and therefore
100  * can affect other applications.</td>
101  * </tr>
102  *
103  * </table>
104  *<p>
105  *
106  * @author Kara Kytle
107  * @version 1.17 03/12/19
108  * @since 1.3
109  */

110
111 /*
112  * The <code>AudioPermission</code> class represents access rights to the audio
113  * system resources. An <code>AudioPermission</code> contains a target name
114  * but no actions list; you either have the named permission or you don't.
115  * <p>
116  * The target name is the name of the audio permission (see the table below).
117  * The names follow the hierarchical property-naming convention. Also, an asterisk
118  * can be used to represent all the audio permissions.
119  * <p>
120  * The following table lists all the possible AudioPermission target names.
121  * For each name, the table provides a description of exactly what that permission
122  * allows, as well as a discussion of the risks of granting code the permission.
123  * <p>
124  *
125  * <table border=1 cellpadding=5>
126  * <tr>
127  * <th>Permission Target Name</th>
128  * <th>What the Permission Allows</th>
129  * <th>Risks of Allowing this Permission</th>
130  * </tr>
131  *
132  * <tr>
133  * <td>play</td>
134  * <td>Audio playback through the audio device or devices on the system.</td>
135  * <td>Allows the application to use a system device. Can affect other applications,
136  * because the result will be mixed with other audio being played on the system.</td>
137  *</tr>
138  *
139  * <tr>
140  * <td>record</td>
141  * <td>Recording audio from the audio device or devices on the system,
142  * commonly through a microphone.</td>
143  * <td>Can enable an applet or application to eavesdrop on a user.</td>
144  * </tr>
145  *
146  * <tr>
147  * <td>playback device access</td>
148  * <td>Direct access to the audio playback device(s), including configuration of the
149  * playback format, volume, and balance, explicit opening and closing of the device,
150  * etc.</td>
151  * <td>Changes the properties of a shared system device and therefore
152  * can affect other applications.</td>
153  * </tr>
154  *
155  * <tr>
156  * <td>playback device override</td>
157  * <td>Manipulation of the audio playback device(s) in a way that directly conflicts
158  * with use by other applications. This includes closing the device while it is in
159  * use by another application, changing the device format while another application
160  * is using it, etc. </td>
161  * <td>Changes the properties of a shared system device and therefore
162  * can affect other applications.</td>
163  * </tr>
164  *
165  * <tr>
166  * <td>record device access</td>
167  * <td>Direct access to the audio recording device(s), including configuration of the
168  * the record format, volume, and balance, explicit opening and closing of the device,
169  * etc.</td>
170  * <td>Changes the properties of a shared system device and therefore
171  * can affect other applications.</td>
172  * </tr>
173  *
174  * <tr>
175  * <td>record device override</td>
176  * <td>Manipulation of the audio recording device(s) in a way that directly conflicts
177  * with use by other applications. This includes closing the device while it is in
178  * use by another application, changing the device format while another application
179  * is using it, etc. </td>
180  * <td>Changes the properties of a shared system device and therefore
181  * can affect other applications.</td>
182  * </tr>
183  *
184  * </table>
185  *<p>
186  *
187  * @version 1.17 03/12/19
188  * @author Kara Kytle
189  */

190
191 public class AudioPermission extends BasicPermission JavaDoc {
192     
193     /**
194      * Creates a new <code>AudioPermission</code> object that has the specified
195      * symbolic name, such as "play" or "record". An asterisk can be used to indicate
196      * all audio permissions.
197      * @param name the name of the new <code>AudioPermission</code>
198      * @throws IllegalArgumentException if <code>name</code> is empty
199      */

200     /*
201      * Creates a new <code>AudioPermission</code> object that has the specified
202      * symbolic name, such as "play" or "record". An asterisk can be used to indicate
203      * all audio permissions.
204      * @param name the name of the new <code>AudioPermission</code>
205      */

206     public AudioPermission(String JavaDoc name) {
207     
208     super(name);
209     }
210     
211     /**
212      * Creates a new <code>AudioPermission</code> object that has the specified
213      * symbolic name, such as "play" or "record". The <code>actions</code>
214      * parameter is currently unused and should be <code>null</code>.
215      * @param name the name of the new <code>AudioPermission</code>
216      * @param actions (unused; should be <code>null</code>)
217      * @throws IllegalArgumentException if <code>name</code> is empty
218      */

219     /*
220      * Creates a new AudioPermission object that has the specified
221      * symbolic name, such as "play" or "record". The <code>actions</code>
222      * parameter is currently unused and should be <code>null</code>.
223      * @param name the name of the new <code>AudioPermission</code>
224      * @param actions (unused; should be <code>null</code>)
225      */

226     public AudioPermission(String JavaDoc name, String JavaDoc actions) {
227     
228     super(name, actions);
229     }
230 }
231
232
Popular Tags