⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 ozonesecuritymanager.java

📁 Java的面向对象数据库系统的源代码
💻 JAVA
字号:
// You can redistribute this software and/or modify it under the terms of
// the Ozone Core License version 1 published by ozone-db.org.
//
// The original code and portions created by SMB are
// Copyright (C) 1997-@year@ by SMB GmbH. All rights reserved.
//
// $Id: OzoneSecurityManager.java,v 1.2 2002/08/27 08:32:25 per_nyfelt Exp $

package org.ozoneDB.core;

import org.ozoneDB.core.DbRemote.CommandThread;
import java.io.*;
import java.net.*;


public class OzoneSecurityManager extends SecurityManager {

    static boolean enabled = false;


    Thread thread() {
        return Thread.currentThread();
    }


    public void enable( boolean value ) {
        enabled = value;
    }


    boolean is3XThread() {
        return !isTransaction();
    }


    boolean isTransaction() {
        if (thread() instanceof CommandThread) {
            return ((CommandThread)thread()).transaction() != null;
        } else {
            return false;
        }
    }


    void standardSecurity() {
        if (enabled) {
            if (isTransaction()) {
                throw new SecurityException();
            }
        }
    }


    public OzoneSecurityManager() {
    }


    public void checkAccept( String host, int port ) {
        standardSecurity();
    }


    public void checkAccess( Thread thread ) {
        standardSecurity();
    }


    public void checkAccess( ThreadGroup threadGroup ) {
        standardSecurity();
    }


    public void checkAwtEventQueueAccess() {
        standardSecurity();
    }


    public void checkConnect( String host, int port ) {
        standardSecurity();
    }


    public void checkConnect( String host, int port, Object obj ) {
        standardSecurity();
    }


    public void checkCreateClassLoader() {
        standardSecurity();
    }


    public void checkDelete( String file ) {
        standardSecurity();
    }


    public void checkExec( String command ) {
        standardSecurity();
    }


    public void checkExit( int code ) {
        if (enabled) {
            throw new SecurityException();
        }
    }


    public void checkLink( String library ) {
        standardSecurity();
    }


    public void checkListen( int port ) {
        standardSecurity();
    }


    public void checkMemberAccess( Class clazz, int which ) {
    }


    public void checkMulitcast( InetAddress add, byte ip ) {
        standardSecurity();
    }


    public void checkPackageAccess( String pkg ) {
    }


    public void checkPackageDefinition( String pkg ) {
    }


    public void checkPermission( java.security.Permission perm, Object context ) {
    }


    /**
     * Allow ObjectOutputStream.enableReplceObject() to be set to true.
     */
    public void checkPermission( java.security.Permission perm ) {
    }


    public void checkPrintJobAccess() {
    }


    public void checkPropertiesAccess() {
    }


    public void checkPropertyAccess( String prop ) {
    }


    public void checkRead( FileDescriptor fd ) {
    }


    public void checkRead( String file ) {
    }


    public void checkRead( String file, Object obj ) {
    }


    public void checkSecurityAccess( String action ) {
    }


    public void checkSetFactory() {
    }


    public void checkSystemClipboardAccess() {
    }


    public boolean checkTopLevelWindow( Object window ) {
        // in case of LocalDatabase this would also prevent the client
        // from havin a GUI
        // throw new SecurityException();
        return true;
    }


    public void checkWrite( FileDescriptor fd ) {
    }


    public void checkWrite( String file ) {
    }
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -