4483N/A * Copyright (c) 1996, 2011, Oracle and/or its affiliates. All rights reserved. 0N/A * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 0N/A * This code is free software; you can redistribute it and/or modify it 0N/A * under the terms of the GNU General Public License version 2 only, as 2362N/A * published by the Free Software Foundation. Oracle designates this 0N/A * particular file as subject to the "Classpath" exception as provided 2362N/A * by Oracle in the LICENSE file that accompanied this code. 0N/A * This code is distributed in the hope that it will be useful, but WITHOUT 0N/A * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 0N/A * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 0N/A * version 2 for more details (a copy is included in the LICENSE file that 0N/A * accompanied this code). 0N/A * You should have received a copy of the GNU General Public License version 0N/A * 2 along with this work; if not, write to the Free Software Foundation, 0N/A * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 2362N/A * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA 2362N/A * or visit www.oracle.com if you need additional information or have any 0N/A * A "registry" exists on every node that allows RMI connections to 0N/A * servers on that node. The registry on a particular node contains a 0N/A * transient database that maps names to remote objects. When the 0N/A * node boots, the registry database is empty. The names stored in the 0N/A * registry are pure and are not parsed. A service storing itself in 0N/A * the registry may want to prefix its name of the service by a package 0N/A * name (although not required), to reduce name collisions in the 0N/A * The LocateRegistry class is used to obtain registry for different hosts. 0N/A * @see java.rmi.registry.LocateRegistry 0N/A /* indicate compatibility with JDK 1.1.x version of class */ 0N/A * Construct a new RegistryImpl on the specified port with the 0N/A * given custom socket factory pair. 0N/A * Construct a new RegistryImpl on the specified port. 0N/A * Create the export the object using the parameter 0N/A /* Server ref must be created and assigned before remote 0N/A * object 'this' can be exported. 0N/A * Returns the remote object for specified name in the registry. 0N/A * @exception RemoteException If remote operation failed. 0N/A * @exception NotBound If name is not currently bound. 0N/A * Binds the name to the specified remote object. 0N/A * @exception RemoteException If remote operation failed. 0N/A * @exception AlreadyBoundException If name is already bound. 0N/A * @exception RemoteException If remote operation failed. 0N/A * @exception NotBound If name is not currently bound. 0N/A * Rebind the name to a new object, replaces any existing binding. 0N/A * @exception RemoteException If remote operation failed. 0N/A * Returns an enumeration of the names in the registry. 0N/A * @exception RemoteException If remote operation failed. 0N/A * Check that the caller has access to perform indicated operation. 0N/A * The client must be on same the same host as this server. 0N/A * Get client host that this registry operation was made from. 0N/A // if client not yet seen, make sure client allowed access 0N/A "Registry." +
op +
" disallowed; origin unknown");
0N/A * if a ServerSocket can be bound to the client's 0N/A * address then that address must be local 0N/A // must have been an IOException 0N/A "Registry." +
op +
" disallowed; origin " +
0N/A * Local call from this VM: allow access. 0N/A " disallowed; origin is unknown host");
0N/A * Retrieves text resources from the locale-specific properties file. 0N/A "sun.rmi.registry.resources.rmiregistry");
0N/A // throwing an Error is a bit extreme, methinks 0N/A return (
"[missing resource file: " +
key +
"]");
0N/A return (
"[missing resource: " +
key +
"]");
0N/A * Main program to start a registry. <br> 0N/A * The port number can be specified on the command line. 0N/A // Create and install the security manager if one is not installed 0N/A * Fix bugid 4147561: When JDK tools are executed, the value of 0N/A * the CLASSPATH environment variable for the shell in which they 0N/A * were invoked is no longer incorporated into the application 0N/A * class path; CLASSPATH's only effect is to be the value of the 0N/A * system property "env.class.path". To preserve the previous 0N/A * (JDK1.1 and JDK1.2beta3) behavior of this tool, however, its 0N/A * CLASSPATH should still be considered when resolving classes 0N/A * being unmarshalled. To effect this old behavior, a class 0N/A * loader that loads from the file path specified in the 0N/A * "env.class.path" property is created and set to be the context 0N/A * class loader before the remote object is exported. 0N/A envcp =
".";
// preserve old default behavior 0N/A * Fix bugid 4242317: Classes defined by this class loader should 0N/A * be annotated with the value of the "java.rmi.server.codebase" 0N/A * property, not the "file:" URLs for the CLASSPATH elements. 0N/A // prevent registry from exiting 4483N/A * Generates an AccessControlContext with minimal permissions. 4455N/A * The approach used here is taken from the similar method 4455N/A * getAccessControlContext() in the sun.applet.AppletPanel class. 4455N/A // begin with permissions granted to all code in current policy 4455N/A * Anyone can connect to the registry and the registry can connect 4455N/A * to and possibly download stubs from anywhere. Downloaded stubs and 4455N/A * related classes themselves are more tightly limited by RMI. 4455N/A * Create an AccessControlContext that consists of a single 4455N/A * protection domain with only the permissions calculated above.