KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > codehaus > loom > xmlpolicy > runtime > PolicyEntry


1 /*
2  * Copyright (C) The Spice Group. All rights reserved.
3  *
4  * This software is published under the terms of the Spice
5  * Software License version 1.1, a copy of which has been included
6  * with this distribution in the LICENSE.txt file.
7  */

8 package org.codehaus.loom.xmlpolicy.runtime;
9
10 import java.security.CodeSource JavaDoc;
11 import java.security.Permissions JavaDoc;
12
13 /**
14  * Internal Policy Entry holder class.
15  * Holds information about an entry in policy file.
16  */

17 final class PolicyEntry
18 {
19     /**
20      * The code source that entry is about.
21      */

22     private final CodeSource JavaDoc m_codeSource;
23
24     /**
25      * the set of permissions for code source.
26      */

27     private final Permissions JavaDoc m_permissions;
28
29     public PolicyEntry( final CodeSource JavaDoc codeSource,
30                         final Permissions JavaDoc permissions )
31     {
32         if( null == codeSource )
33         {
34             throw new NullPointerException JavaDoc( "codeSource" );
35         }
36         if( null == permissions )
37         {
38             throw new NullPointerException JavaDoc( "permissions" );
39         }
40
41         m_codeSource = codeSource;
42         m_permissions = permissions;
43     }
44
45     public CodeSource JavaDoc getCodeSource()
46     {
47         return m_codeSource;
48     }
49
50     public Permissions JavaDoc getPermissions()
51     {
52         return m_permissions;
53     }
54 }
55
Popular Tags