You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@river.apache.org by pe...@apache.org on 2010/09/17 22:56:01 UTC
svn commit: r998319 - in /incubator/river/jtsk/trunk:
qa/src/com/sun/jini/qa/harness/ src/com/sun/jini/collection/
src/com/sun/jini/constants/ src/com/sun/jini/discovery/internal/
src/com/sun/jini/example/browser/ src/com/sun/jini/jeri/internal/runtime...
Author: peter_firmstone
Date: Fri Sep 17 20:56:00 2010
New Revision: 998319
URL: http://svn.apache.org/viewvc?rev=998319&view=rev
Log:
Reversion of all experimental changes.
Note that Gregg's CodebaseAccessClassLoader has been removed to enable it to be patched back in later.
Testing to be performed on Hudson.
Removed:
incubator/river/jtsk/trunk/src/net/jini/core/lookup/MarshalledServiceItem.java
incubator/river/jtsk/trunk/src/net/jini/core/lookup/PortableServiceRegistrar.java
incubator/river/jtsk/trunk/src/net/jini/core/lookup/StreamServiceRegistrar.java
incubator/river/jtsk/trunk/src/net/jini/discovery/DiscoveryListenerManagement.java
incubator/river/jtsk/trunk/src/net/jini/discovery/RegistrarManagement.java
incubator/river/jtsk/trunk/src/net/jini/io/MiToMoOutputStream.java
incubator/river/jtsk/trunk/src/net/jini/io/MoToMiInputStream.java
incubator/river/jtsk/trunk/src/net/jini/io/PackageVersion.java
incubator/river/jtsk/trunk/src/net/jini/loader/CodebaseAccessClassLoader.java
incubator/river/jtsk/trunk/src/net/jini/loader/CodebaseAccessOverridePermission.java
incubator/river/jtsk/trunk/src/net/jini/loader/CodebaseClassAccess.java
incubator/river/jtsk/trunk/src/net/jini/loader/RMIClassLoaderCodebaseAccess.java
incubator/river/jtsk/trunk/src/net/jini/lookup/LookupStreamCache.java
incubator/river/jtsk/trunk/src/net/jini/lookup/ServiceResultStreamFilter.java
incubator/river/jtsk/trunk/src/net/jini/lookup/ServiceResultStreamUnmarshaller.java
incubator/river/jtsk/trunk/src/net/jini/lookup/entry/UIDescriptor2.java
incubator/river/jtsk/trunk/test/src/net/jini/discovery/RemoteDiscoveryEventTest.java
incubator/river/jtsk/trunk/test/src/net/jini/io/MiToMoOutputStreamTest.java
incubator/river/jtsk/trunk/test/src/net/jini/io/MoToMiInputStreamTest.java
incubator/river/jtsk/trunk/test/src/net/jini/io/PackageVersionTest.java
Modified:
incubator/river/jtsk/trunk/qa/src/com/sun/jini/qa/harness/MasterTest.java
incubator/river/jtsk/trunk/src/com/sun/jini/collection/WeakIdentityMap.java
incubator/river/jtsk/trunk/src/com/sun/jini/constants/VersionConstants.java
incubator/river/jtsk/trunk/src/com/sun/jini/discovery/internal/MultiIPDiscovery.java
incubator/river/jtsk/trunk/src/com/sun/jini/example/browser/Browser.java
incubator/river/jtsk/trunk/src/com/sun/jini/jeri/internal/runtime/Util.java
incubator/river/jtsk/trunk/src/com/sun/jini/lookup/entry/LookupAttributes.java
incubator/river/jtsk/trunk/src/com/sun/jini/mahalo/JoinStateManager.java
incubator/river/jtsk/trunk/src/com/sun/jini/mahalo/TxnManagerTransaction.java
incubator/river/jtsk/trunk/src/com/sun/jini/norm/NormServerBaseImpl.java
incubator/river/jtsk/trunk/src/com/sun/jini/outrigger/EntryRep.java
incubator/river/jtsk/trunk/src/com/sun/jini/phoenix/ActivationGroupImpl.java
incubator/river/jtsk/trunk/src/com/sun/jini/phoenix/ActivationGroupInit.java
incubator/river/jtsk/trunk/src/com/sun/jini/reggie/EntryClassBase.java
incubator/river/jtsk/trunk/src/net/jini/activation/ActivationGroup.java
incubator/river/jtsk/trunk/src/net/jini/core/lookup/ServiceRegistrar.java
incubator/river/jtsk/trunk/src/net/jini/discovery/DiscoveryManagement.java
incubator/river/jtsk/trunk/src/net/jini/discovery/OutgoingUnicastResponse.java
incubator/river/jtsk/trunk/src/net/jini/io/MarshalInputStream.java
incubator/river/jtsk/trunk/src/net/jini/io/MarshalOutputStream.java
incubator/river/jtsk/trunk/src/net/jini/io/MarshalledObject.java
incubator/river/jtsk/trunk/src/net/jini/lease/LeaseRenewalService.java
incubator/river/jtsk/trunk/src/net/jini/lease/LeaseRenewalSet.java
incubator/river/jtsk/trunk/src/net/jini/lease/LeaseUnmarshalException.java
incubator/river/jtsk/trunk/src/net/jini/loader/ClassAnnotation.java
incubator/river/jtsk/trunk/src/net/jini/loader/DownloadPermission.java
incubator/river/jtsk/trunk/src/net/jini/loader/pref/PreferredClassProvider.java
incubator/river/jtsk/trunk/src/net/jini/loader/pref/RequireDlPermProvider.java
incubator/river/jtsk/trunk/src/net/jini/security/Security.java
incubator/river/jtsk/trunk/src/net/jini/security/policy/PolicyFileProvider.java
incubator/river/jtsk/trunk/src/net/jini/security/proxytrust/BasicUntrustedObjectSecurityContext.java
incubator/river/jtsk/trunk/src/net/jini/security/proxytrust/ProxyTrustVerifier.java
incubator/river/jtsk/trunk/src/net/jini/space/JavaSpace05.java
Modified: incubator/river/jtsk/trunk/qa/src/com/sun/jini/qa/harness/MasterTest.java
URL: http://svn.apache.org/viewvc/incubator/river/jtsk/trunk/qa/src/com/sun/jini/qa/harness/MasterTest.java?rev=998319&r1=998318&r2=998319&view=diff
==============================================================================
--- incubator/river/jtsk/trunk/qa/src/com/sun/jini/qa/harness/MasterTest.java (original)
+++ incubator/river/jtsk/trunk/qa/src/com/sun/jini/qa/harness/MasterTest.java Fri Sep 17 20:56:00 2010
@@ -17,7 +17,6 @@
*/
package com.sun.jini.qa.harness;
-import com.sun.jini.tool.ProfilingSecurityManager;
import java.io.IOException;
import java.io.ObjectInputStream;
import java.io.ObjectOutputStream;
Modified: incubator/river/jtsk/trunk/src/com/sun/jini/collection/WeakIdentityMap.java
URL: http://svn.apache.org/viewvc/incubator/river/jtsk/trunk/src/com/sun/jini/collection/WeakIdentityMap.java?rev=998319&r1=998318&r2=998319&view=diff
==============================================================================
--- incubator/river/jtsk/trunk/src/com/sun/jini/collection/WeakIdentityMap.java (original)
+++ incubator/river/jtsk/trunk/src/com/sun/jini/collection/WeakIdentityMap.java Fri Sep 17 20:56:00 2010
@@ -23,32 +23,26 @@ import java.lang.ref.WeakReference;
import java.util.Collection;
import java.util.HashMap;
import java.util.Map;
-import java.util.Map.Entry;
-import java.util.Set;
/**
- * Identity-based weak hash map. Updated to support Generics and Map<K,V> on
- * 22nd March 2010
+ * Identity-based weak hash map.
*
- * @param K Object Key used for identity
- * @param V Object Value
* @author Sun Microsystems, Inc.
- * @author Peter Firmstone
- * @version 2.0 - Generic Support and Map<K,V> added.
+ *
* @since 2.0
*/
-public class WeakIdentityMap<K,V> implements Map<K,V>{
+public class WeakIdentityMap {
// REMIND: optimize implementation (clone new java.util.WeakHashMap?)
- private final Map<Key, V> map = new HashMap<Key, V>();
+ private final Map map = new HashMap();
private final ReferenceQueue queue = new ReferenceQueue();
/**
* Associates value with given key, returning value previously associated
* with key, or null if none.
*/
- public V put(K key, V value) {
+ public Object put(Object key, Object value) {
processQueue();
return map.put(Key.create(key, queue), value);
}
@@ -56,7 +50,7 @@ public class WeakIdentityMap<K,V> implem
/**
* Returns value associated with given key, or null if none.
*/
- public V get(Object key) {
+ public Object get(Object key) {
processQueue();
return map.get(Key.create(key, null));
}
@@ -65,7 +59,7 @@ public class WeakIdentityMap<K,V> implem
* Removes association for given key, returning value previously associated
* with key, or null if none.
*/
- public V remove(Object key) {
+ public Object remove(Object key) {
processQueue();
return map.remove(Key.create(key, null));
}
@@ -73,7 +67,7 @@ public class WeakIdentityMap<K,V> implem
/**
* Returns collection containing all values currently held in this map.
*/
- public Collection<V> values() {
+ public Collection values() {
processQueue();
return map.values();
}
@@ -93,28 +87,30 @@ public class WeakIdentityMap<K,V> implem
}
}
- private static class Key<T> extends WeakReference<T> {
+ private static class Key extends WeakReference {
private final int hash;
- @SuppressWarnings("unchecked")
static Key create(Object k, ReferenceQueue q) {
- //if (k == null) {return null;} Not so sure we should return null
- if (q == null) {return new Key(k);}
- return new Key(k, q);
+ if (k == null) {
+ return null;
+ } else if (q == null) {
+ return new Key(k);
+ } else {
+ return new Key(k, q);
+ }
}
- private Key(T k) {
+ private Key(Object k) {
super(k);
hash = System.identityHashCode(k);
}
- private Key(T k, ReferenceQueue<? super T> q) {
+ private Key(Object k, ReferenceQueue q) {
super(k, q);
hash = System.identityHashCode(k);
}
- @Override
public boolean equals(Object o) {
if (this == o) {
return true;
@@ -125,37 +121,8 @@ public class WeakIdentityMap<K,V> implem
return (k1 != null && k2 != null && k1 == k2);
}
- @Override
public int hashCode() {
return hash;
}
}
-
- public int size() {
- throw new UnsupportedOperationException("Not supported yet.");
- }
-
- public boolean isEmpty() {
- throw new UnsupportedOperationException("Not supported yet.");
- }
-
- public boolean containsKey(Object key) {
- throw new UnsupportedOperationException("Not supported yet.");
- }
-
- public boolean containsValue(Object value) {
- throw new UnsupportedOperationException("Not supported yet.");
- }
-
- public void putAll(Map<? extends K, ? extends V> m) {
- throw new UnsupportedOperationException("Not supported yet.");
- }
-
- public Set<K> keySet() {
- throw new UnsupportedOperationException("Not supported yet.");
- }
-
- public Set<Entry<K, V>> entrySet() {
- throw new UnsupportedOperationException("Not supported yet.");
- }
}
Modified: incubator/river/jtsk/trunk/src/com/sun/jini/constants/VersionConstants.java
URL: http://svn.apache.org/viewvc/incubator/river/jtsk/trunk/src/com/sun/jini/constants/VersionConstants.java?rev=998319&r1=998318&r2=998319&view=diff
==============================================================================
--- incubator/river/jtsk/trunk/src/com/sun/jini/constants/VersionConstants.java (original)
+++ incubator/river/jtsk/trunk/src/com/sun/jini/constants/VersionConstants.java Fri Sep 17 20:56:00 2010
@@ -25,5 +25,5 @@ package com.sun.jini.constants;
*/
public interface VersionConstants {
/** Current version of the Apache River release */
- String SERVER_VERSION = "2.2.0";
+ String SERVER_VERSION = "2.1.2";
}
Modified: incubator/river/jtsk/trunk/src/com/sun/jini/discovery/internal/MultiIPDiscovery.java
URL: http://svn.apache.org/viewvc/incubator/river/jtsk/trunk/src/com/sun/jini/discovery/internal/MultiIPDiscovery.java?rev=998319&r1=998318&r2=998319&view=diff
==============================================================================
--- incubator/river/jtsk/trunk/src/com/sun/jini/discovery/internal/MultiIPDiscovery.java (original)
+++ incubator/river/jtsk/trunk/src/com/sun/jini/discovery/internal/MultiIPDiscovery.java Fri Sep 17 20:56:00 2010
@@ -29,6 +29,7 @@ import java.net.SocketException;
import java.net.SocketTimeoutException;
import java.net.UnknownHostException;
import net.jini.core.constraint.InvocationConstraints;
+import net.jini.core.lookup.ServiceRegistrar;
/**
* Utility class used by implementations which want to perform unicast
Modified: incubator/river/jtsk/trunk/src/com/sun/jini/example/browser/Browser.java
URL: http://svn.apache.org/viewvc/incubator/river/jtsk/trunk/src/com/sun/jini/example/browser/Browser.java?rev=998319&r1=998318&r2=998319&view=diff
==============================================================================
--- incubator/river/jtsk/trunk/src/com/sun/jini/example/browser/Browser.java (original)
+++ incubator/river/jtsk/trunk/src/com/sun/jini/example/browser/Browser.java Fri Sep 17 20:56:00 2010
@@ -104,11 +104,9 @@ import net.jini.discovery.ConstrainableL
import net.jini.discovery.DiscoveryEvent;
import net.jini.discovery.DiscoveryGroupManagement;
import net.jini.discovery.DiscoveryListener;
-import net.jini.discovery.DiscoveryListenerManagement;
import net.jini.discovery.DiscoveryLocatorManagement;
-//import net.jini.discovery.DiscoveryManagement;
+import net.jini.discovery.DiscoveryManagement;
import net.jini.discovery.LookupDiscoveryManager;
-import net.jini.discovery.RegistrarManagement;
import net.jini.export.Exporter;
import net.jini.jeri.BasicILFactory;
import net.jini.jeri.BasicJeriExporter;
@@ -241,14 +239,9 @@ public class Browser extends JFrame {
Boolean.FALSE)).booleanValue();
listen = new Listener();
try {
- DiscoveryListenerManagement disco = (DiscoveryListenerManagement)
+ DiscoveryManagement disco = (DiscoveryManagement)
Config.getNonNullEntry(config, BROWSER, "discoveryManager",
- DiscoveryListenerManagement.class);
- if (!(disco instanceof RegistrarManagement)) {
- throw new ConfigurationException(
- "discoveryManager does not " +
- " support RegistrarManagement");
- }
+ DiscoveryManagement.class);
if (!(disco instanceof DiscoveryGroupManagement)) {
throw new ConfigurationException(
"discoveryManager does not " +
@@ -367,7 +360,7 @@ public class Browser extends JFrame {
}));
adder = new LookupListener();
lnotify = new LeaseNotify();
- ((RegistrarManagement)disco).addDiscoveryListener(adder);
+ ((DiscoveryManagement) disco).addDiscoveryListener(adder);
}
/**
@@ -1318,7 +1311,7 @@ public class Browser extends JFrame {
private void failure(Throwable t) {
logger.log(Level.INFO, "call to lookup service failed", t);
- ((RegistrarManagement) disco).discard(lookup);
+ ((DiscoveryManagement) disco).discard(lookup);
}
class ServiceItemRenderer implements ListCellRenderer {
Modified: incubator/river/jtsk/trunk/src/com/sun/jini/jeri/internal/runtime/Util.java
URL: http://svn.apache.org/viewvc/incubator/river/jtsk/trunk/src/com/sun/jini/jeri/internal/runtime/Util.java?rev=998319&r1=998318&r2=998319&view=diff
==============================================================================
--- incubator/river/jtsk/trunk/src/com/sun/jini/jeri/internal/runtime/Util.java (original)
+++ incubator/river/jtsk/trunk/src/com/sun/jini/jeri/internal/runtime/Util.java Fri Sep 17 20:56:00 2010
@@ -31,8 +31,10 @@ import java.lang.ref.SoftReference;
import java.lang.reflect.Method;
import java.lang.reflect.Proxy;
import java.net.URL;
+import java.rmi.MarshalledObject;
import java.rmi.Remote;
import java.rmi.RemoteException;
+import java.rmi.activation.ActivationID;
import java.security.DigestOutputStream;
import java.security.MessageDigest;
import java.security.NoSuchAlgorithmException;
@@ -44,7 +46,6 @@ import java.util.HashSet;
import java.util.Map;
import java.util.WeakHashMap;
import java.net.InetAddress;
-// We need a JERI equivalent that extends RemoteException
import java.rmi.server.ServerNotActiveException;
import javax.security.auth.Subject;
import net.jini.export.ServerContext;
@@ -69,10 +70,9 @@ public class Util {
private static Map proxyRemoteMethodCache = new WeakHashMap();
/** parameter types for activatable constructor or activate method */
-// Doesn't appear to be utilised?
-// private static Class[] paramTypes = {
-// ActivationID.class, MarshalledObject.class
-// };
+ private static Class[] paramTypes = {
+ ActivationID.class, MarshalledObject.class
+ };
/** name of the resource containing prohibited proxy interfaces */
private static final String prohibitedProxyInterfacesResource =
Modified: incubator/river/jtsk/trunk/src/com/sun/jini/lookup/entry/LookupAttributes.java
URL: http://svn.apache.org/viewvc/incubator/river/jtsk/trunk/src/com/sun/jini/lookup/entry/LookupAttributes.java?rev=998319&r1=998318&r2=998319&view=diff
==============================================================================
--- incubator/river/jtsk/trunk/src/com/sun/jini/lookup/entry/LookupAttributes.java (original)
+++ incubator/river/jtsk/trunk/src/com/sun/jini/lookup/entry/LookupAttributes.java Fri Sep 17 20:56:00 2010
@@ -22,10 +22,10 @@ import net.jini.core.entry.Entry;
import net.jini.lookup.entry.ServiceControlled;
import java.lang.reflect.Field;
import java.lang.reflect.Modifier;
+import java.rmi.MarshalledObject;
import java.io.IOException;
import java.util.Arrays;
import java.util.Comparator;
-import net.jini.io.MarshalledInstance;
/**
* Some simple utilities for manipulating lookup service attributes.
@@ -345,7 +345,7 @@ public class LookupAttributes {
c == Short.class)
return o1.equals(o2);
try {
- return new MarshalledInstance(o1).equals(new MarshalledInstance(o2));
+ return new MarshalledObject(o1).equals(new MarshalledObject(o2));
} catch (IOException ex) {
throw new IllegalArgumentException("unexpected IOException");
}
Modified: incubator/river/jtsk/trunk/src/com/sun/jini/mahalo/JoinStateManager.java
URL: http://svn.apache.org/viewvc/incubator/river/jtsk/trunk/src/com/sun/jini/mahalo/JoinStateManager.java?rev=998319&r1=998318&r2=998319&view=diff
==============================================================================
--- incubator/river/jtsk/trunk/src/com/sun/jini/mahalo/JoinStateManager.java (original)
+++ incubator/river/jtsk/trunk/src/com/sun/jini/mahalo/JoinStateManager.java Fri Sep 17 20:56:00 2010
@@ -50,7 +50,6 @@ import com.sun.jini.config.Config;
import com.sun.jini.logging.Levels;
import com.sun.jini.reliableLog.LogHandler;
import com.sun.jini.reliableLog.ReliableLog;
-import net.jini.io.MiToMoOutputStream;
/**
* <code>JoinStateManager</code> provides a utility that manages
@@ -726,7 +725,7 @@ class JoinStateManager extends LogHandle
// this makes sure that the attribute's code base is preserved
// and when we unpack to discard attributes who's codebase
// has been lost without throwing away those we can still deal with.
- // ObjectOutput newOut = new MiToMoOutputStream(out);
+
out.writeInt(attributes.length);
for (int i=0; i<attributes.length; i++) {
out.writeObject(new MarshalledObject(attributes[i]));
Modified: incubator/river/jtsk/trunk/src/com/sun/jini/mahalo/TxnManagerTransaction.java
URL: http://svn.apache.org/viewvc/incubator/river/jtsk/trunk/src/com/sun/jini/mahalo/TxnManagerTransaction.java?rev=998319&r1=998318&r2=998319&view=diff
==============================================================================
--- incubator/river/jtsk/trunk/src/com/sun/jini/mahalo/TxnManagerTransaction.java (original)
+++ incubator/river/jtsk/trunk/src/com/sun/jini/mahalo/TxnManagerTransaction.java Fri Sep 17 20:56:00 2010
@@ -18,6 +18,7 @@
package com.sun.jini.mahalo;
import net.jini.id.Uuid;
+import net.jini.core.lease.Lease;
import net.jini.core.transaction.*;
import net.jini.core.transaction.server.*;
import net.jini.security.ProxyPreparer;
@@ -31,13 +32,18 @@ import com.sun.jini.logging.Levels;
import com.sun.jini.thread.TaskManager;
import com.sun.jini.thread.WakeupManager;
+import java.rmi.MarshalledObject;
import java.rmi.RemoteException;
import java.util.Enumeration;
+import java.util.Collections;
import java.util.Date;
+import java.util.HashMap;
+import java.util.Iterator;
import java.util.List;
import java.util.logging.Level;
import java.util.logging.Logger;
+import java.util.Map;
import java.util.Vector;
/**
Modified: incubator/river/jtsk/trunk/src/com/sun/jini/norm/NormServerBaseImpl.java
URL: http://svn.apache.org/viewvc/incubator/river/jtsk/trunk/src/com/sun/jini/norm/NormServerBaseImpl.java?rev=998319&r1=998318&r2=998319&view=diff
==============================================================================
--- incubator/river/jtsk/trunk/src/com/sun/jini/norm/NormServerBaseImpl.java (original)
+++ incubator/river/jtsk/trunk/src/com/sun/jini/norm/NormServerBaseImpl.java Fri Sep 17 20:56:00 2010
@@ -26,6 +26,7 @@ import java.io.OutputStream;
import java.rmi.MarshalledObject;
import java.rmi.NoSuchObjectException;
import java.rmi.RemoteException;
+import java.rmi.server.RMIClassLoader;
import java.security.PrivilegedActionException;
import java.security.PrivilegedExceptionAction;
import java.util.Collection;
@@ -43,10 +44,13 @@ import java.util.logging.Logger;
import javax.security.auth.Subject;
import javax.security.auth.login.LoginContext;
+import net.jini.admin.Administrable;
+import net.jini.admin.JoinAdmin;
import net.jini.config.Configuration;
import net.jini.config.ConfigurationException;
import net.jini.config.ConfigurationProvider;
import net.jini.config.NoSuchEntryException;
+import net.jini.core.constraint.RemoteMethodControl;
import net.jini.core.discovery.LookupLocator;
import net.jini.core.entry.Entry;
import net.jini.core.event.EventRegistration;
@@ -73,6 +77,7 @@ import net.jini.security.BasicProxyPrepa
import net.jini.security.ProxyPreparer;
import net.jini.security.TrustVerifier;
import net.jini.security.proxytrust.ServerProxyTrust;
+import net.jini.security.proxytrust.TrustEquivalence;
import com.sun.jini.config.Config;
import com.sun.jini.constants.ThrowableConstants;
@@ -83,6 +88,7 @@ import com.sun.jini.landlord.LandlordUti
import com.sun.jini.landlord.LeaseFactory;
import com.sun.jini.landlord.LeasePeriodPolicy;
import com.sun.jini.landlord.LocalLandlord;
+import com.sun.jini.logging.Levels;
import com.sun.jini.lookup.entry.BasicServiceType;
import com.sun.jini.norm.event.EventType;
import com.sun.jini.norm.event.EventTypeGenerator;
@@ -93,9 +99,6 @@ import com.sun.jini.start.LifeCycle;
import com.sun.jini.reliableLog.LogException;
import com.sun.jini.reliableLog.LogHandler;
import com.sun.jini.thread.InterruptedStatusThread;
-import net.jini.core.constraint.RemoteMethodControl;
-import net.jini.loader.CodebaseAccessClassLoader;
-import net.jini.security.proxytrust.TrustEquivalence;
/**
* Base class for implementations of NormServer. Provides a complete
@@ -294,7 +297,7 @@ abstract class NormServerBaseImpl
"Adding lease of class {0} with annotation {1}",
new Object[] {
leaseToRenew.getClass(),
- CodebaseAccessClassLoader.getClassAnnotation(lc) });
+ RMIClassLoader.getClassAnnotation(lc) });
}
// Add the lease to the set
@@ -1336,7 +1339,6 @@ abstract class NormServerBaseImpl
* so it will not hang up in-progress remote calls
*/
private class SnapshotThread extends InterruptedStatusThread {
- private boolean snapshotRequested = false;
/** Create a daemon thread */
private SnapshotThread() {
super("snapshot thread");
@@ -1345,7 +1347,6 @@ abstract class NormServerBaseImpl
/** Signal this thread that is should take a snapshot */
private synchronized void takeSnapshot() {
- snapshotRequested = true;
notifyAll();
}
@@ -1353,13 +1354,9 @@ abstract class NormServerBaseImpl
while (!hasBeenInterrupted()) {
synchronized (this) {
try {
- while (!snapshotRequested) {
- wait();
- }
+ wait();
} catch (InterruptedException e) {
return;
- } finally {
- snapshotRequested = false;
}
}
Modified: incubator/river/jtsk/trunk/src/com/sun/jini/outrigger/EntryRep.java
URL: http://svn.apache.org/viewvc/incubator/river/jtsk/trunk/src/com/sun/jini/outrigger/EntryRep.java?rev=998319&r1=998318&r2=998319&view=diff
==============================================================================
--- incubator/river/jtsk/trunk/src/com/sun/jini/outrigger/EntryRep.java (original)
+++ incubator/river/jtsk/trunk/src/com/sun/jini/outrigger/EntryRep.java Fri Sep 17 20:56:00 2010
@@ -34,10 +34,12 @@ import java.lang.reflect.Modifier;
import java.net.MalformedURLException;
import java.rmi.MarshalException;
import java.rmi.UnmarshalException;
+import java.rmi.server.RMIClassLoader;
import java.security.DigestOutputStream;
import java.security.MessageDigest;
import java.util.ArrayList;
import java.util.Arrays;
+import java.util.Iterator;
import java.util.Comparator;
import java.util.WeakHashMap;
import java.util.logging.Logger;
@@ -48,8 +50,6 @@ import net.jini.id.Uuid;
import net.jini.id.UuidFactory;
import net.jini.io.MarshalledInstance;
import net.jini.loader.ClassLoading;
-import net.jini.loader.CodebaseAccessClassLoader;
-import net.jini.space.JavaSpace;
/**
* An <code>EntryRep</code> object contains a packaged
@@ -234,7 +234,7 @@ class EntryRep implements StorableResour
if (validate)
ensureValidClass(realClass);
className = realClass.getName();
- codebase = CodebaseAccessClassLoader.getClassAnnotation(realClass);
+ codebase = RMIClassLoader.getClassAnnotation(realClass);
/*
* Build up the per-field and superclass information through
@@ -489,10 +489,6 @@ class EntryRep implements StorableResour
} catch (MarshalException e) {
// because we call findHash() w/ false, should never happen
throw new AssertionError(e);
- } catch (IOException e) {
- // see above
- throw throwNewUnusableEntryException("I/O Error " +
- "associated with entry of type " + className, e);
}
}
Modified: incubator/river/jtsk/trunk/src/com/sun/jini/phoenix/ActivationGroupImpl.java
URL: http://svn.apache.org/viewvc/incubator/river/jtsk/trunk/src/com/sun/jini/phoenix/ActivationGroupImpl.java?rev=998319&r1=998318&r2=998319&view=diff
==============================================================================
--- incubator/river/jtsk/trunk/src/com/sun/jini/phoenix/ActivationGroupImpl.java (original)
+++ incubator/river/jtsk/trunk/src/com/sun/jini/phoenix/ActivationGroupImpl.java Fri Sep 17 20:56:00 2010
@@ -32,6 +32,7 @@ import java.rmi.Remote;
import java.rmi.RemoteException;
import java.rmi.activation.*;
import java.rmi.server.ExportException;
+import java.rmi.server.RMIClassLoader;
import java.rmi.server.RemoteObject;
import java.rmi.server.UnicastRemoteObject;
import java.security.AccessController;
@@ -54,7 +55,6 @@ import net.jini.export.Exporter;
import net.jini.export.ProxyAccessor;
import net.jini.jeri.BasicJeriExporter;
import net.jini.jeri.tcp.TcpServerEndpoint;
-import net.jini.loader.CodebaseAccessClassLoader;
import net.jini.security.BasicProxyPreparer;
import net.jini.security.ProxyPreparer;
import net.jini.security.Security;
@@ -617,7 +617,7 @@ public class ActivationGroupImpl extends
* <p>Otherwise:
*
* <p>The class for the object is loaded by invoking {@link
- * CodebaseAccessClassLoader#loadClass(String,String) CodebaseAccessClassLoader.loadClass}
+ * RMIClassLoader#loadClass(String,String) RMIClassLoader.loadClass}
* passing the class location (obtained by invoking {@link
* ActivationDesc#getLocation getLocation} on the activation
* descriptor) and the class name (obtained by invoking {@link
@@ -693,7 +693,7 @@ public class ActivationGroupImpl extends
}
String className = desc.getClassName();
- final Class cl = CodebaseAccessClassLoader.loadClass(desc.getLocation(),
+ final Class cl = RMIClassLoader.loadClass(desc.getLocation(),
className);
final Thread t = Thread.currentThread();
final ClassLoader savedCcl = t.getContextClassLoader();
Modified: incubator/river/jtsk/trunk/src/com/sun/jini/phoenix/ActivationGroupInit.java
URL: http://svn.apache.org/viewvc/incubator/river/jtsk/trunk/src/com/sun/jini/phoenix/ActivationGroupInit.java?rev=998319&r1=998318&r2=998319&view=diff
==============================================================================
--- incubator/river/jtsk/trunk/src/com/sun/jini/phoenix/ActivationGroupInit.java (original)
+++ incubator/river/jtsk/trunk/src/com/sun/jini/phoenix/ActivationGroupInit.java Fri Sep 17 20:56:00 2010
@@ -22,9 +22,9 @@ import java.lang.reflect.Method;
import java.rmi.activation.ActivationGroup;
import java.rmi.activation.ActivationGroupDesc;
import java.rmi.activation.ActivationGroupID;
+import java.rmi.server.RMIClassLoader;
import java.util.Collections;
import net.jini.io.MarshalInputStream;
-import net.jini.loader.CodebaseAccessClassLoader;
/**
* This is the bootstrap code to start a virtual machine (VM) executing an
@@ -70,7 +70,7 @@ class ActivationGroupInit {
ActivationGroupID id = (ActivationGroupID)in.readObject();
ActivationGroupDesc desc = (ActivationGroupDesc)in.readObject();
long incarnation = in.readLong();
- Class cl = CodebaseAccessClassLoader.loadClass(desc.getLocation(),
+ Class cl = RMIClassLoader.loadClass(desc.getLocation(),
desc.getClassName());
try {
Method create =
Modified: incubator/river/jtsk/trunk/src/com/sun/jini/reggie/EntryClassBase.java
URL: http://svn.apache.org/viewvc/incubator/river/jtsk/trunk/src/com/sun/jini/reggie/EntryClassBase.java?rev=998319&r1=998318&r2=998319&view=diff
==============================================================================
--- incubator/river/jtsk/trunk/src/com/sun/jini/reggie/EntryClassBase.java (original)
+++ incubator/river/jtsk/trunk/src/com/sun/jini/reggie/EntryClassBase.java Fri Sep 17 20:56:00 2010
@@ -17,8 +17,9 @@
*/
package com.sun.jini.reggie;
+import java.rmi.server.RMIClassLoader;
+import java.io.IOException;
import java.io.Serializable;
-import net.jini.loader.CodebaseAccessClassLoader;
/**
* An EntryClass annotated with a codebase.
@@ -51,7 +52,7 @@ class EntryClassBase implements Serializ
/** Sets the codebase to the codebase of the given class. */
public void setCodebase(Class cls) {
- codebase = CodebaseAccessClassLoader.getClassAnnotation(cls);
+ codebase = RMIClassLoader.getClassAnnotation(cls);
}
/**
Modified: incubator/river/jtsk/trunk/src/net/jini/activation/ActivationGroup.java
URL: http://svn.apache.org/viewvc/incubator/river/jtsk/trunk/src/net/jini/activation/ActivationGroup.java?rev=998319&r1=998318&r2=998319&view=diff
==============================================================================
--- incubator/river/jtsk/trunk/src/net/jini/activation/ActivationGroup.java (original)
+++ incubator/river/jtsk/trunk/src/net/jini/activation/ActivationGroup.java Fri Sep 17 20:56:00 2010
@@ -23,10 +23,10 @@ import java.rmi.activation.ActivationExc
import java.rmi.activation.ActivationGroupDesc;
import java.rmi.activation.ActivationGroupID;
import java.rmi.activation.ActivationID;
+import java.rmi.server.RMIClassLoader;
import java.security.PrivilegedExceptionAction;
import java.security.PrivilegedActionException;
import net.jini.export.Exporter;
-import net.jini.loader.CodebaseAccessClassLoader;
import net.jini.security.Security;
/**
@@ -129,7 +129,7 @@ public abstract class ActivationGroup
Class cl = (Class) Security.doPrivileged(
new PrivilegedExceptionAction() {
public Object run() throws Exception {
- return CodebaseAccessClassLoader.loadClass(location, className);
+ return RMIClassLoader.loadClass(location, className);
}
});
return ActivationGroup.class.isAssignableFrom(cl);
Modified: incubator/river/jtsk/trunk/src/net/jini/core/lookup/ServiceRegistrar.java
URL: http://svn.apache.org/viewvc/incubator/river/jtsk/trunk/src/net/jini/core/lookup/ServiceRegistrar.java?rev=998319&r1=998318&r2=998319&view=diff
==============================================================================
--- incubator/river/jtsk/trunk/src/net/jini/core/lookup/ServiceRegistrar.java (original)
+++ incubator/river/jtsk/trunk/src/net/jini/core/lookup/ServiceRegistrar.java Fri Sep 17 20:56:00 2010
@@ -19,8 +19,8 @@ package net.jini.core.lookup;
import java.rmi.RemoteException;
import java.rmi.MarshalledObject;
-import net.jini.core.event.EventRegistration;
-import net.jini.core.event.RemoteEventListener;
+import net.jini.core.event.*;
+import net.jini.core.discovery.LookupLocator;
/**
* Defines the interface to the lookup service. The interface is not a
@@ -39,7 +39,107 @@ import net.jini.core.event.RemoteEventLi
*
* @since 1.0
*/
-public interface ServiceRegistrar extends PortableServiceRegistrar {
+public interface ServiceRegistrar {
+
+ /**
+ * Register a new service or re-register an existing service. The method
+ * is defined so that it can be used in an idempotent fashion.
+ * Specifically, if a call to register results in a RemoteException (in
+ * which case the item might or might not have been registered), the
+ * caller can simply repeat the call to register with the same parameters,
+ * until it succeeds.
+ * <p>
+ * To register a new service, item.serviceID should be null. In that
+ * case, if item.service does not equal (using MarshalledObject.equals)
+ * any existing item's service object, then a new service ID will be
+ * assigned and included in the returned ServiceRegistration. The
+ * service ID is unique over time and space with respect to all other
+ * service IDs generated by all lookup services. If item.service does
+ * equal an existing item's service object, the existing item is first
+ * deleted from the lookup service (even if it has different attributes)
+ * and its lease is cancelled, but that item's service ID is reused for
+ * the newly registered item.
+ * <p>
+ * To re-register an existing service, or to register the service in any
+ * other lookup service, item.serviceID should be set to the same service
+ * ID that was returned by the initial registration. If an item is
+ * already registered under the same service ID, the existing item is
+ * first deleted (even if it has different attributes or a different
+ * service instance) and its lease is cancelled. Note that service
+ * object equality is not checked in this case, to allow for reasonable
+ * evolution of the service (e.g., the serialized form of the stub
+ * changes, or the service implements a new interface).
+ * <p>
+ * Any duplicate attribute sets included in a service item are eliminated
+ * in the stored representation of the item. The lease duration request
+ * is not exact; the returned lease is allowed to have a shorter (but not
+ * longer) duration than what was requested. The registration is
+ * persistent across restarts (crashes) of the lookup service until the
+ * lease expires or is cancelled.
+ *
+ * @param item service item to register
+ * @param leaseDuration requested lease duration, in milliseconds
+ * @return a ServiceRegistration in this lookup service for the specified
+ * service item
+ * @throws java.rmi.RemoteException
+ */
+ ServiceRegistration register(ServiceItem item, long leaseDuration)
+ throws RemoteException;
+
+ /**
+ * Returns the service object (i.e., just ServiceItem.service) from an
+ * item matching the template, or null if there is no match. If multiple
+ * items match the template, it is arbitrary as to which service object
+ * is returned. If the returned object cannot be deserialized, an
+ * UnmarshalException is thrown with the standard RMI semantics.
+ *
+ * @param tmpl template to match
+ * @return an object that represents a service that matches the
+ * specified template
+ * @throws java.rmi.RemoteException
+ */
+ Object lookup(ServiceTemplate tmpl) throws RemoteException;
+
+ /**
+ * Returns at most maxMatches items matching the template, plus the total
+ * number of items that match the template. The return value is never
+ * null, and the returned items array is only null if maxMatches is zero.
+ * For each returned item, if the service object cannot be deserialized,
+ * the service field of the item is set to null and no exception is
+ * thrown. Similarly, if an attribute set cannot be deserialized, that
+ * element of the attributeSets array is set to null and no exception
+ * is thrown.
+ *
+ * @param tmpl template to match
+ * @param maxMatches maximum number of matches to return
+ * @return a ServiceMatches instance that contains at most maxMatches
+ * items matching the template, plus the total number of items
+ * that match the template. The return value is never null, and
+ * the returned items array is only null if maxMatches is zero.
+ * @throws java.rmi.RemoteException
+ */
+ ServiceMatches lookup(ServiceTemplate tmpl, int maxMatches)
+ throws RemoteException;
+
+ /**
+ * An event is sent when the changed item matches the template before
+ * the operation, but doesn't match the template after the operation
+ * (this includes deletion of the item).
+ */
+ int TRANSITION_MATCH_NOMATCH = 1 << 0;
+
+ /**
+ * An event is sent when the changed item doesn't match the template
+ * before the operation (this includes not existing), but does match
+ * the template after the operation.
+ */
+ int TRANSITION_NOMATCH_MATCH = 1 << 1;
+
+ /**
+ * An event is sent when the changed item matches the template both
+ * before and after the operation.
+ */
+ int TRANSITION_MATCH_MATCH = 1 << 2;
/**
* Registers for event notification. The registration is leased; the
@@ -69,4 +169,101 @@ public interface ServiceRegistrar extend
MarshalledObject handback,
long leaseDuration)
throws RemoteException;
+
+ /**
+ * Looks at all service items that match the specified template, finds
+ * every entry (among those service items) that either doesn't match any
+ * entry templates or is a subclass of at least one matching entry
+ * template, and returns the set of the (most specific) classes of those
+ * entries. Duplicate classes are eliminated, and the order of classes
+ * within the returned array is arbitrary. Null (not an empty array) is
+ * returned if there are no such entries or no matching items. If a
+ * returned class cannot be deserialized, that element of the returned
+ * array is set to null and no exception is thrown.
+ *
+ * @param tmpl template to match
+ * @return an array of entry Classes (attribute sets) for every service
+ * that matches the specified template
+ * @throws java.rmi.RemoteException
+ */
+ Class[] getEntryClasses(ServiceTemplate tmpl) throws RemoteException;
+
+ /**
+ * Looks at all service items that match the specified template, finds
+ * every entry (among those service items) that matches
+ * tmpl.attributeSetTemplates[setIndex], and returns the set of values
+ * of the specified field of those entries. Duplicate values are
+ * eliminated, and the order of values within the returned array is
+ * arbitrary. Null (not an empty array) is returned if there are no
+ * matching items. If a returned value cannot be deserialized, that
+ * element of the returned array is set to null and no exception is
+ * thrown.
+ *
+ * @param tmpl template to match
+ * @param setIndex index into tmpl.attributeSetTemplates
+ * @param field name of field of tmpl.attributeSetTemplates[setIndex]
+ *
+ * @return an array of objects that represents field values of entries
+ * associated with services that meet the specified matching
+ * criteria
+ *
+ * @throws NoSuchFieldException field does not name a field of the
+ * entry template
+ * @throws java.rmi.RemoteException
+ */
+ Object[] getFieldValues(ServiceTemplate tmpl, int setIndex, String field)
+ throws NoSuchFieldException, RemoteException;
+
+ /**
+ * Looks at all service items that match the specified template, and for
+ * every service item finds the most specific type (class or interface)
+ * or types the service item is an instance of that are neither equal to,
+ * nor a superclass of, any of the service types in the template and that
+ * have names that start with the specified prefix, and returns the set
+ * of all such types. Duplicate types are eliminated, and the order of
+ * types within the returned array is arbitrary. Null (not an empty
+ * array) is returned if there are no such types. If a returned type
+ * cannot be deserialized, that element of the returned array is set to
+ * null and no exception is thrown.
+ *
+ * @param tmpl template to match
+ * @param prefix class name prefix
+ *
+ * @return an array of Classes of all services that either match the
+ * specified template or match the specified prefix
+ * @throws java.rmi.RemoteException
+ */
+ Class[] getServiceTypes(ServiceTemplate tmpl, String prefix)
+ throws RemoteException;
+
+ /**
+ * Returns the service ID of the lookup service. Note that this does not
+ * make a remote call. A lookup service is always registered with itself
+ * under this service ID, and if a lookup service is configured to
+ * register itself with other lookup services, it will register with all
+ * of them using this same service ID.
+ *
+ * @return the service ID of the lookup service.
+ */
+ ServiceID getServiceID();
+
+ /**
+ * Returns a LookupLocator that can be used if necessary for unicast
+ * discovery of the lookup service.
+ *
+ * @return a LookupLocator that can be used for unicast discovery of
+ * the lookup service, if necessary.
+ * @throws java.rmi.RemoteException
+ */
+ LookupLocator getLocator() throws RemoteException;
+
+ /**
+ * Returns the set of groups that this lookup service is currently a
+ * member of.
+ *
+ * @return a String array of groups that this lookup service is currently
+ * a member of.
+ * @throws java.rmi.RemoteException
+ */
+ String[] getGroups() throws RemoteException;
}
Modified: incubator/river/jtsk/trunk/src/net/jini/discovery/DiscoveryManagement.java
URL: http://svn.apache.org/viewvc/incubator/river/jtsk/trunk/src/net/jini/discovery/DiscoveryManagement.java?rev=998319&r1=998318&r2=998319&view=diff
==============================================================================
--- incubator/river/jtsk/trunk/src/net/jini/discovery/DiscoveryManagement.java (original)
+++ incubator/river/jtsk/trunk/src/net/jini/discovery/DiscoveryManagement.java Fri Sep 17 20:56:00 2010
@@ -28,10 +28,47 @@ import net.jini.core.lookup.ServiceRegis
* or terminate the discovery process.
*
* @author Sun Microsystems, Inc.
- * @deprecated replaced by {@link net.jini.discovery.DiscoveryManagement2}
*/
-@Deprecated
-public interface DiscoveryManagement extends DiscoveryListenerManagement {
+public interface DiscoveryManagement {
+
+ /**
+ * Adds an instance of <code>DiscoveryListener</code> to the set of
+ * objects listening for discovery events. Once the listener is
+ * registered, it will be notified of all lookup services discovered
+ * to date, and will then be notified as new lookup services are
+ * discovered or existing lookup services are discarded.
+ * <p>
+ * If <code>null</code> is input to this method, a
+ * <code>NullPointerException</code> is thrown. If the listener
+ * input to this method duplicates (using the <code>equals</code>
+ * method) another element in the current set of listeners, no action
+ * is taken.
+ *
+ * @param listener an instance of <code>DiscoveryListener</code>
+ * corresponding to the listener to add to the set of
+ * listeners.
+ *
+ * @throws java.lang.NullPointerException if <code>null</code> is
+ * input to the <code>listener</code> parameter
+ *
+ * @see #removeDiscoveryListener
+ * @see net.jini.discovery.DiscoveryListener
+ */
+ public void addDiscoveryListener(DiscoveryListener listener);
+
+ /**
+ * Removes a listener from the set of objects listening for discovery
+ * events. If the listener object input to this method does not exist
+ * in the set of listeners, then this method will take no action.
+ *
+ * @param listener an instance of <code>DiscoveryListener</code>
+ * corresponding to the listener to remove from the set
+ * of listeners.
+ *
+ * @see #addDiscoveryListener
+ * @see net.jini.discovery.DiscoveryListener
+ */
+ public void removeDiscoveryListener(DiscoveryListener listener);
/**
* Returns an array of instances of <code>ServiceRegistrar</code>, each
@@ -53,16 +90,21 @@ public interface DiscoveryManagement ext
* the parameter input to this method is <code>null</code>, or if it
* does not match (using <code>equals</code>) any of the elements in
* the managed set.
- *
- * Changing the Parameter to PortableServiceRegistrar doesn't break client
- * code, but it may break implementation code if that code utilises
- * the nofify method from ServiceRegistrar
*
- * @param proxy the instance of <code>PortableServiceRegistrar</code> to remove
+ * @param proxy the instance of <code>ServiceRegistrar</code> to remove
* from the managed set of lookup services
*
- * @see net.jini.core.lookup.PortableServiceRegistrar
* @see net.jini.core.lookup.ServiceRegistrar
*/
public void discard(ServiceRegistrar proxy);
+
+ /**
+ * Ends all discovery processing being performed by the current
+ * implementation of this interface. After this method is invoked,
+ * no new lookup services will be discovered, and the effect of any
+ * new operations performed on the current implementation object are
+ * undefined. Any additional termination semantics must be defined
+ * by the implementation class itself.
+ */
+ public void terminate();
}
Modified: incubator/river/jtsk/trunk/src/net/jini/discovery/OutgoingUnicastResponse.java
URL: http://svn.apache.org/viewvc/incubator/river/jtsk/trunk/src/net/jini/discovery/OutgoingUnicastResponse.java?rev=998319&r1=998318&r2=998319&view=diff
==============================================================================
--- incubator/river/jtsk/trunk/src/net/jini/discovery/OutgoingUnicastResponse.java (original)
+++ incubator/river/jtsk/trunk/src/net/jini/discovery/OutgoingUnicastResponse.java Fri Sep 17 20:56:00 2010
@@ -21,10 +21,7 @@ import java.io.ObjectOutputStream;
import java.io.IOException;
import java.io.OutputStream;
import java.rmi.MarshalledObject;
-import net.jini.core.lookup.PortableServiceRegistrar;
import net.jini.core.lookup.ServiceRegistrar;
-import net.jini.io.MarshalledInstance;
-import net.jini.io.MiToMoOutputStream;
/**
* Encapsulate the details of marshaling a unicast response.
@@ -42,22 +39,6 @@ public class OutgoingUnicastResponse {
/**
* Marshal a unicast response to the given output stream. The
* stream is flushed afterwards.
- *
- * Older Versions of Apache River prior to 2.2.0 participating in a djinn,
- * will not have the ability to wrap a PortableServiceRegistrar, so it
- * can participate as a ServiceRegistrar instance.
- * However it is intended that the Registrar's
- * proxy's implementation will be able to be unmarshalled
- * with a suitable codebase that also implements ServiceRegistrar for
- * recipients IncomingUnicastRequest's
- *
- * At some future point in time, a djinn will have a minimum Apache River
- * version requirement for participation, at that stage old application
- * code will rely upon the PortableServiceRegistrarWrapper and ServiceRegistrar
- * will no longer be implemented directly by the proxy class.
- *
- * At the same point in time the serialized form of the PortableServiceRegistrar
- * will be that of MarshalledInstance, not MarshalledObject as it currently is.
*
* @param str the stream to marshal to
* @param reg the registrar object to marshal
@@ -66,17 +47,16 @@ public class OutgoingUnicastResponse {
* @exception IOException a problem occurred during marshaling
*/
public static void marshal(OutputStream str,
- PortableServiceRegistrar reg,
+ ServiceRegistrar reg,
String[] groups)
throws IOException
{
- ObjectOutputStream ostr = new MiToMoOutputStream(str);
- ostr.writeObject(new MarshalledInstance(reg));
+ ObjectOutputStream ostr = new ObjectOutputStream(str);
+ ostr.writeObject(new MarshalledObject(reg));
ostr.writeInt(groups.length);
for (int i = 0; i < groups.length; i++) {
ostr.writeUTF(groups[i]);
}
ostr.flush();
}
-
}
Modified: incubator/river/jtsk/trunk/src/net/jini/io/MarshalInputStream.java
URL: http://svn.apache.org/viewvc/incubator/river/jtsk/trunk/src/net/jini/io/MarshalInputStream.java?rev=998319&r1=998318&r2=998319&view=diff
==============================================================================
--- incubator/river/jtsk/trunk/src/net/jini/io/MarshalInputStream.java (original)
+++ incubator/river/jtsk/trunk/src/net/jini/io/MarshalInputStream.java Fri Sep 17 20:56:00 2010
@@ -23,18 +23,19 @@ import java.io.InputStream;
import java.io.InvalidObjectException;
import java.io.ObjectInputStream;
import java.io.ObjectStreamClass;
+import java.net.MalformedURLException;
+import java.rmi.server.RMIClassLoader;
import java.util.Collection;
import java.util.HashMap;
import java.util.Map;
import net.jini.loader.ClassLoading;
-import net.jini.loader.CodebaseAccessClassLoader;
import net.jini.security.Security;
/**
* An extension of <code>ObjectInputStream</code> that implements the
* dynamic class loading semantics of Java(TM) Remote Method
* Invocation (Java RMI) argument and result
- * unmarshalling (using {@link CodebaseAccessClassLoader}). A
+ * unmarshalling (using {@link RMIClassLoader}). A
* <code>MarshalInputStream</code> is intended to read data written by
* a corresponding {@link MarshalOutputStream}.
*
@@ -45,10 +46,10 @@ import net.jini.security.Security;
* class descriptors in the stream using {@link ClassLoading#loadClass
* ClassLoading.loadClass} and {@link ClassLoading#loadProxyClass
* ClassLoading.loadProxyClass} (which, in turn, use {@link
- * CodebaseAccessClassLoader#loadClass(String,String,ClassLoader)
- * CodebaseAccessClassLoader.loadClass} and {@link
- * CodebaseAccessClassLoader#loadProxyClass(String,String[],ClassLoader)
- * CodebaseAccessClassLoader.loadProxyClass}), optionally with codebase
+ * RMIClassLoader#loadClass(String,String,ClassLoader)
+ * RMIClassLoader.loadClass} and {@link
+ * RMIClassLoader#loadProxyClass(String,String[],ClassLoader)
+ * RMIClassLoader.loadProxyClass}), optionally with codebase
* annotation strings written by a <code>MarshalOutputStream</code>.
*
* <p>By default, a <code>MarshalInputStream</code> ignores all
Modified: incubator/river/jtsk/trunk/src/net/jini/io/MarshalOutputStream.java
URL: http://svn.apache.org/viewvc/incubator/river/jtsk/trunk/src/net/jini/io/MarshalOutputStream.java?rev=998319&r1=998318&r2=998319&view=diff
==============================================================================
--- incubator/river/jtsk/trunk/src/net/jini/io/MarshalOutputStream.java (original)
+++ incubator/river/jtsk/trunk/src/net/jini/io/MarshalOutputStream.java Fri Sep 17 20:56:00 2010
@@ -21,14 +21,14 @@ package net.jini.io;
import java.io.IOException;
import java.io.ObjectOutputStream;
import java.io.OutputStream;
+import java.rmi.server.RMIClassLoader;
import java.util.Collection;
-import net.jini.loader.CodebaseAccessClassLoader;
/**
* An extension of <code>ObjectOutputStream</code> that implements the
* dynamic class loading semantics of Java(TM) Remote Method Invocation
* (Java RMI) argument and result
- * marshalling (using {@link CodebaseAccessClassLoader}). A
+ * marshalling (using {@link RMIClassLoader}). A
* <code>MarshalOutputStream</code> writes data that is intended to be
* written by a corresponding {@link MarshalInputStream}.
*
@@ -37,8 +37,8 @@ import net.jini.loader.CodebaseAccessCla
* ObjectOutputStream#annotateClass annotateClass} and {@link
* ObjectOutputStream#annotateProxyClass annotateProxyClass} to
* annotate class descriptors in the stream with codebase strings
- * obtained using {@link CodebaseAccessClassLoader#getClassAnnotation
- * CodebaseAccessClassLoader.getClassAnnotation}.
+ * obtained using {@link RMIClassLoader#getClassAnnotation
+ * RMIClassLoader.getClassAnnotation}.
*
* <p><code>MarshalOutputStream</code> writes class annotations to its
* own stream; a subclass may override the {@link #writeAnnotation
@@ -111,8 +111,8 @@ public class MarshalOutputStream
* <p><code>MarshalOutputStream</code> implements this method as
* follows:
*
- * <p>This method invokes {@link CodebaseAccessClassLoader#getClassAnnotation
- * CodebaseAccessClassLoader.getClassAnnotation} with <code>cl</code> to get
+ * <p>This method invokes {@link RMIClassLoader#getClassAnnotation
+ * RMIClassLoader.getClassAnnotation} with <code>cl</code> to get
* the appropriate class annotation string value (possibly
* <code>null</code>), and then it invokes this stream's {@link
* #writeAnnotation writeAnnotation} method with that string to
@@ -127,7 +127,7 @@ public class MarshalOutputStream
* <code>null</code>
**/
protected void annotateClass(Class cl) throws IOException {
- writeAnnotation(CodebaseAccessClassLoader.getClassAnnotation(cl));
+ writeAnnotation(RMIClassLoader.getClassAnnotation(cl));
}
/**
@@ -137,8 +137,8 @@ public class MarshalOutputStream
* <p><code>MarshalOutputStream</code> implements this method as
* follows:
*
- * <p>This method invokes {@link CodebaseAccessClassLoader#getClassAnnotation
- * CodebaseAccessClassLoader.getClassAnnotation} with <code>cl</code> to get
+ * <p>This method invokes {@link RMIClassLoader#getClassAnnotation
+ * RMIClassLoader.getClassAnnotation} with <code>cl</code> to get
* the appropriate class annotation string value (possibly
* <code>null</code>), and then it invokes this stream's {@link
* #writeAnnotation writeAnnotation} method with that string to
@@ -153,7 +153,7 @@ public class MarshalOutputStream
* <code>null</code>
**/
protected void annotateProxyClass(Class cl) throws IOException {
- writeAnnotation(CodebaseAccessClassLoader.getClassAnnotation(cl));
+ writeAnnotation(RMIClassLoader.getClassAnnotation(cl));
}
/**
Modified: incubator/river/jtsk/trunk/src/net/jini/io/MarshalledObject.java
URL: http://svn.apache.org/viewvc/incubator/river/jtsk/trunk/src/net/jini/io/MarshalledObject.java?rev=998319&r1=998318&r2=998319&view=diff
==============================================================================
--- incubator/river/jtsk/trunk/src/net/jini/io/MarshalledObject.java (original)
+++ incubator/river/jtsk/trunk/src/net/jini/io/MarshalledObject.java Fri Sep 17 20:56:00 2010
@@ -21,10 +21,10 @@ package net.jini.io;
import java.io.Serializable;
/**
- * This is a package private class used to convert <code>java.rmi.MarshalledObject</code>
+ * This is a private class used to convert <code>java.rmi.MarshalledObject</code>
* to <code>MarshalledInstance</code> and vice versa.
*/
-final class MarshalledObject<T> implements Serializable {
+final class MarshalledObject implements Serializable {
// Duplicate (private) MarshalledObject fields, and make them
// package visable
Modified: incubator/river/jtsk/trunk/src/net/jini/lease/LeaseRenewalService.java
URL: http://svn.apache.org/viewvc/incubator/river/jtsk/trunk/src/net/jini/lease/LeaseRenewalService.java?rev=998319&r1=998318&r2=998319&view=diff
==============================================================================
--- incubator/river/jtsk/trunk/src/net/jini/lease/LeaseRenewalService.java (original)
+++ incubator/river/jtsk/trunk/src/net/jini/lease/LeaseRenewalService.java Fri Sep 17 20:56:00 2010
@@ -32,9 +32,8 @@ import java.rmi.RemoteException;
*
* @author Sun Microsystems, Inc.
* @see LeaseRenewalSet
- * @deprecated.
*/
-@Deprecated
+
public interface LeaseRenewalService {
/**
* Create a new <code>LeaseRenewalSet</code> that the client can
Modified: incubator/river/jtsk/trunk/src/net/jini/lease/LeaseRenewalSet.java
URL: http://svn.apache.org/viewvc/incubator/river/jtsk/trunk/src/net/jini/lease/LeaseRenewalSet.java?rev=998319&r1=998318&r2=998319&view=diff
==============================================================================
--- incubator/river/jtsk/trunk/src/net/jini/lease/LeaseRenewalSet.java (original)
+++ incubator/river/jtsk/trunk/src/net/jini/lease/LeaseRenewalSet.java Fri Sep 17 20:56:00 2010
@@ -168,9 +168,7 @@ import net.jini.core.lease.Lease;
*
* @author Sun Microsystems, Inc.
* @see LeaseRenewalService
- * @deprecated no replacement.
*/
-@Deprecated
public interface LeaseRenewalSet {
/**
* The event id for all <code>RenewalFailureEvent</code> objects.
Modified: incubator/river/jtsk/trunk/src/net/jini/lease/LeaseUnmarshalException.java
URL: http://svn.apache.org/viewvc/incubator/river/jtsk/trunk/src/net/jini/lease/LeaseUnmarshalException.java?rev=998319&r1=998318&r2=998319&view=diff
==============================================================================
--- incubator/river/jtsk/trunk/src/net/jini/lease/LeaseUnmarshalException.java (original)
+++ incubator/river/jtsk/trunk/src/net/jini/lease/LeaseUnmarshalException.java Fri Sep 17 20:56:00 2010
@@ -67,10 +67,7 @@ import net.jini.core.lease.Lease;
*
* @author Sun Microsystems, Inc.
* @see Lease
- * @deprecated not replaced, only used by {@link LeaseRenewalSet} which is also
- * deprecated.
*/
-@Deprecated
public class LeaseUnmarshalException extends Exception {
private static final long serialVersionUID = -6736107321698417489L;
Modified: incubator/river/jtsk/trunk/src/net/jini/loader/ClassAnnotation.java
URL: http://svn.apache.org/viewvc/incubator/river/jtsk/trunk/src/net/jini/loader/ClassAnnotation.java?rev=998319&r1=998318&r2=998319&view=diff
==============================================================================
--- incubator/river/jtsk/trunk/src/net/jini/loader/ClassAnnotation.java (original)
+++ incubator/river/jtsk/trunk/src/net/jini/loader/ClassAnnotation.java Fri Sep 17 20:56:00 2010
@@ -18,6 +18,7 @@
package net.jini.loader;
+import java.rmi.server.RMIClassLoader;
import net.jini.loader.pref.PreferredClassProvider;
/**
@@ -25,19 +26,19 @@ import net.jini.loader.pref.PreferredCla
* loader that is an instance of this interface.
*
* <p>This interface allows a {@link ClassLoader} subclass to
- * customize the behavior of {@link CodebaseAccessClassLoader#getClassAnnotation
- * CodebaseAccessClassLoader.getClassAnnotation} (and thus RMI marshalling
+ * customize the behavior of {@link RMIClassLoader#getClassAnnotation
+ * RMIClassLoader.getClassAnnotation} (and thus RMI marshalling
* semantics) for classes defined by its instances.
*
* <p>Note that this interface is only effective if the current {@link
- * CodebaseAccessClassLoader} provider supports it; not all
- * <code>CodebaseAccessClassLoader</code> providers support this interface. In
+ * RMIClassLoader} provider supports it; not all
+ * <code>RMIClassLoader</code> providers support this interface. In
* particular, the default provider (see {@link
- * CodebaseAccessClassLoader#getDefaultProviderInstance
- * CodebaseAccessClassLoader.getDefaultProviderInstance}) does <i>not</i> support
+ * RMIClassLoader#getDefaultProviderInstance
+ * RMIClassLoader.getDefaultProviderInstance}) does <i>not</i> support
* this interface, and so when the default provider is used, this
* interface will be ignored by
- * <code>CodebaseAccessClassLoader.getClassAnnotation</code>. {@link
+ * <code>RMIClassLoader.getClassAnnotation</code>. {@link
* PreferredClassProvider} and its subclasses do support this
* interface.
*
Modified: incubator/river/jtsk/trunk/src/net/jini/loader/DownloadPermission.java
URL: http://svn.apache.org/viewvc/incubator/river/jtsk/trunk/src/net/jini/loader/DownloadPermission.java?rev=998319&r1=998318&r2=998319&view=diff
==============================================================================
--- incubator/river/jtsk/trunk/src/net/jini/loader/DownloadPermission.java (original)
+++ incubator/river/jtsk/trunk/src/net/jini/loader/DownloadPermission.java Fri Sep 17 20:56:00 2010
@@ -18,35 +18,39 @@
package net.jini.loader;
+import java.rmi.server.RMIClassLoader;
import java.security.BasicPermission;
+import java.security.CodeSource;
+import net.jini.loader.pref.PreferredClassProvider;
+import net.jini.loader.pref.RequireDlPermProvider;
/**
* Permission that must be granted to the {@link CodeSource} of a
* downloaded class in order for the class to be defined using {@link
- * CodebaseAccessClassLoader}.
+ * RMIClassLoader}.
*
* <p>A <code>DownloadPermission</code> contains a name (also referred
* to as a "target name") but no action list; you either have the
* named permission or you don't. The only defined target name is
* "permit", which allows a downloaded class with a
* <code>CodeSource</code> that is granted the permission to be
- * defined by a class loader created by <code>CodebaseAccessClassLoader</code>.
+ * defined by a class loader created by <code>RMIClassLoader</code>.
*
* <p>Selective granting of this permission can be used to restrict
* the <code>CodeSource</code> values (codebase URLs and signers) from
* which downloaded classes can be defined using
- * <code>CodebaseAccessClassLoader</code>.
+ * <code>RMIClassLoader</code>.
*
* <p>Note that this permission is only enforced if the current {@link
- * CodebaseAccessClassLoader} provider supports it; not all
- * <code>CodebaseAccessClassLoader</code> providers support this permission. In
+ * RMIClassLoader} provider supports it; not all
+ * <code>RMIClassLoader</code> providers support this permission. In
* particular, the default provider (see {@link
- * CodebaseAccessClassLoader#getDefaultProviderInstance
- * CodebaseAccessClassLoader.getDefaultProviderInstance}) does <i>not</i> support
+ * RMIClassLoader#getDefaultProviderInstance
+ * RMIClassLoader.getDefaultProviderInstance}) does <i>not</i> support
* this permission, and so when the default provider is used,
* downloaded classes do not need to be granted
* <code>DownloadPermission</code> in order to be defined using
- * <code>CodebaseAccessClassLoader</code>. {@link PreferredClassProvider} itself
+ * <code>RMIClassLoader</code>. {@link PreferredClassProvider} itself
* does not enforce this permission, but subclasses may configure it
* to do so (see {@link RequireDlPermProvider}).
*
Modified: incubator/river/jtsk/trunk/src/net/jini/loader/pref/PreferredClassProvider.java
URL: http://svn.apache.org/viewvc/incubator/river/jtsk/trunk/src/net/jini/loader/pref/PreferredClassProvider.java?rev=998319&r1=998318&r2=998319&view=diff
==============================================================================
--- incubator/river/jtsk/trunk/src/net/jini/loader/pref/PreferredClassProvider.java (original)
+++ incubator/river/jtsk/trunk/src/net/jini/loader/pref/PreferredClassProvider.java Fri Sep 17 20:56:00 2010
@@ -32,6 +32,7 @@ import java.net.MalformedURLException;
import java.net.URL;
import java.net.URLConnection;
import java.net.URLClassLoader;
+import java.rmi.server.RMIClassLoader;
import java.rmi.server.RMIClassLoaderSpi;
import java.security.AccessController;
import java.security.CodeSource;
@@ -48,20 +49,19 @@ import java.util.WeakHashMap;
import java.util.logging.Logger;
import java.util.logging.Level;
import net.jini.loader.ClassAnnotation;
-import net.jini.loader.CodebaseAccessClassLoader;
import net.jini.loader.DownloadPermission;
/**
- * An <code>CodebaseAccessClassLoader</code> provider that supports preferred
+ * An <code>RMIClassLoader</code> provider that supports preferred
* classes.
*
- * <p>See the {@link CodebaseAccessClassLoader} specification for information
- * about how to install and configure the <code>CodebaseAccessClassLoader</code>
+ * <p>See the {@link RMIClassLoader} specification for information
+ * about how to install and configure the <code>RMIClassLoader</code>
* service provider.
*
* <p><code>PreferredClassProvider</code> uses instances of {@link
* PreferredClassLoader} to load classes from codebase URL paths
- * supplied to <code>CodebaseAccessClassLoader.loadClass</code> methods.
+ * supplied to <code>RMIClassLoader.loadClass</code> methods.
*
* <p><code>PreferredClassProvider</code> does not enforce {@link
* DownloadPermission} by default, but a subclass can configure it to
@@ -79,7 +79,7 @@ import net.jini.loader.DownloadPermissio
*
* The following section defines terms and describes behaviors common
* to how <code>PreferredClassProvider</code> implements the abstract
- * methods of <code>CodebaseAccessClassLoaderSpi</code>. Where applicable, these
+ * methods of <code>RMIClassLoaderSpi</code>. Where applicable, these
* definitions and descriptions are relative to the instance of
* <code>PreferredClassProvider</code> on which a method is invoked
* and the context in which it is invoked.
@@ -282,10 +282,10 @@ public class PreferredClassProvider exte
/**
* Creates a new <code>PreferredClassProvider</code>.
*
- * <p>This constructor is used by the {@link CodebaseAccessClassLoader}
+ * <p>This constructor is used by the {@link RMIClassLoader}
* service provider location mechanism when
* <code>PreferredClassProvider</code> is configured as the
- * <code>CodebaseAccessClassLoader</code> provider class.
+ * <code>RMIClassLoader</code> provider class.
*
* <p>If there is a security manager, its {@link
* SecurityManager#checkCreateClassLoader checkCreateClassLoader}
@@ -387,7 +387,7 @@ public class PreferredClassProvider exte
/**
* Provides the implementation for {@link
- * CodebaseAccessClassLoaderSpi#loadClass(String,String,ClassLoader)}.
+ * RMIClassLoaderSpi#loadClass(String,String,ClassLoader)}.
*
* <p><code>PreferredClassProvider</code> implements this method
* as follows:
@@ -684,7 +684,7 @@ public class PreferredClassProvider exte
/**
* Provides the implementation for {@link
- * CodebaseAccessClassLoaderSpi#getClassAnnotation(Class)}.
+ * RMIClassLoaderSpi#getClassAnnotation(Class)}.
*
* <p><code>PreferredClassProvider</code> implements this method
* as follows:
@@ -1416,14 +1416,23 @@ public class PreferredClassProvider exte
}
/** map from weak(key=string) to [URL[], soft(key)] */
- private final static Map pathToURLsCache = new WeakHashMap(5);
+ private static Map pathToURLsCache = new WeakHashMap(5);
/**
* Return the class loader to be used as the parent for an RMI class
* loader used in the current execution context.
*/
private static ClassLoader getRMIContextClassLoader() {
- return CodebaseAccessClassLoader.getParentContextClassLoader();
+ /*
+ * The current implementation simply uses the current thread's
+ * context class loader.
+ */
+ return (ClassLoader) AccessController.doPrivileged(
+ new PrivilegedAction() {
+ public Object run() {
+ return Thread.currentThread().getContextClassLoader();
+ }
+ });
}
/**
@@ -1657,15 +1666,13 @@ public class PreferredClassProvider exte
final boolean requireDlPerm)
{
checkInitialized();
- return CodebaseAccessClassLoader.createClassLoader( urls, parent, requireDlPerm,
- PreferredClassLoader.getLoaderAccessControlContext(urls) );
-// return (ClassLoader)
-// AccessController.doPrivileged(new PrivilegedAction() {
-// public Object run() {
-// return new PreferredClassLoader(urls, parent, null,
-// requireDlPerm);
-// }
-// }, PreferredClassLoader.getLoaderAccessControlContext(urls));
+ return (ClassLoader)
+ AccessController.doPrivileged(new PrivilegedAction() {
+ public Object run() {
+ return new PreferredClassLoader(urls, parent, null,
+ requireDlPerm);
+ }
+ }, PreferredClassLoader.getLoaderAccessControlContext(urls));
}
/**
@@ -1690,7 +1697,7 @@ public class PreferredClassProvider exte
}
hashValue = h;
}
-
+
public int hashCode() {
return hashValue;
}
Modified: incubator/river/jtsk/trunk/src/net/jini/loader/pref/RequireDlPermProvider.java
URL: http://svn.apache.org/viewvc/incubator/river/jtsk/trunk/src/net/jini/loader/pref/RequireDlPermProvider.java?rev=998319&r1=998318&r2=998319&view=diff
==============================================================================
--- incubator/river/jtsk/trunk/src/net/jini/loader/pref/RequireDlPermProvider.java (original)
+++ incubator/river/jtsk/trunk/src/net/jini/loader/pref/RequireDlPermProvider.java Fri Sep 17 20:56:00 2010
@@ -18,15 +18,15 @@
package net.jini.loader.pref;
-import net.jini.loader.CodebaseAccessClassLoader;
+import java.rmi.server.RMIClassLoader;
import net.jini.loader.DownloadPermission;
/**
- * An <code>CodebaseAccessClassLoader</code> provider that supports preferred
+ * An <code>RMIClassLoader</code> provider that supports preferred
* classes and enforces {@link DownloadPermission}.
*
- * <p>See the {@link CodebaseAccessClassLoader} specification for information
- * about how to install and configure the <code>CodebaseAccessClassLoader</code>
+ * <p>See the {@link RMIClassLoader} specification for information
+ * about how to install and configure the <code>RMIClassLoader</code>
* service provider.
*
* @author Sun Microsystems, Inc.
@@ -37,10 +37,10 @@ public class RequireDlPermProvider exten
/**
* Creates a new <code>RequireDlPermProvider</code>.
*
- * <p>This constructor is used by the {@link CodebaseAccessClassLoader}
+ * <p>This constructor is used by the {@link RMIClassLoader}
* service provider location mechanism when
* <code>RequireDlPermProvider</code> is configured as the
- * <code>CodebaseAccessClassLoader</code> provider class.
+ * <code>RMIClassLoader</code> provider class.
*
* <p>This constructor passes <code>true</code> to the superclass
* constructor that has a <code>boolean</code> parameter.
Modified: incubator/river/jtsk/trunk/src/net/jini/security/Security.java
URL: http://svn.apache.org/viewvc/incubator/river/jtsk/trunk/src/net/jini/security/Security.java?rev=998319&r1=998318&r2=998319&view=diff
==============================================================================
--- incubator/river/jtsk/trunk/src/net/jini/security/Security.java (original)
+++ incubator/river/jtsk/trunk/src/net/jini/security/Security.java Fri Sep 17 20:56:00 2010
@@ -26,7 +26,6 @@ import java.net.MalformedURLException;
import java.net.URL;
import java.rmi.RemoteException;
import java.security.AccessControlContext;
-import java.security.AccessControlException;
import java.security.AccessController;
import java.security.DomainCombiner;
import java.security.Permission;
@@ -51,8 +50,6 @@ import javax.security.auth.Subject;
import javax.security.auth.SubjectDomainCombiner;
import net.jini.security.policy.DynamicPolicy;
import net.jini.security.policy.SecurityContextSource;
-import org.apache.river.api.security.ExecutionContextManager;
-import org.apache.river.api.security.RevokeableDynamicPolicy;
/**
* Provides methods for executing actions with privileges enabled, for
@@ -169,11 +166,7 @@ public final class Security {
AccessController.doPrivileged(new PrivilegedAction() {
public Object run() { return new ClassContextAccess(); }
});
- /**
- * ExecutionContextManager
- * null unless found, never returned.
- */
- private static volatile ExecutionContextManager ecm = null;
+
/**
* Non-instantiable.
*/
@@ -557,67 +550,6 @@ public final class Security {
}
/**
- * <p>
- * An optimised permission check, using the following strategies to
- * reduce the cost of checking Permission:
- * </p>
- * <OL>
- * <LI>Multiple permission checks may be performed together, the current
- * execution AccessControlContext is only obtained once per invocation
- * of this method, since identified as an expensive native code call.
- * The returned AccessControlContext is used for all Permission checks.
- * <LI>The result from an AccessControlContext.checkPermission(Permission)
- * call is cached for that AccessControlContext, so checkPermission will
- * only be called once, if it succeeds. If a RevokeableDynamicPolicy
- * is installed, checkPermission may be called again, on a following
- * invocation if a Permission revocation has cleared it's result from the cache.
- * <LI>Permission's are only stored in the cache based on equality, implies
- * is not called in the cache. This doesn't widen the scope of the cache
- * since the tradeoff is that some implies calls are expensive.
- * <LI>The cache used is backed by a SoftReference based ConcurrentHashMap
- * </OL>
- * <p>
- * This is designed to be used in combination with Permission checks
- * for Permission's that are Revokeable, but may also be used for optimising other
- * non revokeable Permission checks. A non revokeable Permission is a
- * Permission that guards a reference or prevents object creation, but
- * does not prevent use of a privelege or object, if it reference escapes.
- * see the RevokeableDynamicPolicy for details.
- * </p><p>
- * By lessening the cost of Permission calls it is intended that the performance
- * impact of security checking be reduced sufficiently to provide a
- * wider scope for revokeable Permissions.
- * </p><p>
- * If a RevokeableDynamicPolicy is not installed, this method will call
- * AccessController.checkPermission, without any optimisations.
- * </p>
- * @param permissions
- * @throws java.lang.NullPointerException
- * @throws java.security.AccessControlException
- * @see RevokeableDynamicPolicy
- * @see ExecutionContextManager
- * @see AccessController
- * @see AccessControlContext
- */
- public static void checkPermission(Collection<Permission> permissions)
- throws NullPointerException, AccessControlException
- {
- if (ecm == null){
- Policy policy = getPolicy();
- if (!(policy instanceof RevokeableDynamicPolicy)) {
- Iterator<Permission> perms = permissions.iterator();
- while (perms.hasNext()){
- Permission perm = perms.next();
- AccessController.checkPermission(perm);
- }
- return;
- }
- ecm = ((RevokeableDynamicPolicy) policy).getExecutionContextManager();
- }
- ecm.checkPermission(permissions);
- }
-
- /**
* Creates privileged context that contains the protection domain of the
* given caller class (if non-null) and uses the domain combiner of the
* specified context. This method assumes it is called from within a
Modified: incubator/river/jtsk/trunk/src/net/jini/security/policy/PolicyFileProvider.java
URL: http://svn.apache.org/viewvc/incubator/river/jtsk/trunk/src/net/jini/security/policy/PolicyFileProvider.java?rev=998319&r1=998318&r2=998319&view=diff
==============================================================================
--- incubator/river/jtsk/trunk/src/net/jini/security/policy/PolicyFileProvider.java (original)
+++ incubator/river/jtsk/trunk/src/net/jini/security/policy/PolicyFileProvider.java Fri Sep 17 20:56:00 2010
@@ -104,14 +104,8 @@ public class PolicyFileProvider extends
*/
public PolicyFileProvider() throws PolicyInitializationException {
policyFile = null;
- String cname = Security.getProperty(basePolicyClassProperty);
-// @SuppressWarnings("unchecked")
-// String cname = (String) AccessController.doPrivileged(
-// new PrivilegedAction() {
-// public Object run() {
-// return System.getProperty(basePolicyClassProperty);
-// }
-// });
+
+ String cname = Security.getProperty(basePolicyClassProperty);
if (cname == null) {
cname = defaultBasePolicyClass;
}
Modified: incubator/river/jtsk/trunk/src/net/jini/security/proxytrust/BasicUntrustedObjectSecurityContext.java
URL: http://svn.apache.org/viewvc/incubator/river/jtsk/trunk/src/net/jini/security/proxytrust/BasicUntrustedObjectSecurityContext.java?rev=998319&r1=998318&r2=998319&view=diff
==============================================================================
--- incubator/river/jtsk/trunk/src/net/jini/security/proxytrust/BasicUntrustedObjectSecurityContext.java (original)
+++ incubator/river/jtsk/trunk/src/net/jini/security/proxytrust/BasicUntrustedObjectSecurityContext.java Fri Sep 17 20:56:00 2010
@@ -62,15 +62,6 @@ public final class BasicUntrustedObjectS
* neither modified nor retained; subsequent changes to that argument
* have no effect on the instance created.
*
- * If additional permissions are passed in these will be added to a new
- * ProtectionDomain and set readonly, additional Permission's may be
- * granted by a Policy, however any permissions granted at construction
- * time will always be valid and cannot be revoked.
- *
- * If permissions is null or empty then all BasicUntrustedObjectSecurityContext
- * instances will share the same ProtectionDomain with all other instances
- * without additional permissions.
- *
* @param permissions additional permissions to allow, or
* <code>null</code> if no additional permissions should be allowed
* @throws NullPointerException if any element of the argument is
Modified: incubator/river/jtsk/trunk/src/net/jini/security/proxytrust/ProxyTrustVerifier.java
URL: http://svn.apache.org/viewvc/incubator/river/jtsk/trunk/src/net/jini/security/proxytrust/ProxyTrustVerifier.java?rev=998319&r1=998318&r2=998319&view=diff
==============================================================================
--- incubator/river/jtsk/trunk/src/net/jini/security/proxytrust/ProxyTrustVerifier.java (original)
+++ incubator/river/jtsk/trunk/src/net/jini/security/proxytrust/ProxyTrustVerifier.java Fri Sep 17 20:56:00 2010
@@ -31,6 +31,8 @@ import java.lang.reflect.Proxy;
import java.net.MalformedURLException;
import java.rmi.RemoteException;
import java.rmi.UnmarshalException;
+import java.rmi.server.RMIClassLoader;
+import java.security.AccessControlContext;
import java.security.AccessController;
import java.security.PrivilegedAction;
import java.security.PrivilegedActionException;
@@ -44,9 +46,6 @@ import net.jini.core.constraint.MethodCo
import net.jini.core.constraint.RemoteMethodControl;
import net.jini.io.MarshalInputStream;
import net.jini.io.ObjectStreamContext;
-// For Java CDC
-//import net.jini.io.UnmarshalException;
-import net.jini.loader.CodebaseAccessClassLoader;
import net.jini.security.SecurityContext;
import net.jini.security.TrustVerifier;
@@ -229,8 +228,8 @@ public class ProxyTrustVerifier implemen
* method; the class loader of the proxy's class is
* the proper Java(TM) RMI class
* loader (as defined below) for its parent class loader and the class's
- * codebase (as produced by {@link CodebaseAccessClassLoader#getClassAnnotation
- * CodebaseAccessClassLoader.getClassAnnotation}); and both <code>ProxyTrust</code>
+ * codebase (as produced by {@link RMIClassLoader#getClassAnnotation
+ * RMIClassLoader.getClassAnnotation}); and both <code>ProxyTrust</code>
* and <code>RemoteMethodControl</code> are loadable by the parent class
* loader. The derivative that is produced is an instance of a dynamically
* generated <code>Proxy</code> class defined by the parent class loader
@@ -271,7 +270,7 @@ public class ProxyTrustVerifier implemen
* parent class loader and the class's codebase if the class loader is
* not <code>null</code>, the codebase for the class is a non-empty
* string, and calling
- * {@link CodebaseAccessClassLoader#getClassLoader CodebaseAccessClassLoader.getClassLoader}
+ * {@link RMIClassLoader#getClassLoader RMIClassLoader.getClassLoader}
* with that codebase, with the thread's context class loader set to the
* parent class loader, returns the class loader of the class.
*
@@ -414,7 +413,7 @@ public class ProxyTrustVerifier implemen
throws IllegalAccessException,
InvocationTargetException
{
- return m.invoke(obj, (Object[])null);
+ return m.invoke(obj, null);
}
}), rsc.getAccessControlContext());
} catch (PrivilegedActionException pae) {
@@ -514,7 +513,7 @@ public class ProxyTrustVerifier implemen
return null;
}
final Class base = obj.getClass();
- final String bcb = CodebaseAccessClassLoader.getClassAnnotation(base);
+ final String bcb = RMIClassLoader.getClassAnnotation(base);
if (bcb == null || bcb.length() == 0) {
return null;
}
@@ -531,9 +530,8 @@ public class ProxyTrustVerifier implemen
boolean proper = false;
try {
t.setContextClassLoader(pcl);
- proper = (CodebaseAccessClassLoader.getClassLoader(bcb) == bcl);
- } catch (IOException e) {
- logger.log(Level.FINER, e.toString()+": Can't get ClassLoader for "+bcb, e);
+ proper = (RMIClassLoader.getClassLoader(bcb) == bcl);
+ } catch (MalformedURLException e) {
} finally {
t.setContextClassLoader(ccl);
}
@@ -545,7 +543,6 @@ public class ProxyTrustVerifier implemen
RemoteMethodControl.class},
ih);
} catch (IllegalArgumentException e) {
- logger.log(Level.FINER, e.toString(), e);
}
}
return null;
@@ -634,7 +631,7 @@ public class ProxyTrustVerifier implemen
}
private void writeAnnotation(final Class c) throws IOException {
- String cb = CodebaseAccessClassLoader.getClassAnnotation(c);
+ String cb = RMIClassLoader.getClassAnnotation(c);
writeObject(cb);
if (bcb.equals(cb)) {
AccessController.doPrivileged(new PrivilegedAction() {
Modified: incubator/river/jtsk/trunk/src/net/jini/space/JavaSpace05.java
URL: http://svn.apache.org/viewvc/incubator/river/jtsk/trunk/src/net/jini/space/JavaSpace05.java?rev=998319&r1=998318&r2=998319&view=diff
==============================================================================
--- incubator/river/jtsk/trunk/src/net/jini/space/JavaSpace05.java (original)
+++ incubator/river/jtsk/trunk/src/net/jini/space/JavaSpace05.java Fri Sep 17 20:56:00 2010
@@ -18,12 +18,17 @@
package net.jini.space;
import java.rmi.MarshalledObject;
+import java.rmi.MarshalException;
import java.rmi.RemoteException;
import java.util.Collection;
import java.util.List;
+import net.jini.core.entry.Entry;
+import net.jini.core.entry.UnusableEntryException;
import net.jini.core.event.EventRegistration;
+import net.jini.core.event.RemoteEvent;
import net.jini.core.event.RemoteEventListener;
+import net.jini.core.lease.Lease;
import net.jini.core.transaction.Transaction;
import net.jini.core.transaction.TransactionException;
import net.jini.entry.UnusableEntriesException;