src/share/classes/sun/rmi/server/Activation.java

Print this page

        

*** 136,146 **** */ public class Activation implements Serializable { /** indicate compatibility with JDK 1.2 version of class */ private static final long serialVersionUID = 2921265612698155191L; - private static final byte MAJOR_VERSION = 1; private static final byte MINOR_VERSION = 0; /** exec policy object */ private static Object execPolicy; --- 136,145 ----
*** 296,305 **** --- 295,305 ---- } private static class SystemRegistryImpl extends RegistryImpl { private static final String NAME = ActivationSystem.class.getName(); + private static final long serialVersionUID = 4877330021609408794L; private final ActivationSystem systemStub; SystemRegistryImpl(int port, RMIClientSocketFactory csf, RMIServerSocketFactory ssf,
*** 802,814 **** private static final int TERMINATING = 3; ActivationGroupDesc desc = null; ActivationGroupID groupID = null; long incarnation = 0; ! Map<ActivationID,ObjectEntry> objects = ! new HashMap<ActivationID,ObjectEntry>(); ! Set<ActivationID> restartSet = new HashSet<ActivationID>(); transient ActivationInstantiator group = null; transient int status = NORMAL; transient long waitTime = 0; transient String groupName = null; --- 802,813 ---- private static final int TERMINATING = 3; ActivationGroupDesc desc = null; ActivationGroupID groupID = null; long incarnation = 0; ! Map<ActivationID,ObjectEntry> objects = new HashMap<>(); ! Set<ActivationID> restartSet = new HashSet<>(); transient ActivationInstantiator group = null; transient int status = NORMAL; transient long waitTime = 0; transient String groupName = null;
*** 1055,1064 **** --- 1054,1068 ---- waitTime = System.currentTimeMillis() + groupTimeout; notifyAll(); } } + /* + * Fallthrough from TERMINATE to TERMINATING + * is intentional + */ + @SuppressWarnings("fallthrough") private void await() { while (true) { switch (status) { case NORMAL: return;
*** 1226,1243 **** // handle child I/O streams before writing to child PipeWriter.plugTogetherPair (child.getInputStream(), System.out, child.getErrorStream(), System.err); ! ! MarshalOutputStream out = ! new MarshalOutputStream(child.getOutputStream()); out.writeObject(id); out.writeObject(desc); out.writeLong(incarnation); out.flush(); ! out.close(); } catch (IOException e) { terminate(); throw new ActivationException( --- 1230,1246 ---- // handle child I/O streams before writing to child PipeWriter.plugTogetherPair (child.getInputStream(), System.out, child.getErrorStream(), System.err); ! try (MarshalOutputStream out = ! new MarshalOutputStream(child.getOutputStream())) { out.writeObject(id); out.writeObject(desc); out.writeLong(incarnation); out.flush(); ! } } catch (IOException e) { terminate(); throw new ActivationException(
*** 1350,1360 **** private String[] activationArgs(ActivationGroupDesc desc) { ActivationGroupDesc.CommandEnvironment cmdenv; cmdenv = desc.getCommandEnvironment(); // argv is the literal command to exec ! List<String> argv = new ArrayList<String>(); // Command name/path argv.add((cmdenv != null && cmdenv.getCommandPath() != null) ? cmdenv.getCommandPath() : command[0]); --- 1353,1363 ---- private String[] activationArgs(ActivationGroupDesc desc) { ActivationGroupDesc.CommandEnvironment cmdenv; cmdenv = desc.getCommandEnvironment(); // argv is the literal command to exec ! List<String> argv = new ArrayList<>(); // Command name/path argv.add((cmdenv != null && cmdenv.getCommandPath() != null) ? cmdenv.getCommandPath() : command[0]);
*** 1955,1965 **** "rmid.inherited.channel.info") + ": " + inheritedChannel); } String log = null; ! List<String> childArgs = new ArrayList<String>(); /* * Parse arguments */ for (int i = 0; i < args.length; i++) { --- 1958,1968 ---- "rmid.inherited.channel.info") + ": " + inheritedChannel); } String log = null; ! List<String> childArgs = new ArrayList<>(); /* * Parse arguments */ for (int i = 0; i < args.length; i++) {
*** 2029,2040 **** { execPolicyClassName = DefaultExecPolicy.class.getName(); } try { ! Class<?> execPolicyClass = ! RMIClassLoader.loadClass(execPolicyClassName); execPolicy = execPolicyClass.newInstance(); execPolicyMethod = execPolicyClass.getMethod("checkExecCommand", ActivationGroupDesc.class, String[].class); --- 2032,2043 ---- { execPolicyClassName = DefaultExecPolicy.class.getName(); } try { ! Class<?> execPolicyClass = getRMIClass(execPolicyClassName); ! execPolicy = execPolicyClass.newInstance(); execPolicyMethod = execPolicyClass.getMethod("checkExecCommand", ActivationGroupDesc.class, String[].class);
*** 2121,2130 **** --- 2124,2137 ---- } else { return val; } } + @SuppressWarnings("deprecation") + private static Class<?> getRMIClass(String execPolicyClassName) throws Exception { + return RMIClassLoader.loadClass(execPolicyClassName); + } /* * Dijkstra semaphore operations to limit the number of subprocesses * rmid attempts to make at once. */ /**