8267123: Remove RMI Activation
Reviewed-by: erikj, rriggs, alanb
This commit is contained in:
parent
0754266044
commit
7c85f3510c
@ -1,5 +1,5 @@
|
||||
#
|
||||
# Copyright (c) 2011, 2015, Oracle and/or its affiliates. All rights reserved.
|
||||
# Copyright (c) 2011, 2021, Oracle and/or its affiliates. All rights reserved.
|
||||
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
#
|
||||
# This code is free software; you can redistribute it and/or modify it
|
||||
@ -25,10 +25,6 @@
|
||||
|
||||
include LauncherCommon.gmk
|
||||
|
||||
$(eval $(call SetupBuildLauncher, rmid, \
|
||||
MAIN_CLASS := sun.rmi.server.Activation, \
|
||||
))
|
||||
|
||||
$(eval $(call SetupBuildLauncher, rmiregistry, \
|
||||
MAIN_CLASS := sun.rmi.registry.RegistryImpl, \
|
||||
))
|
||||
|
@ -1061,7 +1061,6 @@ jdk.xml.dsig.secureValidationPolicy=\
|
||||
# sun.rmi.server.UnicastRef;\
|
||||
# sun.rmi.server.RMIClientSocketFactory;\
|
||||
# sun.rmi.server.RMIServerSocketFactory;\
|
||||
# java.rmi.activation.ActivationID;\
|
||||
# java.rmi.server.UID
|
||||
#
|
||||
# RMI Distributed Garbage Collector (DGC) Serial Filter
|
||||
|
@ -1,352 +0,0 @@
|
||||
/*
|
||||
* Copyright (c) 2000, 2020, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
* under the terms of the GNU General Public License version 2 only, as
|
||||
* published by the Free Software Foundation. Oracle designates this
|
||||
* particular file as subject to the "Classpath" exception as provided
|
||||
* by Oracle in the LICENSE file that accompanied this code.
|
||||
*
|
||||
* This code is distributed in the hope that it will be useful, but WITHOUT
|
||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
* version 2 for more details (a copy is included in the LICENSE file that
|
||||
* accompanied this code).
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License version
|
||||
* 2 along with this work; if not, write to the Free Software Foundation,
|
||||
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
*
|
||||
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
|
||||
* or visit www.oracle.com if you need additional information or have any
|
||||
* questions.
|
||||
*/
|
||||
|
||||
package com.sun.rmi.rmid;
|
||||
|
||||
import java.security.*;
|
||||
import java.io.*;
|
||||
import java.util.*;
|
||||
|
||||
/**
|
||||
* The ExecOptionPermission class represents permission for rmid to use
|
||||
* a specific command-line option when launching an activation group.
|
||||
*
|
||||
* @author Ann Wollrath
|
||||
*
|
||||
* @serial exclude
|
||||
* @deprecated See the
|
||||
* <a href="{@docRoot}/java.rmi/java/rmi/activation/package-summary.html">
|
||||
* {@code java.rmi.activation}</a> package specification for further information.
|
||||
*/
|
||||
@Deprecated(forRemoval=true, since="15")
|
||||
public final class ExecOptionPermission extends Permission
|
||||
{
|
||||
/**
|
||||
* does this permission have a wildcard at the end?
|
||||
*/
|
||||
private transient boolean wildcard;
|
||||
|
||||
/**
|
||||
* the name without the wildcard on the end
|
||||
*/
|
||||
private transient String name;
|
||||
|
||||
/**
|
||||
* UID for serialization
|
||||
*/
|
||||
private static final long serialVersionUID = 5842294756823092756L;
|
||||
|
||||
public ExecOptionPermission(String name) {
|
||||
super(name);
|
||||
init(name);
|
||||
}
|
||||
|
||||
public ExecOptionPermission(String name, String actions) {
|
||||
this(name);
|
||||
}
|
||||
|
||||
/**
|
||||
* Checks if the specified permission is "implied" by
|
||||
* this object.
|
||||
* <P>
|
||||
* More specifically, this method returns true if:
|
||||
* <ul>
|
||||
* <li> <i>p</i>'s class is the same as this object's class, and
|
||||
* <li> <i>p</i>'s name equals or (in the case of wildcards)
|
||||
* is implied by this object's
|
||||
* name. For example, "a.b.*" implies "a.b.c", and
|
||||
* "a.b=*" implies "a.b=c"
|
||||
* </ul>
|
||||
*
|
||||
* @param p the permission to check against.
|
||||
*
|
||||
* @return true if the passed permission is equal to or
|
||||
* implied by this permission, false otherwise.
|
||||
*/
|
||||
public boolean implies(Permission p) {
|
||||
if (!(p instanceof ExecOptionPermission))
|
||||
return false;
|
||||
|
||||
ExecOptionPermission that = (ExecOptionPermission) p;
|
||||
|
||||
if (this.wildcard) {
|
||||
if (that.wildcard) {
|
||||
// one wildcard can imply another
|
||||
return that.name.startsWith(name);
|
||||
} else {
|
||||
// make sure p.name is longer so a.b.* doesn't imply a.b
|
||||
return (that.name.length() > this.name.length()) &&
|
||||
that.name.startsWith(this.name);
|
||||
}
|
||||
} else {
|
||||
if (that.wildcard) {
|
||||
// a non-wildcard can't imply a wildcard
|
||||
return false;
|
||||
} else {
|
||||
return this.name.equals(that.name);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Checks two ExecOptionPermission objects for equality.
|
||||
* Checks that <i>obj</i>'s class is the same as this object's class
|
||||
* and has the same name as this object.
|
||||
*
|
||||
* @param obj the object we are testing for equality with this object.
|
||||
* @return true if <i>obj</i> is an ExecOptionPermission, and has the same
|
||||
* name as this ExecOptionPermission object, false otherwise.
|
||||
*/
|
||||
public boolean equals(Object obj) {
|
||||
if (obj == this)
|
||||
return true;
|
||||
|
||||
if ((obj == null) || (obj.getClass() != getClass()))
|
||||
return false;
|
||||
|
||||
ExecOptionPermission that = (ExecOptionPermission) obj;
|
||||
|
||||
return this.getName().equals(that.getName());
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Returns the hash code value for this object.
|
||||
* The hash code used is the hash code of the name, that is,
|
||||
* <code>getName().hashCode()</code>, where <code>getName</code> is
|
||||
* from the Permission superclass.
|
||||
*
|
||||
* @return a hash code value for this object.
|
||||
*/
|
||||
public int hashCode() {
|
||||
return this.getName().hashCode();
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the canonical string representation of the actions.
|
||||
*
|
||||
* @return the canonical string representation of the actions.
|
||||
*/
|
||||
public String getActions() {
|
||||
return "";
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns a new PermissionCollection object for storing
|
||||
* ExecOptionPermission objects.
|
||||
* <p>
|
||||
* An ExecOptionPermissionCollection stores a collection of
|
||||
* ExecOptionPermission permissions.
|
||||
*
|
||||
* <p>ExecOptionPermission objects must be stored in a manner that allows
|
||||
* them to be inserted in any order, but that also enables the
|
||||
* PermissionCollection <code>implies</code> method
|
||||
* to be implemented in an efficient (and consistent) manner.
|
||||
*
|
||||
* @return a new PermissionCollection object suitable for
|
||||
* storing ExecOptionPermissions.
|
||||
*/
|
||||
public PermissionCollection newPermissionCollection() {
|
||||
return new ExecOptionPermissionCollection();
|
||||
}
|
||||
|
||||
/**
|
||||
* readObject is called to restore the state of the ExecOptionPermission
|
||||
* from a stream.
|
||||
*/
|
||||
private synchronized void readObject(java.io.ObjectInputStream s)
|
||||
throws IOException, ClassNotFoundException
|
||||
{
|
||||
s.defaultReadObject();
|
||||
// init is called to initialize the rest of the values.
|
||||
init(getName());
|
||||
}
|
||||
|
||||
/**
|
||||
* Initialize a ExecOptionPermission object. Common to all constructors.
|
||||
* Also called during de-serialization.
|
||||
*/
|
||||
private void init(String name)
|
||||
{
|
||||
if (name == null)
|
||||
throw new NullPointerException("name can't be null");
|
||||
|
||||
if (name.isEmpty()) {
|
||||
throw new IllegalArgumentException("name can't be empty");
|
||||
}
|
||||
|
||||
if (name.endsWith(".*") || name.endsWith("=*") || name.equals("*")) {
|
||||
wildcard = true;
|
||||
if (name.length() == 1) {
|
||||
this.name = "";
|
||||
} else {
|
||||
this.name = name.substring(0, name.length()-1);
|
||||
}
|
||||
} else {
|
||||
this.name = name;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* A ExecOptionPermissionCollection stores a collection
|
||||
* of ExecOptionPermission permissions. ExecOptionPermission objects
|
||||
* must be stored in a manner that allows them to be inserted in any
|
||||
* order, but enable the implies function to evaluate the implies
|
||||
* method in an efficient (and consistent) manner.
|
||||
*
|
||||
* A ExecOptionPermissionCollection handles comparing a permission like
|
||||
* "a.b.c.d.e" * with a Permission such as "a.b.*", or "*".
|
||||
*
|
||||
* @serial include
|
||||
*/
|
||||
private static class ExecOptionPermissionCollection
|
||||
extends PermissionCollection
|
||||
implements java.io.Serializable
|
||||
{
|
||||
|
||||
private Hashtable<String, Permission> permissions;
|
||||
private boolean all_allowed; // true if "*" is in the collection
|
||||
private static final long serialVersionUID = -1242475729790124375L;
|
||||
|
||||
/**
|
||||
* Create an empty ExecOptionPermissionCollection.
|
||||
*/
|
||||
public ExecOptionPermissionCollection() {
|
||||
permissions = new Hashtable<>(11);
|
||||
all_allowed = false;
|
||||
}
|
||||
|
||||
/**
|
||||
* Adds a permission to the collection. The key for the hash is
|
||||
* permission.name.
|
||||
*
|
||||
* @param permission the Permission object to add.
|
||||
*
|
||||
* @exception IllegalArgumentException - if the permission is not a
|
||||
* ExecOptionPermission
|
||||
*
|
||||
* @exception SecurityException - if this ExecOptionPermissionCollection
|
||||
* object has been marked readonly
|
||||
*/
|
||||
|
||||
public void add(Permission permission)
|
||||
{
|
||||
if (! (permission instanceof ExecOptionPermission))
|
||||
throw new IllegalArgumentException("invalid permission: "+
|
||||
permission);
|
||||
if (isReadOnly())
|
||||
throw new SecurityException("attempt to add a Permission to a readonly PermissionCollection");
|
||||
|
||||
ExecOptionPermission p = (ExecOptionPermission) permission;
|
||||
|
||||
permissions.put(p.getName(), permission);
|
||||
if (!all_allowed) {
|
||||
if (p.getName().equals("*"))
|
||||
all_allowed = true;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Check and see if this set of permissions implies the permissions
|
||||
* expressed in "permission".
|
||||
*
|
||||
* @param p the Permission object to compare
|
||||
*
|
||||
* @return true if "permission" is a proper subset of a permission in
|
||||
* the set, false if not.
|
||||
*/
|
||||
public boolean implies(Permission permission)
|
||||
{
|
||||
if (! (permission instanceof ExecOptionPermission))
|
||||
return false;
|
||||
|
||||
ExecOptionPermission p = (ExecOptionPermission) permission;
|
||||
|
||||
// short circuit if the "*" Permission was added
|
||||
if (all_allowed)
|
||||
return true;
|
||||
|
||||
// strategy:
|
||||
// Check for full match first. Then work our way up the
|
||||
// name looking for matches on a.b.*
|
||||
|
||||
String pname = p.getName();
|
||||
|
||||
Permission x = permissions.get(pname);
|
||||
|
||||
if (x != null)
|
||||
// we have a direct hit!
|
||||
return x.implies(permission);
|
||||
|
||||
|
||||
// work our way up the tree...
|
||||
int last, offset;
|
||||
|
||||
offset = pname.length() - 1;
|
||||
|
||||
while ((last = pname.lastIndexOf('.', offset)) != -1) {
|
||||
|
||||
pname = pname.substring(0, last+1) + "*";
|
||||
x = permissions.get(pname);
|
||||
|
||||
if (x != null) {
|
||||
return x.implies(permission);
|
||||
}
|
||||
offset = last - 1;
|
||||
}
|
||||
|
||||
// check for "=*" wildcard match
|
||||
pname = p.getName();
|
||||
offset = pname.length() - 1;
|
||||
|
||||
while ((last = pname.lastIndexOf('=', offset)) != -1) {
|
||||
|
||||
pname = pname.substring(0, last+1) + "*";
|
||||
x = permissions.get(pname);
|
||||
|
||||
if (x != null) {
|
||||
return x.implies(permission);
|
||||
}
|
||||
offset = last - 1;
|
||||
}
|
||||
|
||||
// we don't have to check for "*" as it was already checked
|
||||
// at the top (all_allowed), so we just return false
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns an enumeration of all the ExecOptionPermission objects in the
|
||||
* container.
|
||||
*
|
||||
* @return an enumeration of all the ExecOptionPermission objects.
|
||||
*/
|
||||
|
||||
public Enumeration<Permission> elements()
|
||||
{
|
||||
return permissions.elements();
|
||||
}
|
||||
}
|
||||
}
|
@ -1,302 +0,0 @@
|
||||
/*
|
||||
* Copyright (c) 2000, 2020, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
* under the terms of the GNU General Public License version 2 only, as
|
||||
* published by the Free Software Foundation. Oracle designates this
|
||||
* particular file as subject to the "Classpath" exception as provided
|
||||
* by Oracle in the LICENSE file that accompanied this code.
|
||||
*
|
||||
* This code is distributed in the hope that it will be useful, but WITHOUT
|
||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
* version 2 for more details (a copy is included in the LICENSE file that
|
||||
* accompanied this code).
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License version
|
||||
* 2 along with this work; if not, write to the Free Software Foundation,
|
||||
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
*
|
||||
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
|
||||
* or visit www.oracle.com if you need additional information or have any
|
||||
* questions.
|
||||
*/
|
||||
|
||||
package com.sun.rmi.rmid;
|
||||
|
||||
import java.security.*;
|
||||
import java.io.*;
|
||||
import java.util.*;
|
||||
|
||||
/**
|
||||
* The ExecPermission class represents permission for rmid to execute
|
||||
* a specific command to launch an activation group. An ExecPermission
|
||||
* consists of a pathname of a command to launch an activation group.
|
||||
* <P>
|
||||
* Pathname is the pathname of the file or directory to grant rmid
|
||||
* execute permission. A pathname that ends in "/*" (where "/" is
|
||||
* the file separator character, <code>File.separatorChar</code>) indicates
|
||||
* all the files and directories contained in that directory. A pathname
|
||||
* that ends with "/-" indicates (recursively) all files
|
||||
* and subdirectories contained in that directory. A pathname consisting of
|
||||
* the special token "{@code <<ALL FILES>>}" matches <b>any</b> file.
|
||||
* <P>
|
||||
* Note: A pathname consisting of a single "*" indicates all the files
|
||||
* in the current directory, while a pathname consisting of a single "-"
|
||||
* indicates all the files in the current directory and
|
||||
* (recursively) all files and subdirectories contained in the current
|
||||
* directory.
|
||||
*
|
||||
*
|
||||
* @author Ann Wollrath
|
||||
*
|
||||
* @serial exclude
|
||||
* @deprecated See the
|
||||
* <a href="{@docRoot}/java.rmi/java/rmi/activation/package-summary.html">
|
||||
* {@code java.rmi.activation}</a> package specification for further information.
|
||||
*/
|
||||
@Deprecated(forRemoval=true, since="15")
|
||||
public final class ExecPermission extends Permission
|
||||
{
|
||||
/**
|
||||
* UID for serialization
|
||||
*/
|
||||
private static final long serialVersionUID = -6208470287358147919L;
|
||||
|
||||
private transient FilePermission fp;
|
||||
|
||||
/**
|
||||
* Creates a new ExecPermission object with the specified path.
|
||||
* <i>path</i> is the pathname of a file or directory.
|
||||
*
|
||||
* <p>A pathname that ends in "/*" (where "/" is
|
||||
* the file separator character, <code>File.separatorChar</code>) indicates
|
||||
* a directory and all the files contained in that directory. A pathname
|
||||
* that ends with "/-" indicates a directory and (recursively) all files
|
||||
* and subdirectories contained in that directory. The special pathname
|
||||
* "{@code <<ALL FILES>>}" matches all files.
|
||||
*
|
||||
* <p>A pathname consisting of a single "*" indicates all the files
|
||||
* in the current directory, while a pathname consisting of a single "-"
|
||||
* indicates all the files in the current directory and
|
||||
* (recursively) all files and subdirectories contained in the current
|
||||
* directory.
|
||||
*
|
||||
* @param path the pathname of the file/directory.
|
||||
*/
|
||||
public ExecPermission(String path) {
|
||||
super(path);
|
||||
init(path);
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates a new ExecPermission object with the specified path.
|
||||
* <i>path</i> is the pathname of a file or directory.
|
||||
*
|
||||
* <p>A pathname that ends in "/*" (where "/" is
|
||||
* the file separator character, <code>File.separatorChar</code>) indicates
|
||||
* a directory and all the files contained in that directory. A pathname
|
||||
* that ends with "/-" indicates a directory and (recursively) all files
|
||||
* and subdirectories contained in that directory. The special pathname
|
||||
* "{@code <<ALL FILES>>}" matches all files.
|
||||
*
|
||||
* <p>A pathname consisting of a single "*" indicates all the files
|
||||
* in the current directory, while a pathname consisting of a single "-"
|
||||
* indicates all the files in the current directory and
|
||||
* (recursively) all files and subdirectories contained in the current
|
||||
* directory.
|
||||
*
|
||||
* @param path the pathname of the file/directory.
|
||||
* @param actions the action string (unused)
|
||||
*/
|
||||
public ExecPermission(String path, String actions) {
|
||||
this(path);
|
||||
}
|
||||
|
||||
/**
|
||||
* Checks if this ExecPermission object "implies" the specified permission.
|
||||
* <P>
|
||||
* More specifically, this method returns true if:
|
||||
* <ul>
|
||||
* <li> <i>p</i> is an instanceof ExecPermission, and
|
||||
* <li> <i>p</i>'s pathname is implied by this object's
|
||||
* pathname. For example, "/tmp/*" implies "/tmp/foo", since
|
||||
* "/tmp/*" encompasses the "/tmp" directory and all files in that
|
||||
* directory, including the one named "foo".
|
||||
* </ul>
|
||||
* @param p the permission to check against.
|
||||
*
|
||||
* @return true if the specified permission is implied by this object,
|
||||
* false if not.
|
||||
*/
|
||||
public boolean implies(Permission p) {
|
||||
if (!(p instanceof ExecPermission))
|
||||
return false;
|
||||
|
||||
ExecPermission that = (ExecPermission) p;
|
||||
|
||||
return fp.implies(that.fp);
|
||||
}
|
||||
|
||||
/**
|
||||
* Checks two ExecPermission objects for equality.
|
||||
* Checks that <i>obj</i>'s class is the same as this object's class
|
||||
* and has the same name as this object.
|
||||
*
|
||||
* @param obj the object we are testing for equality with this object.
|
||||
* @return true if <i>obj</i> is an ExecPermission, and has the same
|
||||
* pathname as this ExecPermission object, false otherwise.
|
||||
*/
|
||||
public boolean equals(Object obj) {
|
||||
if (obj == this)
|
||||
return true;
|
||||
|
||||
if (! (obj instanceof ExecPermission))
|
||||
return false;
|
||||
|
||||
ExecPermission that = (ExecPermission) obj;
|
||||
|
||||
return fp.equals(that.fp);
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the hash code value for this object.
|
||||
*
|
||||
* @return a hash code value for this object.
|
||||
*/
|
||||
public int hashCode() {
|
||||
return this.fp.hashCode();
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the canonical string representation of the actions.
|
||||
*
|
||||
* @return the canonical string representation of the actions.
|
||||
*/
|
||||
public String getActions() {
|
||||
return "";
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns a new PermissionCollection object for storing
|
||||
* ExecPermission objects.
|
||||
* <p>
|
||||
* A ExecPermissionCollection stores a collection of
|
||||
* ExecPermission permissions.
|
||||
*
|
||||
* <p>ExecPermission objects must be stored in a manner that allows
|
||||
* them to be inserted in any order, but that also enables the
|
||||
* PermissionCollection <code>implies</code> method
|
||||
* to be implemented in an efficient (and consistent) manner.
|
||||
*
|
||||
* @return a new PermissionCollection object suitable for
|
||||
* storing ExecPermissions.
|
||||
*/
|
||||
public PermissionCollection newPermissionCollection() {
|
||||
return new ExecPermissionCollection();
|
||||
}
|
||||
|
||||
/**
|
||||
* readObject is called to restore the state of the ExecPermission
|
||||
* from a stream.
|
||||
*/
|
||||
private synchronized void readObject(java.io.ObjectInputStream s)
|
||||
throws IOException, ClassNotFoundException
|
||||
{
|
||||
s.defaultReadObject();
|
||||
// init is called to initialize the rest of the values.
|
||||
init(getName());
|
||||
}
|
||||
|
||||
/**
|
||||
* Initialize a ExecPermission object. Common to all constructors.
|
||||
* Also called during de-serialization.
|
||||
*/
|
||||
private void init(String path) {
|
||||
this.fp = new FilePermission(path, "execute");
|
||||
}
|
||||
|
||||
/**
|
||||
* A ExecPermissionCollection stores a collection
|
||||
* of ExecPermission permissions. ExecPermission objects
|
||||
* must be stored in a manner that allows them to be inserted in any
|
||||
* order, but enable the implies function to evaluate the implies
|
||||
* method in an efficient (and consistent) manner.
|
||||
*
|
||||
* @serial include
|
||||
*/
|
||||
private static class ExecPermissionCollection
|
||||
extends PermissionCollection
|
||||
implements java.io.Serializable
|
||||
{
|
||||
private Vector<Permission> permissions;
|
||||
|
||||
private static final long serialVersionUID = -3352558508888368273L;
|
||||
|
||||
/**
|
||||
* Create an empty ExecPermissionCollection.
|
||||
*/
|
||||
public ExecPermissionCollection() {
|
||||
permissions = new Vector<>();
|
||||
}
|
||||
|
||||
/**
|
||||
* Adds a permission to the collection.
|
||||
*
|
||||
* @param permission the Permission object to add.
|
||||
*
|
||||
* @exception IllegalArgumentException - if the permission is not a
|
||||
* ExecPermission
|
||||
*
|
||||
* @exception SecurityException - if this ExecPermissionCollection
|
||||
* object has been marked readonly
|
||||
*/
|
||||
public void add(Permission permission)
|
||||
{
|
||||
if (! (permission instanceof ExecPermission))
|
||||
throw new IllegalArgumentException("invalid permission: "+
|
||||
permission);
|
||||
if (isReadOnly())
|
||||
throw new SecurityException("attempt to add a Permission to a readonly PermissionCollection");
|
||||
|
||||
permissions.addElement(permission);
|
||||
}
|
||||
|
||||
/**
|
||||
* Check and see if this set of permissions implies the permissions
|
||||
* expressed in "permission".
|
||||
*
|
||||
* @param p the Permission object to compare
|
||||
*
|
||||
* @return true if "permission" is a proper subset of a permission in
|
||||
* the set, false if not.
|
||||
*/
|
||||
public boolean implies(Permission permission)
|
||||
{
|
||||
if (! (permission instanceof ExecPermission))
|
||||
return false;
|
||||
|
||||
Enumeration<Permission> e = permissions.elements();
|
||||
|
||||
while (e.hasMoreElements()) {
|
||||
ExecPermission x = (ExecPermission)e.nextElement();
|
||||
if (x.implies(permission)) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns an enumeration of all the ExecPermission objects in the
|
||||
* container.
|
||||
*
|
||||
* @return an enumeration of all the ExecPermission objects.
|
||||
*/
|
||||
public Enumeration<Permission> elements()
|
||||
{
|
||||
return permissions.elements();
|
||||
}
|
||||
}
|
||||
}
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 1996, 1998, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 1996, 2021, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
@ -28,8 +28,7 @@ package java.rmi;
|
||||
/**
|
||||
* An <code>AccessException</code> is thrown by certain methods of the
|
||||
* <code>java.rmi.Naming</code> class (specifically <code>bind</code>,
|
||||
* <code>rebind</code>, and <code>unbind</code>) and methods of the
|
||||
* <code>java.rmi.activation.ActivationSystem</code> interface to
|
||||
* <code>rebind</code>, and <code>unbind</code>) to
|
||||
* indicate that the caller does not have permission to perform the action
|
||||
* requested by the method call. If the method was invoked from a non-local
|
||||
* host, then an <code>AccessException</code> is thrown.
|
||||
@ -38,7 +37,6 @@ package java.rmi;
|
||||
* @author Roger Riggs
|
||||
* @since 1.1
|
||||
* @see java.rmi.Naming
|
||||
* @see java.rmi.activation.ActivationSystem
|
||||
*/
|
||||
public class AccessException extends java.rmi.RemoteException {
|
||||
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 1996, 1998, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 1996, 2021, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
@ -35,14 +35,12 @@ package java.rmi;
|
||||
* A <code>NoSuchObjectException</code> is also thrown by the method
|
||||
* <code>java.rmi.server.RemoteObject.toStub</code> and by the
|
||||
* <code>unexportObject</code> methods of
|
||||
* <code>java.rmi.server.UnicastRemoteObject</code> and
|
||||
* <code>java.rmi.activation.Activatable</code> and
|
||||
* <code>java.rmi.server.UnicastRemoteObject</code>.
|
||||
*
|
||||
* @author Ann Wollrath
|
||||
* @since 1.1
|
||||
* @see java.rmi.server.RemoteObject#toStub(Remote)
|
||||
* @see java.rmi.server.UnicastRemoteObject#unexportObject(Remote,boolean)
|
||||
* @see java.rmi.activation.Activatable#unexportObject(Remote,boolean)
|
||||
*/
|
||||
public class NoSuchObjectException extends RemoteException {
|
||||
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 1996, 2017, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 1996, 2021, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
@ -33,11 +33,10 @@ package java.rmi;
|
||||
* extends <code>java.rmi.Remote</code> are available remotely.
|
||||
*
|
||||
* <p>Implementation classes can implement any number of remote interfaces and
|
||||
* can extend other remote implementation classes. RMI provides some
|
||||
* convenience classes that remote object implementations can extend which
|
||||
* facilitate remote object creation. These classes are
|
||||
* <code>java.rmi.server.UnicastRemoteObject</code> and
|
||||
* <code>java.rmi.activation.Activatable</code>.
|
||||
* can extend other remote implementation classes. RMI provides a convenience
|
||||
* class {@link java.rmi.server.UnicastRemoteObject UnicastRemoteObject}
|
||||
* that remote object implementations can extend and that facilitates remote
|
||||
* object creation.
|
||||
*
|
||||
* <p>For complete details on RMI, see the <a
|
||||
* href="{@docRoot}/../specs/rmi/index.html">RMI Specification</a> which
|
||||
@ -45,7 +44,5 @@ package java.rmi;
|
||||
*
|
||||
* @since 1.1
|
||||
* @author Ann Wollrath
|
||||
* @see java.rmi.server.UnicastRemoteObject
|
||||
* @see java.rmi.activation.Activatable
|
||||
*/
|
||||
public interface Remote {}
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 1996, 2003, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 1996, 2021, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
@ -28,14 +28,10 @@ package java.rmi;
|
||||
/**
|
||||
* A <code>StubNotFoundException</code> is thrown if a valid stub class
|
||||
* could not be found for a remote object when it is exported.
|
||||
* A <code>StubNotFoundException</code> may also be
|
||||
* thrown when an activatable object is registered via the
|
||||
* <code>java.rmi.activation.Activatable.register</code> method.
|
||||
*
|
||||
* @author Roger Riggs
|
||||
* @since 1.1
|
||||
* @see java.rmi.server.UnicastRemoteObject
|
||||
* @see java.rmi.activation.Activatable
|
||||
*/
|
||||
public class StubNotFoundException extends RemoteException {
|
||||
|
||||
|
@ -1,584 +0,0 @@
|
||||
/*
|
||||
* Copyright (c) 1997, 2020, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
* under the terms of the GNU General Public License version 2 only, as
|
||||
* published by the Free Software Foundation. Oracle designates this
|
||||
* particular file as subject to the "Classpath" exception as provided
|
||||
* by Oracle in the LICENSE file that accompanied this code.
|
||||
*
|
||||
* This code is distributed in the hope that it will be useful, but WITHOUT
|
||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
* version 2 for more details (a copy is included in the LICENSE file that
|
||||
* accompanied this code).
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License version
|
||||
* 2 along with this work; if not, write to the Free Software Foundation,
|
||||
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
*
|
||||
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
|
||||
* or visit www.oracle.com if you need additional information or have any
|
||||
* questions.
|
||||
*/
|
||||
|
||||
package java.rmi.activation;
|
||||
|
||||
import java.rmi.MarshalledObject;
|
||||
import java.rmi.NoSuchObjectException;
|
||||
import java.rmi.Remote;
|
||||
import java.rmi.RemoteException;
|
||||
import java.rmi.activation.UnknownGroupException;
|
||||
import java.rmi.activation.UnknownObjectException;
|
||||
import java.rmi.server.RMIClientSocketFactory;
|
||||
import java.rmi.server.RMIServerSocketFactory;
|
||||
import java.rmi.server.RemoteServer;
|
||||
import sun.rmi.server.ActivatableServerRef;
|
||||
|
||||
/**
|
||||
* The <code>Activatable</code> class provides support for remote
|
||||
* objects that require persistent access over time and that
|
||||
* can be activated by the system.
|
||||
*
|
||||
* <p>For the constructors and static <code>exportObject</code> methods,
|
||||
* the stub for a remote object being exported is obtained as described in
|
||||
* {@link java.rmi.server.UnicastRemoteObject}.
|
||||
*
|
||||
* <p>An attempt to serialize explicitly an instance of this class will
|
||||
* fail.
|
||||
*
|
||||
* @author Ann Wollrath
|
||||
* @since 1.2
|
||||
* @serial exclude
|
||||
* @deprecated
|
||||
* See the <a href="{@docRoot}/java.rmi/java/rmi/activation/package-summary.html">
|
||||
* {@code java.rmi.activation}</a> package specification for further information.
|
||||
*/
|
||||
@Deprecated(forRemoval=true, since="15")
|
||||
@SuppressWarnings("removal")
|
||||
public abstract class Activatable extends RemoteServer {
|
||||
|
||||
private ActivationID id;
|
||||
/** indicate compatibility with the Java 2 SDK v1.2 version of class */
|
||||
private static final long serialVersionUID = -3120617863591563455L;
|
||||
|
||||
/**
|
||||
* Constructs an activatable remote object by registering
|
||||
* an activation descriptor (with the specified location, data, and
|
||||
* restart mode) for this object, and exporting the object with the
|
||||
* specified port.
|
||||
*
|
||||
* <p><strong>Note:</strong> Using the <code>Activatable</code>
|
||||
* constructors that both register and export an activatable remote
|
||||
* object is strongly discouraged because the actions of registering
|
||||
* and exporting the remote object are <i>not</i> guaranteed to be
|
||||
* atomic. Instead, an application should register an activation
|
||||
* descriptor and export a remote object separately, so that exceptions
|
||||
* can be handled properly.
|
||||
*
|
||||
* <p>This method invokes the {@link
|
||||
* #exportObject(Remote,String,MarshalledObject,boolean,int)
|
||||
* exportObject} method with this object, and the specified location,
|
||||
* data, restart mode, and port. Subsequent calls to {@link #getID}
|
||||
* will return the activation identifier returned from the call to
|
||||
* <code>exportObject</code>.
|
||||
*
|
||||
* @param location the location for classes for this object
|
||||
* @param data the object's initialization data
|
||||
* @param port the port on which the object is exported (an anonymous
|
||||
* port is used if port=0)
|
||||
* @param restart if true, the object is restarted (reactivated) when
|
||||
* either the activator is restarted or the object's activation group
|
||||
* is restarted after an unexpected crash; if false, the object is only
|
||||
* activated on demand. Specifying <code>restart</code> to be
|
||||
* <code>true</code> does not force an initial immediate activation of
|
||||
* a newly registered object; initial activation is lazy.
|
||||
* @throws ActivationException if object registration fails.
|
||||
* @throws RemoteException if either of the following fails:
|
||||
* a) registering the object with the activation system or b) exporting
|
||||
* the object to the RMI runtime.
|
||||
* @throws UnsupportedOperationException if and only if activation is
|
||||
* not supported by this implementation.
|
||||
* @since 1.2
|
||||
**/
|
||||
protected Activatable(String location,
|
||||
MarshalledObject<?> data,
|
||||
boolean restart,
|
||||
int port)
|
||||
throws ActivationException, RemoteException
|
||||
{
|
||||
super();
|
||||
id = exportObject(this, location, data, restart, port);
|
||||
}
|
||||
|
||||
/**
|
||||
* Constructs an activatable remote object by registering
|
||||
* an activation descriptor (with the specified location, data, and
|
||||
* restart mode) for this object, and exporting the object with the
|
||||
* specified port, and specified client and server socket factories.
|
||||
*
|
||||
* <p><strong>Note:</strong> Using the <code>Activatable</code>
|
||||
* constructors that both register and export an activatable remote
|
||||
* object is strongly discouraged because the actions of registering
|
||||
* and exporting the remote object are <i>not</i> guaranteed to be
|
||||
* atomic. Instead, an application should register an activation
|
||||
* descriptor and export a remote object separately, so that exceptions
|
||||
* can be handled properly.
|
||||
*
|
||||
* <p>This method invokes the {@link
|
||||
* #exportObject(Remote,String,MarshalledObject,boolean,int,RMIClientSocketFactory,RMIServerSocketFactory)
|
||||
* exportObject} method with this object, and the specified location,
|
||||
* data, restart mode, port, and client and server socket factories.
|
||||
* Subsequent calls to {@link #getID} will return the activation
|
||||
* identifier returned from the call to <code>exportObject</code>.
|
||||
*
|
||||
* @param location the location for classes for this object
|
||||
* @param data the object's initialization data
|
||||
* @param restart if true, the object is restarted (reactivated) when
|
||||
* either the activator is restarted or the object's activation group
|
||||
* is restarted after an unexpected crash; if false, the object is only
|
||||
* activated on demand. Specifying <code>restart</code> to be
|
||||
* <code>true</code> does not force an initial immediate activation of
|
||||
* a newly registered object; initial activation is lazy.
|
||||
* @param port the port on which the object is exported (an anonymous
|
||||
* port is used if port=0)
|
||||
* @param csf the client-side socket factory for making calls to the
|
||||
* remote object
|
||||
* @param ssf the server-side socket factory for receiving remote calls
|
||||
* @throws ActivationException if object registration fails.
|
||||
* @throws RemoteException if either of the following fails:
|
||||
* a) registering the object with the activation system or b) exporting
|
||||
* the object to the RMI runtime.
|
||||
* @throws UnsupportedOperationException if and only if activation is
|
||||
* not supported by this implementation.
|
||||
* @since 1.2
|
||||
**/
|
||||
protected Activatable(String location,
|
||||
MarshalledObject<?> data,
|
||||
boolean restart,
|
||||
int port,
|
||||
RMIClientSocketFactory csf,
|
||||
RMIServerSocketFactory ssf)
|
||||
throws ActivationException, RemoteException
|
||||
{
|
||||
super();
|
||||
id = exportObject(this, location, data, restart, port, csf, ssf);
|
||||
}
|
||||
|
||||
/**
|
||||
* Constructor used to activate/export the object on a specified
|
||||
* port. An "activatable" remote object must have a constructor that
|
||||
* takes two arguments: <ul>
|
||||
* <li>the object's activation identifier (<code>ActivationID</code>), and
|
||||
* <li>the object's initialization data (a <code>MarshalledObject</code>).
|
||||
* </ul><p>
|
||||
*
|
||||
* A concrete subclass of this class must call this constructor when it is
|
||||
* <i>activated</i> via the two parameter constructor described above. As
|
||||
* a side-effect of construction, the remote object is "exported"
|
||||
* to the RMI runtime (on the specified <code>port</code>) and is
|
||||
* available to accept incoming calls from clients.
|
||||
*
|
||||
* @param id activation identifier for the object
|
||||
* @param port the port number on which the object is exported
|
||||
* @throws RemoteException if exporting the object to the RMI
|
||||
* runtime fails
|
||||
* @throws UnsupportedOperationException if and only if activation is
|
||||
* not supported by this implementation
|
||||
* @since 1.2
|
||||
*/
|
||||
protected Activatable(ActivationID id, int port)
|
||||
throws RemoteException
|
||||
{
|
||||
super();
|
||||
this.id = id;
|
||||
exportObject(this, id, port);
|
||||
}
|
||||
|
||||
/**
|
||||
* Constructor used to activate/export the object on a specified
|
||||
* port. An "activatable" remote object must have a constructor that
|
||||
* takes two arguments: <ul>
|
||||
* <li>the object's activation identifier (<code>ActivationID</code>), and
|
||||
* <li>the object's initialization data (a <code>MarshalledObject</code>).
|
||||
* </ul><p>
|
||||
*
|
||||
* A concrete subclass of this class must call this constructor when it is
|
||||
* <i>activated</i> via the two parameter constructor described above. As
|
||||
* a side-effect of construction, the remote object is "exported"
|
||||
* to the RMI runtime (on the specified <code>port</code>) and is
|
||||
* available to accept incoming calls from clients.
|
||||
*
|
||||
* @param id activation identifier for the object
|
||||
* @param port the port number on which the object is exported
|
||||
* @param csf the client-side socket factory for making calls to the
|
||||
* remote object
|
||||
* @param ssf the server-side socket factory for receiving remote calls
|
||||
* @throws RemoteException if exporting the object to the RMI
|
||||
* runtime fails
|
||||
* @throws UnsupportedOperationException if and only if activation is
|
||||
* not supported by this implementation
|
||||
* @since 1.2
|
||||
*/
|
||||
protected Activatable(ActivationID id, int port,
|
||||
RMIClientSocketFactory csf,
|
||||
RMIServerSocketFactory ssf)
|
||||
throws RemoteException
|
||||
{
|
||||
super();
|
||||
this.id = id;
|
||||
exportObject(this, id, port, csf, ssf);
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the object's activation identifier. The method is
|
||||
* protected so that only subclasses can obtain an object's
|
||||
* identifier.
|
||||
* @return the object's activation identifier
|
||||
* @since 1.2
|
||||
*/
|
||||
protected ActivationID getID() {
|
||||
return id;
|
||||
}
|
||||
|
||||
/**
|
||||
* Register an object descriptor for an activatable remote
|
||||
* object so that is can be activated on demand.
|
||||
*
|
||||
* @param desc the object's descriptor
|
||||
* @return the stub for the activatable remote object
|
||||
* @throws UnknownGroupException if group id in <code>desc</code>
|
||||
* is not registered with the activation system
|
||||
* @throws ActivationException if activation system is not running
|
||||
* @throws RemoteException if remote call fails
|
||||
* @throws UnsupportedOperationException if and only if activation is
|
||||
* not supported by this implementation
|
||||
* @since 1.2
|
||||
*/
|
||||
public static Remote register(ActivationDesc desc)
|
||||
throws UnknownGroupException, ActivationException, RemoteException
|
||||
{
|
||||
// register object with activator.
|
||||
ActivationID id =
|
||||
ActivationGroup.getSystem().registerObject(desc);
|
||||
return sun.rmi.server.ActivatableRef.getStub(desc, id);
|
||||
}
|
||||
|
||||
/**
|
||||
* Informs the system that the object with the corresponding activation
|
||||
* <code>id</code> is currently inactive. If the object is currently
|
||||
* active, the object is "unexported" from the RMI runtime (only if
|
||||
* there are no pending or in-progress calls)
|
||||
* so the that it can no longer receive incoming calls. This call
|
||||
* informs this VM's ActivationGroup that the object is inactive,
|
||||
* that, in turn, informs its ActivationMonitor. If this call
|
||||
* completes successfully, a subsequent activate request to the activator
|
||||
* will cause the object to reactivate. The operation may still
|
||||
* succeed if the object is considered active but has already
|
||||
* unexported itself.
|
||||
*
|
||||
* @param id the object's activation identifier
|
||||
* @return true if the operation succeeds (the operation will
|
||||
* succeed if the object in currently known to be active and is
|
||||
* either already unexported or is currently exported and has no
|
||||
* pending/executing calls); false is returned if the object has
|
||||
* pending/executing calls in which case it cannot be deactivated
|
||||
* @throws UnknownObjectException if object is not known (it may
|
||||
* already be inactive)
|
||||
* @throws ActivationException if group is not active
|
||||
* @throws RemoteException if call informing monitor fails
|
||||
* @throws UnsupportedOperationException if and only if activation is
|
||||
* not supported by this implementation
|
||||
* @since 1.2
|
||||
*/
|
||||
public static boolean inactive(ActivationID id)
|
||||
throws UnknownObjectException, ActivationException, RemoteException
|
||||
{
|
||||
return ActivationGroup.currentGroup().inactiveObject(id);
|
||||
}
|
||||
|
||||
/**
|
||||
* Revokes previous registration for the activation descriptor
|
||||
* associated with <code>id</code>. An object can no longer be
|
||||
* activated via that <code>id</code>.
|
||||
*
|
||||
* @param id the object's activation identifier
|
||||
* @throws UnknownObjectException if object (<code>id</code>) is unknown
|
||||
* @throws ActivationException if activation system is not running
|
||||
* @throws RemoteException if remote call to activation system fails
|
||||
* @throws UnsupportedOperationException if and only if activation is
|
||||
* not supported by this implementation
|
||||
* @since 1.2
|
||||
*/
|
||||
public static void unregister(ActivationID id)
|
||||
throws UnknownObjectException, ActivationException, RemoteException
|
||||
{
|
||||
ActivationGroup.getSystem().unregisterObject(id);
|
||||
}
|
||||
|
||||
/**
|
||||
* Registers an activation descriptor (with the specified location,
|
||||
* data, and restart mode) for the specified object, and exports that
|
||||
* object with the specified port.
|
||||
*
|
||||
* <p><strong>Note:</strong> Using this method (as well as the
|
||||
* <code>Activatable</code> constructors that both register and export
|
||||
* an activatable remote object) is strongly discouraged because the
|
||||
* actions of registering and exporting the remote object are
|
||||
* <i>not</i> guaranteed to be atomic. Instead, an application should
|
||||
* register an activation descriptor and export a remote object
|
||||
* separately, so that exceptions can be handled properly.
|
||||
*
|
||||
* <p>This method invokes the {@link
|
||||
* #exportObject(Remote,String,MarshalledObject,boolean,int,RMIClientSocketFactory,RMIServerSocketFactory)
|
||||
* exportObject} method with the specified object, location, data,
|
||||
* restart mode, and port, and <code>null</code> for both client and
|
||||
* server socket factories, and then returns the resulting activation
|
||||
* identifier.
|
||||
*
|
||||
* @param obj the object being exported
|
||||
* @param location the object's code location
|
||||
* @param data the object's bootstrapping data
|
||||
* @param restart if true, the object is restarted (reactivated) when
|
||||
* either the activator is restarted or the object's activation group
|
||||
* is restarted after an unexpected crash; if false, the object is only
|
||||
* activated on demand. Specifying <code>restart</code> to be
|
||||
* <code>true</code> does not force an initial immediate activation of
|
||||
* a newly registered object; initial activation is lazy.
|
||||
* @param port the port on which the object is exported (an anonymous
|
||||
* port is used if port=0)
|
||||
* @return the activation identifier obtained from registering the
|
||||
* descriptor, <code>desc</code>, with the activation system
|
||||
* the wrong group
|
||||
* @throws ActivationException if activation group is not active
|
||||
* @throws RemoteException if object registration or export fails
|
||||
* @throws UnsupportedOperationException if and only if activation is
|
||||
* not supported by this implementation
|
||||
* @since 1.2
|
||||
**/
|
||||
public static ActivationID exportObject(Remote obj,
|
||||
String location,
|
||||
MarshalledObject<?> data,
|
||||
boolean restart,
|
||||
int port)
|
||||
throws ActivationException, RemoteException
|
||||
{
|
||||
return exportObject(obj, location, data, restart, port, null, null);
|
||||
}
|
||||
|
||||
/**
|
||||
* Registers an activation descriptor (with the specified location,
|
||||
* data, and restart mode) for the specified object, and exports that
|
||||
* object with the specified port, and the specified client and server
|
||||
* socket factories.
|
||||
*
|
||||
* <p><strong>Note:</strong> Using this method (as well as the
|
||||
* <code>Activatable</code> constructors that both register and export
|
||||
* an activatable remote object) is strongly discouraged because the
|
||||
* actions of registering and exporting the remote object are
|
||||
* <i>not</i> guaranteed to be atomic. Instead, an application should
|
||||
* register an activation descriptor and export a remote object
|
||||
* separately, so that exceptions can be handled properly.
|
||||
*
|
||||
* <p>This method first registers an activation descriptor for the
|
||||
* specified object as follows. It obtains the activation system by
|
||||
* invoking the method {@link ActivationGroup#getSystem
|
||||
* ActivationGroup.getSystem}. This method then obtains an {@link
|
||||
* ActivationID} for the object by invoking the activation system's
|
||||
* {@link ActivationSystem#registerObject registerObject} method with
|
||||
* an {@link ActivationDesc} constructed with the specified object's
|
||||
* class name, and the specified location, data, and restart mode. If
|
||||
* an exception occurs obtaining the activation system or registering
|
||||
* the activation descriptor, that exception is thrown to the caller.
|
||||
*
|
||||
* <p>Next, this method exports the object by invoking the {@link
|
||||
* #exportObject(Remote,ActivationID,int,RMIClientSocketFactory,RMIServerSocketFactory)
|
||||
* exportObject} method with the specified remote object, the
|
||||
* activation identifier obtained from registration, the specified
|
||||
* port, and the specified client and server socket factories. If an
|
||||
* exception occurs exporting the object, this method attempts to
|
||||
* unregister the activation identifier (obtained from registration) by
|
||||
* invoking the activation system's {@link
|
||||
* ActivationSystem#unregisterObject unregisterObject} method with the
|
||||
* activation identifier. If an exception occurs unregistering the
|
||||
* identifier, that exception is ignored, and the original exception
|
||||
* that occurred exporting the object is thrown to the caller.
|
||||
*
|
||||
* <p>Finally, this method invokes the {@link
|
||||
* ActivationGroup#activeObject activeObject} method on the activation
|
||||
* group in this VM with the activation identifier and the specified
|
||||
* remote object, and returns the activation identifier to the caller.
|
||||
*
|
||||
* @param obj the object being exported
|
||||
* @param location the object's code location
|
||||
* @param data the object's bootstrapping data
|
||||
* @param restart if true, the object is restarted (reactivated) when
|
||||
* either the activator is restarted or the object's activation group
|
||||
* is restarted after an unexpected crash; if false, the object is only
|
||||
* activated on demand. Specifying <code>restart</code> to be
|
||||
* <code>true</code> does not force an initial immediate activation of
|
||||
* a newly registered object; initial activation is lazy.
|
||||
* @param port the port on which the object is exported (an anonymous
|
||||
* port is used if port=0)
|
||||
* @param csf the client-side socket factory for making calls to the
|
||||
* remote object
|
||||
* @param ssf the server-side socket factory for receiving remote calls
|
||||
* @return the activation identifier obtained from registering the
|
||||
* descriptor with the activation system
|
||||
* @throws ActivationException if activation group is not active
|
||||
* @throws RemoteException if object registration or export fails
|
||||
* @throws UnsupportedOperationException if and only if activation is
|
||||
* not supported by this implementation
|
||||
* @since 1.2
|
||||
**/
|
||||
public static ActivationID exportObject(Remote obj,
|
||||
String location,
|
||||
MarshalledObject<?> data,
|
||||
boolean restart,
|
||||
int port,
|
||||
RMIClientSocketFactory csf,
|
||||
RMIServerSocketFactory ssf)
|
||||
throws ActivationException, RemoteException
|
||||
{
|
||||
ActivationDesc desc = new ActivationDesc(obj.getClass().getName(),
|
||||
location, data, restart);
|
||||
/*
|
||||
* Register descriptor.
|
||||
*/
|
||||
ActivationSystem system = ActivationGroup.getSystem();
|
||||
ActivationID id = system.registerObject(desc);
|
||||
|
||||
/*
|
||||
* Export object.
|
||||
*/
|
||||
try {
|
||||
exportObject(obj, id, port, csf, ssf);
|
||||
} catch (RemoteException e) {
|
||||
/*
|
||||
* Attempt to unregister activation descriptor because export
|
||||
* failed and register/export should be atomic (see 4323621).
|
||||
*/
|
||||
try {
|
||||
system.unregisterObject(id);
|
||||
} catch (Exception ex) {
|
||||
}
|
||||
/*
|
||||
* Report original exception.
|
||||
*/
|
||||
throw e;
|
||||
}
|
||||
|
||||
/*
|
||||
* This call can't fail (it is a local call, and the only possible
|
||||
* exception, thrown if the group is inactive, will not be thrown
|
||||
* because the group is not inactive).
|
||||
*/
|
||||
ActivationGroup.currentGroup().activeObject(id, obj);
|
||||
|
||||
return id;
|
||||
}
|
||||
|
||||
/**
|
||||
* Export the activatable remote object to the RMI runtime to make
|
||||
* the object available to receive incoming calls. The object is
|
||||
* exported on an anonymous port, if <code>port</code> is zero. <p>
|
||||
*
|
||||
* During activation, this <code>exportObject</code> method should
|
||||
* be invoked explicitly by an "activatable" object, that does not
|
||||
* extend the <code>Activatable</code> class. There is no need for objects
|
||||
* that do extend the <code>Activatable</code> class to invoke this
|
||||
* method directly because the object is exported during construction.
|
||||
*
|
||||
* @return the stub for the activatable remote object
|
||||
* @param obj the remote object implementation
|
||||
* @param id the object's activation identifier
|
||||
* @param port the port on which the object is exported (an anonymous
|
||||
* port is used if port=0)
|
||||
* @throws RemoteException if object export fails
|
||||
* @throws UnsupportedOperationException if and only if activation is
|
||||
* not supported by this implementation
|
||||
* @since 1.2
|
||||
*/
|
||||
public static Remote exportObject(Remote obj,
|
||||
ActivationID id,
|
||||
int port)
|
||||
throws RemoteException
|
||||
{
|
||||
return exportObject(obj, new ActivatableServerRef(id, port));
|
||||
}
|
||||
|
||||
/**
|
||||
* Export the activatable remote object to the RMI runtime to make
|
||||
* the object available to receive incoming calls. The object is
|
||||
* exported on an anonymous port, if <code>port</code> is zero. <p>
|
||||
*
|
||||
* During activation, this <code>exportObject</code> method should
|
||||
* be invoked explicitly by an "activatable" object, that does not
|
||||
* extend the <code>Activatable</code> class. There is no need for objects
|
||||
* that do extend the <code>Activatable</code> class to invoke this
|
||||
* method directly because the object is exported during construction.
|
||||
*
|
||||
* @return the stub for the activatable remote object
|
||||
* @param obj the remote object implementation
|
||||
* @param id the object's activation identifier
|
||||
* @param port the port on which the object is exported (an anonymous
|
||||
* port is used if port=0)
|
||||
* @param csf the client-side socket factory for making calls to the
|
||||
* remote object
|
||||
* @param ssf the server-side socket factory for receiving remote calls
|
||||
* @throws RemoteException if object export fails
|
||||
* @throws UnsupportedOperationException if and only if activation is
|
||||
* not supported by this implementation
|
||||
* @since 1.2
|
||||
*/
|
||||
public static Remote exportObject(Remote obj,
|
||||
ActivationID id,
|
||||
int port,
|
||||
RMIClientSocketFactory csf,
|
||||
RMIServerSocketFactory ssf)
|
||||
throws RemoteException
|
||||
{
|
||||
return exportObject(obj, new ActivatableServerRef(id, port, csf, ssf));
|
||||
}
|
||||
|
||||
/**
|
||||
* Remove the remote object, obj, from the RMI runtime. If
|
||||
* successful, the object can no longer accept incoming RMI calls.
|
||||
* If the force parameter is true, the object is forcibly unexported
|
||||
* even if there are pending calls to the remote object or the
|
||||
* remote object still has calls in progress. If the force
|
||||
* parameter is false, the object is only unexported if there are
|
||||
* no pending or in progress calls to the object.
|
||||
*
|
||||
* @param obj the remote object to be unexported
|
||||
* @param force if true, unexports the object even if there are
|
||||
* pending or in-progress calls; if false, only unexports the object
|
||||
* if there are no pending or in-progress calls
|
||||
* @return true if operation is successful, false otherwise
|
||||
* @throws NoSuchObjectException if the remote object is not
|
||||
* currently exported
|
||||
* @throws UnsupportedOperationException if and only if activation is
|
||||
* not supported by this implementation
|
||||
* @since 1.2
|
||||
*/
|
||||
public static boolean unexportObject(Remote obj, boolean force)
|
||||
throws NoSuchObjectException
|
||||
{
|
||||
return sun.rmi.transport.ObjectTable.unexportObject(obj, force);
|
||||
}
|
||||
|
||||
/**
|
||||
* Exports the specified object using the specified server ref.
|
||||
*/
|
||||
private static Remote exportObject(Remote obj, ActivatableServerRef sref)
|
||||
throws RemoteException
|
||||
{
|
||||
// if obj extends Activatable, set its ref.
|
||||
if (obj instanceof Activatable) {
|
||||
((Activatable) obj).ref = sref;
|
||||
|
||||
}
|
||||
return sref.exportObject(obj, null, false);
|
||||
}
|
||||
}
|
@ -1,66 +0,0 @@
|
||||
/*
|
||||
* Copyright (c) 1998, 2020, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
* under the terms of the GNU General Public License version 2 only, as
|
||||
* published by the Free Software Foundation. Oracle designates this
|
||||
* particular file as subject to the "Classpath" exception as provided
|
||||
* by Oracle in the LICENSE file that accompanied this code.
|
||||
*
|
||||
* This code is distributed in the hope that it will be useful, but WITHOUT
|
||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
* version 2 for more details (a copy is included in the LICENSE file that
|
||||
* accompanied this code).
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License version
|
||||
* 2 along with this work; if not, write to the Free Software Foundation,
|
||||
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
*
|
||||
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
|
||||
* or visit www.oracle.com if you need additional information or have any
|
||||
* questions.
|
||||
*/
|
||||
|
||||
package java.rmi.activation;
|
||||
|
||||
/**
|
||||
* This exception is thrown by the RMI runtime when activation
|
||||
* fails during a remote call to an activatable object.
|
||||
*
|
||||
* @author Ann Wollrath
|
||||
* @since 1.2
|
||||
* @deprecated
|
||||
* See the <a href="{@docRoot}/java.rmi/java/rmi/activation/package-summary.html">
|
||||
* {@code java.rmi.activation}</a> package specification for further information.
|
||||
*/
|
||||
@Deprecated(forRemoval=true, since="15")
|
||||
public class ActivateFailedException extends java.rmi.RemoteException {
|
||||
|
||||
/** indicate compatibility with the Java 2 SDK v1.2 version of class */
|
||||
private static final long serialVersionUID = 4863550261346652506L;
|
||||
|
||||
/**
|
||||
* Constructs an <code>ActivateFailedException</code> with the specified
|
||||
* detail message.
|
||||
*
|
||||
* @param s the detail message
|
||||
* @since 1.2
|
||||
*/
|
||||
public ActivateFailedException(String s) {
|
||||
super(s);
|
||||
}
|
||||
|
||||
/**
|
||||
* Constructs an <code>ActivateFailedException</code> with the specified
|
||||
* detail message and nested exception.
|
||||
*
|
||||
* @param s the detail message
|
||||
* @param ex the nested exception
|
||||
* @since 1.2
|
||||
*/
|
||||
public ActivateFailedException(String s, Exception ex) {
|
||||
super(s, ex);
|
||||
}
|
||||
}
|
@ -1,352 +0,0 @@
|
||||
/*
|
||||
* Copyright (c) 1997, 2020, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
* under the terms of the GNU General Public License version 2 only, as
|
||||
* published by the Free Software Foundation. Oracle designates this
|
||||
* particular file as subject to the "Classpath" exception as provided
|
||||
* by Oracle in the LICENSE file that accompanied this code.
|
||||
*
|
||||
* This code is distributed in the hope that it will be useful, but WITHOUT
|
||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
* version 2 for more details (a copy is included in the LICENSE file that
|
||||
* accompanied this code).
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License version
|
||||
* 2 along with this work; if not, write to the Free Software Foundation,
|
||||
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
*
|
||||
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
|
||||
* or visit www.oracle.com if you need additional information or have any
|
||||
* questions.
|
||||
*/
|
||||
|
||||
package java.rmi.activation;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.rmi.MarshalledObject;
|
||||
|
||||
/**
|
||||
* An activation descriptor contains the information necessary to
|
||||
* activate an object: <ul>
|
||||
* <li> the object's group identifier,
|
||||
* <li> the object's fully-qualified class name,
|
||||
* <li> the object's code location (the location of the class), a codebase URL
|
||||
* path,
|
||||
* <li> the object's restart "mode", and,
|
||||
* <li> a "marshalled" object that can contain object specific
|
||||
* initialization data. </ul>
|
||||
*
|
||||
* <p>A descriptor registered with the activation system can be used to
|
||||
* recreate/activate the object specified by the descriptor. The
|
||||
* <code>MarshalledObject</code> in the object's descriptor is passed
|
||||
* as the second argument to the remote object's constructor for
|
||||
* object to use during reinitialization/activation.
|
||||
*
|
||||
* @author Ann Wollrath
|
||||
* @since 1.2
|
||||
* @see java.rmi.activation.Activatable
|
||||
* @deprecated
|
||||
* See the <a href="{@docRoot}/java.rmi/java/rmi/activation/package-summary.html">
|
||||
* {@code java.rmi.activation}</a> package specification for further information.
|
||||
*/
|
||||
@Deprecated(forRemoval=true, since="15")
|
||||
@SuppressWarnings("removal")
|
||||
public final class ActivationDesc implements Serializable {
|
||||
|
||||
/**
|
||||
* @serial the group's identifier
|
||||
*/
|
||||
private ActivationGroupID groupID;
|
||||
|
||||
/**
|
||||
* @serial the object's class name
|
||||
*/
|
||||
private String className;
|
||||
|
||||
/**
|
||||
* @serial the object's code location
|
||||
*/
|
||||
private String location;
|
||||
|
||||
/**
|
||||
* @serial the object's initialization data
|
||||
*/
|
||||
private MarshalledObject<?> data;
|
||||
|
||||
/**
|
||||
* @serial indicates whether the object should be restarted
|
||||
*/
|
||||
private boolean restart;
|
||||
|
||||
/** indicate compatibility with the Java 2 SDK v1.2 version of class */
|
||||
private static final long serialVersionUID = 7455834104417690957L;
|
||||
|
||||
/**
|
||||
* Constructs an object descriptor for an object whose class name
|
||||
* is <code>className</code>, that can be loaded from the
|
||||
* code <code>location</code> and whose initialization
|
||||
* information is <code>data</code>. If this form of the constructor
|
||||
* is used, the <code>groupID</code> defaults to the current id for
|
||||
* <code>ActivationGroup</code> for this VM. All objects with the
|
||||
* same <code>ActivationGroupID</code> are activated in the same VM.
|
||||
*
|
||||
* <p>Note that objects specified by a descriptor created with this
|
||||
* constructor will only be activated on demand (by default, the restart
|
||||
* mode is <code>false</code>). If an activatable object requires restart
|
||||
* services, use one of the <code>ActivationDesc</code> constructors that
|
||||
* takes a boolean parameter, <code>restart</code>.
|
||||
*
|
||||
* <p> This constructor will throw <code>ActivationException</code> if
|
||||
* there is no current activation group for this VM. To create an
|
||||
* <code>ActivationGroup</code> use the
|
||||
* <code>ActivationGroup.createGroup</code> method.
|
||||
*
|
||||
* @param className the object's fully package qualified class name
|
||||
* @param location the object's code location (from where the class is
|
||||
* loaded)
|
||||
* @param data the object's initialization (activation) data contained
|
||||
* in marshalled form.
|
||||
* @throws ActivationException if the current group is nonexistent
|
||||
* @throws UnsupportedOperationException if and only if activation is
|
||||
* not supported by this implementation
|
||||
* @since 1.2
|
||||
*/
|
||||
public ActivationDesc(String className,
|
||||
String location,
|
||||
MarshalledObject<?> data)
|
||||
throws ActivationException
|
||||
{
|
||||
this(ActivationGroup.internalCurrentGroupID(),
|
||||
className, location, data, false);
|
||||
}
|
||||
|
||||
/**
|
||||
* Constructs an object descriptor for an object whose class name
|
||||
* is <code>className</code>, that can be loaded from the
|
||||
* code <code>location</code> and whose initialization
|
||||
* information is <code>data</code>. If this form of the constructor
|
||||
* is used, the <code>groupID</code> defaults to the current id for
|
||||
* <code>ActivationGroup</code> for this VM. All objects with the
|
||||
* same <code>ActivationGroupID</code> are activated in the same VM.
|
||||
*
|
||||
* <p>This constructor will throw <code>ActivationException</code> if
|
||||
* there is no current activation group for this VM. To create an
|
||||
* <code>ActivationGroup</code> use the
|
||||
* <code>ActivationGroup.createGroup</code> method.
|
||||
*
|
||||
* @param className the object's fully package qualified class name
|
||||
* @param location the object's code location (from where the class is
|
||||
* loaded)
|
||||
* @param data the object's initialization (activation) data contained
|
||||
* in marshalled form.
|
||||
* @param restart if true, the object is restarted (reactivated) when
|
||||
* either the activator is restarted or the object's activation group
|
||||
* is restarted after an unexpected crash; if false, the object is only
|
||||
* activated on demand. Specifying <code>restart</code> to be
|
||||
* <code>true</code> does not force an initial immediate activation of
|
||||
* a newly registered object; initial activation is lazy.
|
||||
* @throws ActivationException if the current group is nonexistent
|
||||
* @throws UnsupportedOperationException if and only if activation is
|
||||
* not supported by this implementation
|
||||
* @since 1.2
|
||||
*/
|
||||
public ActivationDesc(String className,
|
||||
String location,
|
||||
MarshalledObject<?> data,
|
||||
boolean restart)
|
||||
throws ActivationException
|
||||
{
|
||||
this(ActivationGroup.internalCurrentGroupID(),
|
||||
className, location, data, restart);
|
||||
}
|
||||
|
||||
/**
|
||||
* Constructs an object descriptor for an object whose class name
|
||||
* is <code>className</code> that can be loaded from the
|
||||
* code <code>location</code> and whose initialization
|
||||
* information is <code>data</code>. All objects with the same
|
||||
* <code>groupID</code> are activated in the same Java VM.
|
||||
*
|
||||
* <p>Note that objects specified by a descriptor created with this
|
||||
* constructor will only be activated on demand (by default, the restart
|
||||
* mode is <code>false</code>). If an activatable object requires restart
|
||||
* services, use one of the <code>ActivationDesc</code> constructors that
|
||||
* takes a boolean parameter, <code>restart</code>.
|
||||
*
|
||||
* @param groupID the group's identifier (obtained from registering
|
||||
* <code>ActivationSystem.registerGroup</code> method). The group
|
||||
* indicates the VM in which the object should be activated.
|
||||
* @param className the object's fully package-qualified class name
|
||||
* @param location the object's code location (from where the class is
|
||||
* loaded)
|
||||
* @param data the object's initialization (activation) data contained
|
||||
* in marshalled form.
|
||||
* @throws IllegalArgumentException if <code>groupID</code> is null
|
||||
* @throws UnsupportedOperationException if and only if activation is
|
||||
* not supported by this implementation
|
||||
* @since 1.2
|
||||
*/
|
||||
public ActivationDesc(ActivationGroupID groupID,
|
||||
String className,
|
||||
String location,
|
||||
MarshalledObject<?> data)
|
||||
{
|
||||
this(groupID, className, location, data, false);
|
||||
}
|
||||
|
||||
/**
|
||||
* Constructs an object descriptor for an object whose class name
|
||||
* is <code>className</code> that can be loaded from the
|
||||
* code <code>location</code> and whose initialization
|
||||
* information is <code>data</code>. All objects with the same
|
||||
* <code>groupID</code> are activated in the same Java VM.
|
||||
*
|
||||
* @param groupID the group's identifier (obtained from registering
|
||||
* <code>ActivationSystem.registerGroup</code> method). The group
|
||||
* indicates the VM in which the object should be activated.
|
||||
* @param className the object's fully package-qualified class name
|
||||
* @param location the object's code location (from where the class is
|
||||
* loaded)
|
||||
* @param data the object's initialization (activation) data contained
|
||||
* in marshalled form.
|
||||
* @param restart if true, the object is restarted (reactivated) when
|
||||
* either the activator is restarted or the object's activation group
|
||||
* is restarted after an unexpected crash; if false, the object is only
|
||||
* activated on demand. Specifying <code>restart</code> to be
|
||||
* <code>true</code> does not force an initial immediate activation of
|
||||
* a newly registered object; initial activation is lazy.
|
||||
* @throws IllegalArgumentException if <code>groupID</code> is null
|
||||
* @throws UnsupportedOperationException if and only if activation is
|
||||
* not supported by this implementation
|
||||
* @since 1.2
|
||||
*/
|
||||
public ActivationDesc(ActivationGroupID groupID,
|
||||
String className,
|
||||
String location,
|
||||
MarshalledObject<?> data,
|
||||
boolean restart)
|
||||
{
|
||||
if (groupID == null)
|
||||
throw new IllegalArgumentException("groupID can't be null");
|
||||
this.groupID = groupID;
|
||||
this.className = className;
|
||||
this.location = location;
|
||||
this.data = data;
|
||||
this.restart = restart;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the group identifier for the object specified by this
|
||||
* descriptor. A group provides a way to aggregate objects into a
|
||||
* single Java virtual machine. RMI creates/activates objects with
|
||||
* the same <code>groupID</code> in the same virtual machine.
|
||||
*
|
||||
* @return the group identifier
|
||||
* @since 1.2
|
||||
*/
|
||||
public ActivationGroupID getGroupID() {
|
||||
return groupID;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the class name for the object specified by this
|
||||
* descriptor.
|
||||
* @return the class name
|
||||
* @since 1.2
|
||||
*/
|
||||
public String getClassName() {
|
||||
return className;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the code location for the object specified by
|
||||
* this descriptor.
|
||||
* @return the code location
|
||||
* @since 1.2
|
||||
*/
|
||||
public String getLocation() {
|
||||
return location;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns a "marshalled object" containing intialization/activation
|
||||
* data for the object specified by this descriptor.
|
||||
* @return the object specific "initialization" data
|
||||
* @since 1.2
|
||||
*/
|
||||
public MarshalledObject<?> getData() {
|
||||
return data;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the "restart" mode of the object associated with
|
||||
* this activation descriptor.
|
||||
*
|
||||
* @return true if the activatable object associated with this
|
||||
* activation descriptor is restarted via the activation
|
||||
* daemon when either the daemon comes up or the object's group
|
||||
* is restarted after an unexpected crash; otherwise it returns false,
|
||||
* meaning that the object is only activated on demand via a
|
||||
* method call. Note that if the restart mode is <code>true</code>, the
|
||||
* activator does not force an initial immediate activation of
|
||||
* a newly registered object; initial activation is lazy.
|
||||
* @since 1.2
|
||||
*/
|
||||
public boolean getRestartMode() {
|
||||
return restart;
|
||||
}
|
||||
|
||||
/**
|
||||
* Compares two activation descriptors for content equality.
|
||||
*
|
||||
* @param obj the Object to compare with
|
||||
* @return true if these Objects are equal; false otherwise.
|
||||
* @see java.util.Hashtable
|
||||
* @since 1.2
|
||||
*/
|
||||
public boolean equals(Object obj) {
|
||||
|
||||
if (obj instanceof ActivationDesc) {
|
||||
ActivationDesc desc = (ActivationDesc) obj;
|
||||
return
|
||||
((groupID == null ? desc.groupID == null :
|
||||
groupID.equals(desc.groupID)) &&
|
||||
(className == null ? desc.className == null :
|
||||
className.equals(desc.className)) &&
|
||||
(location == null ? desc.location == null:
|
||||
location.equals(desc.location)) &&
|
||||
(data == null ? desc.data == null :
|
||||
data.equals(desc.data)) &&
|
||||
(restart == desc.restart));
|
||||
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Return the same hashCode for similar <code>ActivationDesc</code>s.
|
||||
* @return an integer
|
||||
* @see java.util.Hashtable
|
||||
*/
|
||||
public int hashCode() {
|
||||
return ((location == null
|
||||
? 0
|
||||
: location.hashCode() << 24) ^
|
||||
(groupID == null
|
||||
? 0
|
||||
: groupID.hashCode() << 16) ^
|
||||
(className == null
|
||||
? 0
|
||||
: className.hashCode() << 9) ^
|
||||
(data == null
|
||||
? 0
|
||||
: data.hashCode() << 1) ^
|
||||
(restart
|
||||
? 1
|
||||
: 0));
|
||||
}
|
||||
}
|
@ -1,122 +0,0 @@
|
||||
/*
|
||||
* Copyright (c) 1997, 2020, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
* under the terms of the GNU General Public License version 2 only, as
|
||||
* published by the Free Software Foundation. Oracle designates this
|
||||
* particular file as subject to the "Classpath" exception as provided
|
||||
* by Oracle in the LICENSE file that accompanied this code.
|
||||
*
|
||||
* This code is distributed in the hope that it will be useful, but WITHOUT
|
||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
* version 2 for more details (a copy is included in the LICENSE file that
|
||||
* accompanied this code).
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License version
|
||||
* 2 along with this work; if not, write to the Free Software Foundation,
|
||||
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
*
|
||||
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
|
||||
* or visit www.oracle.com if you need additional information or have any
|
||||
* questions.
|
||||
*/
|
||||
|
||||
package java.rmi.activation;
|
||||
|
||||
/**
|
||||
* General exception used by the activation interfaces.
|
||||
*
|
||||
* <p>As of release 1.4, this exception has been retrofitted to conform to
|
||||
* the general purpose exception-chaining mechanism. The "detail exception"
|
||||
* that may be provided at construction time and accessed via the public
|
||||
* {@link #detail} field is now known as the <i>cause</i>, and may be
|
||||
* accessed via the {@link Throwable#getCause()} method, as well as
|
||||
* the aforementioned "legacy field."
|
||||
*
|
||||
* <p>Invoking the method {@link Throwable#initCause(Throwable)} on an
|
||||
* instance of {@code ActivationException} always throws {@link
|
||||
* IllegalStateException}.
|
||||
*
|
||||
* @author Ann Wollrath
|
||||
* @since 1.2
|
||||
* @deprecated
|
||||
* See the <a href="{@docRoot}/java.rmi/java/rmi/activation/package-summary.html">
|
||||
* {@code java.rmi.activation}</a> package specification for further information.
|
||||
*/
|
||||
@Deprecated(forRemoval=true, since="15")
|
||||
public class ActivationException extends Exception {
|
||||
|
||||
/**
|
||||
* The cause of the activation exception.
|
||||
*
|
||||
* <p>This field predates the general-purpose exception chaining facility.
|
||||
* The {@link Throwable#getCause()} method is now the preferred means of
|
||||
* obtaining this information.
|
||||
*
|
||||
* @serial
|
||||
*/
|
||||
public Throwable detail;
|
||||
|
||||
/** indicate compatibility with the Java 2 SDK v1.2 version of class */
|
||||
private static final long serialVersionUID = -4320118837291406071L;
|
||||
|
||||
/**
|
||||
* Constructs an {@code ActivationException}.
|
||||
*/
|
||||
public ActivationException() {
|
||||
initCause(null); // Disallow subsequent initCause
|
||||
}
|
||||
|
||||
/**
|
||||
* Constructs an {@code ActivationException} with the specified
|
||||
* detail message.
|
||||
*
|
||||
* @param s the detail message
|
||||
*/
|
||||
public ActivationException(String s) {
|
||||
super(s);
|
||||
initCause(null); // Disallow subsequent initCause
|
||||
}
|
||||
|
||||
/**
|
||||
* Constructs an {@code ActivationException} with the specified
|
||||
* detail message and cause. This constructor sets the {@link #detail}
|
||||
* field to the specified {@code Throwable}.
|
||||
*
|
||||
* @param s the detail message
|
||||
* @param cause the cause
|
||||
*/
|
||||
public ActivationException(String s, Throwable cause) {
|
||||
super(s);
|
||||
initCause(null); // Disallow subsequent initCause
|
||||
detail = cause;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the detail message, including the message from the cause, if
|
||||
* any, of this exception.
|
||||
*
|
||||
* @return the detail message
|
||||
*/
|
||||
public String getMessage() {
|
||||
if (detail == null)
|
||||
return super.getMessage();
|
||||
else
|
||||
return super.getMessage() +
|
||||
"; nested exception is: \n\t" +
|
||||
detail.toString();
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the cause of this exception. This method returns the value
|
||||
* of the {@link #detail} field.
|
||||
*
|
||||
* @return the cause, which may be {@code null}.
|
||||
* @since 1.4
|
||||
*/
|
||||
public Throwable getCause() {
|
||||
return detail;
|
||||
}
|
||||
}
|
@ -1,543 +0,0 @@
|
||||
/*
|
||||
* Copyright (c) 1997, 2020, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
* under the terms of the GNU General Public License version 2 only, as
|
||||
* published by the Free Software Foundation. Oracle designates this
|
||||
* particular file as subject to the "Classpath" exception as provided
|
||||
* by Oracle in the LICENSE file that accompanied this code.
|
||||
*
|
||||
* This code is distributed in the hope that it will be useful, but WITHOUT
|
||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
* version 2 for more details (a copy is included in the LICENSE file that
|
||||
* accompanied this code).
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License version
|
||||
* 2 along with this work; if not, write to the Free Software Foundation,
|
||||
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
*
|
||||
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
|
||||
* or visit www.oracle.com if you need additional information or have any
|
||||
* questions.
|
||||
*/
|
||||
|
||||
package java.rmi.activation;
|
||||
|
||||
import java.lang.reflect.Constructor;
|
||||
import java.lang.reflect.InvocationTargetException;
|
||||
import java.rmi.MarshalledObject;
|
||||
import java.rmi.Naming;
|
||||
import java.rmi.Remote;
|
||||
import java.rmi.RemoteException;
|
||||
import java.rmi.activation.UnknownGroupException;
|
||||
import java.rmi.activation.UnknownObjectException;
|
||||
import java.rmi.server.RMIClassLoader;
|
||||
import java.rmi.server.UnicastRemoteObject;
|
||||
import java.security.AccessController;
|
||||
import java.security.PrivilegedAction;
|
||||
|
||||
/**
|
||||
* An <code>ActivationGroup</code> is responsible for creating new
|
||||
* instances of "activatable" objects in its group, informing its
|
||||
* <code>ActivationMonitor</code> when either: its object's become
|
||||
* active or inactive, or the group as a whole becomes inactive. <p>
|
||||
*
|
||||
* An <code>ActivationGroup</code> is <i>initially</i> created in one
|
||||
* of several ways: <ul>
|
||||
* <li>as a side-effect of creating an <code>ActivationDesc</code>
|
||||
* without an explicit <code>ActivationGroupID</code> for the
|
||||
* first activatable object in the group, or
|
||||
* <li>via the <code>ActivationGroup.createGroup</code> method
|
||||
* <li>as a side-effect of activating the first object in a group
|
||||
* whose <code>ActivationGroupDesc</code> was only registered.</ul><p>
|
||||
*
|
||||
* Only the activator can <i>recreate</i> an
|
||||
* <code>ActivationGroup</code>. The activator spawns, as needed, a
|
||||
* separate VM (as a child process, for example) for each registered
|
||||
* activation group and directs activation requests to the appropriate
|
||||
* group. It is implementation specific how VMs are spawned. An
|
||||
* activation group is created via the
|
||||
* <code>ActivationGroup.createGroup</code> static method. The
|
||||
* <code>createGroup</code> method has two requirements on the group
|
||||
* to be created: 1) the group must be a concrete subclass of
|
||||
* <code>ActivationGroup</code>, and 2) the group must have a
|
||||
* constructor that takes two arguments:
|
||||
*
|
||||
* <ul>
|
||||
* <li> the group's <code>ActivationGroupID</code>, and
|
||||
* <li> the group's initialization data (in a
|
||||
* <code>java.rmi.MarshalledObject</code>)</ul><p>
|
||||
*
|
||||
* When created, the default implementation of
|
||||
* <code>ActivationGroup</code> will override the system properties
|
||||
* with the properties requested when its
|
||||
* <code>ActivationGroupDesc</code> was created, and will set a
|
||||
* {@link SecurityManager} as the default system
|
||||
* security manager. If your application requires specific properties
|
||||
* to be set when objects are activated in the group, the application
|
||||
* should create a special <code>Properties</code> object containing
|
||||
* these properties, then create an <code>ActivationGroupDesc</code>
|
||||
* with the <code>Properties</code> object, and use
|
||||
* <code>ActivationGroup.createGroup</code> before creating any
|
||||
* <code>ActivationDesc</code>s (before the default
|
||||
* <code>ActivationGroupDesc</code> is created). If your application
|
||||
* requires the use of a security manager other than
|
||||
* {@link SecurityManager}, in the
|
||||
* ActivativationGroupDescriptor properties list you can set
|
||||
* <code>java.security.manager</code> property to the name of the security
|
||||
* manager you would like to install.
|
||||
*
|
||||
* @author Ann Wollrath
|
||||
* @see ActivationInstantiator
|
||||
* @see ActivationGroupDesc
|
||||
* @see ActivationGroupID
|
||||
* @since 1.2
|
||||
* @deprecated
|
||||
* See the <a href="{@docRoot}/java.rmi/java/rmi/activation/package-summary.html">
|
||||
* {@code java.rmi.activation}</a> package specification for further information.
|
||||
*/
|
||||
@Deprecated(forRemoval=true, since="15")
|
||||
@SuppressWarnings("removal")
|
||||
public abstract class ActivationGroup
|
||||
extends UnicastRemoteObject
|
||||
implements ActivationInstantiator
|
||||
{
|
||||
/**
|
||||
* @serial the group's identifier
|
||||
*/
|
||||
private ActivationGroupID groupID;
|
||||
|
||||
/**
|
||||
* @serial the group's monitor
|
||||
*/
|
||||
@SuppressWarnings("serial") // Not statically typed as Serializable
|
||||
private ActivationMonitor monitor;
|
||||
|
||||
/**
|
||||
* @serial the group's incarnation number
|
||||
*/
|
||||
private long incarnation;
|
||||
|
||||
/** the current activation group for this VM */
|
||||
private static ActivationGroup currGroup;
|
||||
/** the current group's identifier */
|
||||
private static ActivationGroupID currGroupID;
|
||||
/** the current group's activation system */
|
||||
private static ActivationSystem currSystem;
|
||||
/** used to control a group being created only once */
|
||||
private static boolean canCreate = true;
|
||||
|
||||
/** indicate compatibility with the Java 2 SDK v1.2 version of class */
|
||||
private static final long serialVersionUID = -7696947875314805420L;
|
||||
|
||||
/**
|
||||
* Constructs an activation group with the given activation group
|
||||
* identifier. The group is exported as a
|
||||
* <code>java.rmi.server.UnicastRemoteObject</code>.
|
||||
*
|
||||
* @param groupID the group's identifier
|
||||
* @throws RemoteException if this group could not be exported
|
||||
* @throws UnsupportedOperationException if and only if activation is
|
||||
* not supported by this implementation
|
||||
* @since 1.2
|
||||
*/
|
||||
protected ActivationGroup(ActivationGroupID groupID)
|
||||
throws RemoteException
|
||||
{
|
||||
// call super constructor to export the object
|
||||
super();
|
||||
this.groupID = groupID;
|
||||
}
|
||||
|
||||
/**
|
||||
* The group's <code>inactiveObject</code> method is called
|
||||
* indirectly via a call to the <code>Activatable.inactive</code>
|
||||
* method. A remote object implementation must call
|
||||
* <code>Activatable</code>'s <code>inactive</code> method when
|
||||
* that object deactivates (the object deems that it is no longer
|
||||
* active). If the object does not call
|
||||
* <code>Activatable.inactive</code> when it deactivates, the
|
||||
* object will never be garbage collected since the group keeps
|
||||
* strong references to the objects it creates.
|
||||
*
|
||||
* <p>The group's <code>inactiveObject</code> method unexports the
|
||||
* remote object from the RMI runtime so that the object can no
|
||||
* longer receive incoming RMI calls. An object will only be unexported
|
||||
* if the object has no pending or executing calls.
|
||||
* The subclass of <code>ActivationGroup</code> must override this
|
||||
* method and unexport the object.
|
||||
*
|
||||
* <p>After removing the object from the RMI runtime, the group
|
||||
* must inform its <code>ActivationMonitor</code> (via the monitor's
|
||||
* <code>inactiveObject</code> method) that the remote object is
|
||||
* not currently active so that the remote object will be
|
||||
* re-activated by the activator upon a subsequent activation
|
||||
* request.
|
||||
*
|
||||
* <p>This method simply informs the group's monitor that the object
|
||||
* is inactive. It is up to the concrete subclass of ActivationGroup
|
||||
* to fulfill the additional requirement of unexporting the object.
|
||||
*
|
||||
* @param id the object's activation identifier
|
||||
* @return true if the object was successfully deactivated; otherwise
|
||||
* returns false.
|
||||
* @throws UnknownObjectException if object is unknown (may already
|
||||
* be inactive)
|
||||
* @throws RemoteException if call informing monitor fails
|
||||
* @throws ActivationException if group is inactive
|
||||
* @since 1.2
|
||||
*/
|
||||
public boolean inactiveObject(ActivationID id)
|
||||
throws ActivationException, UnknownObjectException, RemoteException
|
||||
{
|
||||
getMonitor().inactiveObject(id);
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* The group's <code>activeObject</code> method is called when an
|
||||
* object is exported (either by <code>Activatable</code> object
|
||||
* construction or an explicit call to
|
||||
* <code>Activatable.exportObject</code>. The group must inform its
|
||||
* <code>ActivationMonitor</code> that the object is active (via
|
||||
* the monitor's <code>activeObject</code> method) if the group
|
||||
* hasn't already done so.
|
||||
*
|
||||
* @param id the object's identifier
|
||||
* @param obj the remote object implementation
|
||||
* @throws UnknownObjectException if object is not registered
|
||||
* @throws RemoteException if call informing monitor fails
|
||||
* @throws ActivationException if group is inactive
|
||||
* @since 1.2
|
||||
*/
|
||||
public abstract void activeObject(ActivationID id, Remote obj)
|
||||
throws ActivationException, UnknownObjectException, RemoteException;
|
||||
|
||||
/**
|
||||
* Create and set the activation group for the current VM. The
|
||||
* activation group can only be set if it is not currently set.
|
||||
* An activation group is set using the <code>createGroup</code>
|
||||
* method when the <code>Activator</code> initiates the
|
||||
* re-creation of an activation group in order to carry out
|
||||
* incoming <code>activate</code> requests. A group must first be
|
||||
* registered with the <code>ActivationSystem</code> before it can
|
||||
* be created via this method.
|
||||
*
|
||||
* <p>The group class specified by the
|
||||
* <code>ActivationGroupDesc</code> must be a concrete subclass of
|
||||
* <code>ActivationGroup</code> and have a public constructor that
|
||||
* takes two arguments: the <code>ActivationGroupID</code> for the
|
||||
* group and the <code>MarshalledObject</code> containing the
|
||||
* group's initialization data (obtained from the
|
||||
* <code>ActivationGroupDesc</code>.
|
||||
*
|
||||
* <p>If the group class name specified in the
|
||||
* <code>ActivationGroupDesc</code> is <code>null</code>, then
|
||||
* this method will behave as if the group descriptor contained
|
||||
* the name of the default activation group implementation class.
|
||||
*
|
||||
* <p>Note that if your application creates its own custom
|
||||
* activation group, a security manager must be set for that
|
||||
* group. Otherwise objects cannot be activated in the group.
|
||||
* {@link SecurityManager} is set by default.
|
||||
*
|
||||
* <p>If a security manager is already set in the group VM, this
|
||||
* method first calls the security manager's
|
||||
* <code>checkSetFactory</code> method. This could result in a
|
||||
* <code>SecurityException</code>. If your application needs to
|
||||
* set a different security manager, you must ensure that the
|
||||
* policy file specified by the group's
|
||||
* <code>ActivationGroupDesc</code> grants the group the necessary
|
||||
* permissions to set a new security manager. (Note: This will be
|
||||
* necessary if your group downloads and sets a security manager).
|
||||
*
|
||||
* <p>After the group is created, the
|
||||
* <code>ActivationSystem</code> is informed that the group is
|
||||
* active by calling the <code>activeGroup</code> method which
|
||||
* returns the <code>ActivationMonitor</code> for the group. The
|
||||
* application need not call <code>activeGroup</code>
|
||||
* independently since it is taken care of by this method.
|
||||
*
|
||||
* <p>Once a group is created, subsequent calls to the
|
||||
* <code>currentGroupID</code> method will return the identifier
|
||||
* for this group until the group becomes inactive.
|
||||
*
|
||||
* @param id the activation group's identifier
|
||||
* @param desc the activation group's descriptor
|
||||
* @param incarnation the group's incarnation number (zero on group's
|
||||
* initial creation)
|
||||
* @return the activation group for the VM
|
||||
* @throws ActivationException if group already exists or if error
|
||||
* occurs during group creation
|
||||
* @throws SecurityException if permission to create group is denied.
|
||||
* (Note: The default implementation of the security manager
|
||||
* <code>checkSetFactory</code>
|
||||
* method requires the RuntimePermission "setFactory")
|
||||
* @throws UnsupportedOperationException if and only if activation is
|
||||
* not supported by this implementation
|
||||
* @see SecurityManager#checkSetFactory
|
||||
* @since 1.2
|
||||
*/
|
||||
public static synchronized
|
||||
ActivationGroup createGroup(ActivationGroupID id,
|
||||
final ActivationGroupDesc desc,
|
||||
long incarnation)
|
||||
throws ActivationException
|
||||
{
|
||||
SecurityManager security = System.getSecurityManager();
|
||||
if (security != null)
|
||||
security.checkSetFactory();
|
||||
|
||||
if (currGroup != null)
|
||||
throw new ActivationException("group already exists");
|
||||
|
||||
if (canCreate == false)
|
||||
throw new ActivationException("group deactivated and " +
|
||||
"cannot be recreated");
|
||||
|
||||
try {
|
||||
// load group's class
|
||||
String groupClassName = desc.getClassName();
|
||||
Class<? extends ActivationGroup> cl;
|
||||
Class<? extends ActivationGroup> defaultGroupClass =
|
||||
sun.rmi.server.ActivationGroupImpl.class;
|
||||
if (groupClassName == null || // see 4252236
|
||||
groupClassName.equals(defaultGroupClass.getName()))
|
||||
{
|
||||
cl = defaultGroupClass;
|
||||
} else {
|
||||
Class<?> cl0;
|
||||
try {
|
||||
cl0 = RMIClassLoader.loadClass(desc.getLocation(),
|
||||
groupClassName);
|
||||
} catch (Exception ex) {
|
||||
throw new ActivationException(
|
||||
"Could not load group implementation class", ex);
|
||||
}
|
||||
if (ActivationGroup.class.isAssignableFrom(cl0)) {
|
||||
cl = cl0.asSubclass(ActivationGroup.class);
|
||||
} else {
|
||||
throw new ActivationException("group not correct class: " +
|
||||
cl0.getName());
|
||||
}
|
||||
}
|
||||
|
||||
// create group
|
||||
Constructor<? extends ActivationGroup> constructor =
|
||||
cl.getConstructor(ActivationGroupID.class,
|
||||
MarshalledObject.class);
|
||||
ActivationGroup newGroup =
|
||||
constructor.newInstance(id, desc.getData());
|
||||
currSystem = id.getSystem();
|
||||
newGroup.incarnation = incarnation;
|
||||
newGroup.monitor =
|
||||
currSystem.activeGroup(id, newGroup, incarnation);
|
||||
currGroup = newGroup;
|
||||
currGroupID = id;
|
||||
canCreate = false;
|
||||
} catch (InvocationTargetException e) {
|
||||
e.getTargetException().printStackTrace();
|
||||
throw new ActivationException("exception in group constructor",
|
||||
e.getTargetException());
|
||||
|
||||
} catch (ActivationException e) {
|
||||
throw e;
|
||||
|
||||
} catch (Exception e) {
|
||||
throw new ActivationException("exception creating group", e);
|
||||
}
|
||||
|
||||
return currGroup;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the current activation group's identifier. Returns null
|
||||
* if no group is currently active for this VM.
|
||||
* @throws UnsupportedOperationException if and only if activation is
|
||||
* not supported by this implementation
|
||||
* @return the activation group's identifier
|
||||
* @since 1.2
|
||||
*/
|
||||
public static synchronized ActivationGroupID currentGroupID() {
|
||||
return currGroupID;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the activation group identifier for the VM. If an
|
||||
* activation group does not exist for this VM, a default
|
||||
* activation group is created. A group can be created only once,
|
||||
* so if a group has already become active and deactivated.
|
||||
*
|
||||
* @return the activation group identifier
|
||||
* @throws ActivationException if error occurs during group
|
||||
* creation, if security manager is not set, or if the group
|
||||
* has already been created and deactivated.
|
||||
*/
|
||||
static synchronized ActivationGroupID internalCurrentGroupID()
|
||||
throws ActivationException
|
||||
{
|
||||
if (currGroupID == null)
|
||||
throw new ActivationException("nonexistent group");
|
||||
|
||||
return currGroupID;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set the activation system for the VM. The activation system can
|
||||
* only be set it if no group is currently active. If the activation
|
||||
* system is not set via this call, then the <code>getSystem</code>
|
||||
* method attempts to obtain a reference to the
|
||||
* <code>ActivationSystem</code> by looking up the name
|
||||
* "java.rmi.activation.ActivationSystem" in the Activator's
|
||||
* registry. By default, the port number used to look up the
|
||||
* activation system is defined by
|
||||
* <code>ActivationSystem.SYSTEM_PORT</code>. This port can be overridden
|
||||
* by setting the property <code>java.rmi.activation.port</code>.
|
||||
*
|
||||
* <p>If there is a security manager, this method first
|
||||
* calls the security manager's <code>checkSetFactory</code> method.
|
||||
* This could result in a SecurityException.
|
||||
*
|
||||
* @param system remote reference to the <code>ActivationSystem</code>
|
||||
* @throws ActivationException if activation system is already set
|
||||
* @throws SecurityException if permission to set the activation system is denied.
|
||||
* (Note: The default implementation of the security manager
|
||||
* <code>checkSetFactory</code>
|
||||
* method requires the RuntimePermission "setFactory")
|
||||
* @throws UnsupportedOperationException if and only if activation is
|
||||
* not supported by this implementation
|
||||
* @see #getSystem
|
||||
* @see SecurityManager#checkSetFactory
|
||||
* @since 1.2
|
||||
*/
|
||||
public static synchronized void setSystem(ActivationSystem system)
|
||||
throws ActivationException
|
||||
{
|
||||
SecurityManager security = System.getSecurityManager();
|
||||
if (security != null)
|
||||
security.checkSetFactory();
|
||||
|
||||
if (currSystem != null)
|
||||
throw new ActivationException("activation system already set");
|
||||
|
||||
currSystem = system;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the activation system for the VM. The activation system
|
||||
* may be set by the <code>setSystem</code> method. If the
|
||||
* activation system is not set via the <code>setSystem</code>
|
||||
* method, then the <code>getSystem</code> method attempts to
|
||||
* obtain a reference to the <code>ActivationSystem</code> by
|
||||
* looking up the name "java.rmi.activation.ActivationSystem" in
|
||||
* the Activator's registry. By default, the port number used to
|
||||
* look up the activation system is defined by
|
||||
* <code>ActivationSystem.SYSTEM_PORT</code>. This port can be
|
||||
* overridden by setting the property
|
||||
* <code>java.rmi.activation.port</code>.
|
||||
*
|
||||
* @return the activation system for the VM/group
|
||||
* @throws ActivationException if activation system cannot be
|
||||
* obtained or is not bound
|
||||
* (means that it is not running)
|
||||
* @throws UnsupportedOperationException if and only if activation is
|
||||
* not supported by this implementation
|
||||
* @see #setSystem
|
||||
* @since 1.2
|
||||
*/
|
||||
public static synchronized ActivationSystem getSystem()
|
||||
throws ActivationException
|
||||
{
|
||||
if (currSystem == null) {
|
||||
try {
|
||||
int port = AccessController.doPrivileged((PrivilegedAction<Integer>) () ->
|
||||
Integer.getInteger("java.rmi.activation.port", ActivationSystem.SYSTEM_PORT));
|
||||
currSystem = (ActivationSystem)
|
||||
Naming.lookup("//:" + port +
|
||||
"/java.rmi.activation.ActivationSystem");
|
||||
} catch (Exception e) {
|
||||
throw new ActivationException(
|
||||
"unable to obtain ActivationSystem", e);
|
||||
}
|
||||
}
|
||||
return currSystem;
|
||||
}
|
||||
|
||||
/**
|
||||
* This protected method is necessary for subclasses to
|
||||
* make the <code>activeObject</code> callback to the group's
|
||||
* monitor. The call is simply forwarded to the group's
|
||||
* <code>ActivationMonitor</code>.
|
||||
*
|
||||
* @param id the object's identifier
|
||||
* @param mobj a marshalled object containing the remote object's stub
|
||||
* @throws UnknownObjectException if object is not registered
|
||||
* @throws RemoteException if call informing monitor fails
|
||||
* @throws ActivationException if an activation error occurs
|
||||
* @since 1.2
|
||||
*/
|
||||
protected void activeObject(ActivationID id,
|
||||
MarshalledObject<? extends Remote> mobj)
|
||||
throws ActivationException, UnknownObjectException, RemoteException
|
||||
{
|
||||
getMonitor().activeObject(id, mobj);
|
||||
}
|
||||
|
||||
/**
|
||||
* This protected method is necessary for subclasses to
|
||||
* make the <code>inactiveGroup</code> callback to the group's
|
||||
* monitor. The call is simply forwarded to the group's
|
||||
* <code>ActivationMonitor</code>. Also, the current group
|
||||
* for the VM is set to null.
|
||||
*
|
||||
* @throws UnknownGroupException if group is not registered
|
||||
* @throws RemoteException if call informing monitor fails
|
||||
* @since 1.2
|
||||
*/
|
||||
protected void inactiveGroup()
|
||||
throws UnknownGroupException, RemoteException
|
||||
{
|
||||
try {
|
||||
getMonitor().inactiveGroup(groupID, incarnation);
|
||||
} finally {
|
||||
destroyGroup();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the monitor for the activation group.
|
||||
*/
|
||||
private ActivationMonitor getMonitor() throws RemoteException {
|
||||
synchronized (ActivationGroup.class) {
|
||||
if (monitor != null) {
|
||||
return monitor;
|
||||
}
|
||||
}
|
||||
throw new RemoteException("monitor not received");
|
||||
}
|
||||
|
||||
/**
|
||||
* Destroys the current group.
|
||||
*/
|
||||
private static synchronized void destroyGroup() {
|
||||
currGroup = null;
|
||||
currGroupID = null;
|
||||
// NOTE: don't set currSystem to null since it may be needed
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the current group for the VM.
|
||||
* @throws ActivationException if current group is null (not active)
|
||||
*/
|
||||
static synchronized ActivationGroup currentGroup()
|
||||
throws ActivationException
|
||||
{
|
||||
if (currGroup == null) {
|
||||
throw new ActivationException("group is not active");
|
||||
}
|
||||
return currGroup;
|
||||
}
|
||||
|
||||
}
|
@ -1,381 +0,0 @@
|
||||
/*
|
||||
* Copyright (c) 1997, 2020, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
* under the terms of the GNU General Public License version 2 only, as
|
||||
* published by the Free Software Foundation. Oracle designates this
|
||||
* particular file as subject to the "Classpath" exception as provided
|
||||
* by Oracle in the LICENSE file that accompanied this code.
|
||||
*
|
||||
* This code is distributed in the hope that it will be useful, but WITHOUT
|
||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
* version 2 for more details (a copy is included in the LICENSE file that
|
||||
* accompanied this code).
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License version
|
||||
* 2 along with this work; if not, write to the Free Software Foundation,
|
||||
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
*
|
||||
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
|
||||
* or visit www.oracle.com if you need additional information or have any
|
||||
* questions.
|
||||
*/
|
||||
|
||||
package java.rmi.activation;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.io.ObjectInputStream;
|
||||
import java.io.Serializable;
|
||||
import java.rmi.MarshalledObject;
|
||||
import java.util.Arrays;
|
||||
import java.util.Properties;
|
||||
|
||||
/**
|
||||
* An activation group descriptor contains the information necessary to
|
||||
* create/recreate an activation group in which to activate objects.
|
||||
* Such a descriptor contains: <ul>
|
||||
* <li> the group's class name,
|
||||
* <li> the group's code location (the location of the group's class), and
|
||||
* <li> a "marshalled" object that can contain group specific
|
||||
* initialization data. </ul> <p>
|
||||
*
|
||||
* The group's class must be a concrete subclass of
|
||||
* <code>ActivationGroup</code>. A subclass of
|
||||
* <code>ActivationGroup</code> is created/recreated via the
|
||||
* <code>ActivationGroup.createGroup</code> static method that invokes
|
||||
* a special constructor that takes two arguments: <ul>
|
||||
*
|
||||
* <li> the group's <code>ActivationGroupID</code>, and
|
||||
* <li> the group's initialization data (in a
|
||||
* <code>java.rmi.MarshalledObject</code>)</ul>
|
||||
*
|
||||
* @author Ann Wollrath
|
||||
* @since 1.2
|
||||
* @see ActivationGroup
|
||||
* @see ActivationGroupID
|
||||
* @deprecated
|
||||
* See the <a href="{@docRoot}/java.rmi/java/rmi/activation/package-summary.html">
|
||||
* {@code java.rmi.activation}</a> package specification for further information.
|
||||
*/
|
||||
@Deprecated(forRemoval=true, since="15")
|
||||
public final class ActivationGroupDesc implements Serializable {
|
||||
|
||||
/**
|
||||
* @serial The group's fully package qualified class name.
|
||||
*/
|
||||
private String className;
|
||||
|
||||
/**
|
||||
* @serial The location from where to load the group's class.
|
||||
*/
|
||||
private String location;
|
||||
|
||||
/**
|
||||
* @serial The group's initialization data.
|
||||
*/
|
||||
private MarshalledObject<?> data;
|
||||
|
||||
/**
|
||||
* @serial The controlling options for executing the VM in
|
||||
* another process.
|
||||
*/
|
||||
private CommandEnvironment env;
|
||||
|
||||
/**
|
||||
* @serial A properties map which will override those set
|
||||
* by default in the subprocess environment.
|
||||
*/
|
||||
private Properties props;
|
||||
|
||||
/** indicate compatibility with the Java 2 SDK v1.2 version of class */
|
||||
@java.io.Serial
|
||||
private static final long serialVersionUID = -4936225423168276595L;
|
||||
|
||||
/**
|
||||
* Constructs a group descriptor that uses the system defaults for group
|
||||
* implementation and code location. Properties specify Java
|
||||
* environment overrides (which will override system properties in
|
||||
* the group implementation's VM). The command
|
||||
* environment can control the exact command/options used in
|
||||
* starting the child VM, or can be <code>null</code> to accept
|
||||
* rmid's default.
|
||||
*
|
||||
* <p>This constructor will create an <code>ActivationGroupDesc</code>
|
||||
* with a <code>null</code> group class name, which indicates the system's
|
||||
* default <code>ActivationGroup</code> implementation.
|
||||
*
|
||||
* @param overrides the set of properties to set when the group is
|
||||
* recreated.
|
||||
* @param cmd the controlling options for executing the VM in
|
||||
* another process (or <code>null</code>).
|
||||
* @since 1.2
|
||||
*/
|
||||
public ActivationGroupDesc(Properties overrides,
|
||||
CommandEnvironment cmd)
|
||||
{
|
||||
this(null, null, null, overrides, cmd);
|
||||
}
|
||||
|
||||
/**
|
||||
* Specifies an alternate group implementation and execution
|
||||
* environment to be used for the group.
|
||||
*
|
||||
* @param className the group's package qualified class name or
|
||||
* <code>null</code>. A <code>null</code> group class name indicates
|
||||
* the system's default <code>ActivationGroup</code> implementation.
|
||||
* @param location the location from where to load the group's
|
||||
* class
|
||||
* @param data the group's initialization data contained in
|
||||
* marshalled form (could contain properties, for example)
|
||||
* @param overrides a properties map which will override those set
|
||||
* by default in the subprocess environment (will be translated
|
||||
* into <code>-D</code> options), or <code>null</code>.
|
||||
* @param cmd the controlling options for executing the VM in
|
||||
* another process (or <code>null</code>).
|
||||
* @since 1.2
|
||||
*/
|
||||
public ActivationGroupDesc(String className,
|
||||
String location,
|
||||
MarshalledObject<?> data,
|
||||
Properties overrides,
|
||||
CommandEnvironment cmd)
|
||||
{
|
||||
this.props = overrides;
|
||||
this.env = cmd;
|
||||
this.data = data;
|
||||
this.location = location;
|
||||
this.className = className;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the group's class name (possibly <code>null</code>). A
|
||||
* <code>null</code> group class name indicates the system's default
|
||||
* <code>ActivationGroup</code> implementation.
|
||||
* @return the group's class name
|
||||
* @since 1.2
|
||||
*/
|
||||
public String getClassName() {
|
||||
return className;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the group's code location.
|
||||
* @return the group's code location
|
||||
* @since 1.2
|
||||
*/
|
||||
public String getLocation() {
|
||||
return location;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the group's initialization data.
|
||||
* @return the group's initialization data
|
||||
* @since 1.2
|
||||
*/
|
||||
public MarshalledObject<?> getData() {
|
||||
return data;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the group's property-override list.
|
||||
* @return the property-override list, or <code>null</code>
|
||||
* @since 1.2
|
||||
*/
|
||||
public Properties getPropertyOverrides() {
|
||||
return (props != null) ? (Properties) props.clone() : null;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the group's command-environment control object.
|
||||
* @return the command-environment object, or <code>null</code>
|
||||
* @since 1.2
|
||||
*/
|
||||
public CommandEnvironment getCommandEnvironment() {
|
||||
return this.env;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Startup options for ActivationGroup implementations.
|
||||
*
|
||||
* This class allows overriding default system properties and
|
||||
* specifying implementation-defined options for ActivationGroups.
|
||||
* @since 1.2
|
||||
*/
|
||||
public static class CommandEnvironment implements Serializable {
|
||||
@java.io.Serial
|
||||
private static final long serialVersionUID = 6165754737887770191L;
|
||||
|
||||
/**
|
||||
* @serial
|
||||
*/
|
||||
private String command;
|
||||
|
||||
/**
|
||||
* @serial
|
||||
*/
|
||||
private String[] options;
|
||||
|
||||
/**
|
||||
* Create a CommandEnvironment with all the necessary
|
||||
* information.
|
||||
*
|
||||
* @param cmdpath the name of the java executable, including
|
||||
* the full path, or <code>null</code>, meaning "use rmid's default".
|
||||
* The named program <em>must</em> be able to accept multiple
|
||||
* <code>-Dpropname=value</code> options (as documented for the
|
||||
* "java" tool)
|
||||
*
|
||||
* @param argv extra options which will be used in creating the
|
||||
* ActivationGroup. Null has the same effect as an empty
|
||||
* list.
|
||||
* @since 1.2
|
||||
*/
|
||||
public CommandEnvironment(String cmdpath,
|
||||
String[] argv)
|
||||
{
|
||||
this.command = cmdpath; // might be null
|
||||
|
||||
// Hold a safe copy of argv in this.options
|
||||
if (argv == null) {
|
||||
this.options = new String[0];
|
||||
} else {
|
||||
this.options = new String[argv.length];
|
||||
System.arraycopy(argv, 0, this.options, 0, argv.length);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Fetch the configured path-qualified java command name.
|
||||
*
|
||||
* @return the configured name, or <code>null</code> if configured to
|
||||
* accept the default
|
||||
* @since 1.2
|
||||
*/
|
||||
public String getCommandPath() {
|
||||
return (this.command);
|
||||
}
|
||||
|
||||
/**
|
||||
* Fetch the configured java command options.
|
||||
*
|
||||
* @return An array of the command options which will be passed
|
||||
* to the new child command by rmid.
|
||||
* Note that rmid may add other options before or after these
|
||||
* options, or both.
|
||||
* Never returns <code>null</code>.
|
||||
* @since 1.2
|
||||
*/
|
||||
public String[] getCommandOptions() {
|
||||
return options.clone();
|
||||
}
|
||||
|
||||
/**
|
||||
* Compares two command environments for content equality.
|
||||
*
|
||||
* @param obj the Object to compare with
|
||||
* @return true if these Objects are equal; false otherwise.
|
||||
* @see java.util.Hashtable
|
||||
* @since 1.2
|
||||
*/
|
||||
public boolean equals(Object obj) {
|
||||
|
||||
if (obj instanceof CommandEnvironment) {
|
||||
CommandEnvironment env = (CommandEnvironment) obj;
|
||||
return
|
||||
((command == null ? env.command == null :
|
||||
command.equals(env.command)) &&
|
||||
Arrays.equals(options, env.options));
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Return identical values for similar
|
||||
* <code>CommandEnvironment</code>s.
|
||||
* @return an integer
|
||||
* @see java.util.Hashtable
|
||||
*/
|
||||
public int hashCode()
|
||||
{
|
||||
// hash command and ignore possibly expensive options
|
||||
return (command == null ? 0 : command.hashCode());
|
||||
}
|
||||
|
||||
/**
|
||||
* <code>readObject</code> for custom serialization.
|
||||
*
|
||||
* <p>This method reads this object's serialized form for this
|
||||
* class as follows:
|
||||
* <p>This method first invokes <code>defaultReadObject</code> on
|
||||
* the specified object input stream, and if <code>options</code>
|
||||
* is <code>null</code>, then <code>options</code> is set to a
|
||||
* zero-length array of <code>String</code>.
|
||||
*
|
||||
* @param in the {@code ObjectInputStream} from which data is read
|
||||
* @throws IOException if an I/O error occurs
|
||||
* @throws ClassNotFoundException if a serialized class cannot be loaded
|
||||
*
|
||||
*/
|
||||
@java.io.Serial
|
||||
private void readObject(ObjectInputStream in)
|
||||
throws IOException, ClassNotFoundException
|
||||
{
|
||||
in.defaultReadObject();
|
||||
if (options == null) {
|
||||
options = new String[0];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Compares two activation group descriptors for content equality.
|
||||
*
|
||||
* @param obj the Object to compare with
|
||||
* @return true if these Objects are equal; false otherwise.
|
||||
* @see java.util.Hashtable
|
||||
* @since 1.2
|
||||
*/
|
||||
public boolean equals(Object obj) {
|
||||
|
||||
if (obj instanceof ActivationGroupDesc) {
|
||||
ActivationGroupDesc desc = (ActivationGroupDesc) obj;
|
||||
return
|
||||
((className == null ? desc.className == null :
|
||||
className.equals(desc.className)) &&
|
||||
(location == null ? desc.location == null :
|
||||
location.equals(desc.location)) &&
|
||||
(data == null ? desc.data == null : data.equals(desc.data)) &&
|
||||
(env == null ? desc.env == null : env.equals(desc.env)) &&
|
||||
(props == null ? desc.props == null :
|
||||
props.equals(desc.props)));
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Produce identical numbers for similar <code>ActivationGroupDesc</code>s.
|
||||
* @return an integer
|
||||
* @see java.util.Hashtable
|
||||
*/
|
||||
public int hashCode() {
|
||||
// hash location, className, data, and env
|
||||
// but omit props (may be expensive)
|
||||
return ((location == null
|
||||
? 0
|
||||
: location.hashCode() << 24) ^
|
||||
(env == null
|
||||
? 0
|
||||
: env.hashCode() << 16) ^
|
||||
(className == null
|
||||
? 0
|
||||
: className.hashCode() << 8) ^
|
||||
(data == null
|
||||
? 0
|
||||
: data.hashCode()));
|
||||
}
|
||||
}
|
@ -1,123 +0,0 @@
|
||||
/*
|
||||
* Copyright (c) 1997, 2020, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
* under the terms of the GNU General Public License version 2 only, as
|
||||
* published by the Free Software Foundation. Oracle designates this
|
||||
* particular file as subject to the "Classpath" exception as provided
|
||||
* by Oracle in the LICENSE file that accompanied this code.
|
||||
*
|
||||
* This code is distributed in the hope that it will be useful, but WITHOUT
|
||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
* version 2 for more details (a copy is included in the LICENSE file that
|
||||
* accompanied this code).
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License version
|
||||
* 2 along with this work; if not, write to the Free Software Foundation,
|
||||
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
*
|
||||
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
|
||||
* or visit www.oracle.com if you need additional information or have any
|
||||
* questions.
|
||||
*/
|
||||
|
||||
package java.rmi.activation;
|
||||
|
||||
import java.rmi.server.UID;
|
||||
|
||||
/**
|
||||
* The identifier for a registered activation group serves several
|
||||
* purposes: <ul>
|
||||
* <li>identifies the group uniquely within the activation system, and
|
||||
* <li>contains a reference to the group's activation system so that the
|
||||
* group can contact its activation system when necessary.</ul><p>
|
||||
*
|
||||
* The <code>ActivationGroupID</code> is returned from the call to
|
||||
* <code>ActivationSystem.registerGroup</code> and is used to identify
|
||||
* the group within the activation system. This group id is passed
|
||||
* as one of the arguments to the activation group's special constructor
|
||||
* when an activation group is created/recreated.
|
||||
*
|
||||
* @author Ann Wollrath
|
||||
* @see ActivationGroup
|
||||
* @see ActivationGroupDesc
|
||||
* @since 1.2
|
||||
* @deprecated
|
||||
* See the <a href="{@docRoot}/java.rmi/java/rmi/activation/package-summary.html">
|
||||
* {@code java.rmi.activation}</a> package specification for further information.
|
||||
*/
|
||||
@Deprecated(forRemoval=true, since="15")
|
||||
@SuppressWarnings("removal")
|
||||
public class ActivationGroupID implements java.io.Serializable {
|
||||
/**
|
||||
* @serial The group's activation system.
|
||||
*/
|
||||
@SuppressWarnings("serial") // Not statically typed as Serializable
|
||||
private ActivationSystem system;
|
||||
|
||||
/**
|
||||
* @serial The group's unique id.
|
||||
*/
|
||||
private UID uid = new UID();
|
||||
|
||||
/** indicate compatibility with the Java 2 SDK v1.2 version of class */
|
||||
private static final long serialVersionUID = -1648432278909740833L;
|
||||
|
||||
/**
|
||||
* Constructs a unique group id.
|
||||
*
|
||||
* @param system the group's activation system
|
||||
* @throws UnsupportedOperationException if and only if activation is
|
||||
* not supported by this implementation
|
||||
* @since 1.2
|
||||
*/
|
||||
public ActivationGroupID(ActivationSystem system) {
|
||||
this.system = system;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the group's activation system.
|
||||
* @return the group's activation system
|
||||
* @since 1.2
|
||||
*/
|
||||
public ActivationSystem getSystem() {
|
||||
return system;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns a hashcode for the group's identifier. Two group
|
||||
* identifiers that refer to the same remote group will have the
|
||||
* same hash code.
|
||||
*
|
||||
* @see java.util.Hashtable
|
||||
* @since 1.2
|
||||
*/
|
||||
public int hashCode() {
|
||||
return uid.hashCode();
|
||||
}
|
||||
|
||||
/**
|
||||
* Compares two group identifiers for content equality.
|
||||
* Returns true if both of the following conditions are true:
|
||||
* 1) the unique identifiers are equivalent (by content), and
|
||||
* 2) the activation system specified in each
|
||||
* refers to the same remote object.
|
||||
*
|
||||
* @param obj the Object to compare with
|
||||
* @return true if these Objects are equal; false otherwise.
|
||||
* @see java.util.Hashtable
|
||||
* @since 1.2
|
||||
*/
|
||||
public boolean equals(Object obj) {
|
||||
if (this == obj) {
|
||||
return true;
|
||||
} else if (obj instanceof ActivationGroupID) {
|
||||
ActivationGroupID id = (ActivationGroupID)obj;
|
||||
return (uid.equals(id.uid) && system.equals(id.system));
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
@ -1,112 +0,0 @@
|
||||
/*
|
||||
* Copyright (c) 2002, 2020, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
* under the terms of the GNU General Public License version 2 only, as
|
||||
* published by the Free Software Foundation. Oracle designates this
|
||||
* particular file as subject to the "Classpath" exception as provided
|
||||
* by Oracle in the LICENSE file that accompanied this code.
|
||||
*
|
||||
* This code is distributed in the hope that it will be useful, but WITHOUT
|
||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
* version 2 for more details (a copy is included in the LICENSE file that
|
||||
* accompanied this code).
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License version
|
||||
* 2 along with this work; if not, write to the Free Software Foundation,
|
||||
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
*
|
||||
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
|
||||
* or visit www.oracle.com if you need additional information or have any
|
||||
* questions.
|
||||
*/
|
||||
|
||||
package java.rmi.activation;
|
||||
|
||||
import java.lang.reflect.Method;
|
||||
import java.rmi.MarshalledObject;
|
||||
import java.rmi.Remote;
|
||||
import java.rmi.RemoteException;
|
||||
import java.rmi.UnexpectedException;
|
||||
import java.rmi.server.RemoteRef;
|
||||
import java.rmi.server.RemoteStub;
|
||||
|
||||
/**
|
||||
* {@code ActivationGroup_Stub} is a stub class for the subclasses of {@code java.rmi.activation.ActivationGroup}
|
||||
* that are exported as a {@code java.rmi.server.UnicastRemoteObject}.
|
||||
*
|
||||
* @since 1.2
|
||||
* @deprecated
|
||||
* See the <a href="{@docRoot}/java.rmi/java/rmi/activation/package-summary.html">
|
||||
* {@code java.rmi.activation}</a> package specification for further information.
|
||||
*/
|
||||
@Deprecated(forRemoval=true, since="15")
|
||||
@SuppressWarnings({"rawtypes", "removal", "unchecked"})
|
||||
public final class ActivationGroup_Stub
|
||||
extends RemoteStub
|
||||
implements ActivationInstantiator, Remote {
|
||||
|
||||
@java.io.Serial
|
||||
private static final long serialVersionUID = 2;
|
||||
|
||||
private static Method $method_newInstance_0;
|
||||
|
||||
static {
|
||||
try {
|
||||
$method_newInstance_0 =
|
||||
ActivationInstantiator.class.getMethod("newInstance",
|
||||
new Class<?>[] {ActivationID.class, ActivationDesc.class});
|
||||
} catch (NoSuchMethodException e) {
|
||||
throw new NoSuchMethodError(
|
||||
"stub class initialization failed");
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Constructs a stub for the {@code ActivationGroup} class.
|
||||
* It invokes the superclass {@code RemoteStub(RemoteRef)}
|
||||
* constructor with its argument, {@code ref}.
|
||||
*
|
||||
* @param ref a remote ref
|
||||
*/
|
||||
public ActivationGroup_Stub(RemoteRef ref) {
|
||||
super(ref);
|
||||
}
|
||||
|
||||
/**
|
||||
* Stub method for {@code ActivationGroup.newInstance}. Invokes
|
||||
* the {@code invoke} method on this instance's
|
||||
* {@code RemoteObject.ref} field, with {@code this} as the
|
||||
* first argument, a two-element {@code Object[]} as the second
|
||||
* argument (with {@code id} as the first element and
|
||||
* {@code desc} as the second element), and -5274445189091581345L
|
||||
* as the third argument, and returns the result. If that invocation
|
||||
* throws a {@code RuntimeException}, {@code RemoteException},
|
||||
* or an {@code ActivationException}, then that exception is
|
||||
* thrown to the caller. If that invocation throws any other
|
||||
* {@code java.lang.Exception}, then a
|
||||
* {@code java.rmi.UnexpectedException} is thrown to the caller
|
||||
* with the original exception as the cause.
|
||||
*
|
||||
* @param id an activation identifier
|
||||
* @param desc an activation descriptor
|
||||
* @return the result of the invocation
|
||||
* @throws RemoteException if invocation results in a {@code RemoteException}
|
||||
* @throws ActivationException if invocation results in an {@code ActivationException}
|
||||
*/
|
||||
public MarshalledObject newInstance(ActivationID id,
|
||||
ActivationDesc desc)
|
||||
throws RemoteException, ActivationException {
|
||||
try {
|
||||
Object $result = ref.invoke(this, $method_newInstance_0,
|
||||
new Object[]{id, desc}, -5274445189091581345L);
|
||||
return ((MarshalledObject) $result);
|
||||
} catch (RuntimeException | RemoteException | ActivationException e) {
|
||||
throw e;
|
||||
} catch (Exception e) {
|
||||
throw new UnexpectedException("undeclared checked exception", e);
|
||||
}
|
||||
}
|
||||
}
|
@ -1,328 +0,0 @@
|
||||
/*
|
||||
* Copyright (c) 1997, 2020, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
* under the terms of the GNU General Public License version 2 only, as
|
||||
* published by the Free Software Foundation. Oracle designates this
|
||||
* particular file as subject to the "Classpath" exception as provided
|
||||
* by Oracle in the LICENSE file that accompanied this code.
|
||||
*
|
||||
* This code is distributed in the hope that it will be useful, but WITHOUT
|
||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
* version 2 for more details (a copy is included in the LICENSE file that
|
||||
* accompanied this code).
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License version
|
||||
* 2 along with this work; if not, write to the Free Software Foundation,
|
||||
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
*
|
||||
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
|
||||
* or visit www.oracle.com if you need additional information or have any
|
||||
* questions.
|
||||
*/
|
||||
|
||||
package java.rmi.activation;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.io.InvalidObjectException;
|
||||
import java.io.ObjectInputStream;
|
||||
import java.io.ObjectOutputStream;
|
||||
import java.io.Serializable;
|
||||
import java.lang.reflect.InvocationHandler;
|
||||
import java.lang.reflect.Proxy;
|
||||
import java.rmi.MarshalledObject;
|
||||
import java.rmi.Remote;
|
||||
import java.rmi.RemoteException;
|
||||
import java.rmi.UnmarshalException;
|
||||
import java.rmi.server.RemoteObject;
|
||||
import java.rmi.server.RemoteObjectInvocationHandler;
|
||||
import java.rmi.server.RemoteRef;
|
||||
import java.rmi.server.UID;
|
||||
import java.security.AccessControlContext;
|
||||
import java.security.AccessController;
|
||||
import java.security.Permissions;
|
||||
import java.security.PrivilegedActionException;
|
||||
import java.security.PrivilegedExceptionAction;
|
||||
import java.security.ProtectionDomain;
|
||||
|
||||
/**
|
||||
* Activation makes use of special identifiers to denote remote
|
||||
* objects that can be activated over time. An activation identifier
|
||||
* (an instance of the class <code>ActivationID</code>) contains several
|
||||
* pieces of information needed for activating an object:
|
||||
* <ul>
|
||||
* <li> a remote reference to the object's activator (a {@link
|
||||
* java.rmi.server.RemoteRef RemoteRef}
|
||||
* instance), and
|
||||
* <li> a unique identifier (a {@link java.rmi.server.UID UID}
|
||||
* instance) for the object. </ul> <p>
|
||||
*
|
||||
* An activation identifier for an object can be obtained by registering
|
||||
* an object with the activation system. Registration is accomplished
|
||||
* in a few ways: <ul>
|
||||
* <li>via the <code>Activatable.register</code> method
|
||||
* <li>via the first <code>Activatable</code> constructor (that takes
|
||||
* three arguments and both registers and exports the object, and
|
||||
* <li>via the first <code>Activatable.exportObject</code> method
|
||||
* that takes the activation descriptor, object and port as arguments;
|
||||
* this method both registers and exports the object. </ul>
|
||||
*
|
||||
* @author Ann Wollrath
|
||||
* @see Activatable
|
||||
* @since 1.2
|
||||
* @deprecated
|
||||
* See the <a href="{@docRoot}/java.rmi/java/rmi/activation/package-summary.html">
|
||||
* {@code java.rmi.activation}</a> package specification for further information.
|
||||
*/
|
||||
@Deprecated(forRemoval=true, since="15")
|
||||
@SuppressWarnings("removal")
|
||||
public class ActivationID implements Serializable {
|
||||
/**
|
||||
* the object's activator
|
||||
*/
|
||||
private transient Activator activator;
|
||||
|
||||
/**
|
||||
* the object's unique id
|
||||
*/
|
||||
private transient UID uid = new UID();
|
||||
|
||||
/** indicate compatibility with the Java 2 SDK v1.2 version of class */
|
||||
@java.io.Serial
|
||||
private static final long serialVersionUID = -4608673054848209235L;
|
||||
|
||||
/** an AccessControlContext with no permissions */
|
||||
private static final AccessControlContext NOPERMS_ACC;
|
||||
static {
|
||||
Permissions perms = new Permissions();
|
||||
ProtectionDomain[] pd = { new ProtectionDomain(null, perms) };
|
||||
NOPERMS_ACC = new AccessControlContext(pd);
|
||||
}
|
||||
|
||||
/**
|
||||
* The constructor for <code>ActivationID</code> takes a single
|
||||
* argument, activator, that specifies a remote reference to the
|
||||
* activator responsible for activating the object associated with
|
||||
* this identifier. An instance of <code>ActivationID</code> is globally
|
||||
* unique.
|
||||
*
|
||||
* @param activator reference to the activator responsible for
|
||||
* activating the object
|
||||
* @throws UnsupportedOperationException if and only if activation is
|
||||
* not supported by this implementation
|
||||
* @since 1.2
|
||||
*/
|
||||
public ActivationID(Activator activator) {
|
||||
this.activator = activator;
|
||||
}
|
||||
|
||||
/**
|
||||
* Activate the object for this id.
|
||||
*
|
||||
* @param force if true, forces the activator to contact the group
|
||||
* when activating the object (instead of returning a cached reference);
|
||||
* if false, returning a cached value is acceptable.
|
||||
* @return the reference to the active remote object
|
||||
* @throws ActivationException if activation fails
|
||||
* @throws UnknownObjectException if the object is unknown
|
||||
* @throws RemoteException if remote call fails
|
||||
* @since 1.2
|
||||
*/
|
||||
public Remote activate(boolean force)
|
||||
throws ActivationException, UnknownObjectException, RemoteException
|
||||
{
|
||||
try {
|
||||
MarshalledObject<? extends Remote> mobj =
|
||||
activator.activate(this, force);
|
||||
return AccessController.doPrivileged(
|
||||
new PrivilegedExceptionAction<Remote>() {
|
||||
public Remote run() throws IOException, ClassNotFoundException {
|
||||
return mobj.get();
|
||||
}
|
||||
}, NOPERMS_ACC);
|
||||
} catch (PrivilegedActionException pae) {
|
||||
Exception ex = pae.getException();
|
||||
if (ex instanceof RemoteException) {
|
||||
throw (RemoteException) ex;
|
||||
} else {
|
||||
throw new UnmarshalException("activation failed", ex);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns a hashcode for the activation id. Two identifiers that
|
||||
* refer to the same remote object will have the same hash code.
|
||||
*
|
||||
* @see java.util.Hashtable
|
||||
* @since 1.2
|
||||
*/
|
||||
public int hashCode() {
|
||||
return uid.hashCode();
|
||||
}
|
||||
|
||||
/**
|
||||
* Compares two activation ids for content equality.
|
||||
* Returns true if both of the following conditions are true:
|
||||
* 1) the unique identifiers equivalent (by content), and
|
||||
* 2) the activator specified in each identifier
|
||||
* refers to the same remote object.
|
||||
*
|
||||
* @param obj the Object to compare with
|
||||
* @return true if these Objects are equal; false otherwise.
|
||||
* @see java.util.Hashtable
|
||||
* @since 1.2
|
||||
*/
|
||||
public boolean equals(Object obj) {
|
||||
if (obj instanceof ActivationID) {
|
||||
ActivationID id = (ActivationID) obj;
|
||||
return (uid.equals(id.uid) && activator.equals(id.activator));
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* <code>writeObject</code> for custom serialization.
|
||||
*
|
||||
* <p>This method writes this object's serialized form for
|
||||
* this class as follows:
|
||||
*
|
||||
* <p>The <code>writeObject</code> method is invoked on
|
||||
* <code>out</code> passing this object's unique identifier
|
||||
* (a {@link java.rmi.server.UID UID} instance) as the argument.
|
||||
*
|
||||
* <p>Next, the {@link
|
||||
* java.rmi.server.RemoteRef#getRefClass(java.io.ObjectOutput)
|
||||
* getRefClass} method is invoked on the activator's
|
||||
* <code>RemoteRef</code> instance to obtain its external ref
|
||||
* type name. Next, the <code>writeUTF</code> method is
|
||||
* invoked on <code>out</code> with the value returned by
|
||||
* <code>getRefClass</code>, and then the
|
||||
* <code>writeExternal</code> method is invoked on the
|
||||
* <code>RemoteRef</code> instance passing <code>out</code>
|
||||
* as the argument.
|
||||
*
|
||||
* @serialData The serialized data for this class comprises a
|
||||
* <code>java.rmi.server.UID</code> (written with
|
||||
* <code>ObjectOutput.writeObject</code>) followed by the
|
||||
* external ref type name of the activator's
|
||||
* <code>RemoteRef</code> instance (a string written with
|
||||
* <code>ObjectOutput.writeUTF</code>), followed by the
|
||||
* external form of the <code>RemoteRef</code> instance as
|
||||
* written by its <code>writeExternal</code> method.
|
||||
*
|
||||
* <p>The external ref type name of the
|
||||
* <code>RemoteRef</Code> instance is
|
||||
* determined using the definitions of external ref type
|
||||
* names specified in the {@link java.rmi.server.RemoteObject
|
||||
* RemoteObject} <code>writeObject</code> method
|
||||
* <b>serialData</b> specification. Similarly, the data
|
||||
* written by the <code>writeExternal</code> method and read
|
||||
* by the <code>readExternal</code> method of
|
||||
* <code>RemoteRef</code> implementation classes
|
||||
* corresponding to each of the defined external ref type
|
||||
* names is specified in the {@link
|
||||
* java.rmi.server.RemoteObject RemoteObject}
|
||||
* <code>writeObject</code> method <b>serialData</b>
|
||||
* specification.
|
||||
*
|
||||
* @param out the {@code ObjectOutputStream} to which data is written
|
||||
* @throws IOException if an I/O error occurs
|
||||
**/
|
||||
@java.io.Serial
|
||||
private void writeObject(ObjectOutputStream out)
|
||||
throws IOException
|
||||
{
|
||||
out.writeObject(uid);
|
||||
|
||||
RemoteRef ref;
|
||||
if (activator instanceof RemoteObject) {
|
||||
ref = ((RemoteObject) activator).getRef();
|
||||
} else if (Proxy.isProxyClass(activator.getClass())) {
|
||||
InvocationHandler handler = Proxy.getInvocationHandler(activator);
|
||||
if (!(handler instanceof RemoteObjectInvocationHandler)) {
|
||||
throw new InvalidObjectException(
|
||||
"unexpected invocation handler");
|
||||
}
|
||||
ref = ((RemoteObjectInvocationHandler) handler).getRef();
|
||||
|
||||
} else {
|
||||
throw new InvalidObjectException("unexpected activator type");
|
||||
}
|
||||
out.writeUTF(ref.getRefClass(out));
|
||||
ref.writeExternal(out);
|
||||
}
|
||||
|
||||
/**
|
||||
* <code>readObject</code> for custom serialization.
|
||||
*
|
||||
* <p>This method reads this object's serialized form for this
|
||||
* class as follows:
|
||||
*
|
||||
* <p>The <code>readObject</code> method is invoked on
|
||||
* <code>in</code> to read this object's unique identifier
|
||||
* (a {@link java.rmi.server.UID UID} instance).
|
||||
*
|
||||
* <p>Next, the <code>readUTF</code> method is invoked on
|
||||
* <code>in</code> to read the external ref type name of the
|
||||
* <code>RemoteRef</code> instance for this object's
|
||||
* activator. Next, the <code>RemoteRef</code>
|
||||
* instance is created of an implementation-specific class
|
||||
* corresponding to the external ref type name (returned by
|
||||
* <code>readUTF</code>), and the <code>readExternal</code>
|
||||
* method is invoked on that <code>RemoteRef</code> instance
|
||||
* to read the external form corresponding to the external
|
||||
* ref type name.
|
||||
*
|
||||
* <p>Note: If the external ref type name is
|
||||
* <code>"UnicastRef"</code>, <code>"UnicastServerRef"</code>,
|
||||
* <code>"UnicastRef2"</code>, <code>"UnicastServerRef2"</code>,
|
||||
* or <code>"ActivatableRef"</code>, a corresponding
|
||||
* implementation-specific class must be found, and its
|
||||
* <code>readExternal</code> method must read the serial data
|
||||
* for that external ref type name as specified to be written
|
||||
* in the <b>serialData</b> documentation for this class.
|
||||
* If the external ref type name is any other string (of non-zero
|
||||
* length), a <code>ClassNotFoundException</code> will be thrown,
|
||||
* unless the implementation provides an implementation-specific
|
||||
* class corresponding to that external ref type name, in which
|
||||
* case the <code>RemoteRef</code> will be an instance of
|
||||
* that implementation-specific class.
|
||||
*
|
||||
* @param in the {@code ObjectInputStream} from which data is read
|
||||
* @throws IOException if an I/O error occurs
|
||||
* @throws ClassNotFoundException if a serialized class cannot be loaded
|
||||
*
|
||||
*/
|
||||
@java.io.Serial
|
||||
private void readObject(ObjectInputStream in)
|
||||
throws IOException, ClassNotFoundException
|
||||
{
|
||||
uid = (UID)in.readObject();
|
||||
|
||||
try {
|
||||
Class<? extends RemoteRef> refClass =
|
||||
Class.forName(RemoteRef.packagePrefix + "." + in.readUTF())
|
||||
.asSubclass(RemoteRef.class);
|
||||
@SuppressWarnings("deprecation")
|
||||
RemoteRef ref = refClass.newInstance();
|
||||
ref.readExternal(in);
|
||||
activator = (Activator)
|
||||
Proxy.newProxyInstance(Activator.class.getClassLoader(),
|
||||
new Class<?>[] { Activator.class },
|
||||
new RemoteObjectInvocationHandler(ref));
|
||||
} catch (InstantiationException e) {
|
||||
throw (IOException)
|
||||
new InvalidObjectException(
|
||||
"Unable to create remote reference").initCause(e);
|
||||
} catch (IllegalAccessException e) {
|
||||
throw (IOException)
|
||||
new InvalidObjectException(
|
||||
"Unable to create remote reference").initCause(e);
|
||||
}
|
||||
}
|
||||
}
|
@ -1,94 +0,0 @@
|
||||
/*
|
||||
* Copyright (c) 1997, 2020, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
* under the terms of the GNU General Public License version 2 only, as
|
||||
* published by the Free Software Foundation. Oracle designates this
|
||||
* particular file as subject to the "Classpath" exception as provided
|
||||
* by Oracle in the LICENSE file that accompanied this code.
|
||||
*
|
||||
* This code is distributed in the hope that it will be useful, but WITHOUT
|
||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
* version 2 for more details (a copy is included in the LICENSE file that
|
||||
* accompanied this code).
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License version
|
||||
* 2 along with this work; if not, write to the Free Software Foundation,
|
||||
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
*
|
||||
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
|
||||
* or visit www.oracle.com if you need additional information or have any
|
||||
* questions.
|
||||
*/
|
||||
|
||||
package java.rmi.activation;
|
||||
|
||||
import java.rmi.MarshalledObject;
|
||||
import java.rmi.Remote;
|
||||
import java.rmi.RemoteException;
|
||||
|
||||
/**
|
||||
* An <code>ActivationInstantiator</code> is responsible for creating
|
||||
* instances of "activatable" objects. A concrete subclass of
|
||||
* <code>ActivationGroup</code> implements the <code>newInstance</code>
|
||||
* method to handle creating objects within the group.
|
||||
*
|
||||
* @author Ann Wollrath
|
||||
* @see ActivationGroup
|
||||
* @since 1.2
|
||||
* @deprecated
|
||||
* See the <a href="{@docRoot}/java.rmi/java/rmi/activation/package-summary.html">
|
||||
* {@code java.rmi.activation}</a> package specification for further information.
|
||||
*/
|
||||
@Deprecated(forRemoval=true, since="15")
|
||||
@SuppressWarnings("removal")
|
||||
public interface ActivationInstantiator extends Remote {
|
||||
|
||||
/**
|
||||
* The activator calls an instantiator's <code>newInstance</code>
|
||||
* method in order to recreate in that group an object with the
|
||||
* activation identifier, <code>id</code>, and descriptor,
|
||||
* <code>desc</code>. The instantiator is responsible for: <ul>
|
||||
*
|
||||
* <li> determining the class for the object using the descriptor's
|
||||
* <code>getClassName</code> method,
|
||||
*
|
||||
* <li> loading the class from the code location obtained from the
|
||||
* descriptor (using the <code>getLocation</code> method),
|
||||
*
|
||||
* <li> creating an instance of the class by invoking the special
|
||||
* "activation" constructor of the object's class that takes two
|
||||
* arguments: the object's <code>ActivationID</code>, and the
|
||||
* <code>MarshalledObject</code> containing object specific
|
||||
* initialization data, and
|
||||
*
|
||||
* <li> returning a MarshalledObject containing the stub for the
|
||||
* remote object it created.</ul>
|
||||
*
|
||||
* <p>In order for activation to be successful, one of the following requirements
|
||||
* must be met, otherwise {@link ActivationException} is thrown:
|
||||
*
|
||||
* <ul><li>The class to be activated and the special activation constructor are both public,
|
||||
* and the class resides in a package that is
|
||||
* {@linkplain Module#isExported(String,Module) exported}
|
||||
* to at least the {@code java.rmi} module; or
|
||||
*
|
||||
* <li>The class to be activated resides in a package that is
|
||||
* {@linkplain Module#isOpen(String,Module) open}
|
||||
* to at least the {@code java.rmi} module.
|
||||
* </ul>
|
||||
*
|
||||
* @param id the object's activation identifier
|
||||
* @param desc the object's descriptor
|
||||
* @return a marshalled object containing the serialized
|
||||
* representation of remote object's stub
|
||||
* @throws ActivationException if object activation fails
|
||||
* @throws RemoteException if remote call fails
|
||||
* @since 1.2
|
||||
*/
|
||||
public MarshalledObject<? extends Remote> newInstance(ActivationID id,
|
||||
ActivationDesc desc)
|
||||
throws ActivationException, RemoteException;
|
||||
}
|
@ -1,113 +0,0 @@
|
||||
/*
|
||||
* Copyright (c) 1997, 2020, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
* under the terms of the GNU General Public License version 2 only, as
|
||||
* published by the Free Software Foundation. Oracle designates this
|
||||
* particular file as subject to the "Classpath" exception as provided
|
||||
* by Oracle in the LICENSE file that accompanied this code.
|
||||
*
|
||||
* This code is distributed in the hope that it will be useful, but WITHOUT
|
||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
* version 2 for more details (a copy is included in the LICENSE file that
|
||||
* accompanied this code).
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License version
|
||||
* 2 along with this work; if not, write to the Free Software Foundation,
|
||||
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
*
|
||||
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
|
||||
* or visit www.oracle.com if you need additional information or have any
|
||||
* questions.
|
||||
*/
|
||||
|
||||
package java.rmi.activation;
|
||||
|
||||
import java.rmi.MarshalledObject;
|
||||
import java.rmi.Remote;
|
||||
import java.rmi.RemoteException;
|
||||
import java.rmi.activation.UnknownGroupException;
|
||||
import java.rmi.activation.UnknownObjectException;
|
||||
|
||||
/**
|
||||
* An <code>ActivationMonitor</code> is specific to an
|
||||
* <code>ActivationGroup</code> and is obtained when a group is
|
||||
* reported active via a call to
|
||||
* <code>ActivationSystem.activeGroup</code> (this is done
|
||||
* internally). An activation group is responsible for informing its
|
||||
* <code>ActivationMonitor</code> when either: its objects become active or
|
||||
* inactive, or the group as a whole becomes inactive.
|
||||
*
|
||||
* @author Ann Wollrath
|
||||
* @see Activator
|
||||
* @see ActivationSystem
|
||||
* @see ActivationGroup
|
||||
* @since 1.2
|
||||
* @deprecated
|
||||
* See the <a href="{@docRoot}/java.rmi/java/rmi/activation/package-summary.html">
|
||||
* {@code java.rmi.activation}</a> package specification for further information.
|
||||
*/
|
||||
@Deprecated(forRemoval=true, since="15")
|
||||
@SuppressWarnings("removal")
|
||||
public interface ActivationMonitor extends Remote {
|
||||
|
||||
/**
|
||||
* An activation group calls its monitor's
|
||||
* <code>inactiveObject</code> method when an object in its group
|
||||
* becomes inactive (deactivates). An activation group discovers
|
||||
* that an object (that it participated in activating) in its VM
|
||||
* is no longer active, via calls to the activation group's
|
||||
* <code>inactiveObject</code> method. <p>
|
||||
*
|
||||
* The <code>inactiveObject</code> call informs the
|
||||
* <code>ActivationMonitor</code> that the remote object reference
|
||||
* it holds for the object with the activation identifier,
|
||||
* <code>id</code>, is no longer valid. The monitor considers the
|
||||
* reference associated with <code>id</code> as a stale reference.
|
||||
* Since the reference is considered stale, a subsequent
|
||||
* <code>activate</code> call for the same activation identifier
|
||||
* results in re-activating the remote object.
|
||||
*
|
||||
* @param id the object's activation identifier
|
||||
* @throws UnknownObjectException if object is unknown
|
||||
* @throws RemoteException if remote call fails
|
||||
* @since 1.2
|
||||
*/
|
||||
public void inactiveObject(ActivationID id)
|
||||
throws UnknownObjectException, RemoteException;
|
||||
|
||||
/**
|
||||
* Informs that an object is now active. An <code>ActivationGroup</code>
|
||||
* informs its monitor if an object in its group becomes active by
|
||||
* other means than being activated directly (i.e., the object
|
||||
* is registered and "activated" itself).
|
||||
*
|
||||
* @param id the active object's id
|
||||
* @param obj the marshalled form of the object's stub
|
||||
* @throws UnknownObjectException if object is unknown
|
||||
* @throws RemoteException if remote call fails
|
||||
* @since 1.2
|
||||
*/
|
||||
public void activeObject(ActivationID id,
|
||||
MarshalledObject<? extends Remote> obj)
|
||||
throws UnknownObjectException, RemoteException;
|
||||
|
||||
/**
|
||||
* Informs that the group is now inactive. The group will be
|
||||
* recreated upon a subsequent request to activate an object
|
||||
* within the group. A group becomes inactive when all objects
|
||||
* in the group report that they are inactive.
|
||||
*
|
||||
* @param id the group's id
|
||||
* @param incarnation the group's incarnation number
|
||||
* @throws UnknownGroupException if group is unknown
|
||||
* @throws RemoteException if remote call fails
|
||||
* @since 1.2
|
||||
*/
|
||||
public void inactiveGroup(ActivationGroupID id,
|
||||
long incarnation)
|
||||
throws UnknownGroupException, RemoteException;
|
||||
|
||||
}
|
@ -1,234 +0,0 @@
|
||||
/*
|
||||
* Copyright (c) 1997, 2020, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
* under the terms of the GNU General Public License version 2 only, as
|
||||
* published by the Free Software Foundation. Oracle designates this
|
||||
* particular file as subject to the "Classpath" exception as provided
|
||||
* by Oracle in the LICENSE file that accompanied this code.
|
||||
*
|
||||
* This code is distributed in the hope that it will be useful, but WITHOUT
|
||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
* version 2 for more details (a copy is included in the LICENSE file that
|
||||
* accompanied this code).
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License version
|
||||
* 2 along with this work; if not, write to the Free Software Foundation,
|
||||
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
*
|
||||
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
|
||||
* or visit www.oracle.com if you need additional information or have any
|
||||
* questions.
|
||||
*/
|
||||
|
||||
package java.rmi.activation;
|
||||
|
||||
import java.rmi.Remote;
|
||||
import java.rmi.RemoteException;
|
||||
import java.rmi.activation.UnknownGroupException;
|
||||
import java.rmi.activation.UnknownObjectException;
|
||||
|
||||
/**
|
||||
* The <code>ActivationSystem</code> provides a means for registering
|
||||
* groups and "activatable" objects to be activated within those groups.
|
||||
* The <code>ActivationSystem</code> works closely with the
|
||||
* <code>Activator</code>, which activates objects registered via the
|
||||
* <code>ActivationSystem</code>, and the <code>ActivationMonitor</code>,
|
||||
* which obtains information about active and inactive objects,
|
||||
* and inactive groups.
|
||||
*
|
||||
* @author Ann Wollrath
|
||||
* @see Activator
|
||||
* @see ActivationMonitor
|
||||
* @since 1.2
|
||||
* @deprecated
|
||||
* See the <a href="{@docRoot}/java.rmi/java/rmi/activation/package-summary.html">
|
||||
* {@code java.rmi.activation}</a> package specification for further information.
|
||||
*/
|
||||
@Deprecated(forRemoval=true, since="15")
|
||||
@SuppressWarnings("removal")
|
||||
public interface ActivationSystem extends Remote {
|
||||
|
||||
/** The port to lookup the activation system. */
|
||||
public static final int SYSTEM_PORT = 1098;
|
||||
|
||||
/**
|
||||
* The <code>registerObject</code> method is used to register an
|
||||
* activation descriptor, <code>desc</code>, and obtain an
|
||||
* activation identifier for a activatable remote object. The
|
||||
* <code>ActivationSystem</code> creates an
|
||||
* <code>ActivationID</code> (a activation identifier) for the
|
||||
* object specified by the descriptor, <code>desc</code>, and
|
||||
* records, in stable storage, the activation descriptor and its
|
||||
* associated identifier for later use. When the <code>Activator</code>
|
||||
* receives an <code>activate</code> request for a specific identifier, it
|
||||
* looks up the activation descriptor (registered previously) for
|
||||
* the specified identifier and uses that information to activate
|
||||
* the object.
|
||||
*
|
||||
* @param desc the object's activation descriptor
|
||||
* @return the activation id that can be used to activate the object
|
||||
* @throws ActivationException if registration fails (e.g., database
|
||||
* update failure, etc).
|
||||
* @throws UnknownGroupException if group referred to in
|
||||
* <code>desc</code> is not registered with this system
|
||||
* @throws RemoteException if remote call fails
|
||||
* @since 1.2
|
||||
*/
|
||||
public ActivationID registerObject(ActivationDesc desc)
|
||||
throws ActivationException, UnknownGroupException, RemoteException;
|
||||
|
||||
/**
|
||||
* Remove the activation id and associated descriptor previously
|
||||
* registered with the <code>ActivationSystem</code>; the object
|
||||
* can no longer be activated via the object's activation id.
|
||||
*
|
||||
* @param id the object's activation id (from previous registration)
|
||||
* @throws ActivationException if unregister fails (e.g., database
|
||||
* update failure, etc).
|
||||
* @throws UnknownObjectException if object is unknown (not registered)
|
||||
* @throws RemoteException if remote call fails
|
||||
* @since 1.2
|
||||
*/
|
||||
public void unregisterObject(ActivationID id)
|
||||
throws ActivationException, UnknownObjectException, RemoteException;
|
||||
|
||||
/**
|
||||
* Register the activation group. An activation group must be
|
||||
* registered with the <code>ActivationSystem</code> before objects
|
||||
* can be registered within that group.
|
||||
*
|
||||
* @param desc the group's descriptor
|
||||
* @return an identifier for the group
|
||||
* @throws ActivationException if group registration fails
|
||||
* @throws RemoteException if remote call fails
|
||||
* @since 1.2
|
||||
*/
|
||||
public ActivationGroupID registerGroup(ActivationGroupDesc desc)
|
||||
throws ActivationException, RemoteException;
|
||||
|
||||
/**
|
||||
* Callback to inform activation system that group is now
|
||||
* active. This call is made internally by the
|
||||
* <code>ActivationGroup.createGroup</code> method to inform
|
||||
* the <code>ActivationSystem</code> that the group is now
|
||||
* active.
|
||||
*
|
||||
* @param id the activation group's identifier
|
||||
* @param group the group's instantiator
|
||||
* @param incarnation the group's incarnation number
|
||||
* @return monitor for activation group
|
||||
* @throws UnknownGroupException if group is not registered
|
||||
* @throws ActivationException if a group for the specified
|
||||
* <code>id</code> is already active and that group is not equal
|
||||
* to the specified <code>group</code> or that group has a different
|
||||
* <code>incarnation</code> than the specified <code>group</code>
|
||||
* @throws RemoteException if remote call fails
|
||||
* @since 1.2
|
||||
*/
|
||||
public ActivationMonitor activeGroup(ActivationGroupID id,
|
||||
ActivationInstantiator group,
|
||||
long incarnation)
|
||||
throws UnknownGroupException, ActivationException, RemoteException;
|
||||
|
||||
/**
|
||||
* Remove the activation group. An activation group makes this call back
|
||||
* to inform the activator that the group should be removed (destroyed).
|
||||
* If this call completes successfully, objects can no longer be
|
||||
* registered or activated within the group. All information of the
|
||||
* group and its associated objects is removed from the system.
|
||||
*
|
||||
* @param id the activation group's identifier
|
||||
* @throws ActivationException if unregister fails (e.g., database
|
||||
* update failure, etc).
|
||||
* @throws UnknownGroupException if group is not registered
|
||||
* @throws RemoteException if remote call fails
|
||||
* @since 1.2
|
||||
*/
|
||||
public void unregisterGroup(ActivationGroupID id)
|
||||
throws ActivationException, UnknownGroupException, RemoteException;
|
||||
|
||||
/**
|
||||
* Shutdown the activation system. Destroys all groups spawned by
|
||||
* the activation daemon and exits the activation daemon.
|
||||
* @throws RemoteException if failed to contact/shutdown the activation
|
||||
* daemon
|
||||
* @since 1.2
|
||||
*/
|
||||
public void shutdown() throws RemoteException;
|
||||
|
||||
/**
|
||||
* Set the activation descriptor, <code>desc</code> for the object with
|
||||
* the activation identifier, <code>id</code>. The change will take
|
||||
* effect upon subsequent activation of the object.
|
||||
*
|
||||
* @param id the activation identifier for the activatable object
|
||||
* @param desc the activation descriptor for the activatable object
|
||||
* @throws UnknownGroupException the group associated with
|
||||
* <code>desc</code> is not a registered group
|
||||
* @throws UnknownObjectException the activation <code>id</code>
|
||||
* is not registered
|
||||
* @throws ActivationException for general failure (e.g., unable
|
||||
* to update log)
|
||||
* @throws RemoteException if remote call fails
|
||||
* @return the previous value of the activation descriptor
|
||||
* @see #getActivationDesc
|
||||
* @since 1.2
|
||||
*/
|
||||
public ActivationDesc setActivationDesc(ActivationID id,
|
||||
ActivationDesc desc)
|
||||
throws ActivationException, UnknownObjectException,
|
||||
UnknownGroupException, RemoteException;
|
||||
|
||||
/**
|
||||
* Set the activation group descriptor, <code>desc</code> for the object
|
||||
* with the activation group identifier, <code>id</code>. The change will
|
||||
* take effect upon subsequent activation of the group.
|
||||
*
|
||||
* @param id the activation group identifier for the activation group
|
||||
* @param desc the activation group descriptor for the activation group
|
||||
* @throws UnknownGroupException the group associated with
|
||||
* <code>id</code> is not a registered group
|
||||
* @throws ActivationException for general failure (e.g., unable
|
||||
* to update log)
|
||||
* @throws RemoteException if remote call fails
|
||||
* @return the previous value of the activation group descriptor
|
||||
* @see #getActivationGroupDesc
|
||||
* @since 1.2
|
||||
*/
|
||||
public ActivationGroupDesc setActivationGroupDesc(ActivationGroupID id,
|
||||
ActivationGroupDesc desc)
|
||||
throws ActivationException, UnknownGroupException, RemoteException;
|
||||
|
||||
/**
|
||||
* Returns the activation descriptor, for the object with the activation
|
||||
* identifier, <code>id</code>.
|
||||
*
|
||||
* @param id the activation identifier for the activatable object
|
||||
* @throws UnknownObjectException if <code>id</code> is not registered
|
||||
* @throws ActivationException for general failure
|
||||
* @throws RemoteException if remote call fails
|
||||
* @return the activation descriptor
|
||||
* @see #setActivationDesc
|
||||
* @since 1.2
|
||||
*/
|
||||
public ActivationDesc getActivationDesc(ActivationID id)
|
||||
throws ActivationException, UnknownObjectException, RemoteException;
|
||||
|
||||
/**
|
||||
* Returns the activation group descriptor, for the group
|
||||
* with the activation group identifier, <code>id</code>.
|
||||
*
|
||||
* @param id the activation group identifier for the group
|
||||
* @throws UnknownGroupException if <code>id</code> is not registered
|
||||
* @throws ActivationException for general failure
|
||||
* @throws RemoteException if remote call fails
|
||||
* @return the activation group descriptor
|
||||
* @see #setActivationGroupDesc
|
||||
* @since 1.2
|
||||
*/
|
||||
public ActivationGroupDesc getActivationGroupDesc(ActivationGroupID id)
|
||||
throws ActivationException, UnknownGroupException, RemoteException;
|
||||
}
|
@ -1,119 +0,0 @@
|
||||
/*
|
||||
* Copyright (c) 1997, 2020, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
* under the terms of the GNU General Public License version 2 only, as
|
||||
* published by the Free Software Foundation. Oracle designates this
|
||||
* particular file as subject to the "Classpath" exception as provided
|
||||
* by Oracle in the LICENSE file that accompanied this code.
|
||||
*
|
||||
* This code is distributed in the hope that it will be useful, but WITHOUT
|
||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
* version 2 for more details (a copy is included in the LICENSE file that
|
||||
* accompanied this code).
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License version
|
||||
* 2 along with this work; if not, write to the Free Software Foundation,
|
||||
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
*
|
||||
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
|
||||
* or visit www.oracle.com if you need additional information or have any
|
||||
* questions.
|
||||
*/
|
||||
|
||||
package java.rmi.activation;
|
||||
|
||||
import java.rmi.MarshalledObject;
|
||||
import java.rmi.Remote;
|
||||
import java.rmi.RemoteException;
|
||||
import java.rmi.activation.UnknownObjectException;
|
||||
|
||||
/**
|
||||
* The <code>Activator</code> facilitates remote object activation. A
|
||||
* "faulting" remote reference calls the activator's
|
||||
* <code>activate</code> method to obtain a "live" reference to a
|
||||
* "activatable" remote object. Upon receiving a request for activation,
|
||||
* the activator looks up the activation descriptor for the activation
|
||||
* identifier, <code>id</code>, determines the group in which the
|
||||
* object should be activated initiates object re-creation via the
|
||||
* group's <code>ActivationInstantiator</code> (via a call to the
|
||||
* <code>newInstance</code> method). The activator initiates the
|
||||
* execution of activation groups as necessary. For example, if an
|
||||
* activation group for a specific group identifier is not already
|
||||
* executing, the activator initiates the execution of a VM for the
|
||||
* group. <p>
|
||||
*
|
||||
* The <code>Activator</code> works closely with
|
||||
* <code>ActivationSystem</code>, which provides a means for registering
|
||||
* groups and objects within those groups, and <code>ActivationMonitor</code>,
|
||||
* which receives information about active and inactive objects and inactive
|
||||
* groups. <p>
|
||||
*
|
||||
* The activator is responsible for monitoring and detecting when
|
||||
* activation groups fail so that it can remove stale remote references
|
||||
* to groups and active object's within those groups.
|
||||
*
|
||||
* @author Ann Wollrath
|
||||
* @see ActivationInstantiator
|
||||
* @see ActivationGroupDesc
|
||||
* @see ActivationGroupID
|
||||
* @since 1.2
|
||||
* @deprecated
|
||||
* See the <a href="{@docRoot}/java.rmi/java/rmi/activation/package-summary.html">
|
||||
* {@code java.rmi.activation}</a> package specification for further information.
|
||||
*/
|
||||
@Deprecated(forRemoval=true, since="15")
|
||||
@SuppressWarnings("removal")
|
||||
public interface Activator extends Remote {
|
||||
/**
|
||||
* Activate the object associated with the activation identifier,
|
||||
* <code>id</code>. If the activator knows the object to be active
|
||||
* already, and <code>force</code> is false , the stub with a
|
||||
* "live" reference is returned immediately to the caller;
|
||||
* otherwise, if the activator does not know that corresponding
|
||||
* the remote object is active, the activator uses the activation
|
||||
* descriptor information (previously registered) to determine the
|
||||
* group (VM) in which the object should be activated. If an
|
||||
* <code>ActivationInstantiator</code> corresponding to the
|
||||
* object's group descriptor already exists, the activator invokes
|
||||
* the activation group's <code>newInstance</code> method passing
|
||||
* it the object's id and descriptor. <p>
|
||||
*
|
||||
* If the activation group for the object's group descriptor does
|
||||
* not yet exist, the activator starts an
|
||||
* <code>ActivationInstantiator</code> executing (by spawning a
|
||||
* child process, for example). When the activator receives the
|
||||
* activation group's call back (via the
|
||||
* <code>ActivationSystem</code>'s <code>activeGroup</code>
|
||||
* method) specifying the activation group's reference, the
|
||||
* activator can then invoke that activation instantiator's
|
||||
* <code>newInstance</code> method to forward each pending
|
||||
* activation request to the activation group and return the
|
||||
* result (a marshalled remote object reference, a stub) to the
|
||||
* caller.<p>
|
||||
*
|
||||
* Note that the activator receives a "marshalled" object instead of a
|
||||
* Remote object so that the activator does not need to load the
|
||||
* code for that object, or participate in distributed garbage
|
||||
* collection for that object. If the activator kept a strong
|
||||
* reference to the remote object, the activator would then
|
||||
* prevent the object from being garbage collected under the
|
||||
* normal distributed garbage collection mechanism.
|
||||
*
|
||||
* @param id the activation identifier for the object being activated
|
||||
* @param force if true, the activator contacts the group to obtain
|
||||
* the remote object's reference; if false, returning the cached value
|
||||
* is allowed.
|
||||
* @return the remote object (a stub) in a marshalled form
|
||||
* @throws ActivationException if object activation fails
|
||||
* @throws UnknownObjectException if object is unknown (not registered)
|
||||
* @throws RemoteException if remote call fails
|
||||
* @since 1.2
|
||||
*/
|
||||
public MarshalledObject<? extends Remote> activate(ActivationID id,
|
||||
boolean force)
|
||||
throws ActivationException, UnknownObjectException, RemoteException;
|
||||
|
||||
}
|
@ -1,65 +0,0 @@
|
||||
/*
|
||||
* Copyright (c) 1997, 2020, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
* under the terms of the GNU General Public License version 2 only, as
|
||||
* published by the Free Software Foundation. Oracle designates this
|
||||
* particular file as subject to the "Classpath" exception as provided
|
||||
* by Oracle in the LICENSE file that accompanied this code.
|
||||
*
|
||||
* This code is distributed in the hope that it will be useful, but WITHOUT
|
||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
* version 2 for more details (a copy is included in the LICENSE file that
|
||||
* accompanied this code).
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License version
|
||||
* 2 along with this work; if not, write to the Free Software Foundation,
|
||||
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
*
|
||||
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
|
||||
* or visit www.oracle.com if you need additional information or have any
|
||||
* questions.
|
||||
*/
|
||||
|
||||
package java.rmi.activation;
|
||||
|
||||
/**
|
||||
* An <code>UnknownGroupException</code> is thrown by methods of classes and
|
||||
* interfaces in the <code>java.rmi.activation</code> package when the
|
||||
* <code>ActivationGroupID</code> parameter to the method is determined to be
|
||||
* invalid, i.e., not known by the <code>ActivationSystem</code>. An
|
||||
* <code>UnknownGroupException</code> is also thrown if the
|
||||
* <code>ActivationGroupID</code> in an <code>ActivationDesc</code> refers to
|
||||
* a group that is not registered with the <code>ActivationSystem</code>
|
||||
*
|
||||
* @author Ann Wollrath
|
||||
* @since 1.2
|
||||
* @see java.rmi.activation.Activatable
|
||||
* @see java.rmi.activation.ActivationGroup
|
||||
* @see java.rmi.activation.ActivationGroupID
|
||||
* @see java.rmi.activation.ActivationMonitor
|
||||
* @see java.rmi.activation.ActivationSystem
|
||||
* @deprecated
|
||||
* See the <a href="{@docRoot}/java.rmi/java/rmi/activation/package-summary.html">
|
||||
* {@code java.rmi.activation}</a> package specification for further information.
|
||||
*/
|
||||
@Deprecated(forRemoval=true, since="15")
|
||||
@SuppressWarnings("removal")
|
||||
public class UnknownGroupException extends ActivationException {
|
||||
|
||||
/** indicate compatibility with the Java 2 SDK v1.2 version of class */
|
||||
private static final long serialVersionUID = 7056094974750002460L;
|
||||
|
||||
/**
|
||||
* Constructs an <code>UnknownGroupException</code> with the specified
|
||||
* detail message.
|
||||
*
|
||||
* @param s the detail message
|
||||
* @since 1.2
|
||||
*/
|
||||
public UnknownGroupException(String s) {
|
||||
super(s);
|
||||
}
|
||||
}
|
@ -1,67 +0,0 @@
|
||||
/*
|
||||
* Copyright (c) 1997, 2020, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
* under the terms of the GNU General Public License version 2 only, as
|
||||
* published by the Free Software Foundation. Oracle designates this
|
||||
* particular file as subject to the "Classpath" exception as provided
|
||||
* by Oracle in the LICENSE file that accompanied this code.
|
||||
*
|
||||
* This code is distributed in the hope that it will be useful, but WITHOUT
|
||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
* version 2 for more details (a copy is included in the LICENSE file that
|
||||
* accompanied this code).
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License version
|
||||
* 2 along with this work; if not, write to the Free Software Foundation,
|
||||
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
*
|
||||
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
|
||||
* or visit www.oracle.com if you need additional information or have any
|
||||
* questions.
|
||||
*/
|
||||
|
||||
package java.rmi.activation;
|
||||
|
||||
/**
|
||||
* An <code>UnknownObjectException</code> is thrown by methods of classes and
|
||||
* interfaces in the <code>java.rmi.activation</code> package when the
|
||||
* <code>ActivationID</code> parameter to the method is determined to be
|
||||
* invalid. An <code>ActivationID</code> is invalid if it is not currently
|
||||
* known by the <code>ActivationSystem</code>. An <code>ActivationID</code>
|
||||
* is obtained by the <code>ActivationSystem.registerObject</code> method.
|
||||
* An <code>ActivationID</code> is also obtained during the
|
||||
* <code>Activatable.register</code> call.
|
||||
*
|
||||
* @author Ann Wollrath
|
||||
* @since 1.2
|
||||
* @see java.rmi.activation.Activatable
|
||||
* @see java.rmi.activation.ActivationGroup
|
||||
* @see java.rmi.activation.ActivationID
|
||||
* @see java.rmi.activation.ActivationMonitor
|
||||
* @see java.rmi.activation.ActivationSystem
|
||||
* @see java.rmi.activation.Activator
|
||||
* @deprecated
|
||||
* See the <a href="{@docRoot}/java.rmi/java/rmi/activation/package-summary.html">
|
||||
* {@code java.rmi.activation}</a> package specification for further information.
|
||||
*/
|
||||
@Deprecated(forRemoval=true, since="15")
|
||||
@SuppressWarnings("removal")
|
||||
public class UnknownObjectException extends ActivationException {
|
||||
|
||||
/** indicate compatibility with the Java 2 SDK v1.2 version of class */
|
||||
private static final long serialVersionUID = 3425547551622251430L;
|
||||
|
||||
/**
|
||||
* Constructs an <code>UnknownObjectException</code> with the specified
|
||||
* detail message.
|
||||
*
|
||||
* @param s the detail message
|
||||
* @since 1.2
|
||||
*/
|
||||
public UnknownObjectException(String s) {
|
||||
super(s);
|
||||
}
|
||||
}
|
@ -1,48 +0,0 @@
|
||||
/*
|
||||
* Copyright (c) 1998, 2020, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
* under the terms of the GNU General Public License version 2 only, as
|
||||
* published by the Free Software Foundation. Oracle designates this
|
||||
* particular file as subject to the "Classpath" exception as provided
|
||||
* by Oracle in the LICENSE file that accompanied this code.
|
||||
*
|
||||
* This code is distributed in the hope that it will be useful, but WITHOUT
|
||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
* version 2 for more details (a copy is included in the LICENSE file that
|
||||
* accompanied this code).
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License version
|
||||
* 2 along with this work; if not, write to the Free Software Foundation,
|
||||
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
*
|
||||
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
|
||||
* or visit www.oracle.com if you need additional information or have any
|
||||
* questions.
|
||||
*/
|
||||
|
||||
/**
|
||||
* Provides support for RMI Object Activation. A remote
|
||||
* object's reference can be made ``persistent'' and later activated into a
|
||||
* ``live'' object using the RMI activation mechanism.
|
||||
*
|
||||
* <p>Implementations are not required to support the activation
|
||||
* mechanism. If activation is not supported by this implementation,
|
||||
* several specific activation API methods are all required to throw
|
||||
* {@code UnsupportedOperationException}. If activation is supported by this
|
||||
* implementation, these methods must never throw {@code
|
||||
* UnsupportedOperationException}. These methods are denoted by the
|
||||
* presence of an entry for {@code UnsupportedOperationException} in the
|
||||
* <strong>Throws</strong> section of each method's specification.
|
||||
*
|
||||
* @since 1.2
|
||||
* @deprecated The RMI Activation mechanism has been deprecated and may
|
||||
* be removed from a future version of the Java Platform. All of the classes
|
||||
* and interfaces in this package have been terminally deprecated. The
|
||||
* {@code rmid} tool has also been terminally deprecated. There is no
|
||||
* replacement for the RMI Activation mechanism in the Java Platform. Users of
|
||||
* RMI Activation are advised to migrate their applications to other technologies.
|
||||
*/
|
||||
package java.rmi.activation;
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 1996, 1998, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 1996, 2021, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
@ -29,13 +29,11 @@ package java.rmi.server;
|
||||
* An <code>ExportException</code> is a <code>RemoteException</code>
|
||||
* thrown if an attempt to export a remote object fails. A remote object is
|
||||
* exported via the constructors and <code>exportObject</code> methods of
|
||||
* <code>java.rmi.server.UnicastRemoteObject</code> and
|
||||
* <code>java.rmi.activation.Activatable</code>.
|
||||
* <code>java.rmi.server.UnicastRemoteObject</code>.
|
||||
*
|
||||
* @author Ann Wollrath
|
||||
* @since 1.1
|
||||
* @see java.rmi.server.UnicastRemoteObject
|
||||
* @see java.rmi.activation.Activatable
|
||||
*/
|
||||
public class ExportException extends java.rmi.RemoteException {
|
||||
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 1998, 2020, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 1998, 2021, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
@ -33,8 +33,7 @@ import java.net.*;
|
||||
* in order to obtain client sockets for RMI calls. A remote object can be
|
||||
* associated with an <code>RMIClientSocketFactory</code> when it is
|
||||
* created/exported via the constructors or <code>exportObject</code> methods
|
||||
* of <code>java.rmi.server.UnicastRemoteObject</code> and
|
||||
* <code>java.rmi.activation.Activatable</code> .
|
||||
* of <code>java.rmi.server.UnicastRemoteObject</code>.
|
||||
*
|
||||
* <p>An <code>RMIClientSocketFactory</code> instance associated with a remote
|
||||
* object will be downloaded to clients when the remote object's reference is
|
||||
@ -56,7 +55,6 @@ import java.net.*;
|
||||
* @author Peter Jones
|
||||
* @since 1.2
|
||||
* @see java.rmi.server.UnicastRemoteObject
|
||||
* @see java.rmi.activation.Activatable
|
||||
* @see java.rmi.registry.LocateRegistry
|
||||
*/
|
||||
public interface RMIClientSocketFactory {
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 1998, 2020, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 1998, 2021, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
@ -33,8 +33,7 @@ import java.net.*;
|
||||
* in order to obtain server sockets for RMI calls. A remote object can be
|
||||
* associated with an <code>RMIServerSocketFactory</code> when it is
|
||||
* created/exported via the constructors or <code>exportObject</code> methods
|
||||
* of <code>java.rmi.server.UnicastRemoteObject</code> and
|
||||
* <code>java.rmi.activation.Activatable</code> .
|
||||
* of <code>java.rmi.server.UnicastRemoteObject</code>.
|
||||
*
|
||||
* <p>An <code>RMIServerSocketFactory</code> instance associated with a remote
|
||||
* object is used to obtain the <code>ServerSocket</code> used to accept
|
||||
@ -55,7 +54,6 @@ import java.net.*;
|
||||
* @author Peter Jones
|
||||
* @since 1.2
|
||||
* @see java.rmi.server.UnicastRemoteObject
|
||||
* @see java.rmi.activation.Activatable
|
||||
* @see java.rmi.registry.LocateRegistry
|
||||
*/
|
||||
public interface RMIServerSocketFactory {
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 1996, 2020, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 1996, 2021, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
@ -212,12 +212,6 @@ public abstract class RemoteObject implements Remote, java.io.Serializable {
|
||||
*
|
||||
* If this object is an instance of
|
||||
* <code>RemoteStub</code> or <code>RemoteObjectInvocationHandler</code>
|
||||
* that was returned from any of
|
||||
* the <code>java.rmi.activation.Activatable.exportObject</code> methods,
|
||||
* the external ref type name is <code>"ActivatableRef"</code>.
|
||||
*
|
||||
* If this object is an instance of
|
||||
* <code>RemoteStub</code> or <code>RemoteObjectInvocationHandler</code>
|
||||
* that was returned from
|
||||
* the <code>RemoteObject.toStub</code> method (and the argument passed
|
||||
* to <code>toStub</code> was not itself a <code>RemoteStub</code>),
|
||||
@ -318,43 +312,6 @@ public abstract class RemoteObject implements Remote, java.io.Serializable {
|
||||
*
|
||||
* </ul>
|
||||
*
|
||||
* <p>For <code>"ActivatableRef"</code> with a
|
||||
* <code>null</code> nested remote reference:
|
||||
*
|
||||
* <ul>
|
||||
*
|
||||
* <li>an instance of
|
||||
* <code>java.rmi.activation.ActivationID</code>,
|
||||
* written by passing it to an invocation of
|
||||
* <code>writeObject</code> on the stream instance
|
||||
*
|
||||
* <li>a zero-length string (<code>""</code>),
|
||||
* written by {@link java.io.ObjectOutput#writeUTF(String)}
|
||||
*
|
||||
* </ul>
|
||||
*
|
||||
* <p>For <code>"ActivatableRef"</code> with a
|
||||
* non-<code>null</code> nested remote reference:
|
||||
*
|
||||
* <ul>
|
||||
*
|
||||
* <li>an instance of
|
||||
* <code>java.rmi.activation.ActivationID</code>,
|
||||
* written by passing it to an invocation of
|
||||
* <code>writeObject</code> on the stream instance
|
||||
*
|
||||
* <li>the external ref type name of the nested remote reference,
|
||||
* which must be <code>"UnicastRef2"</code>,
|
||||
* written by {@link java.io.ObjectOutput#writeUTF(String)}
|
||||
*
|
||||
* <li>the external form of the nested remote reference,
|
||||
* written by invoking its <code>writeExternal</code> method
|
||||
* with the stream instance
|
||||
* (see the description of the external form for
|
||||
* <code>"UnicastRef2"</code> above)
|
||||
*
|
||||
* </ul>
|
||||
*
|
||||
* <p>For <code>"UnicastServerRef"</code> and
|
||||
* <code>"UnicastServerRef2"</code>, no data is written by the
|
||||
* <code>writeExternal</code> method or read by the
|
||||
@ -412,8 +369,8 @@ public abstract class RemoteObject implements Remote, java.io.Serializable {
|
||||
*
|
||||
* <p>If the external ref type name is
|
||||
* <code>"UnicastRef"</code>, <code>"UnicastServerRef"</code>,
|
||||
* <code>"UnicastRef2"</code>, <code>"UnicastServerRef2"</code>,
|
||||
* or <code>"ActivatableRef"</code>, a corresponding
|
||||
* <code>"UnicastRef2"</code>, or <code>"UnicastServerRef2"</code>,
|
||||
* a corresponding
|
||||
* implementation-specific class must be found, and its
|
||||
* <code>readExternal</code> method must read the serial data
|
||||
* for that external ref type name as specified to be written
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2003, 2019, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2003, 2021, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
@ -31,7 +31,6 @@ import java.lang.reflect.Proxy;
|
||||
import java.rmi.Remote;
|
||||
import java.rmi.RemoteException;
|
||||
import java.rmi.UnexpectedException;
|
||||
import java.rmi.activation.Activatable;
|
||||
import java.util.Map;
|
||||
import java.util.WeakHashMap;
|
||||
import sun.rmi.server.Util;
|
||||
@ -45,8 +44,7 @@ import sun.rmi.server.WeakClassHashMap;
|
||||
*
|
||||
* <p>Applications are not expected to use this class directly. A remote
|
||||
* object exported to use a dynamic proxy with {@link UnicastRemoteObject}
|
||||
* or {@link Activatable} has an instance of this class as that proxy's
|
||||
* invocation handler.
|
||||
* has an instance of this class as that proxy's invocation handler.
|
||||
*
|
||||
* @author Ann Wollrath
|
||||
* @since 1.5
|
||||
|
@ -28,16 +28,9 @@
|
||||
*
|
||||
* <p> The JDK implementation of this module includes
|
||||
* the <em>{@index rmiregistry rmiregistry tool}</em> tool to start a remote
|
||||
* object registry, and the <em>{@index rmid rmid tool}</em> tool to start
|
||||
* the activation system daemon.
|
||||
*
|
||||
* <p> <strong>Deprecation Notice:</strong> The RMI Activation mechanism has been
|
||||
* deprecated and may be removed from a future version of the Java Platform. See the
|
||||
* <a href="{@docRoot}/java.rmi/java/rmi/activation/package-summary.html">
|
||||
* {@code java.rmi.activation}</a> package specification for further information.
|
||||
* object registry.
|
||||
*
|
||||
* @toolGuide rmiregistry
|
||||
* @toolGuide rmid
|
||||
*
|
||||
* @uses java.rmi.server.RMIClassLoaderSpi
|
||||
*
|
||||
@ -48,15 +41,11 @@ module java.rmi {
|
||||
requires java.logging;
|
||||
|
||||
exports java.rmi;
|
||||
exports java.rmi.activation;
|
||||
exports java.rmi.dgc;
|
||||
exports java.rmi.registry;
|
||||
exports java.rmi.server;
|
||||
exports javax.rmi.ssl;
|
||||
|
||||
// com.sun.rmi.rmid contains permissions classes that must be
|
||||
// accessible to the security manager at initialization time
|
||||
exports com.sun.rmi.rmid to java.base;
|
||||
exports sun.rmi.registry to
|
||||
jdk.management.agent;
|
||||
exports sun.rmi.server to
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 1996, 2020, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 1996, 2021, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
@ -464,7 +464,6 @@ public class RegistryImpl extends java.rmi.server.RemoteServer
|
||||
|| UnicastRef.class.isAssignableFrom(clazz)
|
||||
|| RMIClientSocketFactory.class.isAssignableFrom(clazz)
|
||||
|| RMIServerSocketFactory.class.isAssignableFrom(clazz)
|
||||
|| java.rmi.activation.ActivationID.class.isAssignableFrom(clazz)
|
||||
|| java.rmi.server.UID.class.isAssignableFrom(clazz)) {
|
||||
return ObjectInputFilter.Status.ALLOWED;
|
||||
} else {
|
||||
|
@ -1,411 +0,0 @@
|
||||
/*
|
||||
* Copyright (c) 1997, 2020, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
* under the terms of the GNU General Public License version 2 only, as
|
||||
* published by the Free Software Foundation. Oracle designates this
|
||||
* particular file as subject to the "Classpath" exception as provided
|
||||
* by Oracle in the LICENSE file that accompanied this code.
|
||||
*
|
||||
* This code is distributed in the hope that it will be useful, but WITHOUT
|
||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
* version 2 for more details (a copy is included in the LICENSE file that
|
||||
* accompanied this code).
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License version
|
||||
* 2 along with this work; if not, write to the Free Software Foundation,
|
||||
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
*
|
||||
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
|
||||
* or visit www.oracle.com if you need additional information or have any
|
||||
* questions.
|
||||
*/
|
||||
|
||||
package sun.rmi.server;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.io.ObjectInput;
|
||||
import java.io.ObjectOutput;
|
||||
import java.lang.reflect.Proxy;
|
||||
import java.net.MalformedURLException;
|
||||
import java.net.URL;
|
||||
import java.rmi.*;
|
||||
import java.rmi.activation.*;
|
||||
import java.rmi.server.Operation;
|
||||
import java.rmi.server.RMIClassLoader;
|
||||
import java.rmi.server.RemoteCall;
|
||||
import java.rmi.server.RemoteObject;
|
||||
import java.rmi.server.RemoteObjectInvocationHandler;
|
||||
import java.rmi.server.RemoteRef;
|
||||
import java.rmi.server.RemoteStub;
|
||||
|
||||
@SuppressWarnings({"deprecation", "removal"})
|
||||
public class ActivatableRef implements RemoteRef {
|
||||
|
||||
private static final long serialVersionUID = 7579060052569229166L;
|
||||
|
||||
protected ActivationID id;
|
||||
protected RemoteRef ref;
|
||||
transient boolean force = false;
|
||||
|
||||
private static final int MAX_RETRIES = 3;
|
||||
private static final String versionComplaint =
|
||||
"activation requires 1.2 stubs";
|
||||
|
||||
/**
|
||||
* Create a new (empty) ActivatableRef
|
||||
*/
|
||||
public ActivatableRef()
|
||||
{}
|
||||
|
||||
/**
|
||||
* Create a ActivatableRef with the specified id
|
||||
*/
|
||||
public ActivatableRef(ActivationID id, RemoteRef ref)
|
||||
{
|
||||
this.id = id;
|
||||
this.ref = ref;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the stub for the remote object whose class is
|
||||
* specified in the activation descriptor. The ActivatableRef
|
||||
* in the resulting stub has its activation id set to the
|
||||
* activation id supplied as the second argument.
|
||||
*/
|
||||
public static Remote getStub(ActivationDesc desc, ActivationID id)
|
||||
throws StubNotFoundException
|
||||
{
|
||||
String className = desc.getClassName();
|
||||
|
||||
try {
|
||||
Class<?> cl =
|
||||
RMIClassLoader.loadClass(desc.getLocation(), className);
|
||||
RemoteRef clientRef = new ActivatableRef(id, null);
|
||||
return Util.createProxy(cl, clientRef, false);
|
||||
|
||||
} catch (IllegalArgumentException e) {
|
||||
throw new StubNotFoundException(
|
||||
"class implements an illegal remote interface", e);
|
||||
|
||||
} catch (ClassNotFoundException e) {
|
||||
throw new StubNotFoundException("unable to load class: " +
|
||||
className, e);
|
||||
} catch (MalformedURLException e) {
|
||||
throw new StubNotFoundException("malformed URL", e);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Invoke method on remote object. This method delegates remote
|
||||
* method invocation to the underlying ref type. If the
|
||||
* underlying reference is not known (is null), then the object
|
||||
* must be activated first. If an attempt at method invocation
|
||||
* fails, the object should force reactivation. Method invocation
|
||||
* must preserve "at most once" call semantics. In RMI, "at most
|
||||
* once" applies to parameter deserialization at the remote site
|
||||
* and the remote object's method execution. "At most once" does
|
||||
* not apply to parameter serialization at the client so the
|
||||
* parameters of a call don't need to be buffered in anticipation
|
||||
* of call retry. Thus, a method call is only be retried if the
|
||||
* initial method invocation does not execute at all at the server
|
||||
* (including parameter deserialization).
|
||||
*/
|
||||
public Object invoke(Remote obj,
|
||||
java.lang.reflect.Method method,
|
||||
Object[] params,
|
||||
long opnum)
|
||||
throws Exception
|
||||
{
|
||||
|
||||
boolean force = false;
|
||||
RemoteRef localRef;
|
||||
Exception exception = null;
|
||||
|
||||
/*
|
||||
* Attempt object activation if active ref is unknown.
|
||||
* Throws a RemoteException if object can't be activated.
|
||||
*/
|
||||
synchronized (this) {
|
||||
if (ref == null) {
|
||||
localRef = activate(force);
|
||||
force = true;
|
||||
} else {
|
||||
localRef = ref;
|
||||
}
|
||||
}
|
||||
|
||||
for (int retries = MAX_RETRIES; retries > 0; retries--) {
|
||||
|
||||
try {
|
||||
return localRef.invoke(obj, method, params, opnum);
|
||||
} catch (NoSuchObjectException e) {
|
||||
/*
|
||||
* Object is not active in VM; retry call
|
||||
*/
|
||||
exception = e;
|
||||
} catch (ConnectException e) {
|
||||
/*
|
||||
* Failure during connection setup; retry call
|
||||
*/
|
||||
exception = e;
|
||||
} catch (UnknownHostException e) {
|
||||
/*
|
||||
* Failure during connection setup; retry call.
|
||||
*/
|
||||
exception = e;
|
||||
} catch (ConnectIOException e) {
|
||||
/*
|
||||
* Failure reusing cached connection; retry call
|
||||
*/
|
||||
exception = e;
|
||||
} catch (MarshalException e) {
|
||||
/*
|
||||
* Failure during parameter serialization; call may
|
||||
* have reached server, so call retry not possible.
|
||||
*/
|
||||
throw e;
|
||||
} catch (ServerError e) {
|
||||
/*
|
||||
* Call reached server; propagate remote exception.
|
||||
*/
|
||||
throw e;
|
||||
} catch (ServerException e) {
|
||||
/*
|
||||
* Call reached server; propagate remote exception
|
||||
*/
|
||||
throw e;
|
||||
} catch (RemoteException e) {
|
||||
/*
|
||||
* This is a catch-all for other RemoteExceptions.
|
||||
* UnmarshalException being the only one relevant.
|
||||
*
|
||||
* StubNotFoundException should never show up because
|
||||
* it is generally thrown when attempting to locate
|
||||
* a stub.
|
||||
*
|
||||
* UnexpectedException should never show up because
|
||||
* it is only thrown by a stub and would be wrapped
|
||||
* in a ServerException if it was propagated by a
|
||||
* remote call.
|
||||
*/
|
||||
synchronized (this) {
|
||||
if (localRef == ref) {
|
||||
ref = null; // this may be overly conservative
|
||||
}
|
||||
}
|
||||
|
||||
throw e;
|
||||
}
|
||||
|
||||
if (retries > 1) {
|
||||
/*
|
||||
* Activate object, since object could not be reached.
|
||||
*/
|
||||
synchronized (this) {
|
||||
if (localRef.remoteEquals(ref) || ref == null) {
|
||||
RemoteRef newRef = activate(force);
|
||||
|
||||
if (newRef.remoteEquals(localRef) &&
|
||||
exception instanceof NoSuchObjectException &&
|
||||
force == false) {
|
||||
/*
|
||||
* If last exception was NoSuchObjectException,
|
||||
* then old value of ref is definitely wrong,
|
||||
* so make sure that it is different.
|
||||
*/
|
||||
newRef = activate(true);
|
||||
}
|
||||
|
||||
localRef = newRef;
|
||||
force = true;
|
||||
} else {
|
||||
localRef = ref;
|
||||
force = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* Retries unsuccessful, so throw last exception
|
||||
*/
|
||||
throw exception;
|
||||
}
|
||||
|
||||
/**
|
||||
* private method to obtain the ref for a call.
|
||||
*/
|
||||
private synchronized RemoteRef getRef()
|
||||
throws RemoteException
|
||||
{
|
||||
if (ref == null) {
|
||||
ref = activate(false);
|
||||
}
|
||||
|
||||
return ref;
|
||||
}
|
||||
|
||||
/**
|
||||
* private method to activate the remote object.
|
||||
*
|
||||
* NOTE: the caller must be synchronized on "this" before
|
||||
* calling this method.
|
||||
*/
|
||||
private RemoteRef activate(boolean force)
|
||||
throws RemoteException
|
||||
{
|
||||
assert Thread.holdsLock(this);
|
||||
|
||||
ref = null;
|
||||
try {
|
||||
/*
|
||||
* Activate the object and retrieve the remote reference
|
||||
* from inside the stub returned as the result. Then
|
||||
* set this activatable ref's internal ref to be the
|
||||
* ref inside the ref of the stub. In more clear terms,
|
||||
* the stub returned from the activate call contains an
|
||||
* ActivatableRef. We need to set the ref in *this*
|
||||
* ActivatableRef to the ref inside the ActivatableRef
|
||||
* retrieved from the stub. The ref type embedded in the
|
||||
* ActivatableRef is typically a UnicastRef.
|
||||
*/
|
||||
|
||||
Remote proxy = id.activate(force);
|
||||
ActivatableRef newRef = null;
|
||||
|
||||
if (proxy instanceof RemoteStub) {
|
||||
newRef = (ActivatableRef) ((RemoteStub) proxy).getRef();
|
||||
} else {
|
||||
/*
|
||||
* Assume that proxy is an instance of a dynamic proxy
|
||||
* class. If that assumption is not correct, or either of
|
||||
* the casts below fails, the resulting exception will be
|
||||
* wrapped in an ActivateFailedException below.
|
||||
*/
|
||||
RemoteObjectInvocationHandler handler =
|
||||
(RemoteObjectInvocationHandler)
|
||||
Proxy.getInvocationHandler(proxy);
|
||||
newRef = (ActivatableRef) handler.getRef();
|
||||
}
|
||||
ref = newRef.ref;
|
||||
return ref;
|
||||
|
||||
} catch (ConnectException e) {
|
||||
throw new ConnectException("activation failed", e);
|
||||
} catch (RemoteException e) {
|
||||
throw new ConnectIOException("activation failed", e);
|
||||
} catch (UnknownObjectException e) {
|
||||
throw new NoSuchObjectException("object not registered");
|
||||
} catch (ActivationException e) {
|
||||
throw new ActivateFailedException("activation failed", e);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* This call is used by the old 1.1 stub protocol and is
|
||||
* unsupported since activation requires 1.2 stubs.
|
||||
*/
|
||||
public synchronized RemoteCall newCall(RemoteObject obj,
|
||||
Operation[] ops,
|
||||
int opnum,
|
||||
long hash)
|
||||
throws RemoteException
|
||||
{
|
||||
throw new UnsupportedOperationException(versionComplaint);
|
||||
}
|
||||
|
||||
/**
|
||||
* This call is used by the old 1.1 stub protocol and is
|
||||
* unsupported since activation requires 1.2 stubs.
|
||||
*/
|
||||
public void invoke(RemoteCall call) throws Exception
|
||||
{
|
||||
throw new UnsupportedOperationException(versionComplaint);
|
||||
}
|
||||
|
||||
/**
|
||||
* This call is used by the old 1.1 stub protocol and is
|
||||
* unsupported since activation requires 1.2 stubs.
|
||||
*/
|
||||
public void done(RemoteCall call) throws RemoteException {
|
||||
throw new UnsupportedOperationException(versionComplaint);
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the class of the ref type to be serialized
|
||||
*/
|
||||
public String getRefClass(ObjectOutput out)
|
||||
{
|
||||
return "ActivatableRef";
|
||||
}
|
||||
|
||||
/**
|
||||
* Write out external representation for remote ref.
|
||||
*/
|
||||
public void writeExternal(ObjectOutput out) throws IOException
|
||||
{
|
||||
RemoteRef localRef = ref;
|
||||
|
||||
out.writeObject(id);
|
||||
if (localRef == null) {
|
||||
out.writeUTF("");
|
||||
} else {
|
||||
out.writeUTF(localRef.getRefClass(out));
|
||||
localRef.writeExternal(out);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Read in external representation for remote ref.
|
||||
* @exception ClassNotFoundException If the class for an object
|
||||
* being restored cannot be found.
|
||||
*/
|
||||
public void readExternal(ObjectInput in)
|
||||
throws IOException, ClassNotFoundException
|
||||
{
|
||||
id = (ActivationID)in.readObject();
|
||||
ref = null;
|
||||
String className = in.readUTF();
|
||||
|
||||
if (className.isEmpty()) return;
|
||||
|
||||
try {
|
||||
Class<?> refClass = Class.forName(RemoteRef.packagePrefix + "." +
|
||||
className);
|
||||
ref = (RemoteRef)refClass.newInstance();
|
||||
ref.readExternal(in);
|
||||
} catch (InstantiationException e) {
|
||||
throw new UnmarshalException("Unable to create remote reference",
|
||||
e);
|
||||
} catch (IllegalAccessException e) {
|
||||
throw new UnmarshalException("Illegal access creating remote reference");
|
||||
}
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------;
|
||||
/**
|
||||
* Method from object, forward from RemoteObject
|
||||
*/
|
||||
public String remoteToString() {
|
||||
return Util.getUnqualifiedName(getClass()) +
|
||||
" [remoteRef: " + ref + "]";
|
||||
}
|
||||
|
||||
/**
|
||||
* default implementation of hashCode for remote objects
|
||||
*/
|
||||
public int remoteHashCode() {
|
||||
return id.hashCode();
|
||||
}
|
||||
|
||||
/** default implementation of equals for remote objects
|
||||
*/
|
||||
public boolean remoteEquals(RemoteRef ref) {
|
||||
if (ref instanceof ActivatableRef)
|
||||
return id.equals(((ActivatableRef)ref).id);
|
||||
return false;
|
||||
}
|
||||
}
|
@ -1,94 +0,0 @@
|
||||
/*
|
||||
* Copyright (c) 1997, 2020, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
* under the terms of the GNU General Public License version 2 only, as
|
||||
* published by the Free Software Foundation. Oracle designates this
|
||||
* particular file as subject to the "Classpath" exception as provided
|
||||
* by Oracle in the LICENSE file that accompanied this code.
|
||||
*
|
||||
* This code is distributed in the hope that it will be useful, but WITHOUT
|
||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
* version 2 for more details (a copy is included in the LICENSE file that
|
||||
* accompanied this code).
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License version
|
||||
* 2 along with this work; if not, write to the Free Software Foundation,
|
||||
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
*
|
||||
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
|
||||
* or visit www.oracle.com if you need additional information or have any
|
||||
* questions.
|
||||
*/
|
||||
|
||||
package sun.rmi.server;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.io.NotSerializableException;
|
||||
import java.io.ObjectOutput;
|
||||
import java.rmi.*;
|
||||
import java.rmi.server.*;
|
||||
import java.rmi.activation.ActivationID;
|
||||
import sun.rmi.transport.LiveRef;
|
||||
|
||||
/**
|
||||
* Server-side ref for a persistent remote impl.
|
||||
*
|
||||
* @author Ann Wollrath
|
||||
*/
|
||||
@SuppressWarnings({"removal", "serial"}) // Externalizable class w/o no-arg c'tor
|
||||
public class ActivatableServerRef extends UnicastServerRef2 {
|
||||
|
||||
private static final long serialVersionUID = 2002967993223003793L;
|
||||
|
||||
private ActivationID id;
|
||||
|
||||
/**
|
||||
* Construct a Unicast server remote reference to be exported
|
||||
* on the specified port.
|
||||
*/
|
||||
public ActivatableServerRef(ActivationID id, int port)
|
||||
{
|
||||
this(id, port, null, null);
|
||||
}
|
||||
|
||||
/**
|
||||
* Construct a Unicast server remote reference to be exported
|
||||
* on the specified port.
|
||||
*/
|
||||
public ActivatableServerRef(ActivationID id, int port,
|
||||
RMIClientSocketFactory csf,
|
||||
RMIServerSocketFactory ssf)
|
||||
{
|
||||
super(new LiveRef(port, csf, ssf));
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the class of the ref type to be serialized
|
||||
*/
|
||||
public String getRefClass(ObjectOutput out)
|
||||
{
|
||||
return "ActivatableServerRef";
|
||||
}
|
||||
|
||||
/**
|
||||
* Return the client remote reference for this remoteRef.
|
||||
* In the case of a client RemoteRef "this" is the answer.
|
||||
* For a server remote reference, a client side one will have to
|
||||
* found or created.
|
||||
*/
|
||||
protected RemoteRef getClientRef() {
|
||||
return new ActivatableRef(id, new UnicastRef2(ref));
|
||||
}
|
||||
|
||||
/**
|
||||
* Prevents serialization (because deserializaion is impossible).
|
||||
*/
|
||||
public void writeExternal(ObjectOutput out) throws IOException {
|
||||
throw new NotSerializableException(
|
||||
"ActivatableServerRef not serializable");
|
||||
}
|
||||
}
|
@ -1,239 +0,0 @@
|
||||
/*
|
||||
* Copyright (c) 1997, 2020, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
* under the terms of the GNU General Public License version 2 only, as
|
||||
* published by the Free Software Foundation. Oracle designates this
|
||||
* particular file as subject to the "Classpath" exception as provided
|
||||
* by Oracle in the LICENSE file that accompanied this code.
|
||||
*
|
||||
* This code is distributed in the hope that it will be useful, but WITHOUT
|
||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
* version 2 for more details (a copy is included in the LICENSE file that
|
||||
* accompanied this code).
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License version
|
||||
* 2 along with this work; if not, write to the Free Software Foundation,
|
||||
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
*
|
||||
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
|
||||
* or visit www.oracle.com if you need additional information or have any
|
||||
* questions.
|
||||
*/
|
||||
// Stub class generated by rmic, do not edit.
|
||||
// Contents subject to change without notice.
|
||||
|
||||
package sun.rmi.server;
|
||||
|
||||
/**
|
||||
* Activation$ActivationSystemImpl_Stub.
|
||||
*/
|
||||
@SuppressWarnings({"deprecation", "rawtypes", "removal", "unchecked"})
|
||||
public final class Activation$ActivationSystemImpl_Stub
|
||||
extends java.rmi.server.RemoteStub
|
||||
implements java.rmi.activation.ActivationSystem, java.rmi.Remote {
|
||||
private static final long serialVersionUID = 2;
|
||||
|
||||
private static java.lang.reflect.Method $method_activeGroup_0;
|
||||
private static java.lang.reflect.Method $method_getActivationDesc_1;
|
||||
private static java.lang.reflect.Method $method_getActivationGroupDesc_2;
|
||||
private static java.lang.reflect.Method $method_registerGroup_3;
|
||||
private static java.lang.reflect.Method $method_registerObject_4;
|
||||
private static java.lang.reflect.Method $method_setActivationDesc_5;
|
||||
private static java.lang.reflect.Method $method_setActivationGroupDesc_6;
|
||||
private static java.lang.reflect.Method $method_shutdown_7;
|
||||
private static java.lang.reflect.Method $method_unregisterGroup_8;
|
||||
private static java.lang.reflect.Method $method_unregisterObject_9;
|
||||
|
||||
static {
|
||||
try {
|
||||
$method_activeGroup_0 = java.rmi.activation.ActivationSystem.class.getMethod("activeGroup", new java.lang.Class[]{java.rmi.activation.ActivationGroupID.class, java.rmi.activation.ActivationInstantiator.class, long.class});
|
||||
$method_getActivationDesc_1 = java.rmi.activation.ActivationSystem.class.getMethod("getActivationDesc", new java.lang.Class[]{java.rmi.activation.ActivationID.class});
|
||||
$method_getActivationGroupDesc_2 = java.rmi.activation.ActivationSystem.class.getMethod("getActivationGroupDesc", new java.lang.Class[]{java.rmi.activation.ActivationGroupID.class});
|
||||
$method_registerGroup_3 = java.rmi.activation.ActivationSystem.class.getMethod("registerGroup", new java.lang.Class[]{java.rmi.activation.ActivationGroupDesc.class});
|
||||
$method_registerObject_4 = java.rmi.activation.ActivationSystem.class.getMethod("registerObject", new java.lang.Class[]{java.rmi.activation.ActivationDesc.class});
|
||||
$method_setActivationDesc_5 = java.rmi.activation.ActivationSystem.class.getMethod("setActivationDesc", new java.lang.Class[]{java.rmi.activation.ActivationID.class, java.rmi.activation.ActivationDesc.class});
|
||||
$method_setActivationGroupDesc_6 = java.rmi.activation.ActivationSystem.class.getMethod("setActivationGroupDesc", new java.lang.Class[]{java.rmi.activation.ActivationGroupID.class, java.rmi.activation.ActivationGroupDesc.class});
|
||||
$method_shutdown_7 = java.rmi.activation.ActivationSystem.class.getMethod("shutdown", new java.lang.Class[]{});
|
||||
$method_unregisterGroup_8 = java.rmi.activation.ActivationSystem.class.getMethod("unregisterGroup", new java.lang.Class[]{java.rmi.activation.ActivationGroupID.class});
|
||||
$method_unregisterObject_9 = java.rmi.activation.ActivationSystem.class.getMethod("unregisterObject", new java.lang.Class[]{java.rmi.activation.ActivationID.class});
|
||||
} catch (java.lang.NoSuchMethodException e) {
|
||||
throw new java.lang.NoSuchMethodError(
|
||||
"stub class initialization failed");
|
||||
}
|
||||
}
|
||||
|
||||
// constructors
|
||||
public Activation$ActivationSystemImpl_Stub(java.rmi.server.RemoteRef ref) {
|
||||
super(ref);
|
||||
}
|
||||
|
||||
// methods from remote interfaces
|
||||
|
||||
// implementation of activeGroup(ActivationGroupID, ActivationInstantiator, long)
|
||||
public java.rmi.activation.ActivationMonitor activeGroup(java.rmi.activation.ActivationGroupID $param_ActivationGroupID_1, java.rmi.activation.ActivationInstantiator $param_ActivationInstantiator_2, long $param_long_3)
|
||||
throws java.rmi.RemoteException, java.rmi.activation.ActivationException, java.rmi.activation.UnknownGroupException {
|
||||
try {
|
||||
Object $result = ref.invoke(this, $method_activeGroup_0, new java.lang.Object[]{$param_ActivationGroupID_1, $param_ActivationInstantiator_2, new java.lang.Long($param_long_3)}, -4575843150759415294L);
|
||||
return ((java.rmi.activation.ActivationMonitor) $result);
|
||||
} catch (java.lang.RuntimeException e) {
|
||||
throw e;
|
||||
} catch (java.rmi.RemoteException e) {
|
||||
throw e;
|
||||
} catch (java.rmi.activation.ActivationException e) {
|
||||
throw e;
|
||||
} catch (java.lang.Exception e) {
|
||||
throw new java.rmi.UnexpectedException("undeclared checked exception", e);
|
||||
}
|
||||
}
|
||||
|
||||
// implementation of getActivationDesc(ActivationID)
|
||||
public java.rmi.activation.ActivationDesc getActivationDesc(java.rmi.activation.ActivationID $param_ActivationID_1)
|
||||
throws java.rmi.RemoteException, java.rmi.activation.ActivationException, java.rmi.activation.UnknownObjectException {
|
||||
try {
|
||||
Object $result = ref.invoke(this, $method_getActivationDesc_1, new java.lang.Object[]{$param_ActivationID_1}, 4830055440982622087L);
|
||||
return ((java.rmi.activation.ActivationDesc) $result);
|
||||
} catch (java.lang.RuntimeException e) {
|
||||
throw e;
|
||||
} catch (java.rmi.RemoteException e) {
|
||||
throw e;
|
||||
} catch (java.rmi.activation.ActivationException e) {
|
||||
throw e;
|
||||
} catch (java.lang.Exception e) {
|
||||
throw new java.rmi.UnexpectedException("undeclared checked exception", e);
|
||||
}
|
||||
}
|
||||
|
||||
// implementation of getActivationGroupDesc(ActivationGroupID)
|
||||
public java.rmi.activation.ActivationGroupDesc getActivationGroupDesc(java.rmi.activation.ActivationGroupID $param_ActivationGroupID_1)
|
||||
throws java.rmi.RemoteException, java.rmi.activation.ActivationException, java.rmi.activation.UnknownGroupException {
|
||||
try {
|
||||
Object $result = ref.invoke(this, $method_getActivationGroupDesc_2, new java.lang.Object[]{$param_ActivationGroupID_1}, -8701843806548736528L);
|
||||
return ((java.rmi.activation.ActivationGroupDesc) $result);
|
||||
} catch (java.lang.RuntimeException e) {
|
||||
throw e;
|
||||
} catch (java.rmi.RemoteException e) {
|
||||
throw e;
|
||||
} catch (java.rmi.activation.ActivationException e) {
|
||||
throw e;
|
||||
} catch (java.lang.Exception e) {
|
||||
throw new java.rmi.UnexpectedException("undeclared checked exception", e);
|
||||
}
|
||||
}
|
||||
|
||||
// implementation of registerGroup(ActivationGroupDesc)
|
||||
public java.rmi.activation.ActivationGroupID registerGroup(java.rmi.activation.ActivationGroupDesc $param_ActivationGroupDesc_1)
|
||||
throws java.rmi.RemoteException, java.rmi.activation.ActivationException {
|
||||
try {
|
||||
Object $result = ref.invoke(this, $method_registerGroup_3, new java.lang.Object[]{$param_ActivationGroupDesc_1}, 6921515268192657754L);
|
||||
return ((java.rmi.activation.ActivationGroupID) $result);
|
||||
} catch (java.lang.RuntimeException e) {
|
||||
throw e;
|
||||
} catch (java.rmi.RemoteException e) {
|
||||
throw e;
|
||||
} catch (java.rmi.activation.ActivationException e) {
|
||||
throw e;
|
||||
} catch (java.lang.Exception e) {
|
||||
throw new java.rmi.UnexpectedException("undeclared checked exception", e);
|
||||
}
|
||||
}
|
||||
|
||||
// implementation of registerObject(ActivationDesc)
|
||||
public java.rmi.activation.ActivationID registerObject(java.rmi.activation.ActivationDesc $param_ActivationDesc_1)
|
||||
throws java.rmi.RemoteException, java.rmi.activation.ActivationException, java.rmi.activation.UnknownGroupException {
|
||||
try {
|
||||
Object $result = ref.invoke(this, $method_registerObject_4, new java.lang.Object[]{$param_ActivationDesc_1}, -3006759798994351347L);
|
||||
return ((java.rmi.activation.ActivationID) $result);
|
||||
} catch (java.lang.RuntimeException e) {
|
||||
throw e;
|
||||
} catch (java.rmi.RemoteException e) {
|
||||
throw e;
|
||||
} catch (java.rmi.activation.ActivationException e) {
|
||||
throw e;
|
||||
} catch (java.lang.Exception e) {
|
||||
throw new java.rmi.UnexpectedException("undeclared checked exception", e);
|
||||
}
|
||||
}
|
||||
|
||||
// implementation of setActivationDesc(ActivationID, ActivationDesc)
|
||||
public java.rmi.activation.ActivationDesc setActivationDesc(java.rmi.activation.ActivationID $param_ActivationID_1, java.rmi.activation.ActivationDesc $param_ActivationDesc_2)
|
||||
throws java.rmi.RemoteException, java.rmi.activation.ActivationException, java.rmi.activation.UnknownGroupException, java.rmi.activation.UnknownObjectException {
|
||||
try {
|
||||
Object $result = ref.invoke(this, $method_setActivationDesc_5, new java.lang.Object[]{$param_ActivationID_1, $param_ActivationDesc_2}, 7128043237057180796L);
|
||||
return ((java.rmi.activation.ActivationDesc) $result);
|
||||
} catch (java.lang.RuntimeException e) {
|
||||
throw e;
|
||||
} catch (java.rmi.RemoteException e) {
|
||||
throw e;
|
||||
} catch (java.rmi.activation.ActivationException e) {
|
||||
throw e;
|
||||
} catch (java.lang.Exception e) {
|
||||
throw new java.rmi.UnexpectedException("undeclared checked exception", e);
|
||||
}
|
||||
}
|
||||
|
||||
// implementation of setActivationGroupDesc(ActivationGroupID, ActivationGroupDesc)
|
||||
public java.rmi.activation.ActivationGroupDesc setActivationGroupDesc(java.rmi.activation.ActivationGroupID $param_ActivationGroupID_1, java.rmi.activation.ActivationGroupDesc $param_ActivationGroupDesc_2)
|
||||
throws java.rmi.RemoteException, java.rmi.activation.ActivationException, java.rmi.activation.UnknownGroupException {
|
||||
try {
|
||||
Object $result = ref.invoke(this, $method_setActivationGroupDesc_6, new java.lang.Object[]{$param_ActivationGroupID_1, $param_ActivationGroupDesc_2}, 1213918527826541191L);
|
||||
return ((java.rmi.activation.ActivationGroupDesc) $result);
|
||||
} catch (java.lang.RuntimeException e) {
|
||||
throw e;
|
||||
} catch (java.rmi.RemoteException e) {
|
||||
throw e;
|
||||
} catch (java.rmi.activation.ActivationException e) {
|
||||
throw e;
|
||||
} catch (java.lang.Exception e) {
|
||||
throw new java.rmi.UnexpectedException("undeclared checked exception", e);
|
||||
}
|
||||
}
|
||||
|
||||
// implementation of shutdown()
|
||||
public void shutdown()
|
||||
throws java.rmi.RemoteException {
|
||||
try {
|
||||
ref.invoke(this, $method_shutdown_7, null, -7207851917985848402L);
|
||||
} catch (java.lang.RuntimeException e) {
|
||||
throw e;
|
||||
} catch (java.rmi.RemoteException e) {
|
||||
throw e;
|
||||
} catch (java.lang.Exception e) {
|
||||
throw new java.rmi.UnexpectedException("undeclared checked exception", e);
|
||||
}
|
||||
}
|
||||
|
||||
// implementation of unregisterGroup(ActivationGroupID)
|
||||
public void unregisterGroup(java.rmi.activation.ActivationGroupID $param_ActivationGroupID_1)
|
||||
throws java.rmi.RemoteException, java.rmi.activation.ActivationException, java.rmi.activation.UnknownGroupException {
|
||||
try {
|
||||
ref.invoke(this, $method_unregisterGroup_8, new java.lang.Object[]{$param_ActivationGroupID_1}, 3768097077835970701L);
|
||||
} catch (java.lang.RuntimeException e) {
|
||||
throw e;
|
||||
} catch (java.rmi.RemoteException e) {
|
||||
throw e;
|
||||
} catch (java.rmi.activation.ActivationException e) {
|
||||
throw e;
|
||||
} catch (java.lang.Exception e) {
|
||||
throw new java.rmi.UnexpectedException("undeclared checked exception", e);
|
||||
}
|
||||
}
|
||||
|
||||
// implementation of unregisterObject(ActivationID)
|
||||
public void unregisterObject(java.rmi.activation.ActivationID $param_ActivationID_1)
|
||||
throws java.rmi.RemoteException, java.rmi.activation.ActivationException, java.rmi.activation.UnknownObjectException {
|
||||
try {
|
||||
ref.invoke(this, $method_unregisterObject_9, new java.lang.Object[]{$param_ActivationID_1}, -6843850585331411084L);
|
||||
} catch (java.lang.RuntimeException e) {
|
||||
throw e;
|
||||
} catch (java.rmi.RemoteException e) {
|
||||
throw e;
|
||||
} catch (java.rmi.activation.ActivationException e) {
|
||||
throw e;
|
||||
} catch (java.lang.Exception e) {
|
||||
throw new java.rmi.UnexpectedException("undeclared checked exception", e);
|
||||
}
|
||||
}
|
||||
}
|
File diff suppressed because it is too large
Load Diff
@ -1,502 +0,0 @@
|
||||
/*
|
||||
* Copyright (c) 1997, 2020, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
* under the terms of the GNU General Public License version 2 only, as
|
||||
* published by the Free Software Foundation. Oracle designates this
|
||||
* particular file as subject to the "Classpath" exception as provided
|
||||
* by Oracle in the LICENSE file that accompanied this code.
|
||||
*
|
||||
* This code is distributed in the hope that it will be useful, but WITHOUT
|
||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
* version 2 for more details (a copy is included in the LICENSE file that
|
||||
* accompanied this code).
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License version
|
||||
* 2 along with this work; if not, write to the Free Software Foundation,
|
||||
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
*
|
||||
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
|
||||
* or visit www.oracle.com if you need additional information or have any
|
||||
* questions.
|
||||
*/
|
||||
|
||||
package sun.rmi.server;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.lang.reflect.Constructor;
|
||||
import java.lang.reflect.InvocationTargetException;
|
||||
import java.net.ServerSocket;
|
||||
import java.rmi.MarshalledObject;
|
||||
import java.rmi.NoSuchObjectException;
|
||||
import java.rmi.Remote;
|
||||
import java.rmi.RemoteException;
|
||||
import java.rmi.activation.Activatable;
|
||||
import java.rmi.activation.ActivationDesc;
|
||||
import java.rmi.activation.ActivationException;
|
||||
import java.rmi.activation.ActivationGroup;
|
||||
import java.rmi.activation.ActivationGroupID;
|
||||
import java.rmi.activation.ActivationID;
|
||||
import java.rmi.activation.UnknownObjectException;
|
||||
import java.rmi.server.RMIClassLoader;
|
||||
import java.rmi.server.RMIServerSocketFactory;
|
||||
import java.rmi.server.RMISocketFactory;
|
||||
import java.rmi.server.UnicastRemoteObject;
|
||||
import java.security.AccessController;
|
||||
import java.security.PrivilegedActionException;
|
||||
import java.security.PrivilegedExceptionAction;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Hashtable;
|
||||
import java.util.List;
|
||||
import sun.rmi.registry.RegistryImpl;
|
||||
|
||||
/**
|
||||
* The default activation group implementation.
|
||||
*
|
||||
* @author Ann Wollrath
|
||||
* @since 1.2
|
||||
* @see java.rmi.activation.ActivationGroup
|
||||
*/
|
||||
@SuppressWarnings("removal")
|
||||
public class ActivationGroupImpl extends ActivationGroup {
|
||||
|
||||
// use serialVersionUID from JDK 1.2.2 for interoperability
|
||||
private static final long serialVersionUID = 5758693559430427303L;
|
||||
|
||||
/** maps persistent IDs to activated remote objects */
|
||||
private final Hashtable<ActivationID,ActiveEntry> active =
|
||||
new Hashtable<>();
|
||||
private boolean groupInactive = false;
|
||||
private final ActivationGroupID groupID;
|
||||
@SuppressWarnings("serial") // Conditionally serializable
|
||||
private final List<ActivationID> lockedIDs = new ArrayList<>();
|
||||
|
||||
/**
|
||||
* Creates a default activation group implementation.
|
||||
*
|
||||
* @param id the group's identifier
|
||||
* @param data ignored
|
||||
*/
|
||||
public ActivationGroupImpl(ActivationGroupID id, MarshalledObject<?> data)
|
||||
throws RemoteException
|
||||
{
|
||||
super(id);
|
||||
groupID = id;
|
||||
|
||||
/*
|
||||
* Unexport activation group impl and attempt to export it on
|
||||
* an unshared anonymous port. See 4692286.
|
||||
*/
|
||||
unexportObject(this, true);
|
||||
RMIServerSocketFactory ssf = new ServerSocketFactoryImpl();
|
||||
UnicastRemoteObject.exportObject(this, 0, null, ssf);
|
||||
|
||||
if (System.getSecurityManager() == null) {
|
||||
try {
|
||||
// Provide a default security manager.
|
||||
System.setSecurityManager(new SecurityManager());
|
||||
|
||||
} catch (Exception e) {
|
||||
throw new RemoteException("unable to set security manager", e);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Trivial server socket factory used to export the activation group
|
||||
* impl on an unshared port.
|
||||
*/
|
||||
private static class ServerSocketFactoryImpl
|
||||
implements RMIServerSocketFactory
|
||||
{
|
||||
public ServerSocket createServerSocket(int port) throws IOException
|
||||
{
|
||||
RMISocketFactory sf = RMISocketFactory.getSocketFactory();
|
||||
if (sf == null) {
|
||||
sf = RMISocketFactory.getDefaultSocketFactory();
|
||||
}
|
||||
return sf.createServerSocket(port);
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* Obtains a lock on the ActivationID id before returning. Allows only one
|
||||
* thread at a time to hold a lock on a particular id. If the lock for id
|
||||
* is in use, all requests for an equivalent (in the Object.equals sense)
|
||||
* id will wait for the id to be notified and use the supplied id as the
|
||||
* next lock. The caller of "acquireLock" must execute the "releaseLock"
|
||||
* method" to release the lock and "notifyAll" waiters for the id lock
|
||||
* obtained from this method. The typical usage pattern is as follows:
|
||||
*
|
||||
* try {
|
||||
* acquireLock(id);
|
||||
* // do stuff pertaining to id...
|
||||
* } finally {
|
||||
* releaseLock(id);
|
||||
* checkInactiveGroup();
|
||||
* }
|
||||
*/
|
||||
private void acquireLock(ActivationID id) {
|
||||
|
||||
ActivationID waitForID;
|
||||
|
||||
for (;;) {
|
||||
|
||||
synchronized (lockedIDs) {
|
||||
int index = lockedIDs.indexOf(id);
|
||||
if (index < 0) {
|
||||
lockedIDs.add(id);
|
||||
return;
|
||||
} else {
|
||||
waitForID = lockedIDs.get(index);
|
||||
}
|
||||
}
|
||||
|
||||
synchronized (waitForID) {
|
||||
synchronized (lockedIDs) {
|
||||
int index = lockedIDs.indexOf(waitForID);
|
||||
if (index < 0) continue;
|
||||
ActivationID actualID = lockedIDs.get(index);
|
||||
if (actualID != waitForID)
|
||||
/*
|
||||
* don't wait on an id that won't be notified.
|
||||
*/
|
||||
continue;
|
||||
}
|
||||
|
||||
try {
|
||||
waitForID.wait();
|
||||
} catch (InterruptedException ignore) {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/*
|
||||
* Releases the id lock obtained via the "acquireLock" method and then
|
||||
* notifies all threads waiting on the lock.
|
||||
*/
|
||||
private void releaseLock(ActivationID id) {
|
||||
synchronized (lockedIDs) {
|
||||
id = lockedIDs.remove(lockedIDs.indexOf(id));
|
||||
}
|
||||
|
||||
synchronized (id) {
|
||||
id.notifyAll();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates a new instance of an activatable remote object. The
|
||||
* <code>Activator</code> calls this method to create an activatable
|
||||
* object in this group. This method should be idempotent; a call to
|
||||
* activate an already active object should return the previously
|
||||
* activated object.
|
||||
*
|
||||
* Note: this method assumes that the Activator will only invoke
|
||||
* newInstance for the same object in a serial fashion (i.e.,
|
||||
* the activator will not allow the group to see concurrent requests
|
||||
* to activate the same object.
|
||||
*
|
||||
* @param id the object's activation identifier
|
||||
* @param desc the object's activation descriptor
|
||||
* @return a marshalled object containing the activated object's stub
|
||||
*/
|
||||
public MarshalledObject<? extends Remote>
|
||||
newInstance(final ActivationID id,
|
||||
final ActivationDesc desc)
|
||||
throws ActivationException, RemoteException
|
||||
{
|
||||
RegistryImpl.checkAccess("ActivationInstantiator.newInstance");
|
||||
|
||||
if (!groupID.equals(desc.getGroupID()))
|
||||
throw new ActivationException("newInstance in wrong group");
|
||||
|
||||
try {
|
||||
acquireLock(id);
|
||||
synchronized (this) {
|
||||
if (groupInactive == true)
|
||||
throw new InactiveGroupException("group is inactive");
|
||||
}
|
||||
|
||||
ActiveEntry entry = active.get(id);
|
||||
if (entry != null)
|
||||
return entry.mobj;
|
||||
|
||||
String className = desc.getClassName();
|
||||
|
||||
final Class<? extends Remote> cl =
|
||||
RMIClassLoader.loadClass(desc.getLocation(), className)
|
||||
.asSubclass(Remote.class);
|
||||
Remote impl = null;
|
||||
|
||||
final Thread t = Thread.currentThread();
|
||||
final ClassLoader savedCcl = t.getContextClassLoader();
|
||||
ClassLoader objcl = cl.getClassLoader();
|
||||
final ClassLoader ccl = covers(objcl, savedCcl) ? objcl : savedCcl;
|
||||
|
||||
/*
|
||||
* Fix for 4164971: allow non-public activatable class
|
||||
* and/or constructor, create the activatable object in a
|
||||
* privileged block
|
||||
*/
|
||||
try {
|
||||
/*
|
||||
* The code below is in a doPrivileged block to
|
||||
* protect against user code which code might have set
|
||||
* a global socket factory (in which case application
|
||||
* code would be on the stack).
|
||||
*/
|
||||
impl = AccessController.doPrivileged(
|
||||
new PrivilegedExceptionAction<Remote>() {
|
||||
public Remote run() throws InstantiationException,
|
||||
NoSuchMethodException, IllegalAccessException,
|
||||
InvocationTargetException
|
||||
{
|
||||
Constructor<? extends Remote> constructor =
|
||||
cl.getDeclaredConstructor(
|
||||
ActivationID.class, MarshalledObject.class);
|
||||
constructor.setAccessible(true);
|
||||
try {
|
||||
/*
|
||||
* Fix for 4289544: make sure to set the
|
||||
* context class loader to be the class
|
||||
* loader of the impl class before
|
||||
* constructing that class.
|
||||
*/
|
||||
t.setContextClassLoader(ccl);
|
||||
return constructor.newInstance(id,
|
||||
desc.getData());
|
||||
} finally {
|
||||
t.setContextClassLoader(savedCcl);
|
||||
}
|
||||
}
|
||||
});
|
||||
} catch (PrivilegedActionException pae) {
|
||||
Throwable e = pae.getException();
|
||||
|
||||
// narrow the exception's type and rethrow it
|
||||
if (e instanceof InstantiationException) {
|
||||
throw (InstantiationException) e;
|
||||
} else if (e instanceof NoSuchMethodException) {
|
||||
throw (NoSuchMethodException) e;
|
||||
} else if (e instanceof IllegalAccessException) {
|
||||
throw (IllegalAccessException) e;
|
||||
} else if (e instanceof InvocationTargetException) {
|
||||
throw (InvocationTargetException) e;
|
||||
} else if (e instanceof RuntimeException) {
|
||||
throw (RuntimeException) e;
|
||||
} else if (e instanceof Error) {
|
||||
throw (Error) e;
|
||||
}
|
||||
}
|
||||
|
||||
entry = new ActiveEntry(impl);
|
||||
active.put(id, entry);
|
||||
return entry.mobj;
|
||||
|
||||
} catch (NoSuchMethodException | NoSuchMethodError e) {
|
||||
/* user forgot to provide activatable constructor?
|
||||
* or code recompiled and user forgot to provide
|
||||
* activatable constructor?
|
||||
*/
|
||||
throw new ActivationException
|
||||
("Activatable object must provide an activation"+
|
||||
" constructor", e );
|
||||
|
||||
} catch (InvocationTargetException e) {
|
||||
throw new ActivationException("exception in object constructor",
|
||||
e.getCause());
|
||||
|
||||
} catch (Exception e) {
|
||||
throw new ActivationException("unable to activate object", e);
|
||||
} finally {
|
||||
releaseLock(id);
|
||||
checkInactiveGroup();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* The group's <code>inactiveObject</code> method is called
|
||||
* indirectly via a call to the <code>Activatable.inactive</code>
|
||||
* method. A remote object implementation must call
|
||||
* <code>Activatable</code>'s <code>inactive</code> method when
|
||||
* that object deactivates (the object deems that it is no longer
|
||||
* active). If the object does not call
|
||||
* <code>Activatable.inactive</code> when it deactivates, the
|
||||
* object will never be garbage collected since the group keeps
|
||||
* strong references to the objects it creates. <p>
|
||||
*
|
||||
* The group's <code>inactiveObject</code> method
|
||||
* unexports the remote object from the RMI runtime so that the
|
||||
* object can no longer receive incoming RMI calls. This call will
|
||||
* only succeed if the object has no pending/executing calls. If
|
||||
* the object does have pending/executing RMI calls, then false
|
||||
* will be returned.
|
||||
*
|
||||
* If the object has no pending/executing calls, the object is
|
||||
* removed from the RMI runtime and the group informs its
|
||||
* <code>ActivationMonitor</code> (via the monitor's
|
||||
* <code>inactiveObject</code> method) that the remote object is
|
||||
* not currently active so that the remote object will be
|
||||
* re-activated by the activator upon a subsequent activation
|
||||
* request.
|
||||
*
|
||||
* @param id the object's activation identifier
|
||||
* @return true if the operation succeeds (the operation will
|
||||
* succeed if the object in currently known to be active and is
|
||||
* either already unexported or is currently exported and has no
|
||||
* pending/executing calls); false is returned if the object has
|
||||
* pending/executing calls in which case it cannot be deactivated
|
||||
* @exception UnknownObjectException if object is unknown (may already
|
||||
* be inactive)
|
||||
* @exception RemoteException if call informing monitor fails
|
||||
*/
|
||||
public boolean inactiveObject(ActivationID id)
|
||||
throws ActivationException, UnknownObjectException, RemoteException
|
||||
{
|
||||
|
||||
try {
|
||||
acquireLock(id);
|
||||
synchronized (this) {
|
||||
if (groupInactive == true)
|
||||
throw new ActivationException("group is inactive");
|
||||
}
|
||||
|
||||
ActiveEntry entry = active.get(id);
|
||||
if (entry == null) {
|
||||
// REMIND: should this be silent?
|
||||
throw new UnknownObjectException("object not active");
|
||||
}
|
||||
|
||||
try {
|
||||
if (Activatable.unexportObject(entry.impl, false) == false)
|
||||
return false;
|
||||
} catch (NoSuchObjectException allowUnexportedObjects) {
|
||||
}
|
||||
|
||||
try {
|
||||
super.inactiveObject(id);
|
||||
} catch (UnknownObjectException allowUnregisteredObjects) {
|
||||
}
|
||||
|
||||
active.remove(id);
|
||||
|
||||
} finally {
|
||||
releaseLock(id);
|
||||
checkInactiveGroup();
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
/*
|
||||
* Determines if the group has become inactive and
|
||||
* marks it as such.
|
||||
*/
|
||||
private void checkInactiveGroup() {
|
||||
boolean groupMarkedInactive = false;
|
||||
synchronized (this) {
|
||||
if (active.size() == 0 && lockedIDs.size() == 0 &&
|
||||
groupInactive == false)
|
||||
{
|
||||
groupInactive = true;
|
||||
groupMarkedInactive = true;
|
||||
}
|
||||
}
|
||||
|
||||
if (groupMarkedInactive) {
|
||||
try {
|
||||
super.inactiveGroup();
|
||||
} catch (Exception ignoreDeactivateFailure) {
|
||||
}
|
||||
|
||||
try {
|
||||
UnicastRemoteObject.unexportObject(this, true);
|
||||
} catch (NoSuchObjectException allowUnexportedGroup) {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* The group's <code>activeObject</code> method is called when an
|
||||
* object is exported (either by <code>Activatable</code> object
|
||||
* construction or an explicit call to
|
||||
* <code>Activatable.exportObject</code>. The group must inform its
|
||||
* <code>ActivationMonitor</code> that the object is active (via
|
||||
* the monitor's <code>activeObject</code> method) if the group
|
||||
* hasn't already done so.
|
||||
*
|
||||
* @param id the object's identifier
|
||||
* @param impl the remote object implementation
|
||||
* @exception UnknownObjectException if object is not registered
|
||||
* @exception RemoteException if call informing monitor fails
|
||||
*/
|
||||
public void activeObject(ActivationID id, Remote impl)
|
||||
throws ActivationException, UnknownObjectException, RemoteException
|
||||
{
|
||||
|
||||
try {
|
||||
acquireLock(id);
|
||||
synchronized (this) {
|
||||
if (groupInactive == true)
|
||||
throw new ActivationException("group is inactive");
|
||||
}
|
||||
if (!active.containsKey(id)) {
|
||||
ActiveEntry entry = new ActiveEntry(impl);
|
||||
active.put(id, entry);
|
||||
// created new entry, so inform monitor of active object
|
||||
try {
|
||||
super.activeObject(id, entry.mobj);
|
||||
} catch (RemoteException e) {
|
||||
// daemon can still find it by calling newInstance
|
||||
}
|
||||
}
|
||||
} finally {
|
||||
releaseLock(id);
|
||||
checkInactiveGroup();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Entry in table for active object.
|
||||
*/
|
||||
private static class ActiveEntry {
|
||||
Remote impl;
|
||||
MarshalledObject<Remote> mobj;
|
||||
|
||||
ActiveEntry(Remote impl) throws ActivationException {
|
||||
this.impl = impl;
|
||||
try {
|
||||
this.mobj = new MarshalledObject<Remote>(impl);
|
||||
} catch (IOException e) {
|
||||
throw new
|
||||
ActivationException("failed to marshal remote object", e);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns true if the first argument is either equal to, or is a
|
||||
* descendant of, the second argument. Null is treated as the root of
|
||||
* the tree.
|
||||
*/
|
||||
private static boolean covers(ClassLoader sub, ClassLoader sup) {
|
||||
if (sup == null) {
|
||||
return true;
|
||||
} else if (sub == null) {
|
||||
return false;
|
||||
}
|
||||
do {
|
||||
if (sub == sup) {
|
||||
return true;
|
||||
}
|
||||
sub = sub.getParent();
|
||||
} while (sub != null);
|
||||
return false;
|
||||
}
|
||||
}
|
@ -1,86 +0,0 @@
|
||||
/*
|
||||
* Copyright (c) 1997, 2020, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
* under the terms of the GNU General Public License version 2 only, as
|
||||
* published by the Free Software Foundation. Oracle designates this
|
||||
* particular file as subject to the "Classpath" exception as provided
|
||||
* by Oracle in the LICENSE file that accompanied this code.
|
||||
*
|
||||
* This code is distributed in the hope that it will be useful, but WITHOUT
|
||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
* version 2 for more details (a copy is included in the LICENSE file that
|
||||
* accompanied this code).
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License version
|
||||
* 2 along with this work; if not, write to the Free Software Foundation,
|
||||
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
*
|
||||
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
|
||||
* or visit www.oracle.com if you need additional information or have any
|
||||
* questions.
|
||||
*/
|
||||
|
||||
package sun.rmi.server;
|
||||
|
||||
import java.rmi.activation.ActivationGroupDesc;
|
||||
import java.rmi.activation.ActivationGroupID;
|
||||
import java.rmi.activation.ActivationGroup;
|
||||
|
||||
/**
|
||||
* This is the bootstrap code to start a VM executing an activation
|
||||
* group.
|
||||
*
|
||||
* The activator spawns (as a child process) an activation group as needed
|
||||
* and directs activation requests to the appropriate activation
|
||||
* group. After spawning the VM, the activator passes some
|
||||
* information to the bootstrap code via its stdin:
|
||||
* <ul>
|
||||
* <li> the activation group's id,
|
||||
* <li> the activation group's descriptor (an instance of the class
|
||||
* java.rmi.activation.ActivationGroupDesc) for the group, adn
|
||||
* <li> the group's incarnation number.
|
||||
* </ul><p>
|
||||
*
|
||||
* When the bootstrap VM starts executing, it reads group id and
|
||||
* descriptor from its stdin so that it can create the activation
|
||||
* group for the VM.
|
||||
*
|
||||
* @author Ann Wollrath
|
||||
*/
|
||||
@SuppressWarnings("removal")
|
||||
public abstract class ActivationGroupInit
|
||||
{
|
||||
/**
|
||||
* Main program to start a VM for an activation group.
|
||||
*/
|
||||
public static void main(String args[])
|
||||
{
|
||||
try {
|
||||
if (System.getSecurityManager() == null) {
|
||||
System.setSecurityManager(new SecurityManager());
|
||||
}
|
||||
// read group id, descriptor, and incarnation number from stdin
|
||||
MarshalInputStream in = new MarshalInputStream(System.in);
|
||||
ActivationGroupID id = (ActivationGroupID)in.readObject();
|
||||
ActivationGroupDesc desc = (ActivationGroupDesc)in.readObject();
|
||||
long incarnation = in.readLong();
|
||||
|
||||
// create and set group for the VM
|
||||
ActivationGroup.createGroup(id, desc, incarnation);
|
||||
} catch (Exception e) {
|
||||
System.err.println("Exception in starting ActivationGroupInit:");
|
||||
e.printStackTrace();
|
||||
} finally {
|
||||
try {
|
||||
System.in.close();
|
||||
// note: system out/err shouldn't be closed
|
||||
// since the parent may want to read them.
|
||||
} catch (Exception ex) {
|
||||
// ignore exceptions
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
@ -1,51 +0,0 @@
|
||||
/*
|
||||
* Copyright (c) 2005, 2020, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
* under the terms of the GNU General Public License version 2 only, as
|
||||
* published by the Free Software Foundation. Oracle designates this
|
||||
* particular file as subject to the "Classpath" exception as provided
|
||||
* by Oracle in the LICENSE file that accompanied this code.
|
||||
*
|
||||
* This code is distributed in the hope that it will be useful, but WITHOUT
|
||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
* version 2 for more details (a copy is included in the LICENSE file that
|
||||
* accompanied this code).
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License version
|
||||
* 2 along with this work; if not, write to the Free Software Foundation,
|
||||
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
*
|
||||
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
|
||||
* or visit www.oracle.com if you need additional information or have any
|
||||
* questions.
|
||||
*/
|
||||
|
||||
package sun.rmi.server;
|
||||
|
||||
import java.rmi.activation.ActivationException;
|
||||
|
||||
/**
|
||||
* Thrown if a local or remote call is made on a group implementation
|
||||
* instance that is inactive.
|
||||
*
|
||||
* @author Sun Microsystems, Inc.
|
||||
*
|
||||
* @since 1.6
|
||||
*/
|
||||
@SuppressWarnings("removal")
|
||||
public class InactiveGroupException extends ActivationException {
|
||||
|
||||
private static final long serialVersionUID = -7491041778450214975L;
|
||||
|
||||
/**
|
||||
* Constructs an instance with the specified detail message.
|
||||
*
|
||||
* @param s the detail message
|
||||
*/
|
||||
public InactiveGroupException(String s) {
|
||||
super(s);
|
||||
}
|
||||
}
|
@ -86,28 +86,13 @@ public class MarshalInputStream extends ObjectInputStream {
|
||||
private boolean useCodebaseOnly = useCodebaseOnlyProperty;
|
||||
|
||||
/*
|
||||
* Fix for 4179055: The remote object services inside the
|
||||
* activation daemon use stubs that are in the package
|
||||
* sun.rmi.server. Classes for these stubs should be loaded from
|
||||
* the classpath by RMI system code and not by the normal
|
||||
* unmarshalling process as applications should not need to have
|
||||
* permission to access the sun implementation classes.
|
||||
*
|
||||
* Note: this fix should be redone when API changes may be
|
||||
* integrated
|
||||
*
|
||||
* During parameter unmarshalling RMI needs to explicitly permit
|
||||
* access to three sun.* stub classes
|
||||
* access to sun.* stub classes
|
||||
*/
|
||||
static {
|
||||
try {
|
||||
String system =
|
||||
"sun.rmi.server.Activation$ActivationSystemImpl_Stub";
|
||||
String registry = "sun.rmi.registry.RegistryImpl_Stub";
|
||||
|
||||
permittedSunClasses.put(system, Class.forName(system));
|
||||
permittedSunClasses.put(registry, Class.forName(registry));
|
||||
|
||||
} catch (ClassNotFoundException e) {
|
||||
throw new NoClassDefFoundError("Missing system class: " +
|
||||
e.getMessage());
|
||||
|
@ -1,136 +0,0 @@
|
||||
#
|
||||
#
|
||||
# Copyright (c) 1998, 2020, Oracle and/or its affiliates. All rights reserved.
|
||||
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
#
|
||||
# This code is free software; you can redistribute it and/or modify it
|
||||
# under the terms of the GNU General Public License version 2 only, as
|
||||
# published by the Free Software Foundation. Oracle designates this
|
||||
# particular file as subject to the "Classpath" exception as provided
|
||||
# by Oracle in the LICENSE file that accompanied this code.
|
||||
#
|
||||
# This code is distributed in the hope that it will be useful, but WITHOUT
|
||||
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
# version 2 for more details (a copy is included in the LICENSE file that
|
||||
# accompanied this code).
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License version
|
||||
# 2 along with this work; if not, write to the Free Software Foundation,
|
||||
# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
#
|
||||
# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
|
||||
# or visit www.oracle.com if you need additional information or have any
|
||||
# questions.
|
||||
#
|
||||
|
||||
# "rmid", inetd", and "wait" should not be translated.
|
||||
rmid.syntax.exec.invalid=\
|
||||
rmid was launched from inetd with an invalid status (must be wait)
|
||||
|
||||
# "rmid" and "inetd" should not be translated.
|
||||
rmid.syntax.port.badarg=\
|
||||
port cannot be specified if rmid is launched from inetd
|
||||
|
||||
# "port" here refers to a TCP port for the server to listen on.
|
||||
rmid.syntax.port.badnumber=\
|
||||
port is not a number
|
||||
|
||||
# "-port" should not be translated, because it's part of command syntax.
|
||||
rmid.syntax.port.missing=\
|
||||
-port option requires argument
|
||||
|
||||
# "-log" should not be translated, because it's part of command syntax.
|
||||
rmid.syntax.log.missing=\
|
||||
-log option requires argument
|
||||
|
||||
# "-log" should not be translated, because it's part of command syntax.
|
||||
rmid.syntax.log.required=\
|
||||
-log option required
|
||||
|
||||
# {0} = the (string) illegal argument in question
|
||||
rmid.syntax.illegal.option=\
|
||||
invalid option: {0}
|
||||
|
||||
# {0} = the (string) reason text that came with a thrown exception
|
||||
# "Activation.main" should not be translated, because it's a codepoint
|
||||
rmid.unexpected.exception=\
|
||||
Activation.main: an exception occurred: {0}
|
||||
|
||||
# "java.home" should not be translated, because it's a property name
|
||||
# "ActivatorImpl" should not be translated, because it's a codepoint
|
||||
rmid.unfound.java.home.property=\
|
||||
ActivatorImpl: unable to locate java.home
|
||||
|
||||
# "rmid" should not be translated
|
||||
rmid.inherited.channel.info=\
|
||||
rmid startup with inherited channel
|
||||
|
||||
# "Activation.main" should not be translated, because it's a codepoint
|
||||
rmid.exec.policy.invalid=\
|
||||
Activation.main: invalid exec policy class
|
||||
|
||||
# "rmid" should not be translated
|
||||
rmid.exec.policy.exception=\
|
||||
rmid: attempt to obtain exec policy throws:
|
||||
|
||||
# "rmid" should not be translated
|
||||
rmid.exec.command=\
|
||||
rmid: debugExec: running "{0}"
|
||||
|
||||
# "rmid" should not be translated
|
||||
rmid.group.inactive=\
|
||||
rmid: activation group inactive: {0}
|
||||
|
||||
# "Activation.main", "sun.rmi.activation.execPolicy", "ExecPermission" and
|
||||
# "ExecOptionPermission" should not be translated, since they refer to
|
||||
# class/permission names.
|
||||
rmid.exec.perms.inadequate=\
|
||||
Activation.main: warning: sun.rmi.activation.execPolicy system\n\
|
||||
property unspecified and no ExecPermissions/ExecOptionPermissions\n\
|
||||
granted; subsequent activation attempts may fail due to unsuccessful\n\
|
||||
ExecPermission/ExecOptionPermission permission checks. \n\
|
||||
To configure security, refer to the rmid documentation.\n
|
||||
|
||||
# "rmid", "-port", "-log", "-stop", "-C" and "-J" should not be translated,
|
||||
# because they are syntax
|
||||
rmid.usage=Usage: {0} <options>\
|
||||
\n\
|
||||
\nwhere <options> include:\
|
||||
\n -port <port> Specify port for rmid to use\
|
||||
\n -log <directory> Specify directory in which rmid writes log\
|
||||
\n -stop Stop current invocation of rmid (for specified port)\
|
||||
\n -C<runtime flag> Pass argument to each child process (activation group)\
|
||||
\n -J<runtime flag> Pass argument to the java interpreter\
|
||||
\n\
|
||||
|
||||
# This means "The currently running activation daemon has been shut down,
|
||||
# and is about to exit".
|
||||
rmid.daemon.shutdown=\
|
||||
activation daemon shut down
|
||||
|
||||
# "rmid" should not be translated
|
||||
rmid.restart.group.warning=\
|
||||
\nrmid: (WARNING) restart group throws:
|
||||
|
||||
# "rmid" should not be translated
|
||||
rmid.restart.service.warning=\
|
||||
\nrmid: (WARNING) restart service throws:
|
||||
|
||||
# "rmid" should not be translated
|
||||
rmid.log.update.warning=\
|
||||
\nrmid: (WARNING) log update throws:
|
||||
|
||||
# "rmid" should not be translated
|
||||
rmid.log.snapshot.warning=\
|
||||
\nrmid: (SEVERE) log snapshot throws:
|
||||
|
||||
# "rmid" should not be translated
|
||||
rmid.log.recover.warning=\
|
||||
\nrmid: (WARNING) {0}: skipping log record during recovery:
|
||||
|
||||
# "rmid" should not be translated
|
||||
rmid.deprecation.warning=\
|
||||
rmid: (WARNING) The RMI Activation mechanism and the rmid tool\n\
|
||||
have been deprecated for removal. They may be removed from a future\n\
|
||||
version of the Java Platform.
|
@ -1,96 +0,0 @@
|
||||
#
|
||||
#
|
||||
# Copyright (c) 1998, 2017, Oracle and/or its affiliates. All rights reserved.
|
||||
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
#
|
||||
# This code is free software; you can redistribute it and/or modify it
|
||||
# under the terms of the GNU General Public License version 2 only, as
|
||||
# published by the Free Software Foundation. Oracle designates this
|
||||
# particular file as subject to the "Classpath" exception as provided
|
||||
# by Oracle in the LICENSE file that accompanied this code.
|
||||
#
|
||||
# This code is distributed in the hope that it will be useful, but WITHOUT
|
||||
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
# version 2 for more details (a copy is included in the LICENSE file that
|
||||
# accompanied this code).
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License version
|
||||
# 2 along with this work; if not, write to the Free Software Foundation,
|
||||
# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
#
|
||||
# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
|
||||
# or visit www.oracle.com if you need additional information or have any
|
||||
# questions.
|
||||
#
|
||||
|
||||
# "rmid", inetd", and "wait" should not be translated.
|
||||
rmid.syntax.exec.invalid=rmid wurde mit einem ung\u00FCltigen Status (muss "wait" sein) von inetd gestartet
|
||||
|
||||
# "rmid" and "inetd" should not be translated.
|
||||
rmid.syntax.port.badarg=Port kann nicht angegeben werden, wenn rmid von inetd gestartet wird
|
||||
|
||||
# "port" here refers to a TCP port for the server to listen on.
|
||||
rmid.syntax.port.badnumber=Port ist keine Zahl
|
||||
|
||||
# "-port" should not be translated, because it's part of command syntax.
|
||||
rmid.syntax.port.missing=F\u00FCr Option -port ist ein Argument erforderlich
|
||||
|
||||
# "-log" should not be translated, because it's part of command syntax.
|
||||
rmid.syntax.log.missing=F\u00FCr Option -log ist ein Argument erforderlich
|
||||
|
||||
# "-log" should not be translated, because it's part of command syntax.
|
||||
rmid.syntax.log.required=Option -log ist erforderlich
|
||||
|
||||
# {0} = the (string) illegal argument in question
|
||||
rmid.syntax.illegal.option=Ung\u00FCltige Option: {0}
|
||||
|
||||
# {0} = the (string) reason text that came with a thrown exception
|
||||
# "Activation.main" should not be translated, because it's a codepoint
|
||||
rmid.unexpected.exception=Activation.main: Es ist eine Ausnahme aufgetreten: {0}
|
||||
|
||||
# "java.home" should not be translated, because it's a property name
|
||||
# "ActivatorImpl" should not be translated, because it's a codepoint
|
||||
rmid.unfound.java.home.property=ActivatorImpl: java.home konnte nicht gefunden werden
|
||||
|
||||
# "rmid" should not be translated
|
||||
rmid.inherited.channel.info=rmid-Start mit \u00FCbernommenem Kanal
|
||||
|
||||
# "Activation.main" should not be translated, because it's a codepoint
|
||||
rmid.exec.policy.invalid=Activation.main: Ung\u00FCltige exec-Policy-Klasse
|
||||
|
||||
# "rmid" should not be translated
|
||||
rmid.exec.policy.exception=rmid: Versuch, die exec-Policy abzurufen, l\u00F6st Folgendes aus:
|
||||
|
||||
# "rmid" should not be translated
|
||||
rmid.exec.command=rmid: debugExec: "{0}" wird ausgef\u00FChrt
|
||||
|
||||
# "rmid" should not be translated
|
||||
rmid.group.inactive=rmid: Aktivierungsgruppe inaktiv: {0}
|
||||
|
||||
# "Activation.main", "sun.rmi.activation.execPolicy", "ExecPermission" and
|
||||
# "ExecOptionPermission" should not be translated, since they refer to
|
||||
# class/permission names.
|
||||
rmid.exec.perms.inadequate=Activation.main: Warnung: Es wurde keine Systemeigenschaft sun.rmi.activation.execPolicy\nangegeben und keine ExecPermissions/ExecOptionPermissions\nerteilt. Nachfolgende Aktivierungsversuche scheitern m\u00F6glicherweise aufgrund\nnicht erfolgreicher Berechtigungspr\u00FCfungen ExecPermission/ExecOptionPermission. \nInformationen zur Sicherheitskonfiguration finden Sie in der rmid-Dokumentation.\n
|
||||
|
||||
# "rmid", "-port", "-log", "-stop", "-C" and "-J" should not be translated,
|
||||
# because they are syntax
|
||||
rmid.usage=Verwendung: {0} <Optionen>\n\nwobei folgende <Optionen> m\u00F6glich sind:\n -port <Port> Port f\u00FCr rmid angeben\n -log <Verzeichnis> Verzeichnis, in das rmid die Logdatei schreibt, angeben\n -stop Aktuellen Aufruf von rmid stoppen (f\u00FCr den angegebenen Port)\n -C<Laufzeitkennzeichen> Argument an jeden untergeordneten Prozess (Aktivierungsgruppe) \u00FCbergeben\n -J<Laufzeitkennzeichen> Argument an den Java-Interpreter \u00FCbergeben\n
|
||||
# This means "The currently running activation daemon has been shut down,
|
||||
# and is about to exit".
|
||||
rmid.daemon.shutdown=Aktivierungsdaemon heruntergefahren
|
||||
|
||||
# "rmid" should not be translated
|
||||
rmid.restart.group.warning=\nrmid: (WARNUNG) Neustart der Gruppe l\u00F6st Folgendes aus:
|
||||
|
||||
# "rmid" should not be translated
|
||||
rmid.restart.service.warning=\nrmid: (WARNUNG) Neustart des Service l\u00F6st Folgendes aus:
|
||||
|
||||
# "rmid" should not be translated
|
||||
rmid.log.update.warning=\nrmid: (WARNUNG) Logupdate l\u00F6st Folgendes aus:
|
||||
|
||||
# "rmid" should not be translated
|
||||
rmid.log.snapshot.warning=\nrmid: (SCHWERWIEGEND) Log-Snapshot l\u00F6st Folgendes aus:
|
||||
|
||||
# "rmid" should not be translated
|
||||
rmid.log.recover.warning=\nrmid: (WARNUNG) {0}: Logdatensatz wird bei Wiederherstellung \u00FCbersprungen:
|
@ -1,96 +0,0 @@
|
||||
#
|
||||
#
|
||||
# Copyright (c) 1998, 2017, Oracle and/or its affiliates. All rights reserved.
|
||||
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
#
|
||||
# This code is free software; you can redistribute it and/or modify it
|
||||
# under the terms of the GNU General Public License version 2 only, as
|
||||
# published by the Free Software Foundation. Oracle designates this
|
||||
# particular file as subject to the "Classpath" exception as provided
|
||||
# by Oracle in the LICENSE file that accompanied this code.
|
||||
#
|
||||
# This code is distributed in the hope that it will be useful, but WITHOUT
|
||||
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
# version 2 for more details (a copy is included in the LICENSE file that
|
||||
# accompanied this code).
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License version
|
||||
# 2 along with this work; if not, write to the Free Software Foundation,
|
||||
# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
#
|
||||
# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
|
||||
# or visit www.oracle.com if you need additional information or have any
|
||||
# questions.
|
||||
#
|
||||
|
||||
# "rmid", inetd", and "wait" should not be translated.
|
||||
rmid.syntax.exec.invalid=rmid se ha iniciado desde inetd con un estado no v\u00E1lido (debe ser wait)
|
||||
|
||||
# "rmid" and "inetd" should not be translated.
|
||||
rmid.syntax.port.badarg=no se puede especificar el puerto si rmid se ha iniciado desde inetd
|
||||
|
||||
# "port" here refers to a TCP port for the server to listen on.
|
||||
rmid.syntax.port.badnumber=el puerto no es un n\u00FAmero
|
||||
|
||||
# "-port" should not be translated, because it's part of command syntax.
|
||||
rmid.syntax.port.missing=la opci\u00F3n -port requiere un argumento
|
||||
|
||||
# "-log" should not be translated, because it's part of command syntax.
|
||||
rmid.syntax.log.missing=la opci\u00F3n -log requiere un argumento
|
||||
|
||||
# "-log" should not be translated, because it's part of command syntax.
|
||||
rmid.syntax.log.required=la opci\u00F3n -log es obligatoria
|
||||
|
||||
# {0} = the (string) illegal argument in question
|
||||
rmid.syntax.illegal.option=opci\u00F3n no permitida: {0}
|
||||
|
||||
# {0} = the (string) reason text that came with a thrown exception
|
||||
# "Activation.main" should not be translated, because it's a codepoint
|
||||
rmid.unexpected.exception=Activation.main: se ha producido una excepci\u00F3n: {0}
|
||||
|
||||
# "java.home" should not be translated, because it's a property name
|
||||
# "ActivatorImpl" should not be translated, because it's a codepoint
|
||||
rmid.unfound.java.home.property=ActivatorImpl: no se ha encontrado java.home
|
||||
|
||||
# "rmid" should not be translated
|
||||
rmid.inherited.channel.info=inicio de rmid con canal heredado
|
||||
|
||||
# "Activation.main" should not be translated, because it's a codepoint
|
||||
rmid.exec.policy.invalid=Activation.main: clase de pol\u00EDtica de ejecuci\u00F3n no v\u00E1lida
|
||||
|
||||
# "rmid" should not be translated
|
||||
rmid.exec.policy.exception=rmid: el intento de obtener la pol\u00EDtica de ejecuci\u00F3n devuelve:
|
||||
|
||||
# "rmid" should not be translated
|
||||
rmid.exec.command=rmid: debugExec: en ejecuci\u00F3n "{0}"
|
||||
|
||||
# "rmid" should not be translated
|
||||
rmid.group.inactive=rmid: grupo de activaci\u00F3n inactivo: {0}
|
||||
|
||||
# "Activation.main", "sun.rmi.activation.execPolicy", "ExecPermission" and
|
||||
# "ExecOptionPermission" should not be translated, since they refer to
|
||||
# class/permission names.
|
||||
rmid.exec.perms.inadequate=Activation.main: advertencia: no se han especificado las propiedades del sistema sun.rmi.activation.execPolicy\ny no se han otorgado ExecPermissions/ExecOptionPermissions;\nlos intentos de activaci\u00F3n posteriores pueden fallar debido a\ncomprobaciones de permiso ExecPermission/ExecOptionPermission incorrectas. \nPara configurar la seguridad, consulte la documentaci\u00F3n sobre rmid.\n
|
||||
|
||||
# "rmid", "-port", "-log", "-stop", "-C" and "-J" should not be translated,
|
||||
# because they are syntax
|
||||
rmid.usage=Sintaxis: {0} <opciones>\n\ndonde <opciones> incluye:\n -port <puerto> Especificar puerto para uso de rmid\n -log <directorio> Especificar directorio en el que rmid escribir\u00E1 el registro\n -stop Parar la llamada actual de rmid (para el puerto especificado)\n -C<indicador de tiempo de ejecuci\u00F3n> Pasar argumento a cada uno de los procesos secundarios (grupo de activaci\u00F3n)\n -J<indicador de tiempo de ejecuci\u00F3n> Pasar argumento al int\u00E9rprete de Java\n
|
||||
# This means "The currently running activation daemon has been shut down,
|
||||
# and is about to exit".
|
||||
rmid.daemon.shutdown=daemon de activaci\u00F3n cerrado
|
||||
|
||||
# "rmid" should not be translated
|
||||
rmid.restart.group.warning=\nrmid: (ADVERTENCIA) el reinicio del grupo devuelve:
|
||||
|
||||
# "rmid" should not be translated
|
||||
rmid.restart.service.warning=\nrmid: (ADVERTENCIA) el reinicio del servicio devuelve:
|
||||
|
||||
# "rmid" should not be translated
|
||||
rmid.log.update.warning=\nrmid: (ADVERTENCIA) la actualizaci\u00F3n del log indica:
|
||||
|
||||
# "rmid" should not be translated
|
||||
rmid.log.snapshot.warning=\nrmid: (GRAVE) la instant\u00E1nea del log indica:
|
||||
|
||||
# "rmid" should not be translated
|
||||
rmid.log.recover.warning=\nrmid: (ADVERTENCIA) {0}: se omitir\u00E1 el registro del log durante la recuperaci\u00F3n:
|
@ -1,96 +0,0 @@
|
||||
#
|
||||
#
|
||||
# Copyright (c) 1998, 2017, Oracle and/or its affiliates. All rights reserved.
|
||||
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
#
|
||||
# This code is free software; you can redistribute it and/or modify it
|
||||
# under the terms of the GNU General Public License version 2 only, as
|
||||
# published by the Free Software Foundation. Oracle designates this
|
||||
# particular file as subject to the "Classpath" exception as provided
|
||||
# by Oracle in the LICENSE file that accompanied this code.
|
||||
#
|
||||
# This code is distributed in the hope that it will be useful, but WITHOUT
|
||||
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
# version 2 for more details (a copy is included in the LICENSE file that
|
||||
# accompanied this code).
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License version
|
||||
# 2 along with this work; if not, write to the Free Software Foundation,
|
||||
# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
#
|
||||
# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
|
||||
# or visit www.oracle.com if you need additional information or have any
|
||||
# questions.
|
||||
#
|
||||
|
||||
# "rmid", inetd", and "wait" should not be translated.
|
||||
rmid.syntax.exec.invalid=rmid a \u00E9t\u00E9 lanc\u00E9 depuis inetd avec un statut non valide (doit \u00EAtre wait)
|
||||
|
||||
# "rmid" and "inetd" should not be translated.
|
||||
rmid.syntax.port.badarg=impossible de sp\u00E9cifier port si rmid est lanc\u00E9 depuis inetd
|
||||
|
||||
# "port" here refers to a TCP port for the server to listen on.
|
||||
rmid.syntax.port.badnumber=port n'est pas un num\u00E9ro
|
||||
|
||||
# "-port" should not be translated, because it's part of command syntax.
|
||||
rmid.syntax.port.missing=l'option -port exige un argument
|
||||
|
||||
# "-log" should not be translated, because it's part of command syntax.
|
||||
rmid.syntax.log.missing=l'option -log exige un argument
|
||||
|
||||
# "-log" should not be translated, because it's part of command syntax.
|
||||
rmid.syntax.log.required=option -log obligatoire
|
||||
|
||||
# {0} = the (string) illegal argument in question
|
||||
rmid.syntax.illegal.option=option non admise : {0}
|
||||
|
||||
# {0} = the (string) reason text that came with a thrown exception
|
||||
# "Activation.main" should not be translated, because it's a codepoint
|
||||
rmid.unexpected.exception=Activation.main : une exception s''est produite - {0}
|
||||
|
||||
# "java.home" should not be translated, because it's a property name
|
||||
# "ActivatorImpl" should not be translated, because it's a codepoint
|
||||
rmid.unfound.java.home.property=ActivatorImpl : impossible de localiser java.home
|
||||
|
||||
# "rmid" should not be translated
|
||||
rmid.inherited.channel.info=d\u00E9marrage de rmid avec le canal existant
|
||||
|
||||
# "Activation.main" should not be translated, because it's a codepoint
|
||||
rmid.exec.policy.invalid=Activation.main : classe de r\u00E8gle exec incorrecte
|
||||
|
||||
# "rmid" should not be translated
|
||||
rmid.exec.policy.exception=rmid : tentative d'obtention des basculements de classes exec :
|
||||
|
||||
# "rmid" should not be translated
|
||||
rmid.exec.command=rmid : debugExec : ex\u00E9cution de "{0}"
|
||||
|
||||
# "rmid" should not be translated
|
||||
rmid.group.inactive=rmid : groupe d''activation inactif : {0}
|
||||
|
||||
# "Activation.main", "sun.rmi.activation.execPolicy", "ExecPermission" and
|
||||
# "ExecOptionPermission" should not be translated, since they refer to
|
||||
# class/permission names.
|
||||
rmid.exec.perms.inadequate=Activation.main : avertissement : propri\u00E9t\u00E9 syst\u00E8me sun.rmi.activation.execPolicy\nnon indiqu\u00E9e et ExecPermissions/ExecOptionPermissions\nnon accord\u00E9s ; les tentatives d'activation suivantes risquent d'\u00E9chouer en raison de la v\u00E9rification des droits\nExecPermission/ExecOptionPermission. \nPour configurer la s\u00E9curit\u00E9, reportez-vous \u00E0 la documentation rmid.\n
|
||||
|
||||
# "rmid", "-port", "-log", "-stop", "-C" and "-J" should not be translated,
|
||||
# because they are syntax
|
||||
rmid.usage=Syntaxe : {0} <options>\n\no\u00F9 <options> comprend :\n -port <port> Port que rmid doit utiliser\n -log <r\u00E9pertoire> R\u00E9pertoire o\u00F9 rmid enregistre le journal\n -stop Arr\u00EAter l''appel en cours de rmid (pour le port sp\u00E9cifi\u00E9)\n -C<indicateur d''ex\u00E9cution> Transmet l''argument \u00E0 chaque processus enfant (groupe d''activation)\n -J<indicateur d''ex\u00E9cution> Transmet l''argument \u00E0 l''interpr\u00E9teur Java\n
|
||||
# This means "The currently running activation daemon has been shut down,
|
||||
# and is about to exit".
|
||||
rmid.daemon.shutdown=d\u00E9mon d'activation arr\u00EAt\u00E9
|
||||
|
||||
# "rmid" should not be translated
|
||||
rmid.restart.group.warning=\nrmid : (AVERTISSEMENT) red\u00E9marrer les basculements de groupes :
|
||||
|
||||
# "rmid" should not be translated
|
||||
rmid.restart.service.warning=\nrmid : (AVERTISSEMENT) red\u00E9marrer les basculements de services :
|
||||
|
||||
# "rmid" should not be translated
|
||||
rmid.log.update.warning=\nrmid : (AVERTISSEMENT) consigner les basculements de mises \u00E0 jour :
|
||||
|
||||
# "rmid" should not be translated
|
||||
rmid.log.snapshot.warning=\nrmid : (GRAVE) consigner les basculements de clich\u00E9s :
|
||||
|
||||
# "rmid" should not be translated
|
||||
rmid.log.recover.warning=\nrmid : (AVERTISSEMENT) {0} : enregistrement du journal ignor\u00E9 lors de la r\u00E9cup\u00E9ration :
|
@ -1,96 +0,0 @@
|
||||
#
|
||||
#
|
||||
# Copyright (c) 1998, 2017, Oracle and/or its affiliates. All rights reserved.
|
||||
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
#
|
||||
# This code is free software; you can redistribute it and/or modify it
|
||||
# under the terms of the GNU General Public License version 2 only, as
|
||||
# published by the Free Software Foundation. Oracle designates this
|
||||
# particular file as subject to the "Classpath" exception as provided
|
||||
# by Oracle in the LICENSE file that accompanied this code.
|
||||
#
|
||||
# This code is distributed in the hope that it will be useful, but WITHOUT
|
||||
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
# version 2 for more details (a copy is included in the LICENSE file that
|
||||
# accompanied this code).
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License version
|
||||
# 2 along with this work; if not, write to the Free Software Foundation,
|
||||
# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
#
|
||||
# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
|
||||
# or visit www.oracle.com if you need additional information or have any
|
||||
# questions.
|
||||
#
|
||||
|
||||
# "rmid", inetd", and "wait" should not be translated.
|
||||
rmid.syntax.exec.invalid=rmid \u00E8 stato avviato da inetd con uno stato non valido (diverso da wait)
|
||||
|
||||
# "rmid" and "inetd" should not be translated.
|
||||
rmid.syntax.port.badarg=non \u00E8 possibile specificare la porta se rmid viene avviato da inetd
|
||||
|
||||
# "port" here refers to a TCP port for the server to listen on.
|
||||
rmid.syntax.port.badnumber=la porta non \u00E8 un numero
|
||||
|
||||
# "-port" should not be translated, because it's part of command syntax.
|
||||
rmid.syntax.port.missing=L'opzione -port richiede un argomento
|
||||
|
||||
# "-log" should not be translated, because it's part of command syntax.
|
||||
rmid.syntax.log.missing=L'opzione -log richiede un argomento
|
||||
|
||||
# "-log" should not be translated, because it's part of command syntax.
|
||||
rmid.syntax.log.required=\u00C8 richiesta l'opzione -log
|
||||
|
||||
# {0} = the (string) illegal argument in question
|
||||
rmid.syntax.illegal.option=opzione non valida: {0}
|
||||
|
||||
# {0} = the (string) reason text that came with a thrown exception
|
||||
# "Activation.main" should not be translated, because it's a codepoint
|
||||
rmid.unexpected.exception=Activation.main: si \u00E8 verificata un''eccezione: {0}
|
||||
|
||||
# "java.home" should not be translated, because it's a property name
|
||||
# "ActivatorImpl" should not be translated, because it's a codepoint
|
||||
rmid.unfound.java.home.property=ActivatorImpl: impossibile individuare java.home
|
||||
|
||||
# "rmid" should not be translated
|
||||
rmid.inherited.channel.info=Avvio di rmid con canale ereditato
|
||||
|
||||
# "Activation.main" should not be translated, because it's a codepoint
|
||||
rmid.exec.policy.invalid=Activation.main: classe di criteri eseguibili non valida
|
||||
|
||||
# "rmid" should not be translated
|
||||
rmid.exec.policy.exception=rmid: il tentativo di ottenere i criteri di esecuzione ha restituito:
|
||||
|
||||
# "rmid" should not be translated
|
||||
rmid.exec.command=rmid: debugExec: esecuzione di "{0}" in corso
|
||||
|
||||
# "rmid" should not be translated
|
||||
rmid.group.inactive=rmid: gruppo attivazione inattivo: {0}
|
||||
|
||||
# "Activation.main", "sun.rmi.activation.execPolicy", "ExecPermission" and
|
||||
# "ExecOptionPermission" should not be translated, since they refer to
|
||||
# class/permission names.
|
||||
rmid.exec.perms.inadequate=Activation.main: avvertenza: propriet\u00E0 di sistema sun.rmi.activation.execPolicy\nnon specificata e nessun ExecPermissions/ExecOptionPermissions\nconcesso. I tentativi di attivazione successivi potrebbero fallire a causa di \ncontrolli di autorizzazione ExecPermission/ExecOptionPermission non riusciti.\nPer configurare la sicurezza, fare riferimento alla documentazione rmid.\n
|
||||
|
||||
# "rmid", "-port", "-log", "-stop", "-C" and "-J" should not be translated,
|
||||
# because they are syntax
|
||||
rmid.usage=Uso: {0} <opzioni>\n\ndove <opzioni> include:\n -port <porta> Specifica la porta usata da rmid\n -log <directory> Specifica la directory in cui rmid scrive il log\n -stop Arresta l''invocazione corrente di rmid (per la porta specificata)\n -C<flag fase di esecuzione> Passa l''argomento a ciascun processo figlio (gruppo di attivazione)\n -J<flag fase di esecuzione> Passa l''argomento all''interprete java\n
|
||||
# This means "The currently running activation daemon has been shut down,
|
||||
# and is about to exit".
|
||||
rmid.daemon.shutdown=daemon di attivazione terminato
|
||||
|
||||
# "rmid" should not be translated
|
||||
rmid.restart.group.warning=\nrmid: (AVVERTENZA) il riavvio del gruppo ha restituito:
|
||||
|
||||
# "rmid" should not be translated
|
||||
rmid.restart.service.warning=\nrmid: (AVVERTENZA) il riavvio del servizio ha restituito:
|
||||
|
||||
# "rmid" should not be translated
|
||||
rmid.log.update.warning=\nrmid: (AVVERTENZA) il log dell'aggiornamento ha restituito:
|
||||
|
||||
# "rmid" should not be translated
|
||||
rmid.log.snapshot.warning=\nrmid: (GRAVE) snapshot log ha restituito:
|
||||
|
||||
# "rmid" should not be translated
|
||||
rmid.log.recover.warning=\nrmid: (AVVERTENZA) {0}: record del log ignorato durante il recupero:
|
@ -1,99 +0,0 @@
|
||||
#
|
||||
#
|
||||
# Copyright (c) 1998, 2020, Oracle and/or its affiliates. All rights reserved.
|
||||
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
#
|
||||
# This code is free software; you can redistribute it and/or modify it
|
||||
# under the terms of the GNU General Public License version 2 only, as
|
||||
# published by the Free Software Foundation. Oracle designates this
|
||||
# particular file as subject to the "Classpath" exception as provided
|
||||
# by Oracle in the LICENSE file that accompanied this code.
|
||||
#
|
||||
# This code is distributed in the hope that it will be useful, but WITHOUT
|
||||
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
# version 2 for more details (a copy is included in the LICENSE file that
|
||||
# accompanied this code).
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License version
|
||||
# 2 along with this work; if not, write to the Free Software Foundation,
|
||||
# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
#
|
||||
# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
|
||||
# or visit www.oracle.com if you need additional information or have any
|
||||
# questions.
|
||||
#
|
||||
|
||||
# "rmid", inetd", and "wait" should not be translated.
|
||||
rmid.syntax.exec.invalid=rmid\u304Cinetd\u304B\u3089\u7121\u52B9\u306A\u72B6\u614B\u3067\u8D77\u52D5\u3055\u308C\u307E\u3057\u305F(wait\u3067\u3042\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059)
|
||||
|
||||
# "rmid" and "inetd" should not be translated.
|
||||
rmid.syntax.port.badarg=rmid\u304Cinetd\u304B\u3089\u8D77\u52D5\u3055\u308C\u305F\u5834\u5408\u3001\u30DD\u30FC\u30C8\u306F\u6307\u5B9A\u3067\u304D\u307E\u305B\u3093
|
||||
|
||||
# "port" here refers to a TCP port for the server to listen on.
|
||||
rmid.syntax.port.badnumber=port\u306F\u756A\u53F7\u3067\u306F\u3042\u308A\u307E\u305B\u3093
|
||||
|
||||
# "-port" should not be translated, because it's part of command syntax.
|
||||
rmid.syntax.port.missing=-port\u30AA\u30D7\u30B7\u30E7\u30F3\u306B\u306F\u5F15\u6570\u304C\u5FC5\u8981\u3067\u3059
|
||||
|
||||
# "-log" should not be translated, because it's part of command syntax.
|
||||
rmid.syntax.log.missing=-log\u30AA\u30D7\u30B7\u30E7\u30F3\u306B\u306F\u5F15\u6570\u304C\u5FC5\u8981\u3067\u3059
|
||||
|
||||
# "-log" should not be translated, because it's part of command syntax.
|
||||
rmid.syntax.log.required=-log\u30AA\u30D7\u30B7\u30E7\u30F3\u304C\u5FC5\u8981\u3067\u3059
|
||||
|
||||
# {0} = the (string) illegal argument in question
|
||||
rmid.syntax.illegal.option=\u7121\u52B9\u306A\u30AA\u30D7\u30B7\u30E7\u30F3: {0}
|
||||
|
||||
# {0} = the (string) reason text that came with a thrown exception
|
||||
# "Activation.main" should not be translated, because it's a codepoint
|
||||
rmid.unexpected.exception=Activation.main: \u4F8B\u5916\u304C\u767A\u751F\u3057\u307E\u3057\u305F: {0}
|
||||
|
||||
# "java.home" should not be translated, because it's a property name
|
||||
# "ActivatorImpl" should not be translated, because it's a codepoint
|
||||
rmid.unfound.java.home.property=ActivatorImpl: java.home\u3092\u691C\u51FA\u3067\u304D\u307E\u305B\u3093
|
||||
|
||||
# "rmid" should not be translated
|
||||
rmid.inherited.channel.info=rmid\u306F\u7D99\u627F\u3055\u308C\u305F\u30C1\u30E3\u30CD\u30EB\u3067\u8D77\u52D5\u3057\u307E\u3059
|
||||
|
||||
# "Activation.main" should not be translated, because it's a codepoint
|
||||
rmid.exec.policy.invalid=Activation.main: \u7121\u52B9\u306A\u5B9F\u884C\u30DD\u30EA\u30B7\u30FC\u30FB\u30AF\u30E9\u30B9\u3067\u3059
|
||||
|
||||
# "rmid" should not be translated
|
||||
rmid.exec.policy.exception=rmid: \u5B9F\u884C\u30DD\u30EA\u30B7\u30FC\u306E\u53D6\u5F97\u3067\u6B21\u304C\u30B9\u30ED\u30FC\u3055\u308C\u307E\u3057\u305F:
|
||||
|
||||
# "rmid" should not be translated
|
||||
rmid.exec.command=rmid: debugExec: "{0}"\u3092\u5B9F\u884C\u4E2D
|
||||
|
||||
# "rmid" should not be translated
|
||||
rmid.group.inactive=rmid: \u8D77\u52D5\u30B0\u30EB\u30FC\u30D7\u304C\u505C\u6B62\u3057\u3066\u3044\u307E\u3059: {0}
|
||||
|
||||
# "Activation.main", "sun.rmi.activation.execPolicy", "ExecPermission" and
|
||||
# "ExecOptionPermission" should not be translated, since they refer to
|
||||
# class/permission names.
|
||||
rmid.exec.perms.inadequate=Activation.main: \u8B66\u544A:sun.rmi.activation.execPolicy\u30B7\u30B9\u30C6\u30E0\n\u30D7\u30ED\u30D1\u30C6\u30A3\u304C\u6307\u5B9A\u3055\u308C\u3066\u3044\u306A\u3044\u3001\u307E\u305F\u306FExecPermissions/ExecOptionPermissions\u304C\n\u8A31\u53EF\u3055\u308C\u307E\u305B\u3093\u3002ExecPermissions/ExecOptionPermissions\u30A2\u30AF\u30BB\u30B9\u6A29\u691C\u67FB\u3067\u8A31\u53EF\u3055\u308C\n\u306A\u3044\u305F\u3081\u3001\u5F8C\u306B\u7D9A\u304F\u8D77\u52D5\u306F\u5931\u6557\u3059\u308B\u53EF\u80FD\u6027\u304C\u3042\u308A\u307E\u3059\u3002\n\u30BB\u30AD\u30E5\u30EA\u30C6\u30A3\u3092\u78BA\u8A8D\u3059\u308B\u306B\u306F\u3001rmid\u306E\u30C9\u30AD\u30E5\u30E1\u30F3\u30C8\u3092\u53C2\u7167\u3057\u3066\u304F\u3060\u3055\u3044\u3002\n
|
||||
|
||||
# "rmid", "-port", "-log", "-stop", "-C" and "-J" should not be translated,
|
||||
# because they are syntax
|
||||
rmid.usage=\u4F7F\u7528\u65B9\u6CD5: {0} <options>\n\n<options>\u306B\u306F\u6B21\u306E\u3082\u306E\u304C\u3042\u308A\u307E\u3059\u3002\n -port<port> rmid\u304C\u4F7F\u7528\u3059\u308B\u30DD\u30FC\u30C8\u3092\u6307\u5B9A\u3059\u308B\n -log <directory> rmid\u304C\u30ED\u30B0\u3092\u66F8\u304D\u8FBC\u3080\u30C7\u30A3\u30EC\u30AF\u30C8\u30EA\u3092\u6307\u5B9A\u3059\u308B\n -stop \u6307\u5B9A\u30DD\u30FC\u30C8\u306B\u5BFE\u3059\u308Brmid\u306E\u73FE\u5728\u306E\u547C\u51FA\u3057\u3092\u4E2D\u6B62\u3059\u308B\n -C<runtime flag> \u5404\u5B50\u30D7\u30ED\u30BB\u30B9(\u8D77\u52D5\u30B0\u30EB\u30FC\u30D7)\u306B\u5F15\u6570\u3092\u6E21\u3059\n -J<runtime flag> java\u30A4\u30F3\u30BF\u30D7\u30EA\u30BF\u306B\u5F15\u6570\u3092\u6E21\u3059\n
|
||||
# This means "The currently running activation daemon has been shut down,
|
||||
# and is about to exit".
|
||||
rmid.daemon.shutdown=\u8D77\u52D5\u30C7\u30FC\u30E2\u30F3\u304C\u505C\u6B62\u3057\u307E\u3057\u305F
|
||||
|
||||
# "rmid" should not be translated
|
||||
rmid.restart.group.warning=\nrmid: (\u8B66\u544A)\u30B0\u30EB\u30FC\u30D7\u306E\u518D\u8D77\u52D5\u3067\u6B21\u304C\u30B9\u30ED\u30FC\u3055\u308C\u307E\u3057\u305F:
|
||||
|
||||
# "rmid" should not be translated
|
||||
rmid.restart.service.warning=\nrmid: (\u8B66\u544A)\u30B5\u30FC\u30D3\u30B9\u306E\u518D\u8D77\u52D5\u3067\u6B21\u304C\u30B9\u30ED\u30FC\u3055\u308C\u307E\u3057\u305F:
|
||||
|
||||
# "rmid" should not be translated
|
||||
rmid.log.update.warning=\nrmid: (\u8B66\u544A)\u30ED\u30B0\u66F4\u65B0\u3067\u6B21\u304C\u30B9\u30ED\u30FC\u3055\u308C\u307E\u3057\u305F:
|
||||
|
||||
# "rmid" should not be translated
|
||||
rmid.log.snapshot.warning=\nrmid: (\u91CD\u5927)\u30ED\u30B0\u30FB\u30B9\u30CA\u30C3\u30D7\u30B7\u30E7\u30C3\u30C8\u3067\u6B21\u304C\u30B9\u30ED\u30FC\u3055\u308C\u307E\u3057\u305F:
|
||||
|
||||
# "rmid" should not be translated
|
||||
rmid.log.recover.warning=\nrmid: (\u8B66\u544A){0}: \u56DE\u5FA9\u4E2D\u306E\u30ED\u30B0\u30FB\u30EC\u30B3\u30FC\u30C9\u306E\u30B9\u30AD\u30C3\u30D7:
|
||||
|
||||
# "rmid" should not be translated
|
||||
rmid.deprecation.warning=rmid: (\u8B66\u544A) RMI\u8D77\u52D5\u30E1\u30AB\u30CB\u30BA\u30E0\u304A\u3088\u3073rmid\u30C4\u30FC\u30EB\u306F\u524A\u9664\u4E88\u5B9A\u306E\u305F\u3081\n\u975E\u63A8\u5968\u306B\u306A\u308A\u307E\u3057\u305F\u3002\u3053\u308C\u3089\u306F\u3001Java\u30D7\u30E9\u30C3\u30C8\u30D5\u30A9\u30FC\u30E0\u306E\u5C06\u6765\u306E\u30D0\u30FC\u30B8\u30E7\u30F3\n\u304B\u3089\u524A\u9664\u3055\u308C\u308B\u53EF\u80FD\u6027\u304C\u3042\u308A\u307E\u3059\u3002
|
@ -1,96 +0,0 @@
|
||||
#
|
||||
#
|
||||
# Copyright (c) 1998, 2017, Oracle and/or its affiliates. All rights reserved.
|
||||
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
#
|
||||
# This code is free software; you can redistribute it and/or modify it
|
||||
# under the terms of the GNU General Public License version 2 only, as
|
||||
# published by the Free Software Foundation. Oracle designates this
|
||||
# particular file as subject to the "Classpath" exception as provided
|
||||
# by Oracle in the LICENSE file that accompanied this code.
|
||||
#
|
||||
# This code is distributed in the hope that it will be useful, but WITHOUT
|
||||
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
# version 2 for more details (a copy is included in the LICENSE file that
|
||||
# accompanied this code).
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License version
|
||||
# 2 along with this work; if not, write to the Free Software Foundation,
|
||||
# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
#
|
||||
# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
|
||||
# or visit www.oracle.com if you need additional information or have any
|
||||
# questions.
|
||||
#
|
||||
|
||||
# "rmid", inetd", and "wait" should not be translated.
|
||||
rmid.syntax.exec.invalid=rmid\uAC00 \uBD80\uC801\uD569\uD55C \uC0C1\uD0DC\uC758 inetd\uC5D0\uC11C \uC2DC\uC791\uB418\uC5C8\uC2B5\uB2C8\uB2E4. \uC0C1\uD0DC\uB294 wait\uC5EC\uC57C \uD569\uB2C8\uB2E4.
|
||||
|
||||
# "rmid" and "inetd" should not be translated.
|
||||
rmid.syntax.port.badarg=rmid\uAC00 inetd\uC5D0\uC11C \uC2DC\uC791\uB41C \uACBD\uC6B0 \uD3EC\uD2B8\uB97C \uC9C0\uC815\uD560 \uC218 \uC5C6\uC2B5\uB2C8\uB2E4.
|
||||
|
||||
# "port" here refers to a TCP port for the server to listen on.
|
||||
rmid.syntax.port.badnumber=\uD3EC\uD2B8\uB294 \uC22B\uC790\uAC00 \uC544\uB2D9\uB2C8\uB2E4.
|
||||
|
||||
# "-port" should not be translated, because it's part of command syntax.
|
||||
rmid.syntax.port.missing=-port \uC635\uC158\uC744 \uC0AC\uC6A9\uD558\uB824\uBA74 \uC778\uC218\uAC00 \uD544\uC694\uD569\uB2C8\uB2E4.
|
||||
|
||||
# "-log" should not be translated, because it's part of command syntax.
|
||||
rmid.syntax.log.missing=-log \uC635\uC158\uC744 \uC0AC\uC6A9\uD558\uB824\uBA74 \uC778\uC218\uAC00 \uD544\uC694\uD569\uB2C8\uB2E4.
|
||||
|
||||
# "-log" should not be translated, because it's part of command syntax.
|
||||
rmid.syntax.log.required=-log \uC635\uC158\uC774 \uD544\uC694\uD569\uB2C8\uB2E4.
|
||||
|
||||
# {0} = the (string) illegal argument in question
|
||||
rmid.syntax.illegal.option=\uC798\uBABB\uB41C \uC635\uC158: {0}
|
||||
|
||||
# {0} = the (string) reason text that came with a thrown exception
|
||||
# "Activation.main" should not be translated, because it's a codepoint
|
||||
rmid.unexpected.exception=Activation.main: \uC608\uC678\uC0AC\uD56D \uBC1C\uC0DD: {0}
|
||||
|
||||
# "java.home" should not be translated, because it's a property name
|
||||
# "ActivatorImpl" should not be translated, because it's a codepoint
|
||||
rmid.unfound.java.home.property=ActivatorImpl: java.home\uC744 \uCC3E\uC744 \uC218 \uC5C6\uC2B5\uB2C8\uB2E4.
|
||||
|
||||
# "rmid" should not be translated
|
||||
rmid.inherited.channel.info=\uC0C1\uC18D\uB41C \uCC44\uB110\uC744 \uC0AC\uC6A9\uD558\uC5EC rmid \uC2DC\uC791
|
||||
|
||||
# "Activation.main" should not be translated, because it's a codepoint
|
||||
rmid.exec.policy.invalid=Activation.main: \uC2E4\uD589 \uC815\uCC45 \uD074\uB798\uC2A4\uAC00 \uBD80\uC801\uD569\uD569\uB2C8\uB2E4.
|
||||
|
||||
# "rmid" should not be translated
|
||||
rmid.exec.policy.exception=rmid: \uC2E4\uD589 \uC815\uCC45\uC744 \uAC00\uC838\uC624\uB824\uB294 \uC2DC\uB3C4\uB85C \uBC1C\uC0DD\uD55C \uC608\uC678\uC0AC\uD56D:
|
||||
|
||||
# "rmid" should not be translated
|
||||
rmid.exec.command=rmid: debugExec: "{0}" \uC2E4\uD589 \uC911
|
||||
|
||||
# "rmid" should not be translated
|
||||
rmid.group.inactive=rmid: \uD65C\uC131\uD654 \uADF8\uB8F9 \uBE44\uD65C\uC131: {0}
|
||||
|
||||
# "Activation.main", "sun.rmi.activation.execPolicy", "ExecPermission" and
|
||||
# "ExecOptionPermission" should not be translated, since they refer to
|
||||
# class/permission names.
|
||||
rmid.exec.perms.inadequate=Activation.main: \uACBD\uACE0: sun.rmi.activation.execPolicy \uC2DC\uC2A4\uD15C \uC18D\uC131\uC774\n\uC9C0\uC815\uB418\uC9C0 \uC54A\uC558\uC73C\uBA70 ExecPermissions/ExecOptionPermissions\uAC00 \uBD80\uC5EC\uB418\uC9C0\n\uC54A\uC558\uC2B5\uB2C8\uB2E4. \uD65C\uC131\uD654\uB97C \uACC4\uC18D \uC2DC\uB3C4\uD558\uBA74 ExecPermission/ExecOptionPermission\n\uAD8C\uD55C \uAC80\uC0AC \uC2E4\uD328\uB85C \uC778\uD574 \uC2E4\uD328\uD560 \uC218 \uC788\uC2B5\uB2C8\uB2E4.\n\uBCF4\uC548\uC744 \uAD6C\uC131\uD558\uB824\uBA74 rmid \uC124\uBA85\uC11C\uB97C \uCC38\uC870\uD558\uC2ED\uC2DC\uC624.\n
|
||||
|
||||
# "rmid", "-port", "-log", "-stop", "-C" and "-J" should not be translated,
|
||||
# because they are syntax
|
||||
rmid.usage=\uC0AC\uC6A9\uBC95: {0} <options> \n\n\uC5EC\uAE30\uC11C <options>\uB294 \uB2E4\uC74C\uACFC \uAC19\uC2B5\uB2C8\uB2E4.\n -port <port> rmid\uAC00 \uC0AC\uC6A9\uD560 \uD3EC\uD2B8\uB97C \uC9C0\uC815\uD569\uB2C8\uB2E4.\n -log <directory> rmid\uAC00 \uB85C\uADF8\uB97C \uAE30\uB85D\uD560 \uB514\uB809\uD1A0\uB9AC\uB97C \uC9C0\uC815\uD569\uB2C8\uB2E4.\n -stop \uC9C0\uC815\uB41C \uD3EC\uD2B8\uC5D0 \uB300\uD574 rmid\uC758 \uD604\uC7AC \uD638\uCD9C\uC744 \uC815\uC9C0\uD569\uB2C8\uB2E4.\n -C<runtime flag> \uAC01\uAC01\uC758 \uD558\uC704 \uD504\uB85C\uC138\uC2A4(\uD65C\uC131\uD654 \uADF8\uB8F9)\uC5D0 \uC778\uC218\uB97C \uC804\uB2EC\uD569\uB2C8\uB2E4.\n -J<runtime flag> Java \uC778\uD130\uD504\uB9AC\uD130\uC5D0 \uC778\uC218\uB97C \uC804\uB2EC\uD569\uB2C8\uB2E4.\n
|
||||
# This means "The currently running activation daemon has been shut down,
|
||||
# and is about to exit".
|
||||
rmid.daemon.shutdown=\uD65C\uC131 \uB370\uBAAC \uC885\uB8CC
|
||||
|
||||
# "rmid" should not be translated
|
||||
rmid.restart.group.warning=\nrmid: (\uACBD\uACE0) \uADF8\uB8F9 \uC7AC\uC2DC\uC791\uC73C\uB85C \uC778\uD574 \uBC1C\uC0DD\uD55C \uC624\uB958:
|
||||
|
||||
# "rmid" should not be translated
|
||||
rmid.restart.service.warning=\nrmid: (\uACBD\uACE0) \uC11C\uBE44\uC2A4 \uC7AC\uC2DC\uC791\uC73C\uB85C \uC778\uD574 \uBC1C\uC0DD\uD55C \uC624\uB958:
|
||||
|
||||
# "rmid" should not be translated
|
||||
rmid.log.update.warning=\nrmid: (\uACBD\uACE0) \uB85C\uADF8 \uC5C5\uB370\uC774\uD2B8\uB85C \uC778\uD574 \uBC1C\uC0DD\uD55C \uC624\uB958:
|
||||
|
||||
# "rmid" should not be translated
|
||||
rmid.log.snapshot.warning=\nrmid: (\uC2EC\uAC01) \uB85C\uADF8 \uC2A4\uB0C5\uC0F7\uC73C\uB85C \uC778\uD574 \uBC1C\uC0DD\uD55C \uC624\uB958:
|
||||
|
||||
# "rmid" should not be translated
|
||||
rmid.log.recover.warning=\nrmid: (\uACBD\uACE0) {0}: \uBCF5\uAD6C\uD558\uB294 \uB3D9\uC548 \uB808\uCF54\uB4DC \uAE30\uB85D\uC744 \uAC74\uB108 \uB6F0\uB294 \uC911:
|
@ -1,96 +0,0 @@
|
||||
#
|
||||
#
|
||||
# Copyright (c) 1998, 2017, Oracle and/or its affiliates. All rights reserved.
|
||||
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
#
|
||||
# This code is free software; you can redistribute it and/or modify it
|
||||
# under the terms of the GNU General Public License version 2 only, as
|
||||
# published by the Free Software Foundation. Oracle designates this
|
||||
# particular file as subject to the "Classpath" exception as provided
|
||||
# by Oracle in the LICENSE file that accompanied this code.
|
||||
#
|
||||
# This code is distributed in the hope that it will be useful, but WITHOUT
|
||||
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
# version 2 for more details (a copy is included in the LICENSE file that
|
||||
# accompanied this code).
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License version
|
||||
# 2 along with this work; if not, write to the Free Software Foundation,
|
||||
# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
#
|
||||
# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
|
||||
# or visit www.oracle.com if you need additional information or have any
|
||||
# questions.
|
||||
#
|
||||
|
||||
# "rmid", inetd", and "wait" should not be translated.
|
||||
rmid.syntax.exec.invalid=rmid foi acionado a partir de inetd com um status inv\u00E1lido (deve ser wait)
|
||||
|
||||
# "rmid" and "inetd" should not be translated.
|
||||
rmid.syntax.port.badarg=a porta n\u00E3o poder\u00E1 ser especificada se rmid for acionado a partir de inetd
|
||||
|
||||
# "port" here refers to a TCP port for the server to listen on.
|
||||
rmid.syntax.port.badnumber=a porta n\u00E3o \u00E9 um n\u00FAmero
|
||||
|
||||
# "-port" should not be translated, because it's part of command syntax.
|
||||
rmid.syntax.port.missing=a op\u00E7\u00E3o -port requer um argumento
|
||||
|
||||
# "-log" should not be translated, because it's part of command syntax.
|
||||
rmid.syntax.log.missing=a op\u00E7\u00E3o -log requer um argumento
|
||||
|
||||
# "-log" should not be translated, because it's part of command syntax.
|
||||
rmid.syntax.log.required=op\u00E7\u00E3o -log necess\u00E1ria
|
||||
|
||||
# {0} = the (string) illegal argument in question
|
||||
rmid.syntax.illegal.option=op\u00E7\u00E3o inv\u00E1lida: {0}
|
||||
|
||||
# {0} = the (string) reason text that came with a thrown exception
|
||||
# "Activation.main" should not be translated, because it's a codepoint
|
||||
rmid.unexpected.exception=Activation.main: ocorreu uma exce\u00E7\u00E3o: {0}
|
||||
|
||||
# "java.home" should not be translated, because it's a property name
|
||||
# "ActivatorImpl" should not be translated, because it's a codepoint
|
||||
rmid.unfound.java.home.property=ActivatorImpl: n\u00E3o \u00E9 poss\u00EDvel localizar java.home
|
||||
|
||||
# "rmid" should not be translated
|
||||
rmid.inherited.channel.info=inicializa\u00E7\u00E3o de rmid com canal herdado
|
||||
|
||||
# "Activation.main" should not be translated, because it's a codepoint
|
||||
rmid.exec.policy.invalid=Activation.main: classe de pol\u00EDtica de execu\u00E7\u00E3o inv\u00E1lida
|
||||
|
||||
# "rmid" should not be translated
|
||||
rmid.exec.policy.exception=rmid: a tentativa de obter a pol\u00EDtica de execu\u00E7\u00E3o gera:
|
||||
|
||||
# "rmid" should not be translated
|
||||
rmid.exec.command=rmid: debugExec: executando "{0}"
|
||||
|
||||
# "rmid" should not be translated
|
||||
rmid.group.inactive=rmid: grupo de ativa\u00E7\u00E3o inativo: {0}
|
||||
|
||||
# "Activation.main", "sun.rmi.activation.execPolicy", "ExecPermission" and
|
||||
# "ExecOptionPermission" should not be translated, since they refer to
|
||||
# class/permission names.
|
||||
rmid.exec.perms.inadequate=Activation.main: warning: sun.rmi.activation.execPolicy system\npropriedade n\u00E3o especificada e nenhuma permiss\u00E3o ExecPermissions/ExecOptionPermissions\nconcedida; as tentativas subsequentes de ativa\u00E7\u00E3o poder\u00E3o falhar por causa das\nverifica\u00E7\u00F5es malsucedidas da permiss\u00E3o ExecPermission/ExecOptionPermission. \nPara configurar a seguran\u00E7a, consulte a documenta\u00E7\u00E3o do rmid.\n
|
||||
|
||||
# "rmid", "-port", "-log", "-stop", "-C" and "-J" should not be translated,
|
||||
# because they are syntax
|
||||
rmid.usage=Uso: {0} <op\u00E7\u00F5es>\n\nem que <op\u00E7\u00F5es> inclui:\n -port <porta> especifica a porta que rmid usar\u00E1\n -log <diret\u00F3rio> especifica o diret\u00F3rio no qual o rmid grava o log\n -stop para a chamada atual de rmid (para a porta especificada)\n -C<flag de runtime> especifica o argumento para cada processo filho (grupo de ativa\u00E7\u00E3o)\n -J<flag de runtime> especifica o argumento para o int\u00E9rprete de java\n
|
||||
# This means "The currently running activation daemon has been shut down,
|
||||
# and is about to exit".
|
||||
rmid.daemon.shutdown=shutdown do daemon de ativa\u00E7\u00E3o
|
||||
|
||||
# "rmid" should not be translated
|
||||
rmid.restart.group.warning=\nrmid: (ADVERT\u00CANCIA) a reinicializa\u00E7\u00E3o do grupo gera:
|
||||
|
||||
# "rmid" should not be translated
|
||||
rmid.restart.service.warning=\nrmid: (ADVERT\u00CANCIA) a reinicializa\u00E7\u00E3o do servi\u00E7o gera:
|
||||
|
||||
# "rmid" should not be translated
|
||||
rmid.log.update.warning=\nrmid: (ADVERT\u00CANCIA) o registro da atualiza\u00E7\u00E3o gera:
|
||||
|
||||
# "rmid" should not be translated
|
||||
rmid.log.snapshot.warning=\nrmid: (GRAVE) o registro do snapshot gera:
|
||||
|
||||
# "rmid" should not be translated
|
||||
rmid.log.recover.warning=\nrmid: (ADVERT\u00CANCIA) {0}: ignorando registro de log durante a recupera\u00E7\u00E3o:
|
@ -1,96 +0,0 @@
|
||||
#
|
||||
#
|
||||
# Copyright (c) 1998, 2017, Oracle and/or its affiliates. All rights reserved.
|
||||
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
#
|
||||
# This code is free software; you can redistribute it and/or modify it
|
||||
# under the terms of the GNU General Public License version 2 only, as
|
||||
# published by the Free Software Foundation. Oracle designates this
|
||||
# particular file as subject to the "Classpath" exception as provided
|
||||
# by Oracle in the LICENSE file that accompanied this code.
|
||||
#
|
||||
# This code is distributed in the hope that it will be useful, but WITHOUT
|
||||
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
# version 2 for more details (a copy is included in the LICENSE file that
|
||||
# accompanied this code).
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License version
|
||||
# 2 along with this work; if not, write to the Free Software Foundation,
|
||||
# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
#
|
||||
# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
|
||||
# or visit www.oracle.com if you need additional information or have any
|
||||
# questions.
|
||||
#
|
||||
|
||||
# "rmid", inetd", and "wait" should not be translated.
|
||||
rmid.syntax.exec.invalid=rmid startades fr\u00E5n inetd med ogiltig status (m\u00E5ste vara wait)
|
||||
|
||||
# "rmid" and "inetd" should not be translated.
|
||||
rmid.syntax.port.badarg=port kan inte anges om rmid startas fr\u00E5n inetd
|
||||
|
||||
# "port" here refers to a TCP port for the server to listen on.
|
||||
rmid.syntax.port.badnumber=port \u00E4r inte ett tal
|
||||
|
||||
# "-port" should not be translated, because it's part of command syntax.
|
||||
rmid.syntax.port.missing=alternativet -port kr\u00E4ver argument
|
||||
|
||||
# "-log" should not be translated, because it's part of command syntax.
|
||||
rmid.syntax.log.missing=alternativet -log kr\u00E4ver argument
|
||||
|
||||
# "-log" should not be translated, because it's part of command syntax.
|
||||
rmid.syntax.log.required=alternativet -log kr\u00E4vs
|
||||
|
||||
# {0} = the (string) illegal argument in question
|
||||
rmid.syntax.illegal.option=otill\u00E5tet alternativ: {0}
|
||||
|
||||
# {0} = the (string) reason text that came with a thrown exception
|
||||
# "Activation.main" should not be translated, because it's a codepoint
|
||||
rmid.unexpected.exception=Activation.main: ett undantag uppstod: {0}
|
||||
|
||||
# "java.home" should not be translated, because it's a property name
|
||||
# "ActivatorImpl" should not be translated, because it's a codepoint
|
||||
rmid.unfound.java.home.property=ActivatorImpl: hittar inte java.home
|
||||
|
||||
# "rmid" should not be translated
|
||||
rmid.inherited.channel.info=start av rmid med \u00E4rvd kanal
|
||||
|
||||
# "Activation.main" should not be translated, because it's a codepoint
|
||||
rmid.exec.policy.invalid=Activation.main: ogiltig exec policy-klass
|
||||
|
||||
# "rmid" should not be translated
|
||||
rmid.exec.policy.exception=rmid: f\u00F6rs\u00F6k att h\u00E4mta throws f\u00F6r exec-policy:
|
||||
|
||||
# "rmid" should not be translated
|
||||
rmid.exec.command=rmid: debugExec: k\u00F6r "{0}"
|
||||
|
||||
# "rmid" should not be translated
|
||||
rmid.group.inactive=rmid: aktiveringsgruppen \u00E4r inaktiv: {0}
|
||||
|
||||
# "Activation.main", "sun.rmi.activation.execPolicy", "ExecPermission" and
|
||||
# "ExecOptionPermission" should not be translated, since they refer to
|
||||
# class/permission names.
|
||||
rmid.exec.perms.inadequate=Activation.main: Varning: Systemegenskapen sun.rmi.activation.execPolicy\nhar inte angetts och inga ExecPermissions/ExecOptionPermissions har\ntilldelats. Efterf\u00F6ljande aktiveringsf\u00F6rs\u00F6k kanske inte utf\u00F6rs p\u00E5 grund\nav ej utf\u00F6rda ExecPermission/ExecOptionPermission-beh\u00F6righetskontroller. \nOm du vill konfigurera s\u00E4kerhet l\u00E4ser du i dokumentationen f\u00F6r rmid.
|
||||
|
||||
# "rmid", "-port", "-log", "-stop", "-C" and "-J" should not be translated,
|
||||
# because they are syntax
|
||||
rmid.usage=Syntax: {0} <alternativ>\n\nd\u00E4r <alternativ> inkluderar:\n -port <port> Ange porten f\u00F6r rmid\n -log <katalog> Ange katalogen d\u00E4r rmid ska spara loggen\n -stop Stoppa p\u00E5g\u00E5ende rmid-anrop (f\u00F6r angiven port)\n -C<k\u00F6rningsflagga> Skicka argumentet till varje underordnad process (aktiveringsgrupp)\n -J<k\u00F6rningsflagga> Skicka argumentet till Javatolken\n
|
||||
# This means "The currently running activation daemon has been shut down,
|
||||
# and is about to exit".
|
||||
rmid.daemon.shutdown=aktiveringsdemonen avslutas
|
||||
|
||||
# "rmid" should not be translated
|
||||
rmid.restart.group.warning=\nrmid: (Varning) starta om gruppkast:
|
||||
|
||||
# "rmid" should not be translated
|
||||
rmid.restart.service.warning=\nrmid: (Varning) starta om tj\u00E4nstekast:
|
||||
|
||||
# "rmid" should not be translated
|
||||
rmid.log.update.warning=\nrmid: (Varning) logga uppdateringskast:
|
||||
|
||||
# "rmid" should not be translated
|
||||
rmid.log.snapshot.warning=\nrmid: (Allvarligt) logga \u00F6gonblickskast:
|
||||
|
||||
# "rmid" should not be translated
|
||||
rmid.log.recover.warning=\nrmid: (Varning) {0}: hoppar \u00F6ver loggpost under \u00E5terst\u00E4llning:
|
@ -1,99 +0,0 @@
|
||||
#
|
||||
#
|
||||
# Copyright (c) 1998, 2020, Oracle and/or its affiliates. All rights reserved.
|
||||
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
#
|
||||
# This code is free software; you can redistribute it and/or modify it
|
||||
# under the terms of the GNU General Public License version 2 only, as
|
||||
# published by the Free Software Foundation. Oracle designates this
|
||||
# particular file as subject to the "Classpath" exception as provided
|
||||
# by Oracle in the LICENSE file that accompanied this code.
|
||||
#
|
||||
# This code is distributed in the hope that it will be useful, but WITHOUT
|
||||
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
# version 2 for more details (a copy is included in the LICENSE file that
|
||||
# accompanied this code).
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License version
|
||||
# 2 along with this work; if not, write to the Free Software Foundation,
|
||||
# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
#
|
||||
# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
|
||||
# or visit www.oracle.com if you need additional information or have any
|
||||
# questions.
|
||||
#
|
||||
|
||||
# "rmid", inetd", and "wait" should not be translated.
|
||||
rmid.syntax.exec.invalid=rmid \u5DF2\u4ECE inetd \u542F\u52A8, \u4E14\u72B6\u6001\u65E0\u6548 (\u5FC5\u987B\u7B49\u5F85)
|
||||
|
||||
# "rmid" and "inetd" should not be translated.
|
||||
rmid.syntax.port.badarg=\u5982\u679C rmid \u4ECE inetd \u542F\u52A8, \u5219\u65E0\u6CD5\u6307\u5B9A\u7AEF\u53E3
|
||||
|
||||
# "port" here refers to a TCP port for the server to listen on.
|
||||
rmid.syntax.port.badnumber=\u7AEF\u53E3\u4E0D\u662F\u4E00\u4E2A\u6570\u5B57
|
||||
|
||||
# "-port" should not be translated, because it's part of command syntax.
|
||||
rmid.syntax.port.missing=-port \u9009\u9879\u9700\u8981\u53C2\u6570
|
||||
|
||||
# "-log" should not be translated, because it's part of command syntax.
|
||||
rmid.syntax.log.missing=-log \u9009\u9879\u9700\u8981\u53C2\u6570
|
||||
|
||||
# "-log" should not be translated, because it's part of command syntax.
|
||||
rmid.syntax.log.required=\u9700\u8981 -log \u9009\u9879
|
||||
|
||||
# {0} = the (string) illegal argument in question
|
||||
rmid.syntax.illegal.option=\u65E0\u6548\u7684\u9009\u9879\uFF1A{0}
|
||||
|
||||
# {0} = the (string) reason text that came with a thrown exception
|
||||
# "Activation.main" should not be translated, because it's a codepoint
|
||||
rmid.unexpected.exception=Activation.main: \u51FA\u73B0\u5F02\u5E38\u9519\u8BEF: {0}
|
||||
|
||||
# "java.home" should not be translated, because it's a property name
|
||||
# "ActivatorImpl" should not be translated, because it's a codepoint
|
||||
rmid.unfound.java.home.property=ActivatorImpl: \u627E\u4E0D\u5230 java.home
|
||||
|
||||
# "rmid" should not be translated
|
||||
rmid.inherited.channel.info=rmid \u901A\u8FC7\u7EE7\u627F\u7684\u901A\u9053\u542F\u52A8
|
||||
|
||||
# "Activation.main" should not be translated, because it's a codepoint
|
||||
rmid.exec.policy.invalid=Activation.main: \u65E0\u6548\u7684\u53EF\u6267\u884C policy \u7C7B
|
||||
|
||||
# "rmid" should not be translated
|
||||
rmid.exec.policy.exception=rmid: \u5C1D\u8BD5\u83B7\u53D6\u6267\u884C\u7B56\u7565\u629B\u51FA:
|
||||
|
||||
# "rmid" should not be translated
|
||||
rmid.exec.command=rmid: debugExec: \u6B63\u5728\u8FD0\u884C "{0}"
|
||||
|
||||
# "rmid" should not be translated
|
||||
rmid.group.inactive=rmid: \u6FC0\u6D3B\u7EC4\u65E0\u6548: {0}
|
||||
|
||||
# "Activation.main", "sun.rmi.activation.execPolicy", "ExecPermission" and
|
||||
# "ExecOptionPermission" should not be translated, since they refer to
|
||||
# class/permission names.
|
||||
rmid.exec.perms.inadequate=Activation.main: \u8B66\u544A: \u672A\u6307\u5B9A sun.rmi.activation.execPolicy\n\u7CFB\u7EDF\u5C5E\u6027\u5E76\u4E14\u672A\u6388\u4E88 ExecPermissions/ExecOptionPermissions\u3002\n\u7531\u4E8E\u5BF9 ExecPermission/ExecOptionPermission \u7684\n\u6743\u9650\u68C0\u67E5\u5931\u8D25, \u968F\u540E\u7684\u6FC0\u6D3B\u5C1D\u8BD5\u53EF\u80FD\u4F1A\u5931\u8D25\u3002\n\u8981\u914D\u7F6E\u5B89\u5168\u6027, \u8BF7\u53C2\u9605 rmid \u6587\u6863\u3002\n
|
||||
|
||||
# "rmid", "-port", "-log", "-stop", "-C" and "-J" should not be translated,
|
||||
# because they are syntax
|
||||
rmid.usage=\u7528\u6CD5: {0} <options>\n\n\u5176\u4E2D, <options> \u5305\u62EC:\n -port <port> \u6307\u5B9A\u4F9B rmid \u4F7F\u7528\u7684\u7AEF\u53E3\n -log <directory> \u6307\u5B9A rmid \u5C06\u65E5\u5FD7\u5199\u5165\u7684\u76EE\u5F55\n -stop \u505C\u6B62\u5F53\u524D\u7684 rmid \u8C03\u7528 (\u5BF9\u6307\u5B9A\u7AEF\u53E3)\n -C<runtime flag> \u5411\u6BCF\u4E2A\u5B50\u8FDB\u7A0B\u4F20\u9012\u53C2\u6570 (\u6FC0\u6D3B\u7EC4)\n -J<runtime flag> \u5411 java \u89E3\u91CA\u5668\u4F20\u9012\u53C2\u6570\n
|
||||
# This means "The currently running activation daemon has been shut down,
|
||||
# and is about to exit".
|
||||
rmid.daemon.shutdown=\u6FC0\u6D3B\u5B88\u62A4\u7A0B\u5E8F\u5DF2\u5173\u95ED
|
||||
|
||||
# "rmid" should not be translated
|
||||
rmid.restart.group.warning=\nrmid: (\u8B66\u544A) \u91CD\u65B0\u542F\u52A8\u7EC4\u629B\u51FA:
|
||||
|
||||
# "rmid" should not be translated
|
||||
rmid.restart.service.warning=\nrmid: (\u8B66\u544A) \u91CD\u65B0\u542F\u52A8\u670D\u52A1\u629B\u51FA:
|
||||
|
||||
# "rmid" should not be translated
|
||||
rmid.log.update.warning=\nrmid: (\u8B66\u544A) \u65E5\u5FD7\u66F4\u65B0\u629B\u51FA:
|
||||
|
||||
# "rmid" should not be translated
|
||||
rmid.log.snapshot.warning=\nrmid: (\u4E25\u91CD) \u65E5\u5FD7\u5FEB\u7167\u629B\u51FA:
|
||||
|
||||
# "rmid" should not be translated
|
||||
rmid.log.recover.warning=\nrmid: (\u8B66\u544A) {0}: \u6062\u590D\u671F\u95F4\u8DF3\u8FC7\u65E5\u5FD7\u8BB0\u5F55:
|
||||
|
||||
# "rmid" should not be translated
|
||||
rmid.deprecation.warning=rmid\uFF1A\uFF08\u8B66\u544A\uFF09RMI \u6FC0\u6D3B\u673A\u5236\u548C rmid \u5DE5\u5177\n\u5DF2\u8FC7\u65F6\uFF0C\u5373\u5C06\u5220\u9664\u3002\u5728\u5C06\u6765\u7684\nJava \u5E73\u53F0\u7248\u672C\u4E2D\u53EF\u80FD\u4F1A\u5C06\u5176\u5220\u9664\u3002
|
@ -1,96 +0,0 @@
|
||||
#
|
||||
#
|
||||
# Copyright (c) 1998, 2017, Oracle and/or its affiliates. All rights reserved.
|
||||
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
#
|
||||
# This code is free software; you can redistribute it and/or modify it
|
||||
# under the terms of the GNU General Public License version 2 only, as
|
||||
# published by the Free Software Foundation. Oracle designates this
|
||||
# particular file as subject to the "Classpath" exception as provided
|
||||
# by Oracle in the LICENSE file that accompanied this code.
|
||||
#
|
||||
# This code is distributed in the hope that it will be useful, but WITHOUT
|
||||
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
# version 2 for more details (a copy is included in the LICENSE file that
|
||||
# accompanied this code).
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License version
|
||||
# 2 along with this work; if not, write to the Free Software Foundation,
|
||||
# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
#
|
||||
# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
|
||||
# or visit www.oracle.com if you need additional information or have any
|
||||
# questions.
|
||||
#
|
||||
|
||||
# "rmid", inetd", and "wait" should not be translated.
|
||||
rmid.syntax.exec.invalid=rmid \u5DF2\u5F9E inetd \u555F\u52D5\uFF0C\u4F46\u72C0\u614B\u7121\u6548 (\u5FC5\u9808\u662F wait)
|
||||
|
||||
# "rmid" and "inetd" should not be translated.
|
||||
rmid.syntax.port.badarg=\u5982\u679C rmid \u5F9E inetd \u555F\u52D5\uFF0C\u5247\u7121\u6CD5\u6307\u5B9A\u9023\u63A5\u57E0
|
||||
|
||||
# "port" here refers to a TCP port for the server to listen on.
|
||||
rmid.syntax.port.badnumber=port \u4E0D\u662F\u4E00\u500B\u6578\u5B57
|
||||
|
||||
# "-port" should not be translated, because it's part of command syntax.
|
||||
rmid.syntax.port.missing=-port \u9078\u9805\u9700\u8981\u5F15\u6578
|
||||
|
||||
# "-log" should not be translated, because it's part of command syntax.
|
||||
rmid.syntax.log.missing=-log \u9078\u9805\u9700\u8981\u5F15\u6578
|
||||
|
||||
# "-log" should not be translated, because it's part of command syntax.
|
||||
rmid.syntax.log.required=-log \u9078\u9805\u662F\u5FC5\u9700\u7684
|
||||
|
||||
# {0} = the (string) illegal argument in question
|
||||
rmid.syntax.illegal.option=\u7121\u6548\u7684\u9078\u9805: {0}
|
||||
|
||||
# {0} = the (string) reason text that came with a thrown exception
|
||||
# "Activation.main" should not be translated, because it's a codepoint
|
||||
rmid.unexpected.exception=Activation.main: \u767C\u751F\u7570\u5E38\u72C0\u6CC1: {0}
|
||||
|
||||
# "java.home" should not be translated, because it's a property name
|
||||
# "ActivatorImpl" should not be translated, because it's a codepoint
|
||||
rmid.unfound.java.home.property=ActivatorImpl: \u627E\u4E0D\u5230 java.home \u7684\u6240\u5728
|
||||
|
||||
# "rmid" should not be translated
|
||||
rmid.inherited.channel.info=rmid \u4F7F\u7528\u7E7C\u627F\u7684\u901A\u9053\u555F\u52D5
|
||||
|
||||
# "Activation.main" should not be translated, because it's a codepoint
|
||||
rmid.exec.policy.invalid=Activation.main: \u7121\u6548\u7684\u57F7\u884C\u539F\u5247\u985E\u5225
|
||||
|
||||
# "rmid" should not be translated
|
||||
rmid.exec.policy.exception=rmid: \u5617\u8A66\u53D6\u5F97\u57F7\u884C\u539F\u5247\u62CB\u68C4:
|
||||
|
||||
# "rmid" should not be translated
|
||||
rmid.exec.command=rmid: debugExec: \u57F7\u884C "{0}"
|
||||
|
||||
# "rmid" should not be translated
|
||||
rmid.group.inactive=rmid: \u555F\u52D5\u7FA4\u7D44\u672A\u5728\u4F7F\u7528\u4E2D: {0}
|
||||
|
||||
# "Activation.main", "sun.rmi.activation.execPolicy", "ExecPermission" and
|
||||
# "ExecOptionPermission" should not be translated, since they refer to
|
||||
# class/permission names.
|
||||
rmid.exec.perms.inadequate=Activation.main: \u8B66\u544A: sun.rmi.activation.execPolicy \u7CFB\u7D71\n\u5C6C\u6027\u672A\u6307\u5B9A\uFF0C\u800C\u4E14\u672A\u6388\u4E88 ExecPermissions/ExecOptionPermissions;\n\u5F8C\u7E8C\u7684\u555F\u52D5\u5617\u8A66\u53EF\u80FD\u6703\u56E0\u70BA\u4E0D\u6210\u529F\u7684\nExecPermission/ExecOptionPermission \u6B0A\u9650\u6AA2\u67E5\u800C\u5931\u6557\u3002\n\u5982\u9700\u8A2D\u5B9A\u5B89\u5168\uFF0C\u8ACB\u53C3\u8003 rmid \u6587\u4EF6\u3002\n
|
||||
|
||||
# "rmid", "-port", "-log", "-stop", "-C" and "-J" should not be translated,
|
||||
# because they are syntax
|
||||
rmid.usage=\u7528\u6CD5: {0} <options>\n\n\u5176\u4E2D <options> \u5305\u62EC: \n -port <port> \u6307\u5B9A\u4F9B rmid \u4F7F\u7528\u7684\u9023\u63A5\u57E0\n -log <directory> \u6307\u5B9A\u4F9B rmid \u5BEB\u5165\u65E5\u8A8C\u7684\u76EE\u9304\n -stop \u505C\u6B62\u76EE\u524D rmid \u7684\u547C\u53EB (\u91DD\u5C0D\u6307\u5B9A\u7684\u9023\u63A5\u57E0)\n -C<runtime flag> \u50B3\u905E\u5F15\u6578\u81F3\u6BCF\u4E00\u5B50\u904E\u7A0B (\u4F5C\u7528\u7FA4\u7D44)\n -J<runtime flag> \u50B3\u905E\u5F15\u6578\u81F3 java \u89E3\u8B6F\u7A0B\u5F0F\n
|
||||
# This means "The currently running activation daemon has been shut down,
|
||||
# and is about to exit".
|
||||
rmid.daemon.shutdown=\u95DC\u9589 activation \u5354\u52A9\u7A0B\u5F0F
|
||||
|
||||
# "rmid" should not be translated
|
||||
rmid.restart.group.warning=\nrmid: (\u8B66\u544A) \u91CD\u65B0\u555F\u52D5\u7FA4\u7D44\u62CB\u68C4:
|
||||
|
||||
# "rmid" should not be translated
|
||||
rmid.restart.service.warning=\nrmid: (\u8B66\u544A) \u91CD\u65B0\u555F\u52D5\u670D\u52D9\u62CB\u68C4:
|
||||
|
||||
# "rmid" should not be translated
|
||||
rmid.log.update.warning=\nrmid: (\u8B66\u544A) \u8A18\u9304\u66F4\u65B0\u62CB\u68C4:
|
||||
|
||||
# "rmid" should not be translated
|
||||
rmid.log.snapshot.warning=\nrmid: (\u56B4\u91CD) \u8A18\u9304\u5FEB\u7167\u62CB\u68C4:
|
||||
|
||||
# "rmid" should not be translated
|
||||
rmid.log.recover.warning=\nrmid: (\u8B66\u544A) {0}: \u5728\u56DE\u5FA9\u904E\u7A0B\u4E2D\u7565\u904E\u65E5\u8A8C\u8A18\u9304:
|
@ -1,413 +0,0 @@
|
||||
.\" Copyright (c) 1998, 2020, Oracle and/or its affiliates. All rights reserved.
|
||||
.\" DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
.\"
|
||||
.\" This code is free software; you can redistribute it and/or modify it
|
||||
.\" under the terms of the GNU General Public License version 2 only, as
|
||||
.\" published by the Free Software Foundation.
|
||||
.\"
|
||||
.\" This code is distributed in the hope that it will be useful, but WITHOUT
|
||||
.\" ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
.\" FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
.\" version 2 for more details (a copy is included in the LICENSE file that
|
||||
.\" accompanied this code).
|
||||
.\"
|
||||
.\" You should have received a copy of the GNU General Public License version
|
||||
.\" 2 along with this work; if not, write to the Free Software Foundation,
|
||||
.\" Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
.\"
|
||||
.\" Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
|
||||
.\" or visit www.oracle.com if you need additional information or have any
|
||||
.\" questions.
|
||||
.\"
|
||||
.\" Automatically generated by Pandoc 2.3.1
|
||||
.\"
|
||||
.TH "RMID" "1" "2021" "JDK 17\-ea" "JDK Commands"
|
||||
.hy
|
||||
.SH NAME
|
||||
.PP
|
||||
rmid \- start the activation system daemon that enables objects to be
|
||||
registered and activated in a Java Virtual Machine (JVM)
|
||||
.SH SYNOPSIS
|
||||
.PP
|
||||
\f[CB]rmid\f[R] [\f[I]options\f[R]]
|
||||
.TP
|
||||
.B \f[I]options\f[R]
|
||||
This represent the command\-line options for the \f[CB]rmid\f[R] command.
|
||||
See \f[B]Options for rmid\f[R].
|
||||
.RS
|
||||
.RE
|
||||
.SH DESCRIPTION
|
||||
.PP
|
||||
\f[B]Deprecation Notice:\f[R] The rmid tool and the RMI Activation
|
||||
mechanism have been deprecated and may be removed from a future version
|
||||
of the platform.
|
||||
See \f[B]JEP 385\f[R] [https://openjdk.java.net/jeps/385] for further
|
||||
information.
|
||||
.PP
|
||||
The \f[CB]rmid\f[R] command starts the activation system daemon.
|
||||
The activation system daemon must be started before objects that can be
|
||||
activated are either registered with the activation system or activated
|
||||
in a JVM.
|
||||
.PP
|
||||
Start the daemon by executing the \f[CB]rmid\f[R] command and specifying a
|
||||
security policy file, as follows:
|
||||
.RS
|
||||
.PP
|
||||
\f[CB]rmid\ \-J\-Djava.security.policy=rmid.policy\f[R]
|
||||
.RE
|
||||
.PP
|
||||
When you run Oracle\[aq]s implementation of the \f[CB]rmid\f[R] command,
|
||||
by default you must specify a security policy file so that the
|
||||
\f[CB]rmid\f[R] command can verify whether or not the information in each
|
||||
\f[CB]ActivationGroupDesc\f[R] is allowed to be used to start a JVM for an
|
||||
activation group.
|
||||
Specifically, the command and options specified by the
|
||||
\f[CB]CommandEnvironment\f[R] and any properties passed to an
|
||||
\f[CB]ActivationGroupDesc\f[R] constructor must now be explicitly allowed
|
||||
in the security policy file for the \f[CB]rmid\f[R] command.
|
||||
The value of the \f[CB]sun.rmi.activation.execPolicy\f[R] property
|
||||
dictates the policy that the \f[CB]rmid\f[R] command uses to determine
|
||||
whether or not the information in an \f[CB]ActivationGroupDesc\f[R] can be
|
||||
used to start a JVM for an activation group.
|
||||
For more information see the description of the
|
||||
\f[CB]\-J\-Dsun.rmi.activation.execPolicy=policy\f[R] option.
|
||||
.PP
|
||||
Executing the \f[CB]rmid\f[R] command starts the \f[CB]Activator\f[R] and an
|
||||
internal registry on the default port 1098 and binds an
|
||||
\f[CB]ActivationSystem\f[R] to the name
|
||||
\f[CB]java.rmi.activation.ActivationSystem\f[R] in this internal registry.
|
||||
.PP
|
||||
To specify an alternate port for the registry, you must specify the
|
||||
\f[CB]\-port\f[R] option when you execute the \f[CB]rmid\f[R] command.
|
||||
For example, the following command starts the activation system daemon
|
||||
and a registry on the registry\[aq]s default port, 1099.
|
||||
.RS
|
||||
.PP
|
||||
\f[CB]rmid\ \-J\-Djava.security.policy=rmid.policy\ \-port\ 1099\f[R]
|
||||
.RE
|
||||
.SH START RMID ON DEMAND (LINUX ONLY)
|
||||
.PP
|
||||
An alternative to starting \f[CB]rmid\f[R] from the command line is to
|
||||
configure \f[CB]xinetd\f[R] (Linux) to start \f[CB]rmid\f[R] on demand.
|
||||
.PP
|
||||
When RMID starts, it attempts to obtain an inherited channel (inherited
|
||||
from \f[CB]inetd\f[R]/\f[CB]xinetd\f[R]) by calling the
|
||||
\f[CB]System.inheritedChannel\f[R] method.
|
||||
If the inherited channel is null or not an instance of
|
||||
\f[CB]java.nio.channels.ServerSocketChannel\f[R], then RMID assumes that
|
||||
it wasn\[aq]t started by \f[CB]inetd\f[R]/\f[CB]xinetd\f[R], and it starts
|
||||
as previously described.
|
||||
.PP
|
||||
If the inherited channel is a \f[CB]ServerSocketChannel\f[R] instance,
|
||||
then RMID uses the \f[CB]java.net.ServerSocket\f[R] obtained from the
|
||||
\f[CB]ServerSocketChannel\f[R] as the server socket that accepts requests
|
||||
for the remote objects it exports: The registry in which the
|
||||
\f[CB]java.rmi.activation.ActivationSystem\f[R] is bound and the
|
||||
\f[CB]java.rmi.activation.Activator\f[R] remote object.
|
||||
In this mode, RMID behaves the same as when it is started from the
|
||||
command line, except in the following cases:
|
||||
.IP \[bu] 2
|
||||
Output printed to \f[CB]System.err\f[R] is redirected to a file.
|
||||
This file is located in the directory specified by the
|
||||
\f[CB]java.io.tmpdir\f[R] system property (typically \f[CB]/var/tmp\f[R] or
|
||||
\f[CB]/tmp\f[R]) with the prefix \f[CB]rmid\-err\f[R] and the suffix
|
||||
\f[CB]tmp\f[R].
|
||||
.IP \[bu] 2
|
||||
The \f[CB]\-port\f[R] option isn\[aq]t allowed.
|
||||
If this option is specified, then RMID exits with an error message.
|
||||
.IP \[bu] 2
|
||||
The \f[CB]\-log\f[R] option is required.
|
||||
If this option isn\[aq]t specified, then RMID exits with an error
|
||||
message
|
||||
.SH OPTIONS FOR RMID
|
||||
.TP
|
||||
.B \f[CB]\-C\f[R]\f[I]option\f[R]
|
||||
Specifies an option that\[aq]s passed as a command\-line argument to
|
||||
each child process (activation group) of the \f[CB]rmid\f[R] command when
|
||||
that process is created.
|
||||
For example, you could pass a property to each virtual machine spawned
|
||||
by the activation system daemon:
|
||||
.RS
|
||||
.RS
|
||||
.PP
|
||||
\f[CB]rmid\ \-C\-Dsome.property=value\f[R]
|
||||
.RE
|
||||
.PP
|
||||
This ability to pass command\-line arguments to child processes can be
|
||||
useful for debugging.
|
||||
For example, the following command enables server\-call logging in all
|
||||
child JVMs.
|
||||
.RS
|
||||
.PP
|
||||
\f[CB]rmid\ \-C\-Djava.rmi.server.logCalls=true\f[R]
|
||||
.RE
|
||||
.RE
|
||||
.TP
|
||||
.B \f[CB]\-J\f[R]\f[I]option\f[R]
|
||||
Specifies an option that\[aq]s passed to the Java interpreter running
|
||||
RMID command.
|
||||
For example, to specify that the \f[CB]rmid\f[R] command use a policy file
|
||||
named \f[CB]rmid.policy\f[R], the \f[CB]\-J\f[R] option can be used to
|
||||
define the \f[CB]java.security.policy\f[R] property on the \f[CB]rmid\f[R]
|
||||
command line, for example:
|
||||
.RS
|
||||
.RS
|
||||
.PP
|
||||
\f[CB]rmid\ \-J\-Djava.security.policy\-rmid.policy\f[R]
|
||||
.RE
|
||||
.RE
|
||||
.TP
|
||||
.B \f[CB]\-J\-Dsun.rmi.activation.execPolicy=\f[R]\f[I]policy\f[R]
|
||||
Specifies the policy that the RMID command employs to check commands and
|
||||
command\-line options used to start the JVM in which an activation group
|
||||
runs.
|
||||
This option exists only in Oracle\[aq]s implementation of the Java RMI
|
||||
activation daemon.
|
||||
If this property isn\[aq]t specified on the command line, then the
|
||||
result is the same as though
|
||||
\f[CB]\-J\-Dsun.rmi.activation.execPolicy=default\f[R] were specified.
|
||||
.RS
|
||||
.PP
|
||||
The possible values of \f[I]policy\f[R] can be \f[CB]default\f[R],
|
||||
\f[I]policyClassName\f[R], or \f[CB]none\f[R].
|
||||
.IP \[bu] 2
|
||||
\f[CB]default\f[R]
|
||||
.RS 2
|
||||
.PP
|
||||
The \f[CB]default\f[R] or unspecified value \f[CB]execPolicy\f[R] allows the
|
||||
\f[CB]rmid\f[R] command to execute commands with specific command\-line
|
||||
options only when the \f[CB]rmid\f[R] command was granted permission to
|
||||
execute those commands and options in the security policy file that the
|
||||
\f[CB]rmid\f[R] command uses.
|
||||
Only the default activation group implementation can be used with the
|
||||
default execution policy.
|
||||
.PP
|
||||
The \f[CB]rmid\f[R] command starts a JVM for an activation group with the
|
||||
information in the group\[aq]s registered activation group descriptor,
|
||||
\f[CB]ActivationGroupDesc\f[R].
|
||||
The group descriptor specifies an optional
|
||||
\f[CB]ActivationGroupDesc.CommandEnvironment\f[R] that includes the
|
||||
command to execute to start the activation group and any command\-line
|
||||
options to be added to the command line.
|
||||
By default, the \f[CB]rmid\f[R] command uses the \f[CB]java\f[R] command
|
||||
found in \f[CB]java.home\f[R].
|
||||
The group descriptor also contains properties overrides that are added
|
||||
to the command line as options defined as:
|
||||
\f[CB]\-D\f[R]\f[I]property\f[R]\f[CB]=\f[R]\f[I]value\f[R].
|
||||
The \f[CB]com.sun.rmi.rmid.ExecPermission\f[R] permission grants the
|
||||
\f[CB]rmid\f[R] command permission to execute a command that\[aq]s
|
||||
specified in the group descriptor\[aq]s \f[CB]CommandEnvironment\f[R] to
|
||||
start an activation group.
|
||||
The \f[CB]com.sun.rmi.rmid.ExecOptionPermission\f[R] permission enables
|
||||
the \f[CB]rmid\f[R] command to use command\-line options, specified as
|
||||
properties overrides in the group descriptor or as options in the
|
||||
\f[CB]CommandEnvironment\f[R] when starting the activation group.
|
||||
When granting the \f[CB]rmid\f[R] command permission to execute various
|
||||
commands and options, the permissions \f[CB]ExecPermission\f[R] and
|
||||
\f[CB]ExecOptionPermission\f[R] must be granted to all code sources.
|
||||
.PP
|
||||
\f[CB]ExecPermission\f[R] class: Represents permission for the
|
||||
\f[CB]rmid\f[R] command to execute a specific command to start an
|
||||
activation group.
|
||||
.PP
|
||||
\f[CB]ExecPermission\f[R] syntax: The name of \f[CB]ExecPermission\f[R] is
|
||||
the path name of a command to grant the \f[CB]rmid\f[R] command permission
|
||||
to execute.
|
||||
.PP
|
||||
A path name that ends in a slash (\f[CB]/\f[R]) and an asterisk
|
||||
(\f[CB]*\f[R]) indicates that all of the files are contained in that
|
||||
directory where the slash is the file\-separator character,
|
||||
\f[CB]File.separatorChar\f[R].
|
||||
.PP
|
||||
A path name that ends in a slash (\f[CB]/\f[R]) and a minus sign
|
||||
(\f[CB]\-\f[R]) indicates that all files and subdirectories are contained
|
||||
in that directory (recursively).
|
||||
.PP
|
||||
A path name that consists of the special token \f[CB]<<ALL\ FILES>>\f[R]
|
||||
matches any file.
|
||||
.PP
|
||||
A path name that consists of an asterisk (\f[CB]*\f[R]) indicates that all
|
||||
the files are in the current directory.
|
||||
.PP
|
||||
A path name that consists of a minus sign (\f[CB]\-\f[R]) indicates that
|
||||
all the files are in the current directory and (recursively) all files
|
||||
and subdirectories are contained in the current directory.
|
||||
.PP
|
||||
\f[CB]ExecOptionPermission\f[R] class: Represents permission for the
|
||||
\f[CB]rmid\f[R] command to use a specific command\-line option when
|
||||
starting an activation group.
|
||||
The name of \f[CB]ExecOptionPermission\f[R] is the value of a
|
||||
command\-line option.
|
||||
.PP
|
||||
\f[CB]ExecOptionPermission\f[R] syntax: Options support a limited wild
|
||||
card scheme.
|
||||
An asterisk signifies a wild card match, and it can appear as the option
|
||||
name itself (matches any option), or an asterisk (*) can appear at the
|
||||
end of the option name only when the asterisk (\f[CB]*\f[R]) follows a dot
|
||||
(\f[CB]\&.\f[R]) or an equals sign (\f[CB]=\f[R]).
|
||||
.PP
|
||||
For example: \f[CB]*\f[R] or \f[CB]\-Dmydir.*\f[R] or \f[CB]\-Da.b.c=*\f[R] is
|
||||
valid, but \f[CB]*mydir\f[R] or \f[CB]\-Da*b\f[R] or \f[CB]ab*\f[R] isn\[aq]t
|
||||
valid.
|
||||
.PP
|
||||
\f[B]Policy file for rmid\f[R]
|
||||
.PP
|
||||
When you grant the \f[CB]rmid\f[R] command permission to execute various
|
||||
commands and options, the permissions \f[CB]ExecPermission\f[R] and
|
||||
\f[CB]ExecOptionPermission\f[R] must be granted to all code sources
|
||||
(universally).
|
||||
It is safe to grant these permissions universally because only the
|
||||
\f[CB]rmid\f[R] command checks these permissions.
|
||||
.PP
|
||||
An example policy file that grants various execute permissions to the
|
||||
\f[CB]rmid\f[R] command is:
|
||||
.IP \[bu] 2
|
||||
\f[B]Linux:\f[R]
|
||||
.RS 2
|
||||
.IP
|
||||
.nf
|
||||
\f[CB]
|
||||
grant\ {
|
||||
\ \ \ \ permission\ com.sun.rmi.rmid.ExecPermission
|
||||
\ \ \ \ \ \ \ \ "/files/apps/java/jdk1.7.0/linux/bin/java";
|
||||
|
||||
\ \ \ \ permission\ com.sun.rmi.rmid.ExecPermission
|
||||
\ \ \ \ \ \ \ \ "/files/apps/rmidcmds/*";
|
||||
|
||||
\ \ \ \ permission\ com.sun.rmi.rmid.ExecOptionPermission
|
||||
\ \ \ \ \ \ \ \ "\-Djava.security.policy=/files/policies/group.policy";
|
||||
|
||||
\ \ \ \ permission\ com.sun.rmi.rmid.ExecOptionPermission
|
||||
\ \ \ \ \ \ \ \ "\-Djava.security.debug=*";
|
||||
|
||||
\ \ \ \ permission\ com.sun.rmi.rmid.ExecOptionPermission
|
||||
\ \ \ \ \ \ \ \ "\-Dsun.rmi.*";
|
||||
};
|
||||
\f[R]
|
||||
.fi
|
||||
.RE
|
||||
.IP \[bu] 2
|
||||
\f[B]Windows:\f[R]
|
||||
.RS 2
|
||||
.IP
|
||||
.nf
|
||||
\f[CB]
|
||||
grant\ {
|
||||
\ \ \ \ permission\ com.sun.rmi.rmid.ExecPermission
|
||||
\ \ \ \ \ \ \ \ "c:\\\\files\\\\apps\\\\java\\\\jdk1.7.0\\\\win\\\\bin\\\\java";
|
||||
|
||||
\ \ \ \ permission\ com.sun.rmi.rmid.ExecPermission
|
||||
\ \ \ \ \ \ \ \ "c:\\\\files\\\\apps\\\\rmidcmds\\\\*";
|
||||
|
||||
\ \ \ \ permission\ com.sun.rmi.rmid.ExecOptionPermission
|
||||
\ \ \ \ \ \ \ \ "\-Djava.security.policy=c:\\\\files\\\\policies\\\\group.policy";
|
||||
|
||||
\ \ \ \ permission\ com.sun.rmi.rmid.ExecOptionPermission
|
||||
\ \ \ \ \ \ \ \ "\-Djava.security.debug=*";
|
||||
|
||||
\ \ \ \ permission\ com.sun.rmi.rmid.ExecOptionPermission
|
||||
\ \ \ \ \ \ \ \ "\-Dsun.rmi.*";
|
||||
};
|
||||
\f[R]
|
||||
.fi
|
||||
.RE
|
||||
.PP
|
||||
The first permission granted allows the \f[CB]rmid\f[R] command to execute
|
||||
the 1.7.0 release of the \f[CB]java\f[R] command, specified by its
|
||||
explicit path name.
|
||||
By default, the version of the \f[CB]java\f[R] command found in
|
||||
\f[CB]java.home\f[R] is used (the same one that the \f[CB]rmid\f[R] command
|
||||
uses), and doesn\[aq]t need to be specified in the policy file.
|
||||
The second permission allows the \f[CB]rmid\f[R] command to execute any
|
||||
command in either the directory \f[CB]/files/apps/rmidcmds\f[R] (Linux and
|
||||
macOS) or the directory \f[CB]c:\\files\\apps\\rmidcmds\\\f[R] (Windows).
|
||||
.PP
|
||||
The third permission granted, \f[CB]ExecOptionPermission\f[R], allows the
|
||||
\f[CB]rmid\f[R] command to start an activation group that defines the
|
||||
security policy file to be either \f[CB]/files/policies/group.policy\f[R]
|
||||
(Linux) or \f[CB]c:\\files\\policies\\group.policy\f[R] (Windows).
|
||||
The next permission allows the \f[CB]java.security.debug\ property\f[R] to
|
||||
be used by an activation group.
|
||||
The last permission allows any property in the
|
||||
\f[CB]sun.rmi\ property\f[R] name hierarchy to be used by activation
|
||||
groups.
|
||||
.PP
|
||||
To start the \f[CB]rmid\f[R] command with a policy file, the
|
||||
\f[CB]java.security.policy\f[R] property needs to be specified on the
|
||||
\f[CB]rmid\f[R] command line, for example:
|
||||
.PP
|
||||
\f[CB]rmid\ \-J\-Djava.security.policy=rmid.policy\f[R].
|
||||
.RE
|
||||
.IP \[bu] 2
|
||||
\f[I]policyClassName\f[R]
|
||||
.RS 2
|
||||
.PP
|
||||
If the default behavior isn\[aq]t flexible enough, then an administrator
|
||||
can provide, when starting the \f[CB]rmid\f[R] command, the name of a
|
||||
class whose \f[CB]checkExecCommand\f[R] method is executed to check
|
||||
commands to be executed by the \f[CB]rmid\f[R] command.
|
||||
.PP
|
||||
The \f[CB]policyClassName\f[R] specifies a public class with a public,
|
||||
no\-argument constructor and an implementation of the following
|
||||
\f[CB]checkExecCommand\f[R] method:
|
||||
.IP
|
||||
.nf
|
||||
\f[CB]
|
||||
\ public\ void\ checkExecCommand(ActivationGroupDesc\ desc,\ String[]\ command)
|
||||
\ \ \ \ \ \ \ \ throws\ SecurityException;
|
||||
\f[R]
|
||||
.fi
|
||||
.PP
|
||||
Before starting an activation group, the \f[CB]rmid\f[R] command calls the
|
||||
policy\[aq]s \f[CB]checkExecCommand\f[R] method and passes to it the
|
||||
activation group descriptor and an array that contains the complete
|
||||
command to start the activation group.
|
||||
If the \f[CB]checkExecCommand\f[R] throws a \f[CB]SecurityException\f[R],
|
||||
then the \f[CB]rmid\f[R] command doesn\[aq]t start the activation group
|
||||
and an \f[CB]ActivationException\f[R] is thrown to the caller attempting
|
||||
to activate the object.
|
||||
.RE
|
||||
.IP \[bu] 2
|
||||
\f[CB]none\f[R]
|
||||
.RS 2
|
||||
.PP
|
||||
If the \f[CB]sun.rmi.activation.execPolicy\f[R] property value is
|
||||
\f[CB]none\f[R], then the \f[CB]rmid\f[R] command doesn\[aq]t perform any
|
||||
validation of commands to start activation groups.
|
||||
.RE
|
||||
.RE
|
||||
.TP
|
||||
.B \f[CB]\-log\f[R] \f[I]dir\f[R]
|
||||
Specifies the name of the directory that the activation system daemon
|
||||
uses to write its database and associated information.
|
||||
The log directory defaults to creating a log, in the directory in which
|
||||
the \f[CB]rmid\f[R] command was executed.
|
||||
.RS
|
||||
.RE
|
||||
.TP
|
||||
.B \f[CB]\-port\f[R] \f[I]port\f[R]
|
||||
Specifies the port that the registry uses.
|
||||
The activation system daemon binds \f[CB]ActivationSystem\f[R], with the
|
||||
name \f[CB]java.rmi.activation.ActivationSystem\f[R], in this registry.
|
||||
The \f[CB]ActivationSystem\f[R] on the local machine can be obtained using
|
||||
the following \f[CB]Naming.lookup\f[R] method call:
|
||||
.RS
|
||||
.IP
|
||||
.nf
|
||||
\f[CB]
|
||||
import\ java.rmi.*;
|
||||
import\ java.rmi.activation.*;
|
||||
|
||||
ActivationSystem\ system;\ system\ =\ (ActivationSystem)
|
||||
Naming.lookup("//:port/java.rmi.activation.ActivationSystem");
|
||||
\f[R]
|
||||
.fi
|
||||
.RE
|
||||
.TP
|
||||
.B \f[CB]\-stop\f[R]
|
||||
Stops the current invocation of the \f[CB]rmid\f[R] command for a port
|
||||
specified by the \f[CB]\-port\f[R] option.
|
||||
If no port is specified, then this option stops the \f[CB]rmid\f[R]
|
||||
invocation running on port 1098.
|
||||
.RS
|
||||
.RE
|
@ -635,12 +635,6 @@ java/rmi/transport/rapidExportUnexport/RapidExportUnexport.java 7146541 linux-al
|
||||
|
||||
java/rmi/transport/checkLeaseInfoLeak/CheckLeaseLeak.java 7191877 generic-all
|
||||
|
||||
java/rmi/activation/Activatable/extLoadedImpl/ext.sh 8062724 generic-all
|
||||
|
||||
java/rmi/activation/ActivationGroup/downloadActivationGroup/DownloadActivationGroup.java 8169569 windows-all
|
||||
|
||||
java/rmi/activation/rmidViaInheritedChannel/InheritedChannelNotServerSocket.java 8170562 generic-all
|
||||
|
||||
java/rmi/registry/readTest/CodebaseTest.java 8173324 windows-all
|
||||
|
||||
java/rmi/Naming/DefaultRegistryPort.java 8005619 windows-all
|
||||
|
@ -517,7 +517,6 @@ jdk_core_manual_no_input = \
|
||||
java/net/httpclient/BodyProcessorInputStreamTest.java \
|
||||
java/net/httpclient/HttpInputStreamTest.java \
|
||||
java/nio/MappedByteBuffer/PmemTest.java \
|
||||
java/rmi/activation/nonLocalActivation/NonLocalActivationTest.java \
|
||||
java/rmi/registry/nonLocalRegistry/NonLocalRegistryTest.java \
|
||||
java/util/zip/ZipFile/TestZipFile.java \
|
||||
javax/net/ssl/compatibility/AlpnTest.java \
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2001, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2021, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
@ -28,7 +28,6 @@
|
||||
*/
|
||||
import java.rmi.MarshalledObject;
|
||||
import java.rmi.RemoteException;
|
||||
import java.rmi.activation.ActivationException;
|
||||
import java.rmi.server.ServerCloneException;
|
||||
|
||||
public class Chaining {
|
||||
@ -68,9 +67,6 @@ public class Chaining {
|
||||
test(new RemoteException(), null, null);
|
||||
test(new RemoteException(foo), foo, null);
|
||||
test(new RemoteException(foo, t), fooMsg, t);
|
||||
test(new ActivationException(), null, null);
|
||||
test(new ActivationException(foo), foo, null);
|
||||
test(new ActivationException(foo, t), fooMsg, t);
|
||||
test(new ServerCloneException(foo), foo, null);
|
||||
test(new ServerCloneException(foo, t), fooMsg, t);
|
||||
}
|
||||
|
@ -1,32 +0,0 @@
|
||||
/*
|
||||
* Copyright (c) 1999, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
* under the terms of the GNU General Public License version 2 only, as
|
||||
* published by the Free Software Foundation.
|
||||
*
|
||||
* This code is distributed in the hope that it will be useful, but WITHOUT
|
||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
* version 2 for more details (a copy is included in the LICENSE file that
|
||||
* accompanied this code).
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License version
|
||||
* 2 along with this work; if not, write to the Free Software Foundation,
|
||||
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
*
|
||||
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
|
||||
* or visit www.oracle.com if you need additional information or have any
|
||||
* questions.
|
||||
*/
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
import java.rmi.Remote;
|
||||
import java.rmi.RemoteException;
|
||||
interface ActivateMe extends Remote {
|
||||
public void ping() throws RemoteException;
|
||||
public void shutdown() throws Exception;
|
||||
}
|
@ -1,275 +0,0 @@
|
||||
/*
|
||||
* Copyright (c) 1998, 2014, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
* under the terms of the GNU General Public License version 2 only, as
|
||||
* published by the Free Software Foundation.
|
||||
*
|
||||
* This code is distributed in the hope that it will be useful, but WITHOUT
|
||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
* version 2 for more details (a copy is included in the LICENSE file that
|
||||
* accompanied this code).
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License version
|
||||
* 2 along with this work; if not, write to the Free Software Foundation,
|
||||
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
*
|
||||
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
|
||||
* or visit www.oracle.com if you need additional information or have any
|
||||
* questions.
|
||||
*/
|
||||
|
||||
/* @test
|
||||
* @bug 4105080
|
||||
* @summary Activation retry during a remote method call to an activatable
|
||||
* object can cause infinite recursion in some situations. The
|
||||
* RemoteRef contained in the ActivatableRef should never be
|
||||
* an ActivatableRef, but another type.
|
||||
* (Needs /othervm to evade JavaTest security manager --aecolley)
|
||||
* @author Ann Wollrath
|
||||
*
|
||||
* @bug 4164971
|
||||
* @summary allow non-public activatable class and/or constructor
|
||||
* Main test class hasa non-public constructor to ensure
|
||||
* functionality is in place
|
||||
*
|
||||
* @library ../../../testlibrary
|
||||
* @modules java.rmi/sun.rmi.registry
|
||||
* java.rmi/sun.rmi.server:+open
|
||||
* java.rmi/sun.rmi.transport
|
||||
* java.rmi/sun.rmi.transport.tcp
|
||||
* java.base/sun.nio.ch
|
||||
* @build TestLibrary RMID RMIDSelectorProvider ActivateMe CheckActivateRef_Stub
|
||||
* @run main/othervm/policy=security.policy/timeout=240 -Djava.rmi.server.ignoreStubClasses=true CheckActivateRef
|
||||
* @run main/othervm/policy=security.policy/timeout=240 -Djava.rmi.server.ignoreStubClasses=false CheckActivateRef
|
||||
* @key intermittent
|
||||
*/
|
||||
|
||||
import java.io.*;
|
||||
import java.rmi.*;
|
||||
import java.rmi.server.*;
|
||||
import java.rmi.activation.*;
|
||||
import sun.rmi.server.ActivatableRef;
|
||||
import java.lang.reflect.*;
|
||||
import java.util.Properties;
|
||||
|
||||
public class CheckActivateRef
|
||||
extends Activatable
|
||||
implements ActivateMe, Runnable
|
||||
{
|
||||
|
||||
private CheckActivateRef(ActivationID id, MarshalledObject obj)
|
||||
throws ActivationException, RemoteException
|
||||
{
|
||||
super(id, 0);
|
||||
}
|
||||
|
||||
public void ping()
|
||||
{}
|
||||
|
||||
/**
|
||||
* Spawns a thread to deactivate the object.
|
||||
*/
|
||||
public void shutdown() throws Exception
|
||||
{
|
||||
(new Thread(this,"CheckActivateRef")).start();
|
||||
}
|
||||
|
||||
/**
|
||||
* Thread to deactivate object. First attempts to make object
|
||||
* inactive (via the inactive method). If that fails (the
|
||||
* object may still have pending/executing calls), then
|
||||
* unexport the object forcibly.
|
||||
*/
|
||||
public void run() {
|
||||
ActivationLibrary.deactivate(this, getID());
|
||||
}
|
||||
|
||||
public static void main(String[] args) {
|
||||
/*
|
||||
* The following line is required with the JDK 1.2 VM so that the
|
||||
* VM can exit gracefully when this test completes. Otherwise, the
|
||||
* conservative garbage collector will find a handle to the server
|
||||
* object on the native stack and not clear the weak reference to
|
||||
* it in the RMI runtime's object table.
|
||||
*/
|
||||
Object dummy = new Object();
|
||||
RMID rmid = null;
|
||||
ActivateMe obj;
|
||||
|
||||
// test should tolerate certain types of failures
|
||||
int failures = 0;
|
||||
int i = 0;
|
||||
|
||||
System.err.println("\nRegression test for bug 4105080\n");
|
||||
System.err.println("java.security.policy = " +
|
||||
System.getProperty("java.security.policy",
|
||||
"no policy"));
|
||||
|
||||
|
||||
String propValue =
|
||||
System.getProperty("java.rmi.server.useDynamicProxies", "false");
|
||||
boolean useDynamicProxies = Boolean.parseBoolean(propValue);
|
||||
|
||||
CheckActivateRef server;
|
||||
try {
|
||||
TestLibrary.suggestSecurityManager(TestParams.defaultSecurityManager);
|
||||
|
||||
// start an rmid.
|
||||
RMID.removeLog();
|
||||
rmid = RMID.createRMIDOnEphemeralPort();
|
||||
rmid.start();
|
||||
|
||||
/* Cause activation groups to have a security policy that will
|
||||
* allow security managers to be downloaded and installed
|
||||
*/
|
||||
Properties p = new Properties();
|
||||
// this test must always set policies/managers in its
|
||||
// activation groups
|
||||
p.put("java.security.policy",
|
||||
TestParams.defaultGroupPolicy);
|
||||
p.put("java.security.manager",
|
||||
TestParams.defaultSecurityManager);
|
||||
p.put("java.rmi.server.useDynamicProxies", propValue);
|
||||
|
||||
/*
|
||||
* Activate an object by registering its object
|
||||
* descriptor and invoking a method on the
|
||||
* stub returned from the register call.
|
||||
*/
|
||||
System.err.println("Create activation group in this VM");
|
||||
ActivationGroupDesc groupDesc =
|
||||
new ActivationGroupDesc(p, null);
|
||||
ActivationSystem system = ActivationGroup.getSystem();
|
||||
ActivationGroupID groupID = system.registerGroup(groupDesc);
|
||||
ActivationGroup.createGroup(groupID, groupDesc, 0);
|
||||
System.err.println("Creating descriptor");
|
||||
ActivationDesc desc =
|
||||
new ActivationDesc("CheckActivateRef", null, null);
|
||||
System.err.println("Registering descriptor");
|
||||
obj = (ActivateMe) Activatable.register(desc);
|
||||
|
||||
System.err.println("proxy = " + obj);
|
||||
|
||||
if (useDynamicProxies && !Proxy.isProxyClass(obj.getClass()))
|
||||
{
|
||||
throw new RuntimeException("proxy is not dynamic proxy");
|
||||
}
|
||||
|
||||
/*
|
||||
* Loop a bunch of times to force activator to
|
||||
* spawn VMs (groups)
|
||||
*/
|
||||
try {
|
||||
for (; i < 7; i++) {
|
||||
|
||||
System.err.println("Activate object via method call");
|
||||
|
||||
/*
|
||||
* Fix for 4277196: if we got an inactive group
|
||||
* exception, it is likely that we accidentally
|
||||
* invoked a method on an old activation
|
||||
* group. Give some time for the group to go away
|
||||
* and then retry the activation.
|
||||
*/
|
||||
try {
|
||||
obj.ping();
|
||||
} catch (RemoteException e) {
|
||||
Exception detail = (Exception) e.detail;
|
||||
if ((detail != null) &&
|
||||
(detail instanceof ActivationException) &&
|
||||
(detail.getMessage().equals("group is inactive")))
|
||||
{
|
||||
try {
|
||||
Thread.sleep(5000);
|
||||
} catch (InterruptedException ex) {
|
||||
}
|
||||
obj.ping();
|
||||
|
||||
} else {
|
||||
throw e;
|
||||
}
|
||||
}
|
||||
|
||||
System.err.println("proxy = " + obj);
|
||||
|
||||
/*
|
||||
* Now that object is activated, check to make sure that
|
||||
* the RemoteRef inside the stub's ActivatableRef
|
||||
* is *not* an ActivatableRef.
|
||||
*/
|
||||
ActivatableRef aref;
|
||||
if (obj instanceof RemoteStub) {
|
||||
aref = (ActivatableRef) ((RemoteObject) obj).getRef();
|
||||
} else if (Proxy.isProxyClass(obj.getClass())) {
|
||||
RemoteObjectInvocationHandler handler =
|
||||
(RemoteObjectInvocationHandler)
|
||||
Proxy.getInvocationHandler(obj);
|
||||
aref = (ActivatableRef) handler.getRef();
|
||||
} else {
|
||||
throw new RuntimeException("unknown proxy type");
|
||||
}
|
||||
|
||||
final ActivatableRef ref = aref;
|
||||
Field f = (Field)
|
||||
java.security.AccessController.doPrivileged
|
||||
(new java.security.PrivilegedExceptionAction() {
|
||||
public Object run() throws Exception {
|
||||
Field ff = ref.getClass().getDeclaredField("ref");
|
||||
ff.setAccessible(true);
|
||||
return ff;
|
||||
}
|
||||
});
|
||||
Object insideRef = f.get(ref);
|
||||
System.err.println("insideRef = " + insideRef);
|
||||
if (insideRef instanceof ActivatableRef) {
|
||||
TestLibrary.bomb("Embedded ref is an ActivatableRef");
|
||||
} else {
|
||||
System.err.println("ActivatableRef's embedded ref type: " +
|
||||
insideRef.getClass().getName());
|
||||
}
|
||||
|
||||
/*
|
||||
* Clean up object too.
|
||||
*/
|
||||
System.err.println("Deactivate object via method call");
|
||||
obj.shutdown();
|
||||
|
||||
try {
|
||||
// give activation group time to go away
|
||||
Thread.sleep(3000);
|
||||
} catch (InterruptedException e) {
|
||||
}
|
||||
}
|
||||
} catch (java.rmi.UnmarshalException ue) {
|
||||
// account for test's activation race condition
|
||||
if (ue.detail instanceof java.io.IOException) {
|
||||
if ((failures ++) >= 3) {
|
||||
throw ue;
|
||||
}
|
||||
} else {
|
||||
throw ue;
|
||||
}
|
||||
}
|
||||
|
||||
System.err.println("\nsuccess: CheckActivateRef test passed ");
|
||||
|
||||
} catch (java.rmi.activation.ActivationException e) {
|
||||
// test only needs to pass 3 times in 7
|
||||
if (i < 4) {
|
||||
TestLibrary.bomb(e);
|
||||
}
|
||||
} catch (Exception e) {
|
||||
if (e instanceof java.security.PrivilegedActionException)
|
||||
e = ((java.security.PrivilegedActionException)e).getException();
|
||||
TestLibrary.bomb("\nfailure: unexpected exception " +
|
||||
e.getClass().getName(), e);
|
||||
|
||||
} finally {
|
||||
rmid.cleanup();
|
||||
obj = null;
|
||||
}
|
||||
}
|
||||
}
|
@ -1,104 +0,0 @@
|
||||
/*
|
||||
* Copyright (c) 1998, 1999, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
* under the terms of the GNU General Public License version 2 only, as
|
||||
* published by the Free Software Foundation.
|
||||
*
|
||||
* This code is distributed in the hope that it will be useful, but WITHOUT
|
||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
* version 2 for more details (a copy is included in the LICENSE file that
|
||||
* accompanied this code).
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License version
|
||||
* 2 along with this work; if not, write to the Free Software Foundation,
|
||||
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
*
|
||||
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
|
||||
* or visit www.oracle.com if you need additional information or have any
|
||||
* questions.
|
||||
*/
|
||||
|
||||
// Stub class generated by rmic, do not edit.
|
||||
// Contents subject to change without notice.
|
||||
|
||||
public final class CheckActivateRef_Stub
|
||||
extends java.rmi.server.RemoteStub
|
||||
implements ActivateMe, java.rmi.Remote
|
||||
{
|
||||
private static final java.rmi.server.Operation[] operations = {
|
||||
new java.rmi.server.Operation("void ping()"),
|
||||
new java.rmi.server.Operation("void shutdown()")
|
||||
};
|
||||
|
||||
private static final long interfaceHash = 10333549859256328L;
|
||||
|
||||
private static final long serialVersionUID = 2;
|
||||
|
||||
private static boolean useNewInvoke;
|
||||
private static java.lang.reflect.Method $method_ping_0;
|
||||
private static java.lang.reflect.Method $method_shutdown_1;
|
||||
|
||||
static {
|
||||
try {
|
||||
java.rmi.server.RemoteRef.class.getMethod("invoke",
|
||||
new java.lang.Class[] {
|
||||
java.rmi.Remote.class,
|
||||
java.lang.reflect.Method.class,
|
||||
java.lang.Object[].class,
|
||||
long.class
|
||||
});
|
||||
useNewInvoke = true;
|
||||
$method_ping_0 = ActivateMe.class.getMethod("ping", new java.lang.Class[] {});
|
||||
$method_shutdown_1 = ActivateMe.class.getMethod("shutdown", new java.lang.Class[] {});
|
||||
} catch (java.lang.NoSuchMethodException e) {
|
||||
useNewInvoke = false;
|
||||
}
|
||||
}
|
||||
|
||||
// constructors
|
||||
public CheckActivateRef_Stub() {
|
||||
super();
|
||||
}
|
||||
public CheckActivateRef_Stub(java.rmi.server.RemoteRef ref) {
|
||||
super(ref);
|
||||
}
|
||||
|
||||
// methods from remote interfaces
|
||||
|
||||
// implementation of ping()
|
||||
public void ping()
|
||||
throws java.rmi.RemoteException
|
||||
{
|
||||
try {
|
||||
if (useNewInvoke) {
|
||||
ref.invoke(this, $method_ping_0, null, 5866401369815527589L);
|
||||
} else {
|
||||
java.rmi.server.RemoteCall call = ref.newCall((java.rmi.server.RemoteObject) this, operations, 0, interfaceHash);
|
||||
ref.invoke(call);
|
||||
ref.done(call);
|
||||
}
|
||||
} catch (java.lang.RuntimeException e) {
|
||||
throw e;
|
||||
} catch (java.rmi.RemoteException e) {
|
||||
throw e;
|
||||
} catch (java.lang.Exception e) {
|
||||
throw new java.rmi.UnexpectedException("undeclared checked exception", e);
|
||||
}
|
||||
}
|
||||
|
||||
// implementation of shutdown()
|
||||
public void shutdown()
|
||||
throws java.lang.Exception
|
||||
{
|
||||
if (useNewInvoke) {
|
||||
ref.invoke(this, $method_shutdown_1, null, -7207851917985848402L);
|
||||
} else {
|
||||
java.rmi.server.RemoteCall call = ref.newCall((java.rmi.server.RemoteObject) this, operations, 1, interfaceHash);
|
||||
ref.invoke(call);
|
||||
ref.done(call);
|
||||
}
|
||||
}
|
||||
}
|
@ -1,11 +0,0 @@
|
||||
/*
|
||||
* security policy used by activation groups
|
||||
*/
|
||||
|
||||
grant {
|
||||
permission java.io.FilePermission "..${/}..${/}test.props", "read";
|
||||
permission java.net.SocketPermission "*:1024-", "connect,accept,listen";
|
||||
permission java.util.PropertyPermission "test.*", "read";
|
||||
|
||||
permission java.lang.RuntimePermission "getClassLoader";
|
||||
};
|
@ -1,9 +0,0 @@
|
||||
grant {
|
||||
permission com.sun.rmi.rmid.ExecOptionPermission "-Djava.security.manager=default";
|
||||
permission com.sun.rmi.rmid.ExecOptionPermission "-Djava.security.policy=*";
|
||||
permission com.sun.rmi.rmid.ExecOptionPermission "-Djava.rmi.server.useDynamicProxies=*";
|
||||
permission java.lang.RuntimePermission "selectorProvider";
|
||||
permission java.lang.RuntimePermission "accessClassInPackage.sun.nio.ch";
|
||||
permission java.util.PropertyPermission "test.java.rmi.testlibrary.RMIDSelectorProvider.port", "read";
|
||||
permission java.util.PropertyPermission "test.java.rmi.testlibrary.RMIDSelectorProvider.timeout", "read";
|
||||
};
|
@ -1,43 +0,0 @@
|
||||
/*
|
||||
* security policy used by the test process
|
||||
*/
|
||||
|
||||
grant {
|
||||
// test explicitly acccesses sun.rmi.server.ActivatableRef
|
||||
permission java.lang.RuntimePermission "accessClassInPackage.sun.rmi.server";
|
||||
|
||||
// ref to make sure that internal ref is a UnicastRef
|
||||
permission java.lang.RuntimePermission "accessDeclaredMembers";
|
||||
permission java.lang.reflect.ReflectPermission "suppressAccessChecks";
|
||||
|
||||
// standard test activation permissions
|
||||
permission java.io.FilePermission "..${/}..${/}test.props", "read";
|
||||
|
||||
// test needs to cleanup rmid's log.
|
||||
permission java.io.FilePermission ".${/}log", "read,write,delete";
|
||||
permission java.io.FilePermission ".${/}log${/}-", "read,write,delete";
|
||||
|
||||
// test needs to use java to exec an rmid
|
||||
permission java.io.FilePermission "${java.home}${/}bin${/}java", "execute";
|
||||
|
||||
// test rmid uses these properties to propagate security values to rmid
|
||||
permission java.util.PropertyPermission "java.rmi.server.useDynamicProxies", "read";
|
||||
permission java.util.PropertyPermission "java.security.policy", "read";
|
||||
permission java.util.PropertyPermission "java.security.manager", "read";
|
||||
|
||||
// used by TestLibrary to determine test environment
|
||||
permission java.util.PropertyPermission "test.*", "read";
|
||||
permission java.util.PropertyPermission "user.dir", "read";
|
||||
permission java.util.PropertyPermission "java.home", "read";
|
||||
permission java.util.PropertyPermission "java.rmi.activation.port", "write";
|
||||
|
||||
// Needed to create an activation group
|
||||
permission java.lang.RuntimePermission "setFactory";
|
||||
|
||||
// allow exporting of remote objects on an arbitrary port.
|
||||
permission java.net.SocketPermission "*:1024-", "connect,accept,listen";
|
||||
|
||||
permission java.lang.RuntimePermission "getClassLoader";
|
||||
permission java.lang.RuntimePermission "selectorProvider";
|
||||
permission java.lang.RuntimePermission "accessClassInPackage.sun.nio.ch";
|
||||
};
|
@ -1,280 +0,0 @@
|
||||
/*
|
||||
* Copyright (c) 1998, 2016, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
* under the terms of the GNU General Public License version 2 only, as
|
||||
* published by the Free Software Foundation.
|
||||
*
|
||||
* This code is distributed in the hope that it will be useful, but WITHOUT
|
||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
* version 2 for more details (a copy is included in the LICENSE file that
|
||||
* accompanied this code).
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License version
|
||||
* 2 along with this work; if not, write to the Free Software Foundation,
|
||||
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
*
|
||||
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
|
||||
* or visit www.oracle.com if you need additional information or have any
|
||||
* questions.
|
||||
*/
|
||||
|
||||
/* @test
|
||||
* @bug 4109103
|
||||
* @summary rmid should annotate child process output
|
||||
*
|
||||
* @author Laird Dornin; code borrowed from Ann Wollrath
|
||||
*
|
||||
* @library ../../../testlibrary
|
||||
* @modules java.rmi/sun.rmi.registry
|
||||
* java.rmi/sun.rmi.server
|
||||
* java.rmi/sun.rmi.transport
|
||||
* java.rmi/sun.rmi.transport.tcp
|
||||
* java.base/sun.nio.ch
|
||||
* @build TestLibrary RMID RMIDSelectorProvider MyRMI CheckAnnotations_Stub
|
||||
* @run main/othervm/policy=security.policy/timeout=480 CheckAnnotations
|
||||
*/
|
||||
|
||||
import java.io.*;
|
||||
import java.rmi.*;
|
||||
import java.rmi.server.*;
|
||||
import java.rmi.activation.*;
|
||||
import java.security.CodeSource;
|
||||
import java.util.Properties;
|
||||
import java.util.StringTokenizer;
|
||||
|
||||
|
||||
public class CheckAnnotations
|
||||
extends Activatable implements MyRMI, Runnable
|
||||
{
|
||||
private static final double TIME_FACTOR = TestLibrary.getTimeoutFactor();
|
||||
|
||||
private static Object dummy = new Object();
|
||||
private static MyRMI myRMI = null;
|
||||
|
||||
// buffers to store rmid output.
|
||||
private static ByteArrayOutputStream rmidOut = new ByteArrayOutputStream();
|
||||
private static ByteArrayOutputStream rmidErr = new ByteArrayOutputStream();
|
||||
|
||||
public static void main(String args[]) {
|
||||
/*
|
||||
* The following line is required with the JDK 1.2 VM so that the
|
||||
* VM can exit gracefully when this test completes. Otherwise, the
|
||||
* conservative garbage collector will find a handle to the server
|
||||
* object on the native stack and not clear the weak reference to
|
||||
* it in the RMI runtime's object table.
|
||||
*/
|
||||
Object dummy1 = new Object();
|
||||
RMID rmid = null;
|
||||
|
||||
System.err.println("\nRegression test for bug/rfe 4109103\n");
|
||||
|
||||
try {
|
||||
|
||||
// Set security manager according to the
|
||||
// testlibrary.
|
||||
TestLibrary.suggestSecurityManager(TestParams.defaultSecurityManager);
|
||||
|
||||
// start an rmid.
|
||||
RMID.removeLog();
|
||||
rmid = RMID.createRMIDOnEphemeralPort(rmidOut, rmidErr, false);
|
||||
rmid.start();
|
||||
|
||||
/* Cause activation groups to have a security policy that will
|
||||
* allow security managers to be downloaded and installed
|
||||
*/
|
||||
Properties p = new Properties();
|
||||
// this test must always set policies/managers in its
|
||||
// activation groups
|
||||
p.put("java.security.policy",
|
||||
TestParams.defaultGroupPolicy);
|
||||
p.put("java.security.manager",
|
||||
TestParams.defaultSecurityManager);
|
||||
|
||||
/* new desc - we will reuse in order to get multiple vms.*/
|
||||
System.err.println("Create activation group in this VM");
|
||||
ActivationGroupDesc groupDesc =
|
||||
new ActivationGroupDesc(p, null);
|
||||
ActivationSystem system = ActivationGroup.getSystem();
|
||||
ActivationGroupID groupID = system.registerGroup(groupDesc);
|
||||
ActivationGroup.createGroup(groupID, groupDesc, 0);
|
||||
|
||||
ActivationDesc desc = new ActivationDesc
|
||||
("CheckAnnotations", null, null);
|
||||
myRMI = (MyRMI) Activatable.register(desc);
|
||||
|
||||
/* The test-
|
||||
* Loop a bunch of times to force activator to
|
||||
* spawn VMs (groups)
|
||||
*/
|
||||
for (int i = 0; i < 3; i++) {
|
||||
|
||||
// object activated in annotation check via method call
|
||||
checkAnnotations(i-1);
|
||||
|
||||
/*
|
||||
* Clean up object too.
|
||||
*/
|
||||
System.err.println
|
||||
("Deactivate object via method call");
|
||||
myRMI.shutdown();
|
||||
}
|
||||
System.err.println
|
||||
("\nsuccess: CheckAnnotations test passed ");
|
||||
|
||||
} catch (Exception e) {
|
||||
TestLibrary.bomb("\nfailure: unexpected exception ", e);
|
||||
} finally {
|
||||
try {
|
||||
Thread.sleep(4000);
|
||||
} catch (InterruptedException e) {
|
||||
}
|
||||
|
||||
myRMI = null;
|
||||
System.err.println("rmid shut down");
|
||||
rmid.cleanup();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* check to make sure that the output from a spawned vm is
|
||||
* formatted/annotated properly.
|
||||
*/
|
||||
public static void checkAnnotations(int iteration)
|
||||
throws IOException
|
||||
{
|
||||
try {
|
||||
Thread.sleep((long)(5000 * TIME_FACTOR));
|
||||
} catch(Exception e) {
|
||||
System.err.println(e.getMessage());
|
||||
}
|
||||
|
||||
final String FAIL_MSG = "Test failed: output improperly annotated.";
|
||||
final String OUT = "outABC";
|
||||
final String ERR = "errXYZ";
|
||||
/**
|
||||
* cause the spawned vm to generate output that will
|
||||
* be checked for proper annotation. printOut is
|
||||
* actually being called on an activated implementation.
|
||||
*/
|
||||
myRMI.printOut(OUT + iteration);
|
||||
myRMI.printErr(ERR + iteration);
|
||||
myRMI.printOut(OUT + iteration);
|
||||
myRMI.printErr(ERR + iteration);
|
||||
|
||||
/* we have to wait for output to filter down
|
||||
* from children so we can read it before we
|
||||
* kill rmid.
|
||||
*/
|
||||
|
||||
String outString = null;
|
||||
String errString = null;
|
||||
|
||||
for (int i = 0 ; i < 5 ; i ++ ) {
|
||||
// have to give output from rmid time to trickle down to
|
||||
// this process
|
||||
try {
|
||||
Thread.sleep((long)(4000 * TIME_FACTOR));
|
||||
} catch(InterruptedException e) {
|
||||
}
|
||||
|
||||
outString = rmidOut.toString();
|
||||
errString = rmidErr.toString();
|
||||
|
||||
if ((!outString.equals("")) &&
|
||||
(!errString.equals("")))
|
||||
{
|
||||
System.err.println("obtained annotations");
|
||||
break;
|
||||
}
|
||||
System.err.println("rmid output not yet received, retrying...");
|
||||
}
|
||||
|
||||
rmidOut.reset();
|
||||
rmidErr.reset();
|
||||
|
||||
// only test when we are annotating..., first run does not annotate
|
||||
if (iteration >= 0) {
|
||||
System.err.println("Checking annotations...");
|
||||
System.err.println(outString);
|
||||
System.err.println(errString);
|
||||
|
||||
StringTokenizer stOut = new StringTokenizer(outString, ":");
|
||||
StringTokenizer stErr = new StringTokenizer(errString, ":");
|
||||
|
||||
String execErr = null;
|
||||
String execOut = null;
|
||||
String destOut = null;
|
||||
String destErr = null;
|
||||
String outTmp = null;
|
||||
String errTmp = null;
|
||||
|
||||
while (stOut.hasMoreTokens()) {
|
||||
execOut = outTmp;
|
||||
outTmp = destOut;
|
||||
destOut = stOut.nextToken();
|
||||
}
|
||||
while (stErr.hasMoreTokens()) {
|
||||
execErr = errTmp;
|
||||
errTmp = destErr;
|
||||
destErr = stErr.nextToken();
|
||||
}
|
||||
|
||||
if ((execErr == null)||(errTmp == null)||
|
||||
(destErr == null)) {
|
||||
TestLibrary.bomb(FAIL_MSG);
|
||||
}
|
||||
if ((execOut == null)||(outTmp == null)||
|
||||
(destOut == null)) {
|
||||
TestLibrary.bomb(FAIL_MSG);
|
||||
}
|
||||
|
||||
|
||||
// just make sure that last two strings are what we expect.
|
||||
if (!execOut.equals("ExecGroup-" + iteration)
|
||||
|| !(new String(destOut.substring(0,OUT.length()+1)).equals(OUT +
|
||||
iteration))
|
||||
|| !(execErr.equals("ExecGroup-"+iteration))
|
||||
|| !(new String(destErr.substring(0,ERR.length()+1)).equals(ERR +
|
||||
iteration)) ) {
|
||||
TestLibrary.bomb(FAIL_MSG);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// implementation of MyRMI, make this object activatable.
|
||||
public CheckAnnotations
|
||||
(ActivationID id, MarshalledObject mo)
|
||||
throws RemoteException {
|
||||
|
||||
// register/export anonymously
|
||||
super(id,0);
|
||||
}
|
||||
|
||||
public void printOut(String toPrint) {
|
||||
System.out.println(toPrint);
|
||||
}
|
||||
|
||||
public void printErr(String toPrint) {
|
||||
System.err.println(toPrint);
|
||||
}
|
||||
|
||||
/**
|
||||
* Spawns a thread to deactivate the object.
|
||||
*/
|
||||
public void shutdown() throws Exception {
|
||||
(new Thread(this,"CheckAnnotations")).start();
|
||||
}
|
||||
|
||||
/**
|
||||
* Thread to deactivate object. First attempts to make object
|
||||
* inactive (via the inactive method). If that fails (the
|
||||
* object may still have pending/executing calls), then
|
||||
* unexport the object forcibly.
|
||||
*/
|
||||
public void run() {
|
||||
ActivationLibrary.deactivate(this, getID());
|
||||
}
|
||||
}
|
@ -1,140 +0,0 @@
|
||||
/*
|
||||
* Copyright (c) 1998, 1999, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
* under the terms of the GNU General Public License version 2 only, as
|
||||
* published by the Free Software Foundation.
|
||||
*
|
||||
* This code is distributed in the hope that it will be useful, but WITHOUT
|
||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
* version 2 for more details (a copy is included in the LICENSE file that
|
||||
* accompanied this code).
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License version
|
||||
* 2 along with this work; if not, write to the Free Software Foundation,
|
||||
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
*
|
||||
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
|
||||
* or visit www.oracle.com if you need additional information or have any
|
||||
* questions.
|
||||
*/
|
||||
|
||||
// Stub class generated by rmic, do not edit.
|
||||
// Contents subject to change without notice.
|
||||
|
||||
public final class CheckAnnotations_Stub
|
||||
extends java.rmi.server.RemoteStub
|
||||
implements MyRMI, java.rmi.Remote
|
||||
{
|
||||
private static final java.rmi.server.Operation[] operations = {
|
||||
new java.rmi.server.Operation("void printErr(java.lang.String)"),
|
||||
new java.rmi.server.Operation("void printOut(java.lang.String)"),
|
||||
new java.rmi.server.Operation("void shutdown()")
|
||||
};
|
||||
|
||||
private static final long interfaceHash = -3955951123118841923L;
|
||||
|
||||
private static final long serialVersionUID = 2;
|
||||
|
||||
private static boolean useNewInvoke;
|
||||
private static java.lang.reflect.Method $method_printErr_0;
|
||||
private static java.lang.reflect.Method $method_printOut_1;
|
||||
private static java.lang.reflect.Method $method_shutdown_2;
|
||||
|
||||
static {
|
||||
try {
|
||||
java.rmi.server.RemoteRef.class.getMethod("invoke",
|
||||
new java.lang.Class[] {
|
||||
java.rmi.Remote.class,
|
||||
java.lang.reflect.Method.class,
|
||||
java.lang.Object[].class,
|
||||
long.class
|
||||
});
|
||||
useNewInvoke = true;
|
||||
$method_printErr_0 = MyRMI.class.getMethod("printErr", new java.lang.Class[] {java.lang.String.class});
|
||||
$method_printOut_1 = MyRMI.class.getMethod("printOut", new java.lang.Class[] {java.lang.String.class});
|
||||
$method_shutdown_2 = MyRMI.class.getMethod("shutdown", new java.lang.Class[] {});
|
||||
} catch (java.lang.NoSuchMethodException e) {
|
||||
useNewInvoke = false;
|
||||
}
|
||||
}
|
||||
|
||||
// constructors
|
||||
public CheckAnnotations_Stub() {
|
||||
super();
|
||||
}
|
||||
public CheckAnnotations_Stub(java.rmi.server.RemoteRef ref) {
|
||||
super(ref);
|
||||
}
|
||||
|
||||
// methods from remote interfaces
|
||||
|
||||
// implementation of printErr(String)
|
||||
public void printErr(java.lang.String $param_String_1)
|
||||
throws java.rmi.RemoteException
|
||||
{
|
||||
try {
|
||||
if (useNewInvoke) {
|
||||
ref.invoke(this, $method_printErr_0, new java.lang.Object[] {$param_String_1}, 1120261287704800747L);
|
||||
} else {
|
||||
java.rmi.server.RemoteCall call = ref.newCall((java.rmi.server.RemoteObject) this, operations, 0, interfaceHash);
|
||||
try {
|
||||
java.io.ObjectOutput out = call.getOutputStream();
|
||||
out.writeObject($param_String_1);
|
||||
} catch (java.io.IOException e) {
|
||||
throw new java.rmi.MarshalException("error marshalling arguments", e);
|
||||
}
|
||||
ref.invoke(call);
|
||||
ref.done(call);
|
||||
}
|
||||
} catch (java.lang.RuntimeException e) {
|
||||
throw e;
|
||||
} catch (java.rmi.RemoteException e) {
|
||||
throw e;
|
||||
} catch (java.lang.Exception e) {
|
||||
throw new java.rmi.UnexpectedException("undeclared checked exception", e);
|
||||
}
|
||||
}
|
||||
|
||||
// implementation of printOut(String)
|
||||
public void printOut(java.lang.String $param_String_1)
|
||||
throws java.rmi.RemoteException
|
||||
{
|
||||
try {
|
||||
if (useNewInvoke) {
|
||||
ref.invoke(this, $method_printOut_1, new java.lang.Object[] {$param_String_1}, -7517735248176918178L);
|
||||
} else {
|
||||
java.rmi.server.RemoteCall call = ref.newCall((java.rmi.server.RemoteObject) this, operations, 1, interfaceHash);
|
||||
try {
|
||||
java.io.ObjectOutput out = call.getOutputStream();
|
||||
out.writeObject($param_String_1);
|
||||
} catch (java.io.IOException e) {
|
||||
throw new java.rmi.MarshalException("error marshalling arguments", e);
|
||||
}
|
||||
ref.invoke(call);
|
||||
ref.done(call);
|
||||
}
|
||||
} catch (java.lang.RuntimeException e) {
|
||||
throw e;
|
||||
} catch (java.rmi.RemoteException e) {
|
||||
throw e;
|
||||
} catch (java.lang.Exception e) {
|
||||
throw new java.rmi.UnexpectedException("undeclared checked exception", e);
|
||||
}
|
||||
}
|
||||
|
||||
// implementation of shutdown()
|
||||
public void shutdown()
|
||||
throws java.lang.Exception
|
||||
{
|
||||
if (useNewInvoke) {
|
||||
ref.invoke(this, $method_shutdown_2, null, -7207851917985848402L);
|
||||
} else {
|
||||
java.rmi.server.RemoteCall call = ref.newCall((java.rmi.server.RemoteObject) this, operations, 2, interfaceHash);
|
||||
ref.invoke(call);
|
||||
ref.done(call);
|
||||
}
|
||||
}
|
||||
}
|
@ -1,33 +0,0 @@
|
||||
/*
|
||||
* Copyright (c) 1999, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
* under the terms of the GNU General Public License version 2 only, as
|
||||
* published by the Free Software Foundation.
|
||||
*
|
||||
* This code is distributed in the hope that it will be useful, but WITHOUT
|
||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
* version 2 for more details (a copy is included in the LICENSE file that
|
||||
* accompanied this code).
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License version
|
||||
* 2 along with this work; if not, write to the Free Software Foundation,
|
||||
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
*
|
||||
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
|
||||
* or visit www.oracle.com if you need additional information or have any
|
||||
* questions.
|
||||
*/
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
import java.rmi.Remote;
|
||||
import java.rmi.RemoteException;
|
||||
interface MyRMI extends java.rmi.Remote {
|
||||
public void printOut(String toPrint) throws RemoteException;
|
||||
public void printErr(String toPrint) throws RemoteException;
|
||||
public void shutdown() throws Exception;
|
||||
}
|
@ -1,9 +0,0 @@
|
||||
/*
|
||||
* security policy used by activation groups
|
||||
*/
|
||||
|
||||
grant {
|
||||
permission java.io.FilePermission "..${/}..${/}test.props", "read";
|
||||
permission java.net.SocketPermission "*:1024-", "connect,accept,listen";
|
||||
permission java.util.PropertyPermission "test.*", "read";
|
||||
};
|
@ -1,8 +0,0 @@
|
||||
grant {
|
||||
permission com.sun.rmi.rmid.ExecOptionPermission "-Djava.security.manager=default";
|
||||
permission com.sun.rmi.rmid.ExecOptionPermission "-Djava.security.policy=*";
|
||||
permission java.lang.RuntimePermission "selectorProvider";
|
||||
permission java.lang.RuntimePermission "accessClassInPackage.sun.nio.ch";
|
||||
permission java.util.PropertyPermission "test.java.rmi.testlibrary.RMIDSelectorProvider.port", "read";
|
||||
permission java.util.PropertyPermission "test.java.rmi.testlibrary.RMIDSelectorProvider.timeout", "read";
|
||||
};
|
@ -1,34 +0,0 @@
|
||||
/*
|
||||
* security policy used by the test process
|
||||
*/
|
||||
|
||||
grant {
|
||||
// standard test activation permissions
|
||||
permission java.io.FilePermission "..${/}..${/}test.props", "read";
|
||||
|
||||
// test needs to cleanup rmid's log.
|
||||
permission java.io.FilePermission ".${/}log", "read,write,delete";
|
||||
permission java.io.FilePermission ".${/}log${/}-", "read,write,delete";
|
||||
|
||||
// test needs to use java to exec an rmid
|
||||
permission java.io.FilePermission "${java.home}${/}bin${/}java", "execute";
|
||||
|
||||
// test uses these permissions to propagate security values to rmid
|
||||
permission java.util.PropertyPermission "java.security.policy", "read";
|
||||
permission java.util.PropertyPermission "java.security.manager", "read";
|
||||
|
||||
// used by TestLibrary to determine test environment
|
||||
permission java.util.PropertyPermission "test.*", "read";
|
||||
permission java.util.PropertyPermission "user.dir", "read";
|
||||
permission java.util.PropertyPermission "java.home", "read";
|
||||
permission java.util.PropertyPermission "java.rmi.activation.port", "write";
|
||||
|
||||
// required for test to create an ActivationGroup
|
||||
permission java.lang.RuntimePermission "setFactory";
|
||||
|
||||
// test needs to export rmid and communicate with objects on arbitrary ports
|
||||
permission java.net.SocketPermission "*:1024-", "connect,accept,listen";
|
||||
|
||||
permission java.lang.RuntimePermission "selectorProvider";
|
||||
permission java.lang.RuntimePermission "accessClassInPackage.sun.nio.ch";
|
||||
};
|
@ -1,64 +0,0 @@
|
||||
/*
|
||||
* Copyright (c) 2000, 2001, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
* under the terms of the GNU General Public License version 2 only, as
|
||||
* published by the Free Software Foundation.
|
||||
*
|
||||
* This code is distributed in the hope that it will be useful, but WITHOUT
|
||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
* version 2 for more details (a copy is included in the LICENSE file that
|
||||
* accompanied this code).
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License version
|
||||
* 2 along with this work; if not, write to the Free Software Foundation,
|
||||
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
*
|
||||
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
|
||||
* or visit www.oracle.com if you need additional information or have any
|
||||
* questions.
|
||||
*/
|
||||
|
||||
/*
|
||||
*
|
||||
*/
|
||||
|
||||
import java.rmi.activation.Activatable;
|
||||
import java.rmi.RemoteException;
|
||||
import java.rmi.activation.ActivationID;
|
||||
import java.rmi.MarshalledObject;
|
||||
import java.net.URL;
|
||||
|
||||
public class ActivatableImpl extends Activatable implements MyRMI {
|
||||
|
||||
private boolean classLoaderOk = false;
|
||||
|
||||
public ActivatableImpl(ActivationID id, MarshalledObject mobj)
|
||||
throws RemoteException
|
||||
{
|
||||
super(id, 0);
|
||||
|
||||
ClassLoader thisLoader = ActivatableImpl.class.getClassLoader();
|
||||
ClassLoader ccl = Thread.currentThread().getContextClassLoader();
|
||||
|
||||
System.err.println("implLoader: " + thisLoader);
|
||||
System.err.println("ccl: " + ccl);
|
||||
|
||||
/*
|
||||
* the context class loader is the ccl from when this object
|
||||
* was exported. If the bug has been fixed, the ccl will be
|
||||
* the same as the class loader of this class.
|
||||
*/
|
||||
classLoaderOk = (thisLoader == ccl);
|
||||
}
|
||||
|
||||
public boolean classLoaderOk() throws RemoteException {
|
||||
return classLoaderOk;
|
||||
}
|
||||
|
||||
public void shutdown() throws Exception {
|
||||
ActivationLibrary.deactivate(this, getID());
|
||||
}
|
||||
}
|
@ -1,75 +0,0 @@
|
||||
/*
|
||||
* Copyright (c) 2000, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
* under the terms of the GNU General Public License version 2 only, as
|
||||
* published by the Free Software Foundation.
|
||||
*
|
||||
* This code is distributed in the hope that it will be useful, but WITHOUT
|
||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
* version 2 for more details (a copy is included in the LICENSE file that
|
||||
* accompanied this code).
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License version
|
||||
* 2 along with this work; if not, write to the Free Software Foundation,
|
||||
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
*
|
||||
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
|
||||
* or visit www.oracle.com if you need additional information or have any
|
||||
* questions.
|
||||
*/
|
||||
|
||||
// Stub class generated by rmic, do not edit.
|
||||
// Contents subject to change without notice.
|
||||
|
||||
public final class ActivatableImpl_Stub
|
||||
extends java.rmi.server.RemoteStub
|
||||
implements MyRMI, java.rmi.Remote
|
||||
{
|
||||
private static final long serialVersionUID = 2;
|
||||
|
||||
private static java.lang.reflect.Method $method_classLoaderOk_0;
|
||||
private static java.lang.reflect.Method $method_shutdown_1;
|
||||
|
||||
static {
|
||||
try {
|
||||
$method_classLoaderOk_0 = MyRMI.class.getMethod("classLoaderOk", new java.lang.Class[] {});
|
||||
$method_shutdown_1 = MyRMI.class.getMethod("shutdown", new java.lang.Class[] {});
|
||||
} catch (java.lang.NoSuchMethodException e) {
|
||||
throw new java.lang.NoSuchMethodError(
|
||||
"stub class initialization failed");
|
||||
}
|
||||
}
|
||||
|
||||
// constructors
|
||||
public ActivatableImpl_Stub(java.rmi.server.RemoteRef ref) {
|
||||
super(ref);
|
||||
}
|
||||
|
||||
// methods from remote interfaces
|
||||
|
||||
// implementation of classLoaderOk()
|
||||
public boolean classLoaderOk()
|
||||
throws java.rmi.RemoteException
|
||||
{
|
||||
try {
|
||||
Object $result = ref.invoke(this, $method_classLoaderOk_0, null, 5226188865994330896L);
|
||||
return ((java.lang.Boolean) $result).booleanValue();
|
||||
} catch (java.lang.RuntimeException e) {
|
||||
throw e;
|
||||
} catch (java.rmi.RemoteException e) {
|
||||
throw e;
|
||||
} catch (java.lang.Exception e) {
|
||||
throw new java.rmi.UnexpectedException("undeclared checked exception", e);
|
||||
}
|
||||
}
|
||||
|
||||
// implementation of shutdown()
|
||||
public void shutdown()
|
||||
throws java.lang.Exception
|
||||
{
|
||||
ref.invoke(this, $method_shutdown_1, null, -7207851917985848402L);
|
||||
}
|
||||
}
|
@ -1,124 +0,0 @@
|
||||
/*
|
||||
* Copyright (c) 2000, 2014, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
* under the terms of the GNU General Public License version 2 only, as
|
||||
* published by the Free Software Foundation.
|
||||
*
|
||||
* This code is distributed in the hope that it will be useful, but WITHOUT
|
||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
* version 2 for more details (a copy is included in the LICENSE file that
|
||||
* accompanied this code).
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License version
|
||||
* 2 along with this work; if not, write to the Free Software Foundation,
|
||||
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
*
|
||||
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
|
||||
* or visit www.oracle.com if you need additional information or have any
|
||||
* questions.
|
||||
*/
|
||||
|
||||
/* @test
|
||||
* @bug 4289544
|
||||
* @summary ActivationGroupImpl.newInstance does not set context classloader for impl
|
||||
* @author Laird Dornin; code borrowed from Ann Wollrath
|
||||
*
|
||||
* @library ../../../testlibrary
|
||||
* @modules java.rmi/sun.rmi.registry
|
||||
* java.rmi/sun.rmi.server
|
||||
* java.rmi/sun.rmi.transport
|
||||
* java.rmi/sun.rmi.transport.tcp
|
||||
* java.base/sun.nio.ch
|
||||
* @build TestLibrary RMID RMIDSelectorProvider
|
||||
* MyRMI ActivatableImpl ActivatableImpl ActivatableImpl_Stub
|
||||
* @run main/othervm/policy=security.policy/timeout=150 CheckImplClassLoader
|
||||
*/
|
||||
|
||||
import java.io.*;
|
||||
import java.rmi.*;
|
||||
import java.rmi.server.*;
|
||||
import java.rmi.activation.*;
|
||||
import java.net.URL;
|
||||
|
||||
/**
|
||||
* sun.rmi.server.ActivationGroupImpl.newInstance() needs to set the
|
||||
* context class loader when it constructs the implementation class of
|
||||
* an Activatable object. It needs to set the ccl to be the class
|
||||
* loader of the implementation class.
|
||||
*
|
||||
* Test creates an Activatable object whose impl is loaded outside of
|
||||
* CLASSPATH. The impls constructor checks to make sure that the
|
||||
* correct context class loader has been set when the constructor is
|
||||
* invoked.
|
||||
*/
|
||||
public class CheckImplClassLoader {
|
||||
|
||||
private static Object dummy = new Object();
|
||||
private static MyRMI myRMI = null;
|
||||
private static ActivationGroup group = null;
|
||||
|
||||
public static void main(String args[]) {
|
||||
/*
|
||||
* The following line is required with the JDK 1.2 VM because
|
||||
* of gc hocus pocus that may no longer be needed with an
|
||||
* exact vm (hotspot).
|
||||
*/
|
||||
Object dummy1 = new Object();
|
||||
RMID rmid = null;
|
||||
|
||||
System.err.println("\nRegression test for bug/rfe 4289544\n");
|
||||
|
||||
try {
|
||||
|
||||
URL implcb = TestLibrary.installClassInCodebase("ActivatableImpl",
|
||||
"implcb");
|
||||
TestLibrary.installClassInCodebase("ActivatableImpl_Stub",
|
||||
"implcb");
|
||||
TestLibrary.suggestSecurityManager(
|
||||
TestParams.defaultSecurityManager);
|
||||
|
||||
RMID.removeLog();
|
||||
rmid = RMID.createRMIDOnEphemeralPort();
|
||||
rmid.start();
|
||||
|
||||
System.err.println("Create activation group in this VM");
|
||||
ActivationGroupDesc groupDesc =
|
||||
new ActivationGroupDesc(null, null);
|
||||
ActivationSystem system = ActivationGroup.getSystem();
|
||||
ActivationGroupID groupID = system.registerGroup(groupDesc);
|
||||
group = ActivationGroup.createGroup(groupID, groupDesc, 0);
|
||||
|
||||
ActivationDesc desc = new ActivationDesc("ActivatableImpl",
|
||||
implcb.toString(), null);
|
||||
myRMI = (MyRMI) Activatable.register(desc);
|
||||
|
||||
System.err.println("Checking that impl has correct " +
|
||||
"context class loader");
|
||||
if (!myRMI.classLoaderOk()) {
|
||||
TestLibrary.bomb("incorrect context class loader for " +
|
||||
"activation constructor");
|
||||
}
|
||||
|
||||
System.err.println("Deactivate object via method call");
|
||||
myRMI.shutdown();
|
||||
|
||||
System.err.println("\nsuccess: CheckImplClassLoader test passed ");
|
||||
|
||||
} catch (Exception e) {
|
||||
TestLibrary.bomb("\nfailure: unexpected exception ", e);
|
||||
} finally {
|
||||
try {
|
||||
Thread.sleep(4000);
|
||||
} catch (InterruptedException e) {
|
||||
}
|
||||
|
||||
myRMI = null;
|
||||
System.err.println("rmid shut down");
|
||||
rmid.cleanup();
|
||||
TestLibrary.unexport(group);
|
||||
}
|
||||
}
|
||||
}
|
@ -1,33 +0,0 @@
|
||||
/*
|
||||
* Copyright (c) 2000, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
* under the terms of the GNU General Public License version 2 only, as
|
||||
* published by the Free Software Foundation.
|
||||
*
|
||||
* This code is distributed in the hope that it will be useful, but WITHOUT
|
||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
* version 2 for more details (a copy is included in the LICENSE file that
|
||||
* accompanied this code).
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License version
|
||||
* 2 along with this work; if not, write to the Free Software Foundation,
|
||||
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
*
|
||||
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
|
||||
* or visit www.oracle.com if you need additional information or have any
|
||||
* questions.
|
||||
*/
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
import java.rmi.Remote;
|
||||
import java.rmi.RemoteException;
|
||||
|
||||
public interface MyRMI extends java.rmi.Remote {
|
||||
public boolean classLoaderOk() throws RemoteException;
|
||||
public void shutdown() throws Exception;
|
||||
}
|
@ -1,8 +0,0 @@
|
||||
grant {
|
||||
permission com.sun.rmi.rmid.ExecOptionPermission "-Djava.security.manager=default";
|
||||
permission com.sun.rmi.rmid.ExecOptionPermission "-Djava.security.policy=*";
|
||||
permission java.lang.RuntimePermission "selectorProvider";
|
||||
permission java.lang.RuntimePermission "accessClassInPackage.sun.nio.ch";
|
||||
permission java.util.PropertyPermission "test.java.rmi.testlibrary.RMIDSelectorProvider.port", "read";
|
||||
permission java.util.PropertyPermission "test.java.rmi.testlibrary.RMIDSelectorProvider.timeout", "read";
|
||||
};
|
@ -1,45 +0,0 @@
|
||||
/*
|
||||
* security policy used by the test process
|
||||
*/
|
||||
|
||||
grant {
|
||||
// need to move some classes out of the tests classpath; specific to this test
|
||||
permission java.io.FilePermission "${test.classes}", "read,write,delete";
|
||||
permission java.io.FilePermission "${test.classes}${/}-", "read,write,delete";
|
||||
|
||||
// need to load custom security manager and activation group from a new codebase
|
||||
permission java.io.FilePermission ".${/}implcb", "read,write,delete";
|
||||
permission java.io.FilePermission ".${/}implcb${/}-", "read,write,delete";
|
||||
|
||||
// impl class needs to compare context class loader to its own class loader
|
||||
permission java.lang.RuntimePermission "getClassLoader";
|
||||
|
||||
// standard test activation permissions
|
||||
permission java.io.FilePermission "..${/}..${/}test.props", "read";
|
||||
|
||||
// test needs to cleanup rmid's log.
|
||||
permission java.io.FilePermission ".${/}log", "read,write,delete";
|
||||
permission java.io.FilePermission ".${/}log${/}-", "read,write,delete";
|
||||
|
||||
// test needs to use java to exec an rmid
|
||||
permission java.io.FilePermission "${java.home}${/}bin${/}java", "execute";
|
||||
|
||||
// test uses these permissions to propagate security values to rmid
|
||||
permission java.util.PropertyPermission "java.security.policy", "read";
|
||||
permission java.util.PropertyPermission "java.security.manager", "read";
|
||||
|
||||
// used by TestLibrary to determine test environment
|
||||
permission java.util.PropertyPermission "test.*", "read";
|
||||
permission java.util.PropertyPermission "user.dir", "read";
|
||||
permission java.util.PropertyPermission "java.home", "read";
|
||||
permission java.util.PropertyPermission "java.rmi.activation.port", "write";
|
||||
|
||||
// required for test to create an ActivationGroup
|
||||
permission java.lang.RuntimePermission "setFactory";
|
||||
|
||||
// test needs to export rmid and communicate with objects on arbitrary ports
|
||||
permission java.net.SocketPermission "*:1024-", "connect,accept,listen";
|
||||
|
||||
permission java.lang.RuntimePermission "selectorProvider";
|
||||
permission java.lang.RuntimePermission "accessClassInPackage.sun.nio.ch";
|
||||
};
|
@ -1,32 +0,0 @@
|
||||
/*
|
||||
* Copyright (c) 1999, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
* under the terms of the GNU General Public License version 2 only, as
|
||||
* published by the Free Software Foundation.
|
||||
*
|
||||
* This code is distributed in the hope that it will be useful, but WITHOUT
|
||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
* version 2 for more details (a copy is included in the LICENSE file that
|
||||
* accompanied this code).
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License version
|
||||
* 2 along with this work; if not, write to the Free Software Foundation,
|
||||
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
*
|
||||
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
|
||||
* or visit www.oracle.com if you need additional information or have any
|
||||
* questions.
|
||||
*/
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
import java.rmi.Remote;
|
||||
import java.rmi.RemoteException;
|
||||
interface ActivateMe extends Remote {
|
||||
public void ping() throws RemoteException;
|
||||
public void shutdown() throws Exception;
|
||||
}
|
@ -1,175 +0,0 @@
|
||||
/*
|
||||
* Copyright (c) 1998, 2014, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
* under the terms of the GNU General Public License version 2 only, as
|
||||
* published by the Free Software Foundation.
|
||||
*
|
||||
* This code is distributed in the hope that it will be useful, but WITHOUT
|
||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
* version 2 for more details (a copy is included in the LICENSE file that
|
||||
* accompanied this code).
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License version
|
||||
* 2 along with this work; if not, write to the Free Software Foundation,
|
||||
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
*
|
||||
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
|
||||
* or visit www.oracle.com if you need additional information or have any
|
||||
* questions.
|
||||
*/
|
||||
|
||||
/* @test
|
||||
* @bug 4110548
|
||||
* @summary activate fails if rmid is restarted
|
||||
* @author Ann Wollrath
|
||||
*
|
||||
* @library ../../../testlibrary
|
||||
* @modules java.rmi/sun.rmi.registry
|
||||
* java.rmi/sun.rmi.server
|
||||
* java.rmi/sun.rmi.transport
|
||||
* java.rmi/sun.rmi.transport.tcp
|
||||
* java.base/sun.nio.ch
|
||||
* @build TestLibrary RMID RMIDSelectorProvider ActivationLibrary
|
||||
* ActivateMe CheckRegisterInLog_Stub
|
||||
* @run main/othervm/policy=security.policy/timeout=240 CheckRegisterInLog
|
||||
*/
|
||||
|
||||
import java.io.*;
|
||||
import java.rmi.*;
|
||||
import java.rmi.server.*;
|
||||
import java.rmi.activation.*;
|
||||
import sun.rmi.server.ActivatableRef;
|
||||
import java.lang.reflect.*;
|
||||
import java.util.Properties;
|
||||
|
||||
public class CheckRegisterInLog
|
||||
extends Activatable
|
||||
implements ActivateMe, Runnable
|
||||
{
|
||||
|
||||
public CheckRegisterInLog(ActivationID id, MarshalledObject obj)
|
||||
throws ActivationException, RemoteException
|
||||
{
|
||||
super(id, 0);
|
||||
}
|
||||
|
||||
public void ping()
|
||||
{}
|
||||
|
||||
/**
|
||||
* Spawns a thread to deactivate the object.
|
||||
*/
|
||||
public void shutdown() throws Exception
|
||||
{
|
||||
(new Thread(this,"CheckRegisterInLog")).start();
|
||||
}
|
||||
|
||||
/**
|
||||
* Thread to deactivate object. First attempts to make object
|
||||
* inactive (via the inactive method). If that fails (the
|
||||
* object may still have pending/executing calls), then
|
||||
* unexport the object forcibly.
|
||||
*/
|
||||
public void run() {
|
||||
ActivationLibrary.deactivate(this, getID());
|
||||
}
|
||||
|
||||
public static void main(String[] args) {
|
||||
/*
|
||||
* The following line is required with the JDK 1.2 VM so that the
|
||||
* VM can exit gracefully when this test completes. Otherwise, the
|
||||
* conservative garbage collector will find a handle to the server
|
||||
* object on the native stack and not clear the weak reference to
|
||||
* it in the RMI runtime's object table.
|
||||
*/
|
||||
Object dummy = new Object();
|
||||
RMID rmid = null;
|
||||
ActivateMe obj;
|
||||
|
||||
System.out.println("\nRegression test for bug 4110548\n");
|
||||
|
||||
CheckRegisterInLog server;
|
||||
|
||||
try {
|
||||
TestLibrary.suggestSecurityManager("java.rmi.RMISecurityManager");
|
||||
|
||||
/*
|
||||
* Start up activation system daemon "rmid".
|
||||
*/
|
||||
RMID.removeLog();
|
||||
rmid = RMID.createRMIDOnEphemeralPort();
|
||||
rmid.start();
|
||||
|
||||
/* Cause activation groups to have a security policy that will
|
||||
* allow security managers to be downloaded and installed
|
||||
*/
|
||||
Properties p = new Properties();
|
||||
// this test must always set policies/managers in its
|
||||
// activation groups
|
||||
p.put("java.security.policy",
|
||||
TestParams.defaultGroupPolicy);
|
||||
p.put("java.security.manager",
|
||||
TestParams.defaultSecurityManager);
|
||||
|
||||
/*
|
||||
* Register an activation group and an object
|
||||
* in that group.
|
||||
*/
|
||||
System.err.println("Creating group descriptor");
|
||||
ActivationGroupDesc groupDesc =
|
||||
new ActivationGroupDesc(p, null);
|
||||
System.err.println("Registering group");
|
||||
ActivationSystem system = ActivationGroup.getSystem();
|
||||
ActivationGroupID groupID = system.registerGroup(groupDesc);
|
||||
|
||||
System.err.println("Creating descriptor");
|
||||
ActivationDesc desc =
|
||||
new ActivationDesc(groupID, "CheckRegisterInLog",
|
||||
null, null);
|
||||
System.err.println("Registering descriptor");
|
||||
obj = (ActivateMe)Activatable.register(desc);
|
||||
|
||||
/*
|
||||
* Restart rmid to force it to read the log file
|
||||
*/
|
||||
rmid.restart();
|
||||
|
||||
|
||||
/*
|
||||
* 4212096: Give rmid time to go away - we want to make
|
||||
* sure that an attempt to activate the test object is not made
|
||||
* on the ActivationSystem that is about to be shutdown.
|
||||
*/
|
||||
try {
|
||||
Thread.sleep(5000);
|
||||
} catch (InterruptedException ie) {
|
||||
}
|
||||
|
||||
/*
|
||||
* Activate the object via a method call.
|
||||
*/
|
||||
System.err.println("Activate the object via method call");
|
||||
obj.ping();
|
||||
|
||||
/*
|
||||
* Clean up object too.
|
||||
*/
|
||||
System.err.println("Deactivate object via method call");
|
||||
obj.shutdown();
|
||||
|
||||
System.err.println("\nsuccess: CheckRegisterInLog test passed ");
|
||||
|
||||
} catch (Exception e) {
|
||||
System.err.println("\nfailure: unexpected exception " +
|
||||
e.getClass().getName() + ": " + e.getMessage());
|
||||
e.printStackTrace(System.err);
|
||||
throw new RuntimeException("CheckRegisterInLog got exception " +
|
||||
e.getMessage());
|
||||
} finally {
|
||||
rmid.cleanup();
|
||||
}
|
||||
}
|
||||
}
|
@ -1,104 +0,0 @@
|
||||
/*
|
||||
* Copyright (c) 1998, 1999, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
* under the terms of the GNU General Public License version 2 only, as
|
||||
* published by the Free Software Foundation.
|
||||
*
|
||||
* This code is distributed in the hope that it will be useful, but WITHOUT
|
||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
* version 2 for more details (a copy is included in the LICENSE file that
|
||||
* accompanied this code).
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License version
|
||||
* 2 along with this work; if not, write to the Free Software Foundation,
|
||||
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
*
|
||||
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
|
||||
* or visit www.oracle.com if you need additional information or have any
|
||||
* questions.
|
||||
*/
|
||||
|
||||
// Stub class generated by rmic, do not edit.
|
||||
// Contents subject to change without notice.
|
||||
|
||||
public final class CheckRegisterInLog_Stub
|
||||
extends java.rmi.server.RemoteStub
|
||||
implements ActivateMe, java.rmi.Remote
|
||||
{
|
||||
private static final java.rmi.server.Operation[] operations = {
|
||||
new java.rmi.server.Operation("void ping()"),
|
||||
new java.rmi.server.Operation("void shutdown()")
|
||||
};
|
||||
|
||||
private static final long interfaceHash = 10333549859256328L;
|
||||
|
||||
private static final long serialVersionUID = 2;
|
||||
|
||||
private static boolean useNewInvoke;
|
||||
private static java.lang.reflect.Method $method_ping_0;
|
||||
private static java.lang.reflect.Method $method_shutdown_1;
|
||||
|
||||
static {
|
||||
try {
|
||||
java.rmi.server.RemoteRef.class.getMethod("invoke",
|
||||
new java.lang.Class[] {
|
||||
java.rmi.Remote.class,
|
||||
java.lang.reflect.Method.class,
|
||||
java.lang.Object[].class,
|
||||
long.class
|
||||
});
|
||||
useNewInvoke = true;
|
||||
$method_ping_0 = ActivateMe.class.getMethod("ping", new java.lang.Class[] {});
|
||||
$method_shutdown_1 = ActivateMe.class.getMethod("shutdown", new java.lang.Class[] {});
|
||||
} catch (java.lang.NoSuchMethodException e) {
|
||||
useNewInvoke = false;
|
||||
}
|
||||
}
|
||||
|
||||
// constructors
|
||||
public CheckRegisterInLog_Stub() {
|
||||
super();
|
||||
}
|
||||
public CheckRegisterInLog_Stub(java.rmi.server.RemoteRef ref) {
|
||||
super(ref);
|
||||
}
|
||||
|
||||
// methods from remote interfaces
|
||||
|
||||
// implementation of ping()
|
||||
public void ping()
|
||||
throws java.rmi.RemoteException
|
||||
{
|
||||
try {
|
||||
if (useNewInvoke) {
|
||||
ref.invoke(this, $method_ping_0, null, 5866401369815527589L);
|
||||
} else {
|
||||
java.rmi.server.RemoteCall call = ref.newCall((java.rmi.server.RemoteObject) this, operations, 0, interfaceHash);
|
||||
ref.invoke(call);
|
||||
ref.done(call);
|
||||
}
|
||||
} catch (java.lang.RuntimeException e) {
|
||||
throw e;
|
||||
} catch (java.rmi.RemoteException e) {
|
||||
throw e;
|
||||
} catch (java.lang.Exception e) {
|
||||
throw new java.rmi.UnexpectedException("undeclared checked exception", e);
|
||||
}
|
||||
}
|
||||
|
||||
// implementation of shutdown()
|
||||
public void shutdown()
|
||||
throws java.lang.Exception
|
||||
{
|
||||
if (useNewInvoke) {
|
||||
ref.invoke(this, $method_shutdown_1, null, -7207851917985848402L);
|
||||
} else {
|
||||
java.rmi.server.RemoteCall call = ref.newCall((java.rmi.server.RemoteObject) this, operations, 1, interfaceHash);
|
||||
ref.invoke(call);
|
||||
ref.done(call);
|
||||
}
|
||||
}
|
||||
}
|
@ -1,9 +0,0 @@
|
||||
/*
|
||||
* security policy used by activation groups
|
||||
*/
|
||||
|
||||
grant {
|
||||
permission java.io.FilePermission "..${/}..${/}test.props", "read";
|
||||
permission java.net.SocketPermission "*:1024-", "connect,accept,listen";
|
||||
permission java.util.PropertyPermission "test.*", "read";
|
||||
};
|
@ -1,9 +0,0 @@
|
||||
grant {
|
||||
permission com.sun.rmi.rmid.ExecOptionPermission "-Djava.security.manager=default";
|
||||
permission com.sun.rmi.rmid.ExecOptionPermission "-Djava.security.policy=*";
|
||||
permission java.lang.RuntimePermission "selectorProvider";
|
||||
permission java.lang.RuntimePermission "accessClassInPackage.sun.nio.ch";
|
||||
permission java.util.PropertyPermission "test.java.rmi.testlibrary.RMIDSelectorProvider.port", "read";
|
||||
permission java.util.PropertyPermission "test.java.rmi.testlibrary.RMIDSelectorProvider.timeout", "read";
|
||||
permission java.net.SocketPermission "*:1024-", "listen,resolve,connect,accept";
|
||||
};
|
@ -1,37 +0,0 @@
|
||||
/*
|
||||
* security policy used by the test process
|
||||
*/
|
||||
|
||||
grant {
|
||||
// standard test activation permissions
|
||||
permission java.io.FilePermission "..${/}..${/}test.props", "read";
|
||||
|
||||
// test needs to cleanup rmid's log.
|
||||
permission java.io.FilePermission ".${/}log", "read,write,delete";
|
||||
permission java.io.FilePermission ".${/}log${/}-", "read,write,delete";
|
||||
|
||||
// test needs to use java to exec an rmid
|
||||
permission java.io.FilePermission "${java.home}${/}bin${/}java", "execute";
|
||||
|
||||
// test rmid uses these properties to propagate security values to rmid
|
||||
permission java.util.PropertyPermission "java.security.policy", "read";
|
||||
permission java.util.PropertyPermission "java.security.manager", "read";
|
||||
|
||||
// used by TestLibrary to determine test environment
|
||||
permission java.util.PropertyPermission "test.*", "read";
|
||||
permission java.util.PropertyPermission "user.dir", "read";
|
||||
permission java.util.PropertyPermission "java.home", "read";
|
||||
permission java.util.PropertyPermission "java.rmi.activation.port", "write";
|
||||
|
||||
// Needed to create an activation group
|
||||
permission java.lang.RuntimePermission "setFactory";
|
||||
|
||||
// allow exporting of remote objects on an arbitrary port.
|
||||
permission java.net.SocketPermission "*:1024-", "connect,accept,listen";
|
||||
|
||||
// allow exporting object with non-public remote interface
|
||||
permission java.rmi.RMIPermission "exportRemoteInterface.ActivateMe";
|
||||
|
||||
permission java.lang.RuntimePermission "selectorProvider";
|
||||
permission java.lang.RuntimePermission "accessClassInPackage.sun.nio.ch";
|
||||
};
|
@ -1,32 +0,0 @@
|
||||
/*
|
||||
* Copyright (c) 1999, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
* under the terms of the GNU General Public License version 2 only, as
|
||||
* published by the Free Software Foundation.
|
||||
*
|
||||
* This code is distributed in the hope that it will be useful, but WITHOUT
|
||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
* version 2 for more details (a copy is included in the LICENSE file that
|
||||
* accompanied this code).
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License version
|
||||
* 2 along with this work; if not, write to the Free Software Foundation,
|
||||
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
*
|
||||
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
|
||||
* or visit www.oracle.com if you need additional information or have any
|
||||
* questions.
|
||||
*/
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
import java.rmi.Remote;
|
||||
import java.rmi.RemoteException;
|
||||
interface ActivateMe extends Remote {
|
||||
public void ping() throws RemoteException;
|
||||
public void shutdown() throws Exception;
|
||||
}
|
@ -1,167 +0,0 @@
|
||||
/*
|
||||
* Copyright (c) 1999, 2014, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
* under the terms of the GNU General Public License version 2 only, as
|
||||
* published by the Free Software Foundation.
|
||||
*
|
||||
* This code is distributed in the hope that it will be useful, but WITHOUT
|
||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
* version 2 for more details (a copy is included in the LICENSE file that
|
||||
* accompanied this code).
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License version
|
||||
* 2 along with this work; if not, write to the Free Software Foundation,
|
||||
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
*
|
||||
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
|
||||
* or visit www.oracle.com if you need additional information or have any
|
||||
* questions.
|
||||
*/
|
||||
|
||||
/* @test
|
||||
* @bug 4164971
|
||||
* @summary allow non-public activatable class and/or constructor
|
||||
* @author Laird Dornin
|
||||
*
|
||||
* @library ../../../testlibrary
|
||||
* @modules java.rmi/sun.rmi.registry
|
||||
* java.rmi/sun.rmi.server
|
||||
* java.rmi/sun.rmi.transport
|
||||
* java.rmi/sun.rmi.transport.tcp
|
||||
* java.base/sun.nio.ch
|
||||
* @build TestLibrary RMID RMIDSelectorProvider ActivateMe
|
||||
* @run main/othervm/policy=security.policy/timeout=240 CreatePrivateActivatable
|
||||
*/
|
||||
|
||||
import java.io.*;
|
||||
import java.rmi.*;
|
||||
import java.rmi.server.*;
|
||||
import java.rmi.activation.*;
|
||||
import sun.rmi.server.ActivatableRef;
|
||||
import java.lang.reflect.*;
|
||||
import java.util.Properties;
|
||||
|
||||
/**
|
||||
* Test creates a private inner class Activatable object with a
|
||||
* private constructor and makes sure that the object can be
|
||||
* activated.
|
||||
*/
|
||||
public class CreatePrivateActivatable
|
||||
{
|
||||
private static class PrivateActivatable extends Activatable
|
||||
implements ActivateMe, Runnable
|
||||
{
|
||||
private PrivateActivatable(ActivationID id, MarshalledObject obj)
|
||||
throws ActivationException, RemoteException
|
||||
{
|
||||
super(id, 0);
|
||||
}
|
||||
|
||||
public void ping()
|
||||
{}
|
||||
|
||||
/**
|
||||
* Spawns a thread to deactivate the object.
|
||||
*/
|
||||
public void shutdown() throws Exception
|
||||
{
|
||||
(new Thread(this, "CreatePrivateActivatable$PrivateActivatable")).start();
|
||||
}
|
||||
|
||||
/**
|
||||
* Thread to deactivate object. First attempts to make object
|
||||
* inactive (via the inactive method). If that fails (the
|
||||
* object may still have pending/executing calls), then
|
||||
* unexport the object forcibly.
|
||||
*/
|
||||
public void run() {
|
||||
ActivationLibrary.deactivate(this, getID());
|
||||
}
|
||||
}
|
||||
|
||||
public static void main(String[] args) {
|
||||
/*
|
||||
* The following line is required with the JDK 1.2 VM so that the
|
||||
* VM can exit gracefully when this test completes. Otherwise, the
|
||||
* conservative garbage collector will find a handle to the server
|
||||
* object on the native stack and not clear the weak reference to
|
||||
* it in the RMI runtime's object table.
|
||||
*/
|
||||
Object dummy = new Object();
|
||||
RMID rmid = null;
|
||||
ActivateMe obj;
|
||||
|
||||
System.err.println("\nRegression test for bug 4164971\n");
|
||||
System.err.println("java.security.policy = " +
|
||||
System.getProperty("java.security.policy", "no policy"));
|
||||
|
||||
CreatePrivateActivatable server;
|
||||
try {
|
||||
TestLibrary.suggestSecurityManager(TestParams.defaultSecurityManager);
|
||||
|
||||
// start an rmid.
|
||||
RMID.removeLog();
|
||||
rmid = RMID.createRMIDOnEphemeralPort();
|
||||
rmid.start();
|
||||
|
||||
/* Cause activation groups to have a security policy that will
|
||||
* allow security managers to be downloaded and installed
|
||||
*/
|
||||
Properties p = new Properties();
|
||||
// this test must always set policies/managers in its
|
||||
// activation groups
|
||||
p.put("java.security.policy",
|
||||
TestParams.defaultGroupPolicy);
|
||||
p.put("java.security.manager",
|
||||
TestParams.defaultSecurityManager);
|
||||
|
||||
/*
|
||||
* Activate an object by registering its object
|
||||
* descriptor and invoking a method on the
|
||||
* stub returned from the register call.
|
||||
*/
|
||||
ActivationGroupDesc groupDesc =
|
||||
new ActivationGroupDesc(p, null);
|
||||
ActivationSystem system = ActivationGroup.getSystem();
|
||||
ActivationGroupID groupID = system.registerGroup(groupDesc);
|
||||
|
||||
System.err.println("Creating descriptor");
|
||||
ActivationDesc desc =
|
||||
new ActivationDesc(groupID,
|
||||
"CreatePrivateActivatable$PrivateActivatable",
|
||||
null, null);
|
||||
|
||||
System.err.println("Registering descriptor");
|
||||
obj = (ActivateMe) Activatable.register(desc);
|
||||
|
||||
/*
|
||||
* Loop a bunch of times to force activator to
|
||||
* spawn VMs (groups)
|
||||
*/
|
||||
System.err.println("Activate object via method call");
|
||||
obj.ping();
|
||||
|
||||
/*
|
||||
* Clean up object too.
|
||||
*/
|
||||
System.err.println("Deactivate object via method call");
|
||||
obj.shutdown();
|
||||
|
||||
System.err.println("\nsuccess: CreatePrivateActivatable test passed ");
|
||||
|
||||
} catch (Exception e) {
|
||||
if (e instanceof java.security.PrivilegedActionException) {
|
||||
e = ((java.security.PrivilegedActionException)e).getException();
|
||||
}
|
||||
TestLibrary.bomb("\nfailure: unexpected exception " +
|
||||
e.getClass().getName(), e);
|
||||
|
||||
} finally {
|
||||
rmid.cleanup();
|
||||
obj = null;
|
||||
}
|
||||
}
|
||||
}
|
@ -1,9 +0,0 @@
|
||||
/*
|
||||
* security policy used by activation groups
|
||||
*/
|
||||
|
||||
grant {
|
||||
permission java.io.FilePermission "..${/}..${/}test.props", "read";
|
||||
permission java.net.SocketPermission "*:1024-", "connect,accept,listen";
|
||||
permission java.util.PropertyPermission "test.*", "read";
|
||||
};
|
@ -1,8 +0,0 @@
|
||||
grant {
|
||||
permission com.sun.rmi.rmid.ExecOptionPermission "-Djava.security.manager=default";
|
||||
permission com.sun.rmi.rmid.ExecOptionPermission "-Djava.security.policy=*";
|
||||
permission java.lang.RuntimePermission "selectorProvider";
|
||||
permission java.lang.RuntimePermission "accessClassInPackage.sun.nio.ch";
|
||||
permission java.util.PropertyPermission "test.java.rmi.testlibrary.RMIDSelectorProvider.port", "read";
|
||||
permission java.util.PropertyPermission "test.java.rmi.testlibrary.RMIDSelectorProvider.timeout", "read";
|
||||
};
|
@ -1,37 +0,0 @@
|
||||
/*
|
||||
* security policy used by the test process
|
||||
*/
|
||||
|
||||
grant {
|
||||
// standard test activation permissions
|
||||
permission java.io.FilePermission "..${/}..${/}test.props", "read";
|
||||
|
||||
// test needs to cleanup rmid's log.
|
||||
permission java.io.FilePermission ".${/}log", "read,write,delete";
|
||||
permission java.io.FilePermission ".${/}log${/}-", "read,write,delete";
|
||||
|
||||
// test needs to use java to exec an rmid
|
||||
permission java.io.FilePermission "${java.home}${/}bin${/}java", "execute";
|
||||
|
||||
// test rmid uses these properties to propagate security values to rmid
|
||||
permission java.util.PropertyPermission "java.security.policy", "read";
|
||||
permission java.util.PropertyPermission "java.security.manager", "read";
|
||||
|
||||
// used by TestLibrary to determine test environment
|
||||
permission java.util.PropertyPermission "test.*", "read";
|
||||
permission java.util.PropertyPermission "user.dir", "read";
|
||||
permission java.util.PropertyPermission "java.home", "read";
|
||||
permission java.util.PropertyPermission "java.rmi.activation.port", "write";
|
||||
|
||||
// Needed to create an activation group
|
||||
permission java.lang.RuntimePermission "setFactory";
|
||||
|
||||
// allow exporting of remote objects on an arbitrary port.
|
||||
permission java.net.SocketPermission "*:1024-", "connect,accept,listen";
|
||||
|
||||
// allow exporting object with non-public remote interface
|
||||
permission java.rmi.RMIPermission "exportRemoteInterface.ActivateMe";
|
||||
|
||||
permission java.lang.RuntimePermission "selectorProvider";
|
||||
permission java.lang.RuntimePermission "accessClassInPackage.sun.nio.ch";
|
||||
};
|
@ -1,25 +0,0 @@
|
||||
/*
|
||||
* Copyright (c) 1998, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
* under the terms of the GNU General Public License version 2 only, as
|
||||
* published by the Free Software Foundation.
|
||||
*
|
||||
* This code is distributed in the hope that it will be useful, but WITHOUT
|
||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
* version 2 for more details (a copy is included in the LICENSE file that
|
||||
* accompanied this code).
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License version
|
||||
* 2 along with this work; if not, write to the Free Software Foundation,
|
||||
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
*
|
||||
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
|
||||
* or visit www.oracle.com if you need additional information or have any
|
||||
* questions.
|
||||
*/
|
||||
|
||||
public class Bar extends Foo {
|
||||
}
|
@ -1,149 +0,0 @@
|
||||
/*
|
||||
* Copyright (c) 1998, 2014, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
* under the terms of the GNU General Public License version 2 only, as
|
||||
* published by the Free Software Foundation.
|
||||
*
|
||||
* This code is distributed in the hope that it will be useful, but WITHOUT
|
||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
* version 2 for more details (a copy is included in the LICENSE file that
|
||||
* accompanied this code).
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License version
|
||||
* 2 along with this work; if not, write to the Free Software Foundation,
|
||||
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
*
|
||||
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
|
||||
* or visit www.oracle.com if you need additional information or have any
|
||||
* questions.
|
||||
*/
|
||||
|
||||
/* @test
|
||||
* @bug 4149366
|
||||
* @summary The class loader used to load classes for parameter types sent in
|
||||
* an RMI call to an activatable object should delegate to the class loader
|
||||
* that loaded the class of the activatable object itself, to maximize the
|
||||
* likelihood of type compatibility between downloaded parameter types and
|
||||
* supertypes shared with the activatable object.
|
||||
* @author Peter Jones (much code taken from Ann Wollrath's activation tests)
|
||||
*
|
||||
* @library ../../../testlibrary
|
||||
* @modules java.rmi/sun.rmi.registry
|
||||
* java.rmi/sun.rmi.server
|
||||
* java.rmi/sun.rmi.transport
|
||||
* java.rmi/sun.rmi.transport.tcp
|
||||
* java.base/sun.nio.ch
|
||||
* @build TestLibrary RMID RMIDSelectorProvider ActivationLibrary
|
||||
* Foo FooReceiverImpl FooReceiverImpl_Stub Bar
|
||||
* @run main/othervm/policy=security.policy/timeout=240 DownloadParameterClass
|
||||
*/
|
||||
|
||||
import java.io.*;
|
||||
import java.net.*;
|
||||
import java.util.*;
|
||||
import java.rmi.*;
|
||||
import java.rmi.activation.*;
|
||||
import java.rmi.server.*;
|
||||
import java.rmi.registry.*;
|
||||
|
||||
public class DownloadParameterClass {
|
||||
|
||||
public interface FooReceiver extends Remote {
|
||||
|
||||
/*
|
||||
* The interface can't actually declare that the method takes a
|
||||
* Foo, because then Foo would have to be in the test's CLASSPATH,
|
||||
* which might get propagated to the group VM's CLASSPATH, which
|
||||
* would nullify the test (the Foo supertype must be loaded in the
|
||||
* group VM only through the class loader that loaded the
|
||||
* activatable object).
|
||||
*/
|
||||
public void receiveFoo(Object obj) throws RemoteException;
|
||||
}
|
||||
|
||||
public static void main(String[] args) {
|
||||
|
||||
System.err.println("\nRegression test for bug 4149366\n");
|
||||
|
||||
/*
|
||||
* Install classes to be seen by the activatable object's class
|
||||
* loader in the "codebase1" subdirectory of working directory, and
|
||||
* install the subtype to be downloaded into the activatable object
|
||||
* into the "codebase2" subdirectory.
|
||||
*/
|
||||
URL codebase1 = null;
|
||||
URL codebase2 = null;
|
||||
try {
|
||||
codebase1 = TestLibrary.installClassInCodebase("FooReceiverImpl", "codebase1");
|
||||
TestLibrary.installClassInCodebase("FooReceiverImpl_Stub", "codebase1");
|
||||
TestLibrary.installClassInCodebase("Foo", "codebase1");
|
||||
codebase2 = TestLibrary.installClassInCodebase("Bar", "codebase2");
|
||||
} catch (MalformedURLException e) {
|
||||
TestLibrary.bomb("failed to install test classes", e);
|
||||
}
|
||||
|
||||
TestLibrary.suggestSecurityManager("java.rmi.RMISecurityManager");
|
||||
|
||||
RMID rmid = null;
|
||||
|
||||
try {
|
||||
RMID.removeLog();
|
||||
rmid = RMID.createRMIDOnEphemeralPort();
|
||||
rmid.start();
|
||||
|
||||
/* Cause activation groups to have a security policy that will
|
||||
* allow security managers to be downloaded and installed
|
||||
*/
|
||||
Properties p = new Properties();
|
||||
// this test must always set policies/managers in its
|
||||
// activation groups
|
||||
p.put("java.security.policy",
|
||||
TestParams.defaultGroupPolicy);
|
||||
p.put("java.security.manager",
|
||||
TestParams.defaultSecurityManager);
|
||||
|
||||
/*
|
||||
* Create and register descriptors for activatable object in a
|
||||
* group other than this VM's group, so that another VM will be
|
||||
* spawned with the object is activated.
|
||||
*/
|
||||
System.err.println("Creating descriptors");
|
||||
ActivationGroupDesc groupDesc =
|
||||
new ActivationGroupDesc(p, null);
|
||||
ActivationGroupID groupID =
|
||||
ActivationGroup.getSystem().registerGroup(groupDesc);
|
||||
ActivationDesc objDesc =
|
||||
new ActivationDesc(groupID, "FooReceiverImpl",
|
||||
codebase1.toString(), null, false);
|
||||
|
||||
System.err.println("Registering descriptors");
|
||||
FooReceiver obj = (FooReceiver) Activatable.register(objDesc);
|
||||
|
||||
/*
|
||||
* Create an instance of the subtype to be downloaded by the
|
||||
* activatable object. The codebase must be a path including
|
||||
* "codebase1" as well as "codebase2" because the supertype
|
||||
* must be visible here as well; the supertype cannot be
|
||||
* installed in both codebases (like it would be in a typical
|
||||
* setup) because of the trivial installation mechanism used
|
||||
* below, and see the comment above for why it can't be in
|
||||
* the test's CLASSPATH.
|
||||
*/
|
||||
Class subtype = RMIClassLoader.loadClass(
|
||||
codebase2 + " " + codebase1, "Bar");
|
||||
Object subtypeInstance = subtype.newInstance();
|
||||
|
||||
obj.receiveFoo(subtypeInstance);
|
||||
|
||||
System.err.println("\nTEST PASSED\n");
|
||||
|
||||
} catch (Exception e) {
|
||||
TestLibrary.bomb("test failed", e);
|
||||
} finally {
|
||||
rmid.cleanup();
|
||||
}
|
||||
}
|
||||
}
|
@ -1,25 +0,0 @@
|
||||
/*
|
||||
* Copyright (c) 1998, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
* under the terms of the GNU General Public License version 2 only, as
|
||||
* published by the Free Software Foundation.
|
||||
*
|
||||
* This code is distributed in the hope that it will be useful, but WITHOUT
|
||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
* version 2 for more details (a copy is included in the LICENSE file that
|
||||
* accompanied this code).
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License version
|
||||
* 2 along with this work; if not, write to the Free Software Foundation,
|
||||
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
*
|
||||
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
|
||||
* or visit www.oracle.com if you need additional information or have any
|
||||
* questions.
|
||||
*/
|
||||
|
||||
public class Foo implements java.io.Serializable {
|
||||
}
|
@ -1,46 +0,0 @@
|
||||
/*
|
||||
* Copyright (c) 1998, 2001, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
* under the terms of the GNU General Public License version 2 only, as
|
||||
* published by the Free Software Foundation.
|
||||
*
|
||||
* This code is distributed in the hope that it will be useful, but WITHOUT
|
||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
* version 2 for more details (a copy is included in the LICENSE file that
|
||||
* accompanied this code).
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License version
|
||||
* 2 along with this work; if not, write to the Free Software Foundation,
|
||||
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
*
|
||||
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
|
||||
* or visit www.oracle.com if you need additional information or have any
|
||||
* questions.
|
||||
*/
|
||||
|
||||
import java.rmi.*;
|
||||
import java.rmi.activation.*;
|
||||
|
||||
public class FooReceiverImpl implements DownloadParameterClass.FooReceiver {
|
||||
|
||||
private ActivationID id;
|
||||
|
||||
public FooReceiverImpl(ActivationID id, MarshalledObject mobj)
|
||||
throws ActivationException, RemoteException
|
||||
{
|
||||
this.id = id;
|
||||
Activatable.exportObject(this, id, 0);
|
||||
}
|
||||
|
||||
public void receiveFoo(Object obj) {
|
||||
/*
|
||||
* Cast argument to the type "Foo" as resolved from this activatble
|
||||
* object's class; a ClassCastException will be thrown if the argument
|
||||
* implements a type "Foo" loaded from a different class loader.
|
||||
*/
|
||||
Foo foo = (Foo) obj;
|
||||
}
|
||||
}
|
@ -1,65 +0,0 @@
|
||||
/*
|
||||
* Copyright (c) 1998, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
* under the terms of the GNU General Public License version 2 only, as
|
||||
* published by the Free Software Foundation.
|
||||
*
|
||||
* This code is distributed in the hope that it will be useful, but WITHOUT
|
||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
* version 2 for more details (a copy is included in the LICENSE file that
|
||||
* accompanied this code).
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License version
|
||||
* 2 along with this work; if not, write to the Free Software Foundation,
|
||||
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
*
|
||||
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
|
||||
* or visit www.oracle.com if you need additional information or have any
|
||||
* questions.
|
||||
*/
|
||||
|
||||
// Stub class generated by rmic, do not edit.
|
||||
// Contents subject to change without notice.
|
||||
|
||||
public final class FooReceiverImpl_Stub
|
||||
extends java.rmi.server.RemoteStub
|
||||
implements DownloadParameterClass. FooReceiver
|
||||
{
|
||||
private static final long serialVersionUID = 2;
|
||||
|
||||
private static java.lang.reflect.Method $method_receiveFoo_0;
|
||||
|
||||
static {
|
||||
try {
|
||||
$method_receiveFoo_0 = DownloadParameterClass. FooReceiver.class.getMethod("receiveFoo", new java.lang.Class[] {java.lang.Object.class});
|
||||
} catch (java.lang.NoSuchMethodException e) {
|
||||
throw new java.lang.NoSuchMethodError(
|
||||
"stub class initialization failed");
|
||||
}
|
||||
}
|
||||
|
||||
// constructors
|
||||
public FooReceiverImpl_Stub(java.rmi.server.RemoteRef ref) {
|
||||
super(ref);
|
||||
}
|
||||
|
||||
// methods from remote interfaces
|
||||
|
||||
// implementation of receiveFoo(Object)
|
||||
public void receiveFoo(java.lang.Object $param_Object_1)
|
||||
throws java.rmi.RemoteException
|
||||
{
|
||||
try {
|
||||
ref.invoke(this, $method_receiveFoo_0, new java.lang.Object[] {$param_Object_1}, -1548895758515635945L);
|
||||
} catch (java.lang.RuntimeException e) {
|
||||
throw e;
|
||||
} catch (java.rmi.RemoteException e) {
|
||||
throw e;
|
||||
} catch (java.lang.Exception e) {
|
||||
throw new java.rmi.UnexpectedException("undeclared checked exception", e);
|
||||
}
|
||||
}
|
||||
}
|
@ -1,15 +0,0 @@
|
||||
/*
|
||||
* security policy used by activation groups
|
||||
*/
|
||||
|
||||
grant {
|
||||
permission java.io.FilePermission "..${/}..${/}test.props", "read";
|
||||
permission java.net.SocketPermission "*:1024-", "connect,accept,listen";
|
||||
permission java.util.PropertyPermission "test.*", "read";
|
||||
|
||||
// need to load custom security manager and activation group from a new codebase
|
||||
permission java.io.FilePermission ".${/}codebase1", "read,write,delete";
|
||||
permission java.io.FilePermission ".${/}codebase1${/}-", "read,write";
|
||||
permission java.io.FilePermission ".${/}codebase2", "read,write,delete";
|
||||
permission java.io.FilePermission ".${/}codebase2${/}-", "read,write,delete";
|
||||
};
|
@ -1,40 +0,0 @@
|
||||
/*
|
||||
* security policy used by the test process
|
||||
*/
|
||||
|
||||
grant {
|
||||
// need to move some classes out of the tests classpath; specific to this test
|
||||
permission java.io.FilePermission ".", "read,write,delete";
|
||||
permission java.io.FilePermission ".${/}-", "read,write,delete";
|
||||
|
||||
// need to load custom security manager and activation group from a new codebase
|
||||
permission java.io.FilePermission ".${/}codebase1", "read,write,delete";
|
||||
permission java.io.FilePermission ".${/}codebase1${/}-", "read,write";
|
||||
permission java.io.FilePermission ".${/}codebase2", "read,write,delete";
|
||||
permission java.io.FilePermission ".${/}codebase2${/}-", "read,write,delete";
|
||||
|
||||
// standard activation permissions
|
||||
|
||||
// test needs to cleanup rmid's log.
|
||||
permission java.io.FilePermission ".${/}log", "read,write,delete";
|
||||
permission java.io.FilePermission ".${/}log${/}-", "read,write,delete";
|
||||
|
||||
// test needs to use java to exec an rmid
|
||||
permission java.io.FilePermission "${java.home}${/}bin${/}java", "execute";
|
||||
|
||||
// test rmid uses these properties to propagate security values to rmid
|
||||
permission java.util.PropertyPermission "java.security.policy", "read";
|
||||
permission java.util.PropertyPermission "java.security.manager", "read";
|
||||
|
||||
// used by TestLibrary to determine test environment
|
||||
permission java.util.PropertyPermission "test.classes", "read";
|
||||
permission java.util.PropertyPermission "test.src", "read";
|
||||
permission java.util.PropertyPermission "user.dir", "read";
|
||||
permission java.util.PropertyPermission "java.home", "read";
|
||||
|
||||
// allow exporting of remote objects on an arbitrary port.
|
||||
permission java.net.SocketPermission "*:1024-", "connect,accept,listen";
|
||||
|
||||
permission java.lang.RuntimePermission "selectorProvider";
|
||||
permission java.lang.RuntimePermission "accessClassInPackage.sun.nio.ch";
|
||||
};
|
@ -1,8 +0,0 @@
|
||||
grant {
|
||||
permission com.sun.rmi.rmid.ExecOptionPermission "-Djava.security.manager=default";
|
||||
permission com.sun.rmi.rmid.ExecOptionPermission "-Djava.security.policy=*";
|
||||
permission java.lang.RuntimePermission "selectorProvider";
|
||||
permission java.lang.RuntimePermission "accessClassInPackage.sun.nio.ch";
|
||||
permission java.util.PropertyPermission "test.java.rmi.testlibrary.RMIDSelectorProvider.port", "read";
|
||||
permission java.util.PropertyPermission "test.java.rmi.testlibrary.RMIDSelectorProvider.timeout", "read";
|
||||
};
|
@ -1,41 +0,0 @@
|
||||
/*
|
||||
* security policy used by the test process
|
||||
*/
|
||||
|
||||
grant {
|
||||
// need to move some classes out of the tests classpath; specific to this test
|
||||
permission java.io.FilePermission "${test.classes}", "read,write,delete";
|
||||
permission java.io.FilePermission "${test.classes}${/}-", "read,write,delete";
|
||||
|
||||
// need to load custom security manager and activation group from a new codebase
|
||||
permission java.io.FilePermission ".${/}codebase1", "read,write,delete";
|
||||
permission java.io.FilePermission ".${/}codebase1${/}-", "read,write";
|
||||
permission java.io.FilePermission ".${/}codebase2", "read,write,delete";
|
||||
permission java.io.FilePermission ".${/}codebase2${/}-", "read,write,delete";
|
||||
|
||||
// standard activation permissions
|
||||
permission java.io.FilePermission "..${/}..${/}test.props", "read";
|
||||
|
||||
// test needs to cleanup rmid's log.
|
||||
permission java.io.FilePermission ".${/}log", "read,write,delete";
|
||||
permission java.io.FilePermission ".${/}log${/}-", "read,write,delete";
|
||||
|
||||
// test needs to use java to exec an rmid
|
||||
permission java.io.FilePermission "${java.home}${/}bin${/}java", "execute";
|
||||
|
||||
// test rmid uses these properties to propagate security values to rmid
|
||||
permission java.util.PropertyPermission "java.security.policy", "read";
|
||||
permission java.util.PropertyPermission "java.security.manager", "read";
|
||||
|
||||
// used by TestLibrary to determine test environment
|
||||
permission java.util.PropertyPermission "test.*", "read";
|
||||
permission java.util.PropertyPermission "user.dir", "read";
|
||||
permission java.util.PropertyPermission "java.home", "read";
|
||||
permission java.util.PropertyPermission "java.rmi.activation.port", "write";
|
||||
|
||||
// allow exporting of remote objects on an arbitrary port.
|
||||
permission java.net.SocketPermission "*:1024-", "connect,accept,listen";
|
||||
|
||||
permission java.lang.RuntimePermission "selectorProvider";
|
||||
permission java.lang.RuntimePermission "accessClassInPackage.sun.nio.ch";
|
||||
};
|
@ -1,32 +0,0 @@
|
||||
/*
|
||||
* Copyright (c) 1999, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
* under the terms of the GNU General Public License version 2 only, as
|
||||
* published by the Free Software Foundation.
|
||||
*
|
||||
* This code is distributed in the hope that it will be useful, but WITHOUT
|
||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
* version 2 for more details (a copy is included in the LICENSE file that
|
||||
* accompanied this code).
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License version
|
||||
* 2 along with this work; if not, write to the Free Software Foundation,
|
||||
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
*
|
||||
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
|
||||
* or visit www.oracle.com if you need additional information or have any
|
||||
* questions.
|
||||
*/
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
import java.rmi.Remote;
|
||||
import java.rmi.RemoteException;
|
||||
interface ActivateMe extends Remote {
|
||||
public void ping() throws RemoteException;
|
||||
public void shutdown() throws Exception;
|
||||
}
|
@ -1,146 +0,0 @@
|
||||
/*
|
||||
* Copyright (c) 1998, 2014, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
* under the terms of the GNU General Public License version 2 only, as
|
||||
* published by the Free Software Foundation.
|
||||
*
|
||||
* This code is distributed in the hope that it will be useful, but WITHOUT
|
||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
* version 2 for more details (a copy is included in the LICENSE file that
|
||||
* accompanied this code).
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License version
|
||||
* 2 along with this work; if not, write to the Free Software Foundation,
|
||||
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
*
|
||||
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
|
||||
* or visit www.oracle.com if you need additional information or have any
|
||||
* questions.
|
||||
*/
|
||||
|
||||
/* @test
|
||||
* @bug 4128620
|
||||
* @summary synopsis: NoSuchMethodError should be elucidated
|
||||
* @author Laird Dornin
|
||||
*
|
||||
* @library ../../../testlibrary
|
||||
* @modules java.rmi/sun.rmi.registry
|
||||
* java.rmi/sun.rmi.server
|
||||
* java.rmi/sun.rmi.transport
|
||||
* java.rmi/sun.rmi.transport.tcp
|
||||
* java.base/sun.nio.ch
|
||||
* @build TestLibrary RMID RMIDSelectorProvider ActivateMe ElucidateNoSuchMethod_Stub
|
||||
* @run main/othervm/policy=security.policy/timeout=240 ElucidateNoSuchMethod
|
||||
*/
|
||||
|
||||
import java.io.*;
|
||||
import java.rmi.*;
|
||||
import java.rmi.activation.*;
|
||||
import java.rmi.server.*;
|
||||
import java.rmi.registry.*;
|
||||
import java.util.Properties;
|
||||
|
||||
public class ElucidateNoSuchMethod
|
||||
extends Activatable
|
||||
implements ActivateMe, Runnable
|
||||
{
|
||||
|
||||
/**
|
||||
* provide a constructor that alllows this object to be made
|
||||
* activatable, or at least registered.
|
||||
*/
|
||||
ElucidateNoSuchMethod(ActivationID id, int port)
|
||||
throws RemoteException
|
||||
{
|
||||
super(id, port);
|
||||
}
|
||||
|
||||
/**
|
||||
* dont provide an activation constructor so that we get a no such
|
||||
* method error.
|
||||
*/
|
||||
|
||||
public void ping() {}
|
||||
|
||||
/**
|
||||
* Spawns a thread to deactivate the object.
|
||||
*/
|
||||
public void shutdown() throws Exception {
|
||||
(new Thread(this,"ElucidateNoSuchMethod")).start();
|
||||
}
|
||||
|
||||
/**
|
||||
* Thread to deactivate object. First attempts to make object
|
||||
* inactive (via the inactive method). If that fails (the
|
||||
* object may still have pending/executing calls), then
|
||||
* unexport the object forcibly.
|
||||
*/
|
||||
public void run() {
|
||||
ActivationLibrary.deactivate(this, getID());
|
||||
}
|
||||
|
||||
public static void main(String[] args) {
|
||||
|
||||
System.out.println("\nRegression test for 4128620 \n");
|
||||
|
||||
TestLibrary.suggestSecurityManager("java.rmi.RMISecurityManager");
|
||||
|
||||
RMID rmid = null;
|
||||
|
||||
try {
|
||||
RMID.removeLog();
|
||||
rmid = RMID.createRMIDOnEphemeralPort();
|
||||
rmid.start();
|
||||
|
||||
/* Cause activation groups to have a security policy that will
|
||||
* allow security managers to be downloaded and installed
|
||||
*/
|
||||
Properties p = new Properties();
|
||||
// this test must always set policies/managers in its
|
||||
// activation groups
|
||||
p.put("java.security.policy",
|
||||
TestParams.defaultGroupPolicy);
|
||||
p.put("java.security.manager",
|
||||
TestParams.defaultSecurityManager);
|
||||
|
||||
System.err.println("Create activation group in this VM");
|
||||
ActivationGroupDesc groupDesc =
|
||||
new ActivationGroupDesc(p, null);
|
||||
ActivationSystem system = ActivationGroup.getSystem();
|
||||
ActivationGroupID groupID = system.registerGroup(groupDesc);
|
||||
ActivationGroup.createGroup(groupID, groupDesc, 0);
|
||||
|
||||
System.err.println("Creating descriptor");
|
||||
ActivationDesc desc =
|
||||
new ActivationDesc("ElucidateNoSuchMethod", null, null);
|
||||
|
||||
System.err.println("Registering descriptor");
|
||||
ActivateMe obj = (ActivateMe) Activatable.register(desc);
|
||||
|
||||
System.err.println("Activate object via method call");
|
||||
|
||||
try {
|
||||
obj.ping();
|
||||
} catch (ActivateFailedException afe) {
|
||||
ActivationException a = (ActivationException) afe.detail;
|
||||
|
||||
if (((a.detail instanceof NoSuchMethodException) ||
|
||||
(a.detail instanceof NoSuchMethodError)) &&
|
||||
(a.getMessage().indexOf
|
||||
("must provide an activation constructor") > -1)) {
|
||||
System.err.println("\ntest passed for 4128620\n");
|
||||
} else {
|
||||
TestLibrary.bomb("test failed", afe);
|
||||
}
|
||||
}
|
||||
|
||||
} catch (Exception e) {
|
||||
TestLibrary.bomb("test failed", e);
|
||||
} finally {
|
||||
rmid.cleanup();
|
||||
}
|
||||
}
|
||||
}
|
@ -1,104 +0,0 @@
|
||||
/*
|
||||
* Copyright (c) 1998, 1999, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
* under the terms of the GNU General Public License version 2 only, as
|
||||
* published by the Free Software Foundation.
|
||||
*
|
||||
* This code is distributed in the hope that it will be useful, but WITHOUT
|
||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
* version 2 for more details (a copy is included in the LICENSE file that
|
||||
* accompanied this code).
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License version
|
||||
* 2 along with this work; if not, write to the Free Software Foundation,
|
||||
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
*
|
||||
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
|
||||
* or visit www.oracle.com if you need additional information or have any
|
||||
* questions.
|
||||
*/
|
||||
|
||||
// Stub class generated by rmic, do not edit.
|
||||
// Contents subject to change without notice.
|
||||
|
||||
public final class ElucidateNoSuchMethod_Stub
|
||||
extends java.rmi.server.RemoteStub
|
||||
implements ActivateMe, java.rmi.Remote
|
||||
{
|
||||
private static final java.rmi.server.Operation[] operations = {
|
||||
new java.rmi.server.Operation("void ping()"),
|
||||
new java.rmi.server.Operation("void shutdown()")
|
||||
};
|
||||
|
||||
private static final long interfaceHash = 10333549859256328L;
|
||||
|
||||
private static final long serialVersionUID = 2;
|
||||
|
||||
private static boolean useNewInvoke;
|
||||
private static java.lang.reflect.Method $method_ping_0;
|
||||
private static java.lang.reflect.Method $method_shutdown_1;
|
||||
|
||||
static {
|
||||
try {
|
||||
java.rmi.server.RemoteRef.class.getMethod("invoke",
|
||||
new java.lang.Class[] {
|
||||
java.rmi.Remote.class,
|
||||
java.lang.reflect.Method.class,
|
||||
java.lang.Object[].class,
|
||||
long.class
|
||||
});
|
||||
useNewInvoke = true;
|
||||
$method_ping_0 = ActivateMe.class.getMethod("ping", new java.lang.Class[] {});
|
||||
$method_shutdown_1 = ActivateMe.class.getMethod("shutdown", new java.lang.Class[] {});
|
||||
} catch (java.lang.NoSuchMethodException e) {
|
||||
useNewInvoke = false;
|
||||
}
|
||||
}
|
||||
|
||||
// constructors
|
||||
public ElucidateNoSuchMethod_Stub() {
|
||||
super();
|
||||
}
|
||||
public ElucidateNoSuchMethod_Stub(java.rmi.server.RemoteRef ref) {
|
||||
super(ref);
|
||||
}
|
||||
|
||||
// methods from remote interfaces
|
||||
|
||||
// implementation of ping()
|
||||
public void ping()
|
||||
throws java.rmi.RemoteException
|
||||
{
|
||||
try {
|
||||
if (useNewInvoke) {
|
||||
ref.invoke(this, $method_ping_0, null, 5866401369815527589L);
|
||||
} else {
|
||||
java.rmi.server.RemoteCall call = ref.newCall((java.rmi.server.RemoteObject) this, operations, 0, interfaceHash);
|
||||
ref.invoke(call);
|
||||
ref.done(call);
|
||||
}
|
||||
} catch (java.lang.RuntimeException e) {
|
||||
throw e;
|
||||
} catch (java.rmi.RemoteException e) {
|
||||
throw e;
|
||||
} catch (java.lang.Exception e) {
|
||||
throw new java.rmi.UnexpectedException("undeclared checked exception", e);
|
||||
}
|
||||
}
|
||||
|
||||
// implementation of shutdown()
|
||||
public void shutdown()
|
||||
throws java.lang.Exception
|
||||
{
|
||||
if (useNewInvoke) {
|
||||
ref.invoke(this, $method_shutdown_1, null, -7207851917985848402L);
|
||||
} else {
|
||||
java.rmi.server.RemoteCall call = ref.newCall((java.rmi.server.RemoteObject) this, operations, 1, interfaceHash);
|
||||
ref.invoke(call);
|
||||
ref.done(call);
|
||||
}
|
||||
}
|
||||
}
|
@ -1,13 +0,0 @@
|
||||
/*
|
||||
* security policy used by activation groups
|
||||
*/
|
||||
|
||||
grant {
|
||||
permission java.io.FilePermission "..${/}..${/}test.props", "read";
|
||||
permission java.net.SocketPermission "*:1024-", "connect,accept,listen";
|
||||
permission java.util.PropertyPermission "test.*", "read";
|
||||
|
||||
// Needed because of bug#: 4182104
|
||||
permission java.lang.RuntimePermission "modifyThreadGroup";
|
||||
permission java.lang.RuntimePermission "modifyThread";
|
||||
};
|
@ -1,9 +0,0 @@
|
||||
grant {
|
||||
permission com.sun.rmi.rmid.ExecOptionPermission "-Djava.security.manager=default";
|
||||
permission com.sun.rmi.rmid.ExecOptionPermission "-Djava.security.policy=*";
|
||||
|
||||
permission java.lang.RuntimePermission "selectorProvider";
|
||||
permission java.lang.RuntimePermission "accessClassInPackage.sun.nio.ch";
|
||||
permission java.util.PropertyPermission "test.java.rmi.testlibrary.RMIDSelectorProvider.port", "read";
|
||||
permission java.util.PropertyPermission "test.java.rmi.testlibrary.RMIDSelectorProvider.timeout", "read";
|
||||
};
|
@ -1,43 +0,0 @@
|
||||
/*
|
||||
* security policy used by the test process
|
||||
*/
|
||||
|
||||
grant {
|
||||
// Needed because of bug#: 4182104
|
||||
permission java.lang.RuntimePermission "modifyThreadGroup";
|
||||
permission java.lang.RuntimePermission "modifyThread";
|
||||
|
||||
// properties are needed because of bug#: 4179055
|
||||
permission java.lang.RuntimePermission "accessClassInPackage.sun.rmi.server";
|
||||
permission java.util.PropertyPermission "package.restrict.access.sun", "read";
|
||||
permission java.util.PropertyPermission "package.restrict.access.sun.rmi", "read";
|
||||
|
||||
// standard test activation permissions
|
||||
permission java.io.FilePermission "..${/}..${/}test.props", "read";
|
||||
|
||||
// test needs to cleanup rmid's log.
|
||||
permission java.io.FilePermission ".${/}log", "read,write,delete";
|
||||
permission java.io.FilePermission ".${/}log${/}-", "read,write,delete";
|
||||
|
||||
// test needs to use java to exec an rmid
|
||||
permission java.io.FilePermission "${java.home}${/}bin${/}java", "execute";
|
||||
|
||||
// test rmid uses these properties to propagate security values to rmid
|
||||
permission java.util.PropertyPermission "java.security.policy", "read";
|
||||
permission java.util.PropertyPermission "java.security.manager", "read";
|
||||
|
||||
// used by TestLibrary to determine test environment
|
||||
permission java.util.PropertyPermission "test.*", "read";
|
||||
permission java.util.PropertyPermission "user.dir", "read";
|
||||
permission java.util.PropertyPermission "java.home", "read";
|
||||
permission java.util.PropertyPermission "java.rmi.activation.port", "write";
|
||||
|
||||
// Needed to create an activation group
|
||||
permission java.lang.RuntimePermission "setFactory";
|
||||
|
||||
// allow exporting of remote objects on an arbitrary port.
|
||||
permission java.net.SocketPermission "*:1024-", "connect,accept,listen";
|
||||
|
||||
permission java.lang.RuntimePermission "selectorProvider";
|
||||
permission java.lang.RuntimePermission "accessClassInPackage.sun.nio.ch";
|
||||
};
|
@ -1,26 +0,0 @@
|
||||
/*
|
||||
* Copyright (c) 2002, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
* under the terms of the GNU General Public License version 2 only, as
|
||||
* published by the Free Software Foundation.
|
||||
*
|
||||
* This code is distributed in the hope that it will be useful, but WITHOUT
|
||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
* version 2 for more details (a copy is included in the LICENSE file that
|
||||
* accompanied this code).
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License version
|
||||
* 2 along with this work; if not, write to the Free Software Foundation,
|
||||
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
*
|
||||
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
|
||||
* or visit www.oracle.com if you need additional information or have any
|
||||
* questions.
|
||||
*/
|
||||
|
||||
public interface CheckLoader extends java.rmi.Remote {
|
||||
boolean isCorrectContextLoader() throws java.rmi.RemoteException;
|
||||
}
|
@ -1,50 +0,0 @@
|
||||
/*
|
||||
* Copyright (c) 2002, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
* under the terms of the GNU General Public License version 2 only, as
|
||||
* published by the Free Software Foundation.
|
||||
*
|
||||
* This code is distributed in the hope that it will be useful, but WITHOUT
|
||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
* version 2 for more details (a copy is included in the LICENSE file that
|
||||
* accompanied this code).
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License version
|
||||
* 2 along with this work; if not, write to the Free Software Foundation,
|
||||
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
*
|
||||
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
|
||||
* or visit www.oracle.com if you need additional information or have any
|
||||
* questions.
|
||||
*/
|
||||
|
||||
import java.rmi.*;
|
||||
import java.rmi.activation.*;
|
||||
|
||||
public class ExtLoadedImpl implements CheckLoader {
|
||||
|
||||
public ExtLoadedImpl(ActivationID id, MarshalledObject obj)
|
||||
throws ActivationException, RemoteException
|
||||
{
|
||||
Activatable.exportObject(this, id, 0);
|
||||
}
|
||||
|
||||
public boolean isCorrectContextLoader() {
|
||||
ClassLoader contextLoader =
|
||||
Thread.currentThread().getContextClassLoader();
|
||||
ClassLoader implLoader = this.getClass().getClassLoader();
|
||||
if (contextLoader == implLoader) {
|
||||
System.err.println("contextLoader same as implLoader");
|
||||
return false;
|
||||
} else if (contextLoader.getParent() == implLoader) {
|
||||
System.err.println("contextLoader is child of implLoader");
|
||||
return true;
|
||||
} else {
|
||||
System.err.println("unknown loader relationship");
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user