< prev index next >

src/java.rmi/share/classes/sun/rmi/registry/RegistryImpl.java

Print this page
rev 51958 : 8211122: Reduce the number of internal classes made accessible to jdk.unsupported
Reviewed-by: alanb, dfuchs, kvn
   1 /*
   2  * Copyright (c) 1996, 2017, Oracle and/or its affiliates. All rights reserved.
   3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
   4  *
   5  * This code is free software; you can redistribute it and/or modify it
   6  * under the terms of the GNU General Public License version 2 only, as
   7  * published by the Free Software Foundation.  Oracle designates this
   8  * particular file as subject to the "Classpath" exception as provided
   9  * by Oracle in the LICENSE file that accompanied this code.
  10  *
  11  * This code is distributed in the hope that it will be useful, but WITHOUT
  12  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  13  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
  14  * version 2 for more details (a copy is included in the LICENSE file that
  15  * accompanied this code).
  16  *
  17  * You should have received a copy of the GNU General Public License version
  18  * 2 along with this work; if not, write to the Free Software Foundation,
  19  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  20  *
  21  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  22  * or visit www.oracle.com if you need additional information or have any


  40 import java.io.FilePermission;
  41 import java.io.IOException;
  42 import java.net.*;
  43 import java.rmi.*;
  44 import java.rmi.server.ObjID;
  45 import java.rmi.server.ServerNotActiveException;
  46 import java.rmi.registry.Registry;
  47 import java.rmi.server.RMIClientSocketFactory;
  48 import java.rmi.server.RMIServerSocketFactory;
  49 import java.security.AccessControlContext;
  50 import java.security.AccessController;
  51 import java.security.CodeSource;
  52 import java.security.Policy;
  53 import java.security.PrivilegedActionException;
  54 import java.security.PrivilegedExceptionAction;
  55 import java.security.PermissionCollection;
  56 import java.security.Permissions;
  57 import java.security.ProtectionDomain;
  58 import java.text.MessageFormat;
  59 
  60 import jdk.internal.misc.SharedSecrets;
  61 import sun.rmi.runtime.Log;
  62 import sun.rmi.server.UnicastRef;
  63 import sun.rmi.server.UnicastServerRef;
  64 import sun.rmi.server.UnicastServerRef2;
  65 import sun.rmi.transport.LiveRef;
  66 
  67 /**
  68  * A "registry" exists on every node that allows RMI connections to
  69  * servers on that node.  The registry on a particular node contains a
  70  * transient database that maps names to remote objects.  When the
  71  * node boots, the registry database is empty.  The names stored in the
  72  * registry are pure and are not parsed.  A service storing itself in
  73  * the registry may want to prefix its name of the service by a package
  74  * name (although not required), to reduce name collisions in the
  75  * registry.
  76  *
  77  * The LocateRegistry class is used to obtain registry for different hosts.
  78  * <p>
  79  * The default RegistryImpl exported restricts access to clients on the local host
  80  * for the methods {@link #bind}, {@link #rebind}, {@link #unbind} by checking


   1 /*
   2  * Copyright (c) 1996, 2018, Oracle and/or its affiliates. All rights reserved.
   3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
   4  *
   5  * This code is free software; you can redistribute it and/or modify it
   6  * under the terms of the GNU General Public License version 2 only, as
   7  * published by the Free Software Foundation.  Oracle designates this
   8  * particular file as subject to the "Classpath" exception as provided
   9  * by Oracle in the LICENSE file that accompanied this code.
  10  *
  11  * This code is distributed in the hope that it will be useful, but WITHOUT
  12  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  13  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
  14  * version 2 for more details (a copy is included in the LICENSE file that
  15  * accompanied this code).
  16  *
  17  * You should have received a copy of the GNU General Public License version
  18  * 2 along with this work; if not, write to the Free Software Foundation,
  19  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  20  *
  21  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  22  * or visit www.oracle.com if you need additional information or have any


  40 import java.io.FilePermission;
  41 import java.io.IOException;
  42 import java.net.*;
  43 import java.rmi.*;
  44 import java.rmi.server.ObjID;
  45 import java.rmi.server.ServerNotActiveException;
  46 import java.rmi.registry.Registry;
  47 import java.rmi.server.RMIClientSocketFactory;
  48 import java.rmi.server.RMIServerSocketFactory;
  49 import java.security.AccessControlContext;
  50 import java.security.AccessController;
  51 import java.security.CodeSource;
  52 import java.security.Policy;
  53 import java.security.PrivilegedActionException;
  54 import java.security.PrivilegedExceptionAction;
  55 import java.security.PermissionCollection;
  56 import java.security.Permissions;
  57 import java.security.ProtectionDomain;
  58 import java.text.MessageFormat;
  59 
  60 import jdk.internal.access.SharedSecrets;
  61 import sun.rmi.runtime.Log;
  62 import sun.rmi.server.UnicastRef;
  63 import sun.rmi.server.UnicastServerRef;
  64 import sun.rmi.server.UnicastServerRef2;
  65 import sun.rmi.transport.LiveRef;
  66 
  67 /**
  68  * A "registry" exists on every node that allows RMI connections to
  69  * servers on that node.  The registry on a particular node contains a
  70  * transient database that maps names to remote objects.  When the
  71  * node boots, the registry database is empty.  The names stored in the
  72  * registry are pure and are not parsed.  A service storing itself in
  73  * the registry may want to prefix its name of the service by a package
  74  * name (although not required), to reduce name collisions in the
  75  * registry.
  76  *
  77  * The LocateRegistry class is used to obtain registry for different hosts.
  78  * <p>
  79  * The default RegistryImpl exported restricts access to clients on the local host
  80  * for the methods {@link #bind}, {@link #rebind}, {@link #unbind} by checking


< prev index next >