KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > quadcap > util > NullSecurityManager


1 package com.quadcap.util;
2
3 /* Copyright 1997 - 2003 Quadcap Software. All rights reserved.
4  *
5  * This software is distributed under the Quadcap Free Software License.
6  * This software may be used or modified for any purpose, personal or
7  * commercial. Open Source redistributions are permitted. Commercial
8  * redistribution of larger works derived from, or works which bundle
9  * this software requires a "Commercial Redistribution License"; see
10  * http://www.quadcap.com/purchase.
11  *
12  * Redistributions qualify as "Open Source" under one of the following terms:
13  *
14  * Redistributions are made at no charge beyond the reasonable cost of
15  * materials and delivery.
16  *
17  * Redistributions are accompanied by a copy of the Source Code or by an
18  * irrevocable offer to provide a copy of the Source Code for up to three
19  * years at the cost of materials and delivery. Such redistributions
20  * must allow further use, modification, and redistribution of the Source
21  * Code under substantially the same terms as this license.
22  *
23  * Redistributions of source code must retain the copyright notices as they
24  * appear in each source code file, these license terms, and the
25  * disclaimer/limitation of liability set forth as paragraph 6 below.
26  *
27  * Redistributions in binary form must reproduce this Copyright Notice,
28  * these license terms, and the disclaimer/limitation of liability set
29  * forth as paragraph 6 below, in the documentation and/or other materials
30  * provided with the distribution.
31  *
32  * The Software is provided on an "AS IS" basis. No warranty is
33  * provided that the Software is free of defects, or fit for a
34  * particular purpose.
35  *
36  * Limitation of Liability. Quadcap Software shall not be liable
37  * for any damages suffered by the Licensee or any third party resulting
38  * from use of the Software.
39  */

40
41 import java.lang.SecurityManager JavaDoc;
42 import java.io.FileDescriptor JavaDoc;
43 import java.net.InetAddress JavaDoc;
44 //#ifdef JDK12
45
//-import java.security.Permission;
46
//#endif
47

48 /**
49  *
50  *
51  * @author Stan Bailes
52  */

53 class NullSecurityManager extends SecurityManager JavaDoc {
54     public void checkCreateClassLoader() { }
55     public void checkAccess(Thread JavaDoc g) { }
56     public void checkAccess(ThreadGroup JavaDoc g) { }
57     public void checkExit(int status) { }
58     public void checkExec(String JavaDoc cmd) { }
59     public void checkLink(String JavaDoc lib) { }
60     public void checkRead(FileDescriptor JavaDoc fd) { }
61     public void checkRead(String JavaDoc file) { }
62     public void checkRead(String JavaDoc file, Object JavaDoc context) { }
63     public void checkWrite(FileDescriptor JavaDoc fd) { }
64     public void checkWrite(String JavaDoc file) { }
65     public void checkDelete(String JavaDoc file) { }
66     public void checkConnect(String JavaDoc host, int port) { }
67     public void checkConnect(String JavaDoc host, int port, Object JavaDoc context) { }
68     public void checkListen(int port) { }
69     public void checkAccept(String JavaDoc host, int port) { }
70     public void checkMulticast(InetAddress JavaDoc maddr) { }
71     public void checkMulticast(InetAddress JavaDoc maddr, byte ttl) { }
72     public void checkPropertiesAccess() { }
73     public void checkPropertyAccess(String JavaDoc key) { }
74     public void checkPropertyAccess(String JavaDoc key, String JavaDoc def) { }
75     public boolean checkTopLevelWindow(Object JavaDoc window) { return true; }
76     public void checkPrintJobAccess() { }
77     public void checkSystemClipboardAccess() { }
78     public void checkAwtEventQueueAccess() { }
79     public void checkPackageAccess(String JavaDoc pkg) { }
80     public void checkPackageDefinition(String JavaDoc pkg) { }
81     public void checkSetFactory() { }
82     public void checkMemberAccess(Class JavaDoc clazz, int which) { }
83     public void checkSecurityAccess(String JavaDoc provider) { }
84     public Class JavaDoc[] pubGetClassContext() {
85     return getClassContext();
86     }
87 //#ifdef JDK12
88
//- public void checkPermission(Permission perm) {}
89
//- public void checkPermission(Permission perm, Object context) {}
90
//#endif
91
}
92
Popular Tags