77 |
|
|
78 |
/** |
/** |
79 |
* Construct a new AccessControlContext with the specified |
* Construct a new AccessControlContext with the specified |
80 |
* ProtectionDomains and DomainCombiner |
* {@link ProtectionDomain}s and {@link DomainCombiner}. |
81 |
* |
* |
82 |
|
* <p>Code calling this constructor must have a {@link |
83 |
|
* SecurityPermission} of <i>createAccessControlContext</i>.</p> |
84 |
|
* |
85 |
|
* @throws SecurityException If the caller does not have permission |
86 |
|
* to create an access control context. |
87 |
* @since 1.3 |
* @since 1.3 |
88 |
*/ |
*/ |
89 |
public AccessControlContext(AccessControlContext acc, |
public AccessControlContext(AccessControlContext acc, |
90 |
DomainCombiner combiner) |
DomainCombiner combiner) |
91 |
{ |
{ |
92 |
// XXX check permission to call this. |
SecurityManager sm = System.getSecurityManager (); |
93 |
|
if (sm != null) |
94 |
|
{ |
95 |
|
sm.checkPermission (new SecurityPermission ("createAccessControlContext")); |
96 |
|
} |
97 |
AccessControlContext acc2 = AccessController.getContext(); |
AccessControlContext acc2 = AccessController.getContext(); |
98 |
protectionDomains = combiner.combine (acc2.protectionDomains, |
protectionDomains = combiner.combine (acc2.protectionDomains, |
99 |
acc.protectionDomains); |
acc.protectionDomains); |
182 |
|
|
183 |
return h; |
return h; |
184 |
} |
} |
185 |
|
|
186 |
|
ProtectionDomain[] getProtectionDomains () |
187 |
|
{ |
188 |
|
return protectionDomains; |
189 |
|
} |
190 |
} |
} |