river-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From peter_firmst...@apache.org
Subject svn commit: r958358 [1/2] - in /incubator/river/jtsk/trunk: examples/hello/src/com/sun/jini/example/hello/ qa/src/com/sun/jini/test/impl/joinmanager/ qa/src/com/sun/jini/test/impl/servicediscovery/event/ qa/src/com/sun/jini/test/share/reggie/ qa/src/co...
Date Sun, 27 Jun 2010 10:32:19 GMT
Author: peter_firmstone
Date: Sun Jun 27 10:32:18 2010
New Revision: 958358

URL: http://svn.apache.org/viewvc?rev=958358&view=rev
Log:
River Refactoring, including the new RevokeableDynamicPolicy implementation for River-340

Added:
    incubator/river/jtsk/trunk/src/net/jini/lookup/LookupStreamCache.java   (with props)
    incubator/river/jtsk/trunk/src/net/jini/lookup/entry/UIDescriptor2.java   (with props)
    incubator/river/jtsk/trunk/src/org/apache/river/api/security/Deny.java   (with props)
    incubator/river/jtsk/trunk/src/org/apache/river/api/security/DenyPermission.java   (with props)
    incubator/river/jtsk/trunk/src/org/apache/river/api/security/PermissionGrant.java
      - copied, changed from r957448, incubator/river/jtsk/trunk/src/org/apache/river/imp/security/policy/util/PermissionGrant.java
    incubator/river/jtsk/trunk/src/org/apache/river/api/security/PermissionGrantBuilder.java
      - copied, changed from r957454, incubator/river/jtsk/trunk/src/org/apache/river/imp/security/policy/util/PermissionGrantBuilder.java
    incubator/river/jtsk/trunk/src/org/apache/river/api/security/RevokeableDynamicPolicy.java   (with props)
    incubator/river/jtsk/trunk/src/org/apache/river/imp/security/policy/util/PermissionGrantBuilderImp.java   (with props)
Removed:
    incubator/river/jtsk/trunk/src/org/apache/river/api/security/RevokeablePolicy.java
    incubator/river/jtsk/trunk/src/org/apache/river/imp/security/policy/util/PermissionGrant.java
    incubator/river/jtsk/trunk/src/org/apache/river/imp/security/policy/util/PermissionGrantBuilder.java
Modified:
    incubator/river/jtsk/trunk/examples/hello/src/com/sun/jini/example/hello/Client.java
    incubator/river/jtsk/trunk/examples/hello/src/com/sun/jini/example/hello/Server.java
    incubator/river/jtsk/trunk/qa/src/com/sun/jini/test/impl/joinmanager/AddAttributesRace.java
    incubator/river/jtsk/trunk/qa/src/com/sun/jini/test/impl/joinmanager/LeaseRenewDurRFE.java
    incubator/river/jtsk/trunk/qa/src/com/sun/jini/test/impl/joinmanager/RaceAttrsVsTerminateISE.java
    incubator/river/jtsk/trunk/qa/src/com/sun/jini/test/impl/joinmanager/RaceAttrsVsTerminateULE.java
    incubator/river/jtsk/trunk/qa/src/com/sun/jini/test/impl/joinmanager/TerminateSemantics.java
    incubator/river/jtsk/trunk/qa/src/com/sun/jini/test/impl/servicediscovery/event/LookupTaskServiceIdMapRace.java
    incubator/river/jtsk/trunk/qa/src/com/sun/jini/test/share/reggie/RegistrarImpl.java
    incubator/river/jtsk/trunk/qa/src/com/sun/jini/test/spec/joinmanager/Equality.java
    incubator/river/jtsk/trunk/qa/src/com/sun/jini/test/spec/joinmanager/GetAttributes.java
    incubator/river/jtsk/trunk/qa/src/com/sun/jini/test/spec/joinmanager/GetJoinSetCallback.java
    incubator/river/jtsk/trunk/qa/src/com/sun/jini/test/spec/joinmanager/LDMNullPublicGroup.java
    incubator/river/jtsk/trunk/qa/src/com/sun/jini/test/spec/joinmanager/ModifyAttributesServiceControlled.java
    incubator/river/jtsk/trunk/qa/src/com/sun/jini/test/spec/joinmanager/Register.java
    incubator/river/jtsk/trunk/qa/src/com/sun/jini/test/spec/joinmanager/TerminateDiscovery.java
    incubator/river/jtsk/trunk/qa/src/com/sun/jini/test/spec/joinmanager/TerminateLeases.java
    incubator/river/jtsk/trunk/qa/src/com/sun/jini/test/spec/servicediscovery/AbstractBaseTest.java
    incubator/river/jtsk/trunk/qa/src/com/sun/jini/test/spec/servicediscovery/DefaultDiscoverPublic.java
    incubator/river/jtsk/trunk/qa/src/com/sun/jini/test/spec/servicediscovery/cache/AddListenerNPE.java
    incubator/river/jtsk/trunk/src/com/sun/jini/fiddler/FiddlerImpl.java
    incubator/river/jtsk/trunk/src/com/sun/jini/mahalo/JoinStateManager.java
    incubator/river/jtsk/trunk/src/com/sun/jini/mercury/MailboxImpl.java
    incubator/river/jtsk/trunk/src/com/sun/jini/norm/lookup/JoinState.java
    incubator/river/jtsk/trunk/src/com/sun/jini/outrigger/JoinStateManager.java
    incubator/river/jtsk/trunk/src/com/sun/jini/reggie/RegistrarImpl.java
    incubator/river/jtsk/trunk/src/net/jini/core/lookup/MarshalledServiceItem.java
    incubator/river/jtsk/trunk/src/net/jini/core/lookup/StreamServiceRegistrar.java
    incubator/river/jtsk/trunk/src/net/jini/lookup/JoinManager.java
    incubator/river/jtsk/trunk/src/net/jini/lookup/ServiceDiscoveryManager.java
    incubator/river/jtsk/trunk/src/net/jini/lookup/ServiceRegistrarFacade.java
    incubator/river/jtsk/trunk/src/net/jini/lookup/ServiceResultStreamUnmarshaller.java
    incubator/river/jtsk/trunk/src/net/jini/lookup/StreamServiceRegistrarFacade.java
    incubator/river/jtsk/trunk/src/net/jini/security/policy/DynamicPolicyProvider.java
    incubator/river/jtsk/trunk/src/org/apache/river/imp/security/policy/cdc/DynamicPolicyProviderImpl.java
    incubator/river/jtsk/trunk/src/org/apache/river/imp/security/policy/concurrent/DynamicConcurrentPolicyProvider.java
    incubator/river/jtsk/trunk/src/org/apache/river/imp/security/policy/spi/RevokeableDynamicPolicySpi.java
    incubator/river/jtsk/trunk/src/org/apache/river/imp/security/policy/util/CertificateGrant.java
    incubator/river/jtsk/trunk/src/org/apache/river/imp/security/policy/util/ClassLoaderGrant.java
    incubator/river/jtsk/trunk/src/org/apache/river/imp/security/policy/util/CodeSourceGrant.java
    incubator/river/jtsk/trunk/src/org/apache/river/imp/security/policy/util/PrincipalGrant.java
    incubator/river/jtsk/trunk/src/org/apache/river/imp/security/policy/util/ProtectionDomainGrant.java

Modified: incubator/river/jtsk/trunk/examples/hello/src/com/sun/jini/example/hello/Client.java
URL: http://svn.apache.org/viewvc/incubator/river/jtsk/trunk/examples/hello/src/com/sun/jini/example/hello/Client.java?rev=958358&r1=958357&r2=958358&view=diff
==============================================================================
--- incubator/river/jtsk/trunk/examples/hello/src/com/sun/jini/example/hello/Client.java (original)
+++ incubator/river/jtsk/trunk/examples/hello/src/com/sun/jini/example/hello/Client.java Sun Jun 27 10:32:18 2010
@@ -28,6 +28,7 @@ import net.jini.config.NoSuchEntryExcept
 import net.jini.core.lookup.ServiceItem;
 import net.jini.core.lookup.ServiceTemplate;
 import net.jini.discovery.LookupDiscovery;
+import net.jini.discovery.DiscoveryManagement2;
 import net.jini.lookup.ServiceDiscoveryManager;
 import net.jini.lookup.ServiceItemFilter;
 import net.jini.security.BasicProxyPreparer;
@@ -109,7 +110,7 @@ public class Client {
 	} catch (NoSuchEntryException e) {
 	    /* Default to search in the public group */
 	    serviceDiscovery = new ServiceDiscoveryManager(
-		new LookupDiscovery(new String[] { "" }, config),
+		(DiscoveryManagement2) new LookupDiscovery(new String[] { "" }, config),
 		null, config);
 	}
 

Modified: incubator/river/jtsk/trunk/examples/hello/src/com/sun/jini/example/hello/Server.java
URL: http://svn.apache.org/viewvc/incubator/river/jtsk/trunk/examples/hello/src/com/sun/jini/example/hello/Server.java?rev=958358&r1=958357&r2=958358&view=diff
==============================================================================
--- incubator/river/jtsk/trunk/examples/hello/src/com/sun/jini/example/hello/Server.java (original)
+++ incubator/river/jtsk/trunk/examples/hello/src/com/sun/jini/example/hello/Server.java Sun Jun 27 10:32:18 2010
@@ -27,7 +27,7 @@ import net.jini.config.ConfigurationExce
 import net.jini.config.ConfigurationProvider;
 import net.jini.config.NoSuchEntryException;
 import net.jini.core.lookup.ServiceID;
-import net.jini.discovery.DiscoveryManagement;
+import net.jini.discovery.DiscoveryListenerManagement;
 import net.jini.discovery.LookupDiscovery;
 import net.jini.export.Exporter;
 import net.jini.export.ProxyAccessor;
@@ -149,11 +149,11 @@ public class Server implements Hello, Se
 	Proxy smartProxy = Proxy.create(serverProxy);
 
 	/* Get the discovery manager, for discovering lookup services */
-	DiscoveryManagement discoveryManager;
+	DiscoveryListenerManagement discoveryManager;
 	try {
-	    discoveryManager = (DiscoveryManagement) config.getEntry(
+	    discoveryManager = (DiscoveryListenerManagement) config.getEntry(
 		"com.sun.jini.example.hello.Server", "discoveryManager",
-		DiscoveryManagement.class);
+		DiscoveryListenerManagement.class);
 	} catch (NoSuchEntryException e) {
             /* Use the public group */
 	    discoveryManager = new LookupDiscovery(

Modified: incubator/river/jtsk/trunk/qa/src/com/sun/jini/test/impl/joinmanager/AddAttributesRace.java
URL: http://svn.apache.org/viewvc/incubator/river/jtsk/trunk/qa/src/com/sun/jini/test/impl/joinmanager/AddAttributesRace.java?rev=958358&r1=958357&r2=958358&view=diff
==============================================================================
--- incubator/river/jtsk/trunk/qa/src/com/sun/jini/test/impl/joinmanager/AddAttributesRace.java (original)
+++ incubator/river/jtsk/trunk/qa/src/com/sun/jini/test/impl/joinmanager/AddAttributesRace.java Sun Jun 27 10:32:18 2010
@@ -31,6 +31,7 @@ import net.jini.discovery.LookupDiscover
 import net.jini.lookup.JoinManager;
 
 import net.jini.core.entry.Entry;
+import net.jini.discovery.DiscoveryListenerManagement;
 
 /** Regression test for bug #4671109.
  *
@@ -168,7 +169,7 @@ public class AddAttributesRace extends A
 	joinMgrSrvcID = new JoinManager(testService,
 					serviceAttrs,
 					serviceID,
-					ldm,
+					(DiscoveryListenerManagement) ldm,
 					leaseMgr,
 					getConfig().getConfiguration());
 	joinMgrList.add(joinMgrSrvcID);

Modified: incubator/river/jtsk/trunk/qa/src/com/sun/jini/test/impl/joinmanager/LeaseRenewDurRFE.java
URL: http://svn.apache.org/viewvc/incubator/river/jtsk/trunk/qa/src/com/sun/jini/test/impl/joinmanager/LeaseRenewDurRFE.java?rev=958358&r1=958357&r2=958358&view=diff
==============================================================================
--- incubator/river/jtsk/trunk/qa/src/com/sun/jini/test/impl/joinmanager/LeaseRenewDurRFE.java (original)
+++ incubator/river/jtsk/trunk/qa/src/com/sun/jini/test/impl/joinmanager/LeaseRenewDurRFE.java Sun Jun 27 10:32:18 2010
@@ -111,6 +111,8 @@ import java.util.StringTokenizer;
 
 import javax.security.auth.Subject;
 import javax.security.auth.login.LoginContext;
+import net.jini.discovery.DiscoveryListenerManagement;
+import net.jini.discovery.DiscoveryManagement2;
 
 /**
  * This class verifies that the current implementation of the 
@@ -451,7 +453,7 @@ public class LeaseRenewDurRFE extends Ab
 
         /* create SDM to retrieve ref to TestService-i from lookup */
         sdm = new ServiceDiscoveryManager
-                                    (ldm, null, sysConfig.getConfiguration());
+                                    ((DiscoveryManagement2) ldm, null, sysConfig.getConfiguration());
     }//end setup
 
     /** For each separate TestService started during setup, do the following:
@@ -1227,7 +1229,8 @@ public class LeaseRenewDurRFE extends Ab
             outerProxy = TestServiceProxy.createTestServiceProxy
                                           (innerProxy, proxyID, val, renewDur);
             joinMgr = new JoinManager(outerProxy, null, serviceID,
-                                      ldm, null, config);
+                                      (DiscoveryListenerManagement) ldm, 
+                                      null, config);
         }//end doInit
 
         public TrustVerifier getProxyVerifier() {

Modified: incubator/river/jtsk/trunk/qa/src/com/sun/jini/test/impl/joinmanager/RaceAttrsVsTerminateISE.java
URL: http://svn.apache.org/viewvc/incubator/river/jtsk/trunk/qa/src/com/sun/jini/test/impl/joinmanager/RaceAttrsVsTerminateISE.java?rev=958358&r1=958357&r2=958358&view=diff
==============================================================================
--- incubator/river/jtsk/trunk/qa/src/com/sun/jini/test/impl/joinmanager/RaceAttrsVsTerminateISE.java (original)
+++ incubator/river/jtsk/trunk/qa/src/com/sun/jini/test/impl/joinmanager/RaceAttrsVsTerminateISE.java Sun Jun 27 10:32:18 2010
@@ -24,6 +24,7 @@ import com.sun.jini.test.spec.joinmanage
 import net.jini.lookup.JoinManager;
 
 import java.util.logging.Level;
+import net.jini.discovery.DiscoveryListenerManagement;
 
 /** Regression test for bug #4953710 (ISE = IllegalStateException).
  *
@@ -62,7 +63,8 @@ public class RaceAttrsVsTerminateISE ext
                removeDups( addAttrsDup1DupAll(serviceAttrs,newServiceAttrs) );
         /* Discover & join lookups just started */
         jm = new JoinManager(testService,serviceAttrs,serviceID,
-                             getLookupDiscoveryManager(),leaseMgr,
+                             (DiscoveryListenerManagement) getLookupDiscoveryManager(),
+                             leaseMgr,
                              sysConfig.getConfiguration());
     }//end setup
 

Modified: incubator/river/jtsk/trunk/qa/src/com/sun/jini/test/impl/joinmanager/RaceAttrsVsTerminateULE.java
URL: http://svn.apache.org/viewvc/incubator/river/jtsk/trunk/qa/src/com/sun/jini/test/impl/joinmanager/RaceAttrsVsTerminateULE.java?rev=958358&r1=958357&r2=958358&view=diff
==============================================================================
--- incubator/river/jtsk/trunk/qa/src/com/sun/jini/test/impl/joinmanager/RaceAttrsVsTerminateULE.java (original)
+++ incubator/river/jtsk/trunk/qa/src/com/sun/jini/test/impl/joinmanager/RaceAttrsVsTerminateULE.java Sun Jun 27 10:32:18 2010
@@ -24,6 +24,7 @@ import com.sun.jini.test.spec.joinmanage
 import net.jini.lookup.JoinManager;
 
 import java.util.logging.Level;
+import net.jini.discovery.DiscoveryListenerManagement;
 
 /** Regression test for bug #4953710 (ULE = UnknownLeaseException).
  *
@@ -62,7 +63,8 @@ public class RaceAttrsVsTerminateULE ext
                removeDups( addAttrsDup1DupAll(serviceAttrs,newServiceAttrs) );
         /* Discover & join lookups just started */
         jm = new JoinManager(testService,serviceAttrs,serviceID,
-                             getLookupDiscoveryManager(),leaseMgr,
+                             (DiscoveryListenerManagement) getLookupDiscoveryManager(),
+                             leaseMgr,
                              sysConfig.getConfiguration());
     }//end setup
 

Modified: incubator/river/jtsk/trunk/qa/src/com/sun/jini/test/impl/joinmanager/TerminateSemantics.java
URL: http://svn.apache.org/viewvc/incubator/river/jtsk/trunk/qa/src/com/sun/jini/test/impl/joinmanager/TerminateSemantics.java?rev=958358&r1=958357&r2=958358&view=diff
==============================================================================
--- incubator/river/jtsk/trunk/qa/src/com/sun/jini/test/impl/joinmanager/TerminateSemantics.java (original)
+++ incubator/river/jtsk/trunk/qa/src/com/sun/jini/test/impl/joinmanager/TerminateSemantics.java Sun Jun 27 10:32:18 2010
@@ -29,6 +29,7 @@ import net.jini.lookup.JoinManager;
 
 import net.jini.core.entry.Entry;
 import net.jini.core.lookup.ServiceRegistrar;
+import net.jini.discovery.DiscoveryListenerManagement;
 
 /**
  * With respect to the current implementation of the <code>JoinManager</code>
@@ -66,7 +67,8 @@ public class TerminateSemantics extends 
         super.setup(sysConfig);
         logger.log(Level.FINE, "creating a service ID join manager ...");
         joinMgrSrvcID = new JoinManager(testService,serviceAttrs,serviceID,
-                                        null,null,
+                                        (DiscoveryListenerManagement) null,
+                                        null,
 					sysConfig.getConfiguration());
     }//end setup
 

Modified: incubator/river/jtsk/trunk/qa/src/com/sun/jini/test/impl/servicediscovery/event/LookupTaskServiceIdMapRace.java
URL: http://svn.apache.org/viewvc/incubator/river/jtsk/trunk/qa/src/com/sun/jini/test/impl/servicediscovery/event/LookupTaskServiceIdMapRace.java?rev=958358&r1=958357&r2=958358&view=diff
==============================================================================
--- incubator/river/jtsk/trunk/qa/src/com/sun/jini/test/impl/servicediscovery/event/LookupTaskServiceIdMapRace.java (original)
+++ incubator/river/jtsk/trunk/qa/src/com/sun/jini/test/impl/servicediscovery/event/LookupTaskServiceIdMapRace.java Sun Jun 27 10:32:18 2010
@@ -37,6 +37,7 @@ import net.jini.core.lookup.ServiceRegis
 import java.rmi.RemoteException;
 import java.util.ArrayList;
 import java.util.logging.Level;
+import net.jini.discovery.DiscoveryManagement2;
 
 /**
  * This test attempts to simulate the following race condition that
@@ -273,7 +274,7 @@ public class LookupTaskServiceIdMapRace 
         /* 2. Create half the SDM's and caches */
         for (int i=0; i<(N_SDM/2); i++) {
             ServiceDiscoveryManager sdm = new ServiceDiscoveryManager
-                                      (ldm,null,testConfig.getConfiguration());
+                                      ( (DiscoveryManagement2) ldm,null,testConfig.getConfiguration());
             sdmList.add(sdm);
             SDMListener l = new SDMListener(testConfig, "SDM_"+i);
             sdmListeners.add(l);
@@ -287,7 +288,7 @@ public class LookupTaskServiceIdMapRace 
         /* 4. Create the remaining SDM's and caches */
         for (int i=(N_SDM/2); i<N_SDM; i++) {
             ServiceDiscoveryManager sdm = new ServiceDiscoveryManager
-                                      (ldm,null,testConfig.getConfiguration());
+                                      ( (DiscoveryManagement2) ldm,null,testConfig.getConfiguration());
             sdmList.add(sdm);
             SDMListener l = new SDMListener(testConfig, "SDM_"+i);
             sdmListeners.add(l);

Modified: incubator/river/jtsk/trunk/qa/src/com/sun/jini/test/share/reggie/RegistrarImpl.java
URL: http://svn.apache.org/viewvc/incubator/river/jtsk/trunk/qa/src/com/sun/jini/test/share/reggie/RegistrarImpl.java?rev=958358&r1=958357&r2=958358&view=diff
==============================================================================
--- incubator/river/jtsk/trunk/qa/src/com/sun/jini/test/share/reggie/RegistrarImpl.java (original)
+++ incubator/river/jtsk/trunk/qa/src/com/sun/jini/test/share/reggie/RegistrarImpl.java Sun Jun 27 10:32:18 2010
@@ -3939,7 +3939,7 @@ public class RegistrarImpl implements Re
 	discoer = new LookupDiscoveryManager(lookupGroups, lookupLocators,
 					     null);
 	joiner = new JoinManager(proxy, lookupAttrs, myServiceID,
-				 discoer, null);
+				 (DiscoveryListenerManagement) discoer, null);
 	/* start up all the daemon threads */
 	serviceExpirer.start();
 	eventExpirer.start();

Modified: incubator/river/jtsk/trunk/qa/src/com/sun/jini/test/spec/joinmanager/Equality.java
URL: http://svn.apache.org/viewvc/incubator/river/jtsk/trunk/qa/src/com/sun/jini/test/spec/joinmanager/Equality.java?rev=958358&r1=958357&r2=958358&view=diff
==============================================================================
--- incubator/river/jtsk/trunk/qa/src/com/sun/jini/test/spec/joinmanager/Equality.java (original)
+++ incubator/river/jtsk/trunk/qa/src/com/sun/jini/test/spec/joinmanager/Equality.java Sun Jun 27 10:32:18 2010
@@ -27,6 +27,7 @@ import net.jini.lookup.JoinManager;
 import net.jini.config.ConfigurationException;
 
 import java.io.IOException;
+import net.jini.discovery.DiscoveryListenerManagement;
 
 /**
  * This class verifies that the <code>JoinManager</code> utility class
@@ -57,7 +58,7 @@ public class Equality extends AbstractBa
         joinMgrCallback = new JoinManager(testService,
 					  serviceAttrs,
 					  callback,
-                                          discoveryMgr,
+                                          (DiscoveryListenerManagement) discoveryMgr,
 					  leaseMgr,
 					  sysConfig.getConfiguration());
         joinMgrList.add(joinMgrCallback);
@@ -65,7 +66,7 @@ public class Equality extends AbstractBa
         joinMgrSrvcID = new JoinManager(testService,
 					serviceAttrs,
 					serviceID,
-                                        discoveryMgr,
+                                        (DiscoveryListenerManagement) discoveryMgr,
 					leaseMgr,
 					sysConfig.getConfiguration());
         joinMgrList.add(joinMgrSrvcID);
@@ -107,7 +108,7 @@ public class Equality extends AbstractBa
 	newJM = new JoinManager(testService,
 				serviceAttrs,
 				serviceID,
-				discoveryMgr,
+				(DiscoveryListenerManagement) discoveryMgr,
 				leaseMgr,
 				getConfig().getConfiguration());
 	joinMgrList.add(newJM);

Modified: incubator/river/jtsk/trunk/qa/src/com/sun/jini/test/spec/joinmanager/GetAttributes.java
URL: http://svn.apache.org/viewvc/incubator/river/jtsk/trunk/qa/src/com/sun/jini/test/spec/joinmanager/GetAttributes.java?rev=958358&r1=958357&r2=958358&view=diff
==============================================================================
--- incubator/river/jtsk/trunk/qa/src/com/sun/jini/test/spec/joinmanager/GetAttributes.java (original)
+++ incubator/river/jtsk/trunk/qa/src/com/sun/jini/test/spec/joinmanager/GetAttributes.java Sun Jun 27 10:32:18 2010
@@ -27,6 +27,7 @@ import com.sun.jini.test.share.Attribute
 import net.jini.lookup.JoinManager;
 
 import net.jini.core.entry.Entry;
+import net.jini.discovery.DiscoveryListenerManagement;
 
 /**
  * This class verifies that the <code>JoinManager</code> utility class
@@ -58,7 +59,8 @@ public class GetAttributes extends Abstr
         /* Discover & join lookups just started */
         logger.log(Level.FINE, "creating a service ID join manager ...");
         joinMgrSrvcID = new JoinManager(testService,serviceAttrs,serviceID,
-                                        getLookupDiscoveryManager(),leaseMgr,
+                                        (DiscoveryListenerManagement) getLookupDiscoveryManager(),
+                                        leaseMgr,
 					sysConfig.getConfiguration());
         joinMgrList.add(joinMgrSrvcID);
     }//end setup

Modified: incubator/river/jtsk/trunk/qa/src/com/sun/jini/test/spec/joinmanager/GetJoinSetCallback.java
URL: http://svn.apache.org/viewvc/incubator/river/jtsk/trunk/qa/src/com/sun/jini/test/spec/joinmanager/GetJoinSetCallback.java?rev=958358&r1=958357&r2=958358&view=diff
==============================================================================
--- incubator/river/jtsk/trunk/qa/src/com/sun/jini/test/spec/joinmanager/GetJoinSetCallback.java (original)
+++ incubator/river/jtsk/trunk/qa/src/com/sun/jini/test/spec/joinmanager/GetJoinSetCallback.java Sun Jun 27 10:32:18 2010
@@ -27,6 +27,7 @@ import net.jini.lookup.JoinManager;
 import net.jini.core.lookup.ServiceRegistrar;
 
 import java.util.ArrayList;
+import net.jini.discovery.DiscoveryListenerManagement;
 
 /**
  * This class verifies that the <code>JoinManager</code> utility class
@@ -69,12 +70,14 @@ public class GetJoinSetCallback extends 
         if(callbackJM) {
             jm = new JoinManager(testService,serviceAttrs,
                                  new SrvcIDListener(testService),
-                                 getLookupDiscoveryManager(),leaseMgr,
+                                 (DiscoveryListenerManagement) getLookupDiscoveryManager(),
+                                 leaseMgr,
 				 sysConfig.getConfiguration());
             nServiceIDEventsExpected = 1;
         } else {//create a join manager that sends the generated ID in an event
             jm = new JoinManager(testService,serviceAttrs,serviceID,
-                                 getLookupDiscoveryManager(),leaseMgr,
+                                 (DiscoveryListenerManagement) getLookupDiscoveryManager(),
+                                 leaseMgr,
 				 sysConfig.getConfiguration());
             nServiceIDEventsExpected = 0;
         }//endif

Modified: incubator/river/jtsk/trunk/qa/src/com/sun/jini/test/spec/joinmanager/LDMNullPublicGroup.java
URL: http://svn.apache.org/viewvc/incubator/river/jtsk/trunk/qa/src/com/sun/jini/test/spec/joinmanager/LDMNullPublicGroup.java?rev=958358&r1=958357&r2=958358&view=diff
==============================================================================
--- incubator/river/jtsk/trunk/qa/src/com/sun/jini/test/spec/joinmanager/LDMNullPublicGroup.java (original)
+++ incubator/river/jtsk/trunk/qa/src/com/sun/jini/test/spec/joinmanager/LDMNullPublicGroup.java Sun Jun 27 10:32:18 2010
@@ -32,6 +32,7 @@ import net.jini.lookup.JoinManager;
 import net.jini.core.discovery.LookupLocator;
 
 import java.util.ArrayList;
+import net.jini.discovery.DiscoveryListenerManagement;
 
 /**
  * This class verifies that when <code>null</code> is input to the
@@ -64,12 +65,14 @@ public class LDMNullPublicGroup extends 
         super.setup(sysConfig);
         logger.log(Level.FINE, "creating a callback join manager ...");
         joinMgrCallback = new JoinManager(testService,serviceAttrs,callback,
-                                          discoveryMgr,leaseMgr,
+                                          (DiscoveryListenerManagement) discoveryMgr,
+                                          leaseMgr,
 					  sysConfig.getConfiguration());
         joinMgrList.add(joinMgrCallback);
         logger.log(Level.FINE, "creating a service ID join manager ...");
         joinMgrSrvcID = new JoinManager(testService,serviceAttrs,serviceID,
-                                        discoveryMgr,leaseMgr,
+                                        (DiscoveryListenerManagement) discoveryMgr,
+                                        leaseMgr,
 					sysConfig.getConfiguration());
         joinMgrList.add(joinMgrSrvcID);
     }//end setup

Modified: incubator/river/jtsk/trunk/qa/src/com/sun/jini/test/spec/joinmanager/ModifyAttributesServiceControlled.java
URL: http://svn.apache.org/viewvc/incubator/river/jtsk/trunk/qa/src/com/sun/jini/test/spec/joinmanager/ModifyAttributesServiceControlled.java?rev=958358&r1=958357&r2=958358&view=diff
==============================================================================
--- incubator/river/jtsk/trunk/qa/src/com/sun/jini/test/spec/joinmanager/ModifyAttributesServiceControlled.java (original)
+++ incubator/river/jtsk/trunk/qa/src/com/sun/jini/test/spec/joinmanager/ModifyAttributesServiceControlled.java Sun Jun 27 10:32:18 2010
@@ -27,6 +27,7 @@ import com.sun.jini.test.share.Attribute
 import net.jini.lookup.JoinManager;
 
 import net.jini.core.entry.Entry;
+import net.jini.discovery.DiscoveryListenerManagement;
 
 /**
  * This class verifies that the <code>JoinManager</code> utility class
@@ -100,7 +101,8 @@ public class ModifyAttributesServiceCont
         }//end loop
         logger.log(Level.FINE, "creating a service ID join manager ...");
         joinMgrSrvcID = new JoinManager(testService,serviceAttrs,serviceID,
-                                        getLookupDiscoveryManager(),leaseMgr,
+                                        (DiscoveryListenerManagement) getLookupDiscoveryManager(),
+                                        leaseMgr,
 					sysConfig.getConfiguration());
         joinMgrList.add(joinMgrSrvcID);
     }//end setup

Modified: incubator/river/jtsk/trunk/qa/src/com/sun/jini/test/spec/joinmanager/Register.java
URL: http://svn.apache.org/viewvc/incubator/river/jtsk/trunk/qa/src/com/sun/jini/test/spec/joinmanager/Register.java?rev=958358&r1=958357&r2=958358&view=diff
==============================================================================
--- incubator/river/jtsk/trunk/qa/src/com/sun/jini/test/spec/joinmanager/Register.java (original)
+++ incubator/river/jtsk/trunk/qa/src/com/sun/jini/test/spec/joinmanager/Register.java Sun Jun 27 10:32:18 2010
@@ -23,6 +23,7 @@ import java.util.logging.Level;
 import com.sun.jini.qa.harness.QAConfig;
 import com.sun.jini.qa.harness.TestException;
 
+import net.jini.discovery.DiscoveryListenerManagement;
 import net.jini.lookup.JoinManager;
 
 /**
@@ -55,7 +56,8 @@ public class Register extends AbstractBa
         /* Discover & join lookups just started */
         logger.log(Level.FINE, "creating a service ID join manager ...");
         joinMgrSrvcID = new JoinManager(testService,serviceAttrs,serviceID,
-                                        getLookupDiscoveryManager(),leaseMgr,
+                                        (DiscoveryListenerManagement) getLookupDiscoveryManager(),
+                                        leaseMgr,
 					sysConfig.getConfiguration());
         joinMgrList.add(joinMgrSrvcID);
     }//end setup

Modified: incubator/river/jtsk/trunk/qa/src/com/sun/jini/test/spec/joinmanager/TerminateDiscovery.java
URL: http://svn.apache.org/viewvc/incubator/river/jtsk/trunk/qa/src/com/sun/jini/test/spec/joinmanager/TerminateDiscovery.java?rev=958358&r1=958357&r2=958358&view=diff
==============================================================================
--- incubator/river/jtsk/trunk/qa/src/com/sun/jini/test/spec/joinmanager/TerminateDiscovery.java (original)
+++ incubator/river/jtsk/trunk/qa/src/com/sun/jini/test/spec/joinmanager/TerminateDiscovery.java Sun Jun 27 10:32:18 2010
@@ -23,6 +23,7 @@ import java.util.logging.Level;
 import com.sun.jini.qa.harness.QAConfig;
 import com.sun.jini.qa.harness.TestException;
 
+import net.jini.discovery.DiscoveryListenerManagement;
 import net.jini.discovery.LookupDiscoveryManager;
 import net.jini.lookup.JoinManager;
 
@@ -61,13 +62,14 @@ public class TerminateDiscovery extends 
         /* Discover & join lookups just started */
         logger.log(Level.FINE, "creating a service ID join manager ...");
         joinMgrSrvcID = new JoinManager(testService,serviceAttrs,serviceID,
-                                        null,null,sysConfig.getConfiguration());
+                                        (DiscoveryListenerManagement) null,
+                                        null,sysConfig.getConfiguration());
         /* Note: no need to add joinMgrSrvcID to the joinMgrList for
          *       termination during tearDown because it will be terminated
          *       in the run method
          */
         LookupDiscoveryManager discMgr 
-              = (LookupDiscoveryManager)(joinMgrSrvcID.getDiscoveryManager());
+              = (LookupDiscoveryManager)(joinMgrSrvcID.discoveryManager());
         discMgr.setGroups(toGroupsArray(initLookupsToStart));
         discMgr.addDiscoveryListener(mainListener);
     }//end setup

Modified: incubator/river/jtsk/trunk/qa/src/com/sun/jini/test/spec/joinmanager/TerminateLeases.java
URL: http://svn.apache.org/viewvc/incubator/river/jtsk/trunk/qa/src/com/sun/jini/test/spec/joinmanager/TerminateLeases.java?rev=958358&r1=958357&r2=958358&view=diff
==============================================================================
--- incubator/river/jtsk/trunk/qa/src/com/sun/jini/test/spec/joinmanager/TerminateLeases.java (original)
+++ incubator/river/jtsk/trunk/qa/src/com/sun/jini/test/spec/joinmanager/TerminateLeases.java Sun Jun 27 10:32:18 2010
@@ -23,6 +23,7 @@ import java.util.logging.Level;
 import com.sun.jini.qa.harness.QAConfig;
 import com.sun.jini.qa.harness.TestException;
 
+import net.jini.discovery.DiscoveryListenerManagement;
 import net.jini.discovery.DiscoveryManagement;
 import net.jini.lookup.JoinManager;
 
@@ -54,7 +55,8 @@ public class TerminateLeases extends Abs
         /* Discover & join lookups just started */
         logger.log(Level.FINE, "creating a service ID join manager ...");
         joinMgrSrvcID = new JoinManager(testService,serviceAttrs,serviceID,
-                                        getLookupDiscoveryManager(),null,
+                                        (DiscoveryListenerManagement) getLookupDiscoveryManager(),
+                                        null,
 					sysConfig.getConfiguration());
         /* Note: no need to add joinMgrSrvcID to the joinMgrList for
          *       termination during tearDown because it will be terminated

Modified: incubator/river/jtsk/trunk/qa/src/com/sun/jini/test/spec/servicediscovery/AbstractBaseTest.java
URL: http://svn.apache.org/viewvc/incubator/river/jtsk/trunk/qa/src/com/sun/jini/test/spec/servicediscovery/AbstractBaseTest.java?rev=958358&r1=958357&r2=958358&view=diff
==============================================================================
--- incubator/river/jtsk/trunk/qa/src/com/sun/jini/test/spec/servicediscovery/AbstractBaseTest.java (original)
+++ incubator/river/jtsk/trunk/qa/src/com/sun/jini/test/spec/servicediscovery/AbstractBaseTest.java Sun Jun 27 10:32:18 2010
@@ -66,6 +66,7 @@ import java.util.HashMap;
 import java.util.Properties;
 
 import net.jini.config.ConfigurationException;
+import net.jini.discovery.DiscoveryManagement2;
 
 /**
  * This class is an abstract class that acts as the base class which
@@ -503,7 +504,7 @@ abstract public class AbstractBaseTest e
 	    /* Construct the ServiceDiscoveryManager that will be tested */
 	    logger.log(Level.FINE, "constructing a service discovery manager");
 	    srvcDiscoveryMgr = new ServiceDiscoveryManager
-		(getLookupDiscoveryManager(),
+		( (DiscoveryManagement2) getLookupDiscoveryManager(),
 		 null,  //LeaseRenewalManager
 		 sysConfig.getConfiguration());
 	    sdmList.add(srvcDiscoveryMgr);
@@ -573,7 +574,7 @@ abstract public class AbstractBaseTest e
             for(int i=0;i<sdmList.size();i++) {
                 ServiceDiscoveryManager sdmMgr
                                     = (ServiceDiscoveryManager)sdmList.get(i);
-                DiscoveryManagement discMgr = sdmMgr.getDiscoveryManager();
+                DiscoveryManagement2 discMgr = sdmMgr.discoveryManager();
                 try {
                     logger.log(Level.FINE,
 			 "tearDown - terminating service discovery manager "+i);

Modified: incubator/river/jtsk/trunk/qa/src/com/sun/jini/test/spec/servicediscovery/DefaultDiscoverPublic.java
URL: http://svn.apache.org/viewvc/incubator/river/jtsk/trunk/qa/src/com/sun/jini/test/spec/servicediscovery/DefaultDiscoverPublic.java?rev=958358&r1=958357&r2=958358&view=diff
==============================================================================
--- incubator/river/jtsk/trunk/qa/src/com/sun/jini/test/spec/servicediscovery/DefaultDiscoverPublic.java (original)
+++ incubator/river/jtsk/trunk/qa/src/com/sun/jini/test/spec/servicediscovery/DefaultDiscoverPublic.java Sun Jun 27 10:32:18 2010
@@ -26,6 +26,8 @@ import net.jini.discovery.LookupDiscover
 import net.jini.lookup.ServiceDiscoveryManager;
 import com.sun.jini.qa.harness.QAConfig;
 import com.sun.jini.qa.harness.TestException;
+import net.jini.discovery.DiscoveryManagement2;
+import net.jini.lease.LeaseRenewalManager;
 
 /**
  * With respect to the lookup discovery processing performed by the
@@ -59,15 +61,15 @@ public class DefaultDiscoverPublic exten
         testDesc = "service discovery manager with default lookup "
                    +"discovery manager (should discover public lookups)";
         srvcDiscoveryMgr = 
-	    new ServiceDiscoveryManager(null, 
-					null,
+	    new ServiceDiscoveryManager( (DiscoveryManagement2) null, 
+					 (LeaseRenewalManager) null,
 					config.getConfiguration());
         sdmList.add(srvcDiscoveryMgr);
     }//end setup
 
     /** Executes the current test by doing the following:
      *  
-     *  1. Retrieves the instance of <code>DiscoveryManagement</code>
+     *  1. Retrieves the instance of <code>DiscoveryManagement2</code>
      *     being used by the service discovery manager.
      *  2. Retrieves the set of groups the lookup discovery manager is
      *     configured to discover. 
@@ -77,7 +79,7 @@ public class DefaultDiscoverPublic exten
      *           <code>null</code> if the test was successful.
      */
     protected void applyTestDef() throws Exception {
-        DiscoveryManagement dm = srvcDiscoveryMgr.getDiscoveryManager();
+        DiscoveryManagement2 dm = srvcDiscoveryMgr.discoveryManager();
         if( !(dm instanceof LookupDiscoveryManager) ) {
         throw new TestException(" -- default lookup discovery manager is not "
 				+"an instance of "

Modified: incubator/river/jtsk/trunk/qa/src/com/sun/jini/test/spec/servicediscovery/cache/AddListenerNPE.java
URL: http://svn.apache.org/viewvc/incubator/river/jtsk/trunk/qa/src/com/sun/jini/test/spec/servicediscovery/cache/AddListenerNPE.java?rev=958358&r1=958357&r2=958358&view=diff
==============================================================================
--- incubator/river/jtsk/trunk/qa/src/com/sun/jini/test/spec/servicediscovery/cache/AddListenerNPE.java (original)
+++ incubator/river/jtsk/trunk/qa/src/com/sun/jini/test/spec/servicediscovery/cache/AddListenerNPE.java Sun Jun 27 10:32:18 2010
@@ -33,6 +33,7 @@ import net.jini.lookup.ServiceDiscoveryM
 import java.rmi.RemoteException;
 import com.sun.jini.qa.harness.QAConfig;
 import com.sun.jini.qa.harness.TestException;
+import net.jini.discovery.DiscoveryManagement2;
 
 /**
  * This class verifies that the <code>addListener</code> method of
@@ -84,7 +85,7 @@ public class AddListenerNPE extends Abst
 				       null,
 				       sysConfig.getConfiguration());
         srvcDiscoveryMgr = 
-	    new ServiceDiscoveryManager(discoveryMgr,
+	    new ServiceDiscoveryManager((DiscoveryManagement2) discoveryMgr,
 					null,
 					sysConfig.getConfiguration());
         sdmList.add(srvcDiscoveryMgr);

Modified: incubator/river/jtsk/trunk/src/com/sun/jini/fiddler/FiddlerImpl.java
URL: http://svn.apache.org/viewvc/incubator/river/jtsk/trunk/src/com/sun/jini/fiddler/FiddlerImpl.java?rev=958358&r1=958357&r2=958358&view=diff
==============================================================================
--- incubator/river/jtsk/trunk/src/com/sun/jini/fiddler/FiddlerImpl.java (original)
+++ incubator/river/jtsk/trunk/src/com/sun/jini/fiddler/FiddlerImpl.java Sun Jun 27 10:32:18 2010
@@ -140,6 +140,7 @@ import java.util.Set;
 import java.util.TreeMap;
 import java.util.logging.Level;
 import java.util.logging.Logger;
+import net.jini.discovery.DiscoveryListenerManagement;
 
 /**
  * This class is the server side of an implementation of the lookup
@@ -278,7 +279,7 @@ class FiddlerImpl implements ServerProxy
     /** Earliest expiration time over all active registrations */
     private long minExpiration = Long.MAX_VALUE;
     /** The lookup discovery manager this service's join manager will use */
-    private DiscoveryManagement joinMgrLDM;
+    private DiscoveryListenerManagement joinMgrLDM;
     /** Manager for discovering and registering with lookup services */
     private JoinManager joinMgr;
     /** Task manager for sending remote discovery events */

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=958358&r1=958357&r2=958358&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 Sun Jun 27 10:32:18 2010
@@ -50,6 +50,7 @@ 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.discovery.DiscoveryListenerManagement;
 import net.jini.io.MiToMoOutputStream;
 
 /**
@@ -323,7 +324,7 @@ class JoinStateManager extends LogHandle
 	    initlogger.log(Level.FINEST, "Creating JoinManager");
         }
 	mgr = new JoinManager(service, attributes, serviceID, 
-            dm, null, config);
+            (DiscoveryListenerManagement) dm, null, config);
         // Once we are running we don't need the attributes,
         // locators, and groups fields, null them out (the
         // state is in the mgr and dm.

Modified: incubator/river/jtsk/trunk/src/com/sun/jini/mercury/MailboxImpl.java
URL: http://svn.apache.org/viewvc/incubator/river/jtsk/trunk/src/com/sun/jini/mercury/MailboxImpl.java?rev=958358&r1=958357&r2=958358&view=diff
==============================================================================
--- incubator/river/jtsk/trunk/src/com/sun/jini/mercury/MailboxImpl.java (original)
+++ incubator/river/jtsk/trunk/src/com/sun/jini/mercury/MailboxImpl.java Sun Jun 27 10:32:18 2010
@@ -130,6 +130,7 @@ import net.jini.core.lease.LeaseDeniedEx
 import net.jini.core.lease.UnknownLeaseException;
 import net.jini.core.lookup.ServiceID;
 import net.jini.discovery.DiscoveryGroupManagement;
+import net.jini.discovery.DiscoveryListenerManagement;
 import net.jini.discovery.DiscoveryLocatorManagement;
 import net.jini.discovery.DiscoveryManagement;
 import net.jini.discovery.LookupDiscoveryManager;
@@ -393,7 +394,7 @@ class MailboxImpl implements MailboxBack
      * This can always be obtained from the JoinManager, so
      * this is just used as a shortcut.
      */
-    private DiscoveryManagement lookupDiscMgr = null;
+    private DiscoveryListenerManagement lookupDiscMgr = null;
 
     /** The attributes to use when joining lookup services */
     private Entry[] baseLookupAttrs = new Entry[] { 

Modified: incubator/river/jtsk/trunk/src/com/sun/jini/norm/lookup/JoinState.java
URL: http://svn.apache.org/viewvc/incubator/river/jtsk/trunk/src/com/sun/jini/norm/lookup/JoinState.java?rev=958358&r1=958357&r2=958358&view=diff
==============================================================================
--- incubator/river/jtsk/trunk/src/com/sun/jini/norm/lookup/JoinState.java (original)
+++ incubator/river/jtsk/trunk/src/com/sun/jini/norm/lookup/JoinState.java Sun Jun 27 10:32:18 2010
@@ -48,6 +48,7 @@ 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.discovery.DiscoveryListenerManagement;
 
 /**
  * Utility class that combines <code>JoinManager</code> with persistence.
@@ -120,7 +121,7 @@ public class JoinState extends LogHandle
      * must also implement <code>DiscoveryGroupManagement</code> and
      * <code>DiscoveryLocatorManagement</code>.
      */
-    private DiscoveryManagement dm;
+    private DiscoveryListenerManagement dm;
 
     /** Our join manager */
     private JoinManager joinMgr;

Modified: incubator/river/jtsk/trunk/src/com/sun/jini/outrigger/JoinStateManager.java
URL: http://svn.apache.org/viewvc/incubator/river/jtsk/trunk/src/com/sun/jini/outrigger/JoinStateManager.java?rev=958358&r1=958357&r2=958358&view=diff
==============================================================================
--- incubator/river/jtsk/trunk/src/com/sun/jini/outrigger/JoinStateManager.java (original)
+++ incubator/river/jtsk/trunk/src/com/sun/jini/outrigger/JoinStateManager.java Sun Jun 27 10:32:18 2010
@@ -41,6 +41,7 @@ import net.jini.security.ProxyPreparer;
 
 import com.sun.jini.config.Config;
 import com.sun.jini.logging.Levels;
+import net.jini.discovery.DiscoveryListenerManagement;
 
 /**
  * <code>JoinStateManager</code> provides a utility that manages
@@ -303,7 +304,7 @@ class JoinStateManager implements Storab
 	((DiscoveryLocatorManagement)dgm).setLocators(locators);
 
 	mgr = new JoinManager(service, attributes, serviceID, 
-			      (DiscoveryManagement)dgm, null, config);
+			      (DiscoveryListenerManagement)dgm, null, config);
 
 	// Once we are running we don't need the attributes,
 	// locators, and groups fields, null them out (the

Modified: incubator/river/jtsk/trunk/src/com/sun/jini/reggie/RegistrarImpl.java
URL: http://svn.apache.org/viewvc/incubator/river/jtsk/trunk/src/com/sun/jini/reggie/RegistrarImpl.java?rev=958358&r1=958357&r2=958358&view=diff
==============================================================================
--- incubator/river/jtsk/trunk/src/com/sun/jini/reggie/RegistrarImpl.java (original)
+++ incubator/river/jtsk/trunk/src/com/sun/jini/reggie/RegistrarImpl.java Sun Jun 27 10:32:18 2010
@@ -109,6 +109,7 @@ import net.jini.core.lookup.ServiceRegis
 import net.jini.discovery.Constants;
 import net.jini.discovery.ConstrainableLookupLocator;
 import net.jini.discovery.DiscoveryGroupManagement;
+import net.jini.discovery.DiscoveryListenerManagement;
 import net.jini.discovery.DiscoveryLocatorManagement;
 import net.jini.discovery.DiscoveryManagement;
 import net.jini.discovery.LookupDiscoveryManager;
@@ -4670,7 +4671,7 @@ class RegistrarImpl implements Registrar
 	    throw new ConfigurationException(null, e);
 	}
 	joiner = new JoinManager(proxy, lookupAttrs, myServiceID,
-				 discoer, null, config);
+				 (DiscoveryListenerManagement) discoer, null, config);
 
 	/* start up all the daemon threads */
 	serviceExpirer.start();

Modified: incubator/river/jtsk/trunk/src/net/jini/core/lookup/MarshalledServiceItem.java
URL: http://svn.apache.org/viewvc/incubator/river/jtsk/trunk/src/net/jini/core/lookup/MarshalledServiceItem.java?rev=958358&r1=958357&r2=958358&view=diff
==============================================================================
--- incubator/river/jtsk/trunk/src/net/jini/core/lookup/MarshalledServiceItem.java (original)
+++ incubator/river/jtsk/trunk/src/net/jini/core/lookup/MarshalledServiceItem.java Sun Jun 27 10:32:18 2010
@@ -5,6 +5,9 @@
 
 package net.jini.core.lookup;
 
+import java.net.URI;
+import java.security.CodeSource;
+import java.util.Collection;
 import net.jini.core.entry.Entry;
 
 /**
@@ -36,12 +39,15 @@ public abstract class MarshalledServiceI
     }
     /**
      * Unmarshall the service proxy. 
+     * @param code load service with a local or existing CodeSource.
      * @return the service proxy, null if class not found.
      */
-    public abstract Object getService();
+    public abstract Object getService(CodeSource[] code);
     /**
      * Unmarshall the Entry's
      * @return array of Entry's, null entry in array for any class not found.
      */
     public abstract Entry[] getEntries();
+    
+    public abstract Collection<? extends URI> getAnnotations();
 }

Modified: incubator/river/jtsk/trunk/src/net/jini/core/lookup/StreamServiceRegistrar.java
URL: http://svn.apache.org/viewvc/incubator/river/jtsk/trunk/src/net/jini/core/lookup/StreamServiceRegistrar.java?rev=958358&r1=958357&r2=958358&view=diff
==============================================================================
--- incubator/river/jtsk/trunk/src/net/jini/core/lookup/StreamServiceRegistrar.java (original)
+++ incubator/river/jtsk/trunk/src/net/jini/core/lookup/StreamServiceRegistrar.java Sun Jun 27 10:32:18 2010
@@ -17,8 +17,8 @@
  */
 package net.jini.core.lookup;
 
+import java.io.IOException;
 import org.apache.river.api.util.ResultStream;
-import java.rmi.RemoteException;
 import net.jini.core.entry.Entry;
 import net.jini.core.event.EventRegistration;
 import net.jini.core.event.RemoteEventListener;
@@ -82,7 +82,7 @@ public interface StreamServiceRegistrar 
 			     int transitions,
 			     RemoteEventListener listener,
 			     long leaseDuration)
-	throws RemoteException;
+	throws IOException;
 
     /**
      * Returns a ResultStream that provides access to MarshalledServiceItem 
@@ -122,7 +122,7 @@ public interface StreamServiceRegistrar 
      * @since 2.2.0
      */
     ResultStream<ServiceItem> lookup(ServiceTemplate tmpl, 
-        Class<? extends Entry>[] unmarshalledEntries, int maxBatchSize) throws RemoteException;
+        Class<? extends Entry>[] unmarshalledEntries, int maxBatchSize) throws IOException;
     
     /**
      * Looks at all service items that match the specified template, finds
@@ -142,7 +142,7 @@ public interface StreamServiceRegistrar 
      * @throws java.rmi.RemoteException
      */
     ResultStream<Class> getEntryClasses(ServiceTemplate tmpl, int maxBatchSize) 
-            throws RemoteException;
+            throws IOException;
 
     /**
      * Looks at all service items that match the specified template, finds
@@ -167,7 +167,7 @@ public interface StreamServiceRegistrar 
      * @throws java.rmi.RemoteException
      */
     ResultStream getFieldValues(ServiceTemplate tmpl, int setIndex, String field,
-            int maxBatchSize) throws NoSuchFieldException, RemoteException;
+            int maxBatchSize) throws NoSuchFieldException, IOException;
     
     /**
      * Looks at all service items that match the specified template, and for
@@ -189,6 +189,6 @@ public interface StreamServiceRegistrar 
      * @throws java.rmi.RemoteException
      */
     ResultStream<Class> getServiceTypes(ServiceTemplate tmpl, String prefix, 
-            int maxBatchSize) throws RemoteException;
+            int maxBatchSize) throws IOException;
 
 }

Modified: incubator/river/jtsk/trunk/src/net/jini/lookup/JoinManager.java
URL: http://svn.apache.org/viewvc/incubator/river/jtsk/trunk/src/net/jini/lookup/JoinManager.java?rev=958358&r1=958357&r2=958358&view=diff
==============================================================================
--- incubator/river/jtsk/trunk/src/net/jini/lookup/JoinManager.java (original)
+++ incubator/river/jtsk/trunk/src/net/jini/lookup/JoinManager.java Sun Jun 27 10:32:18 2010
@@ -59,7 +59,6 @@ import net.jini.discovery.DiscoveryListe
 import net.jini.discovery.DiscoveryManagement2;
 import net.jini.discovery.DiscMan2Facade;
 import org.apache.river.api.util.Facade;
-import net.jini.lookup.ServiceRegistrarFacade;
 
 /**
  * A goal of any well-behaved service is to advertise the facilities and
@@ -1653,10 +1652,10 @@ public class JoinManager {
         } catch(ConfigurationException e) { /* swallow this exception */ }
     }//end constructor
      
-     public JoinManager(DiscoveryListenerManagement discoveryMgr,
-                        Object serviceProxy,
+     public JoinManager(Object serviceProxy,
                         Entry[] attrSets,
 			ServiceIDListener callback,
+                        DiscoveryListenerManagement discoveryMgr,
 			LeaseRenewalManager leaseMgr
                         )    throws IOException
     {
@@ -1784,10 +1783,10 @@ public class JoinManager {
                           callback, leaseMgr, config);
     }//end constructor
 
-     public JoinManager(DiscoveryListenerManagement discoveryMgr,
-                        Object serviceProxy,
+     public JoinManager(Object serviceProxy,
                         Entry[] attrSets,
 			ServiceIDListener callback,
+                        DiscoveryListenerManagement discoveryMgr,
                         LeaseRenewalManager leaseMgr,			
                         Configuration config)
                                     throws IOException, ConfigurationException
@@ -1861,10 +1860,10 @@ public class JoinManager {
         } catch(ConfigurationException e) { /* swallow this exception */ }
     }//end constructor
 
-     public JoinManager(DiscoveryListenerManagement discoveryMgr,
-                        Object serviceProxy,
+     public JoinManager(Object serviceProxy,
                         Entry[] attrSets,
 			ServiceID serviceID,
+                        DiscoveryListenerManagement discoveryMgr,
                         LeaseRenewalManager leaseMgr
 			)
                         throws IOException
@@ -1955,10 +1954,10 @@ public class JoinManager {
                           (ServiceIDListener)null, leaseMgr, config);
     }//end constructor
      
-     public JoinManager(DiscoveryListenerManagement discoveryMgr,
-                        Object serviceProxy,
+     public JoinManager(Object serviceProxy,
                         Entry[] attrSets,
 			ServiceID serviceID,
+                        DiscoveryListenerManagement discoveryMgr,
                         LeaseRenewalManager leaseMgr,			
                         Configuration config)
                                     throws IOException, ConfigurationException

Added: incubator/river/jtsk/trunk/src/net/jini/lookup/LookupStreamCache.java
URL: http://svn.apache.org/viewvc/incubator/river/jtsk/trunk/src/net/jini/lookup/LookupStreamCache.java?rev=958358&view=auto
==============================================================================
--- incubator/river/jtsk/trunk/src/net/jini/lookup/LookupStreamCache.java (added)
+++ incubator/river/jtsk/trunk/src/net/jini/lookup/LookupStreamCache.java Sun Jun 27 10:32:18 2010
@@ -0,0 +1,20 @@
+/*
+ * To change this template, choose Tools | Templates
+ * and open the template in the editor.
+ */
+
+package net.jini.lookup;
+
+import java.util.List;
+import net.jini.core.lookup.ServiceItem;
+import org.apache.river.api.util.ResultStream;
+
+/**
+ *
+ * @author peter
+ */
+public interface LookupStreamCache extends LookupCache {
+    
+    public ResultStream<ServiceItem> lookup(ServiceItemFilter[] filters, int maxMatches);
+
+}

Propchange: incubator/river/jtsk/trunk/src/net/jini/lookup/LookupStreamCache.java
------------------------------------------------------------------------------
    svn:eol-style = native

Modified: incubator/river/jtsk/trunk/src/net/jini/lookup/ServiceDiscoveryManager.java
URL: http://svn.apache.org/viewvc/incubator/river/jtsk/trunk/src/net/jini/lookup/ServiceDiscoveryManager.java?rev=958358&r1=958357&r2=958358&view=diff
==============================================================================
--- incubator/river/jtsk/trunk/src/net/jini/lookup/ServiceDiscoveryManager.java (original)
+++ incubator/river/jtsk/trunk/src/net/jini/lookup/ServiceDiscoveryManager.java Sun Jun 27 10:32:18 2010
@@ -2792,9 +2792,8 @@ public class ServiceDiscoveryManager {
         } catch(ConfigurationException e) { /* swallow this exception */ }
     }//end constructor
     
-    public ServiceDiscoveryManager(LeaseRenewalManager leaseMgr,
-                                   DiscoveryManagement2 discoveryMgr)
-                                                            throws IOException
+    public ServiceDiscoveryManager(DiscoveryManagement2 discoveryMgr,
+            LeaseRenewalManager leaseMgr) throws IOException
     {
         try {
             init(discoveryMgr, leaseMgr, EmptyConfiguration.INSTANCE);
@@ -2874,9 +2873,9 @@ public class ServiceDiscoveryManager {
         init(discoveryMgr, leaseMgr, config);
     }//end constructor
 
-    public ServiceDiscoveryManager(LeaseRenewalManager leaseMgr,
-                                   Configuration config,
-                                   DiscoveryManagement2 discoveryMgr)
+    public ServiceDiscoveryManager(DiscoveryManagement2 discoveryMgr,
+                                   LeaseRenewalManager leaseMgr,
+                                   Configuration config)
                                                 throws IOException,
                                                        ConfigurationException
     {
@@ -3787,7 +3786,7 @@ public class ServiceDiscoveryManager {
     private EventReg registerListener(PortableServiceRegistrar proxy,
 			              ServiceTemplate tmpl,
 			              RemoteEventListener listenerProxy,
-			              long duration)  throws RemoteException
+			              long duration)  throws IOException
     {
         /* Register with the event mechanism of the given lookup service */
         EventRegistration e = null;

Modified: incubator/river/jtsk/trunk/src/net/jini/lookup/ServiceRegistrarFacade.java
URL: http://svn.apache.org/viewvc/incubator/river/jtsk/trunk/src/net/jini/lookup/ServiceRegistrarFacade.java?rev=958358&r1=958357&r2=958358&view=diff
==============================================================================
--- incubator/river/jtsk/trunk/src/net/jini/lookup/ServiceRegistrarFacade.java (original)
+++ incubator/river/jtsk/trunk/src/net/jini/lookup/ServiceRegistrarFacade.java Sun Jun 27 10:32:18 2010
@@ -5,8 +5,11 @@
 
 package net.jini.lookup;
 
+import java.io.IOException;
 import java.rmi.MarshalledObject;
 import java.rmi.RemoteException;
+import java.util.logging.Level;
+import java.util.logging.Logger;
 import net.jini.core.discovery.LookupLocator;
 import net.jini.core.event.EventRegistration;
 import net.jini.core.event.RemoteEventListener;
@@ -50,11 +53,15 @@ public class ServiceRegistrarFacade impl
             RemoteEventListener listener, MarshalledObject handback, 
             long leaseDuration) throws RemoteException {
         if ( isStreamServiceRegistrar ) {
-            Convert convert = Convert.getInstance();
-            @SuppressWarnings("unchecked")
-            MarshalledInstance hback = convert.toMarshalledInstance(handback);
-            StreamServiceRegistrar ssr = (StreamServiceRegistrar) sr;
-            return ssr.notify(hback, tmpl, transitions, listener, leaseDuration);
+            try {
+                Convert convert = Convert.getInstance();
+                @SuppressWarnings(value = "unchecked")
+                MarshalledInstance hback = convert.toMarshalledInstance(handback);
+                StreamServiceRegistrar ssr = (StreamServiceRegistrar) sr;
+                return ssr.notify(hback, tmpl, transitions, listener, leaseDuration);
+            } catch (IOException ex) {
+                throw new RemoteException("ServiceRegistrarFacade threw exception",ex);
+            }
         }
         throw new UnsupportedOperationException("PortableServiceRegistrar " +
                 "doesn't implement this method");

Modified: incubator/river/jtsk/trunk/src/net/jini/lookup/ServiceResultStreamUnmarshaller.java
URL: http://svn.apache.org/viewvc/incubator/river/jtsk/trunk/src/net/jini/lookup/ServiceResultStreamUnmarshaller.java?rev=958358&r1=958357&r2=958358&view=diff
==============================================================================
--- incubator/river/jtsk/trunk/src/net/jini/lookup/ServiceResultStreamUnmarshaller.java (original)
+++ incubator/river/jtsk/trunk/src/net/jini/lookup/ServiceResultStreamUnmarshaller.java Sun Jun 27 10:32:18 2010
@@ -30,7 +30,7 @@ public class ServiceResultStreamUnmarsha
                 item = input.get()) {
             if (item instanceof MarshalledServiceItem){
                 MarshalledServiceItem msi = (MarshalledServiceItem) item;
-                ServiceItem it = new ServiceItem(msi.serviceID, msi.getService(),
+                ServiceItem it = new ServiceItem(msi.serviceID, msi.getService(null),
                         msi.getEntries());
                 item = it;
             }

Modified: incubator/river/jtsk/trunk/src/net/jini/lookup/StreamServiceRegistrarFacade.java
URL: http://svn.apache.org/viewvc/incubator/river/jtsk/trunk/src/net/jini/lookup/StreamServiceRegistrarFacade.java?rev=958358&r1=958357&r2=958358&view=diff
==============================================================================
--- incubator/river/jtsk/trunk/src/net/jini/lookup/StreamServiceRegistrarFacade.java (original)
+++ incubator/river/jtsk/trunk/src/net/jini/lookup/StreamServiceRegistrarFacade.java Sun Jun 27 10:32:18 2010
@@ -5,6 +5,7 @@
 
 package net.jini.lookup;
 
+import java.io.IOException;
 import org.apache.river.api.util.ResultStream;
 import java.rmi.RemoteException;
 import net.jini.core.discovery.LookupLocator;
@@ -126,7 +127,7 @@ public class StreamServiceRegistrarFacad
 
     public ResultStream<ServiceItem> lookup(ServiceTemplate tmpl, 
             Class<? extends Entry>[] unmarshalledEntries, int maxBatchSize) 
-            throws RemoteException {
+            throws IOException {
         if ( psr instanceof StreamServiceRegistrar ){
             StreamServiceRegistrar ssr = (StreamServiceRegistrar) psr;
             return ssr.lookup(tmpl, unmarshalledEntries, maxBatchSize);

Added: incubator/river/jtsk/trunk/src/net/jini/lookup/entry/UIDescriptor2.java
URL: http://svn.apache.org/viewvc/incubator/river/jtsk/trunk/src/net/jini/lookup/entry/UIDescriptor2.java?rev=958358&view=auto
==============================================================================
--- incubator/river/jtsk/trunk/src/net/jini/lookup/entry/UIDescriptor2.java (added)
+++ incubator/river/jtsk/trunk/src/net/jini/lookup/entry/UIDescriptor2.java Sun Jun 27 10:32:18 2010
@@ -0,0 +1,205 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package net.jini.lookup.entry;
+
+import com.artima.lookup.util.ConsistentSet;
+import java.io.IOException;
+import java.util.Set;
+import net.jini.entry.AbstractEntry;
+import net.jini.io.MarshalledInstance;
+
+/**
+ * <CODE>Entry</CODE> that enables a UI for a service to be associated
+ * with the service in the attribute sets of the service item.
+ * <CODE>UIDescriptor2</CODE> holds a marshalled UI factory object, as
+ * well as a role string, a sub-role string, and set of attributes that describe the
+ * UI generated by the factory.
+ * 
+ * This is a slightly modified version of UIDescriptor using MarshalledInstance
+ * in place of MarshalledObject, which is RMI dependant.
+ * 
+ * It is recommended to use both UIDescriptor Entry's, in case an older platform
+ * is encountered that cannot unmarshall this Entry due to missing classes.
+ * 
+ * @author Bill Vennors
+ * @author Peter Firmstone
+ */
+public class UIDescriptor2 extends AbstractEntry{
+    // This remains unchanged in case we would like to replace this object
+    // during unmarshalling with UIDescriptor
+        private static final long serialVersionUID = -4862086482826820670L;
+        
+    /**
+     * Gives the fully qualified name of the interface that represents
+     * the role of the UI generated by the marshalled UI factory.
+     * If the client program unmarshals the UI factory and invokes a factory method, the
+     * UI returned by the factory method must implement the role the interface specified by
+     * <CODE>role</CODE>.
+     *
+     * <P>
+     * For a client program to be able to use a UI, the client has to have prior knowledge
+     * of the UI semantics, which is defined by the UI's role type. Thus, for a client
+     * to be able to use a UI, the client must understand the semantics
+     * of the type whose fully qualified name is given in the <CODE>String</CODE>
+     * referenced from the <CODE>role</CODE> field of that UI's <CODE>UIDescriptor</CODE>.
+     *
+     * <P>
+     * For example, two role types that are defined in the <CODE>net.jini.lookup.ui</CODE>
+     * package by the Jini Service UI Specification are <CODE>MainUI</CODE>, for a main UI
+     * to a Jini service, and <CODE>AdminUI</CODE>, for an administration UI. Other role types
+     * may be defined by the Jini Service UI Specification and by individual Jini service API
+     * specifications.
+     *
+     * <P>
+     * As the strings referenced from the <CODE>role</CODE> field are Java type names, they
+     * are intended to be manipulated by client programs only. They should not be shown to a user.
+     */
+    public String role;
+
+    /**
+     * A <code>String</code> to facilitate searching whose value represents the main UI toolkit (for example
+     * Swing or AWT) which the produced UI makes use of. The value to which this field should
+     * be set is defined by the semantics of the factory type. (This field is intended
+     * to facilitate searches. For example, a client can search for all blender services that have Swing
+     * MainUI's.)
+     */
+    public String toolkit;
+
+    /**
+     * A set of objects that describe the UI generated by the marshalled UI factory.
+     */
+    public Set attributes;
+
+    /**
+     * The <CODE>get()</CODE> method of this <CODE>MarshalledObject</CODE>
+     * must return an object that implements one or more UI factory interfaces. The actual
+     * UI factory type or types implemented by the returned object
+     * must be described by a <CODE>UIFactoryTypes</CODE> attribute placed in
+     * the attributes set of this <CODE>UIDescriptor</CODE>.
+     */
+    public MarshalledInstance factory;
+
+    /**
+     * Constructs a <CODE>UIDescriptor</CODE> with all fields set to <CODE>null</CODE>.
+     */
+    public UIDescriptor2() {
+    }
+
+    /**
+     * Constructs a <CODE>UIDescriptor</CODE> with the fields set to passed values.
+     * This constructor copies the contents of the passed attributes <code>Set</code> into a
+     * serializable read-only <code>Set</code> that has a
+     * consistent serialized form across all VMs, and initializes the <code>attributes</code>
+     * field with the consistent <code>Set</code>.
+     *
+     * @param role the role
+     * @param toolkit the toolkit
+     * @param attributes the attributes
+     * @param factory the factory
+     */
+    public UIDescriptor2(String role, String toolkit, Set attributes,
+        MarshalledInstance factory) {
+
+        this.role = role;
+        this.toolkit = toolkit;
+        if (attributes != null) {
+            this.attributes = new ConsistentSet(attributes);
+        }
+        else {
+            this.attributes = null;
+        }
+        this.factory = factory;
+    }
+
+    /**
+     * A convenience method for unmarshalling the UI factory stored
+     * in the <CODE>MarshalledObject</CODE> referenced from the
+     * <CODE>factory</CODE> field. This method saves a reference
+     * to the current context class loader, sets the context class loader
+     * to the class loader passed as <CODE>parentLoader</CODE>, invokes
+     * <CODE>get()</CODE> on the marshalled object, then resets the
+     * context class loader to the saved reference before returning
+     * the object produced by <CODE>get()</CODE>.
+     *
+     * <P>The class loader
+     * passed in <CODE>parentLoader</CODE> should be able to load classes
+     * needed when the UI interacts with the <CODE>roleObject</CODE> passed as the first
+     * parameter to the factory method. For example, if the <CODE>roleObject</CODE> is
+     * the service item (as it is for the <CODE>MainUI</CODE> and <CODE>AdminUI</CODE>
+     * roles), the class loader passed in <CODE>parentLoader</CODE> could be
+     * the class loader with which the service proxy object referenced
+     * from the service item's <CODE>service</CODE> field was loaded.
+     * For example:
+     *
+     * <PRE>
+     * Object uiFactory = uiDescriptor.getUIFactory(
+     *     serviceItem.service.getClass().getClassLoader());
+     * </PRE>
+     *
+     * @param parentLoader 
+     * @throws java.io.IOException
+     * @throws NullPointerException if <CODE>parentLoader</CODE> is null.
+     * @throws java.lang.ClassNotFoundException 
+     * @return the unmarshalled UI factory
+     */
+    public final Object getUIFactory(final ClassLoader parentLoader)
+        throws IOException, ClassNotFoundException {
+
+        if (parentLoader == null) {
+            throw new NullPointerException();
+        }
+
+        Object uiFactory;
+        final Thread currentThread = Thread.currentThread();
+
+        // First, get a reference to the current context class loader,
+        // so it can be restored after the unmarshalling
+        ClassLoader original = currentThread.getContextClassLoader();
+        try {
+            currentThread.setContextClassLoader(parentLoader);
+            // We need to look into verification and ClassLoader's
+            // MarshalledInstance may not require changing of the context
+            // class loader.
+            uiFactory = factory.get(false);
+        }
+        finally {
+            currentThread.setContextClassLoader(original);
+        }
+        return uiFactory;
+    }
+    
+    /**
+     * 
+     */
+    private void readObject(java.io.ObjectInputStream stream)
+	throws java.io.IOException, ClassNotFoundException
+    {
+        stream.defaultReadObject();
+        // Defensive copy of Set.
+        attributes = new ConsistentSet(attributes);
+    }
+    
+    /**
+     * 
+     * @param stream
+     * @throws java.io.IOException
+     */
+    private void writeObject(java.io.ObjectOutputStream stream) throws IOException{
+        stream.defaultWriteObject();
+    }
+}

Propchange: incubator/river/jtsk/trunk/src/net/jini/lookup/entry/UIDescriptor2.java
------------------------------------------------------------------------------
    svn:eol-style = native

Modified: incubator/river/jtsk/trunk/src/net/jini/security/policy/DynamicPolicyProvider.java
URL: http://svn.apache.org/viewvc/incubator/river/jtsk/trunk/src/net/jini/security/policy/DynamicPolicyProvider.java?rev=958358&r1=958357&r2=958358&view=diff
==============================================================================
--- incubator/river/jtsk/trunk/src/net/jini/security/policy/DynamicPolicyProvider.java (original)
+++ incubator/river/jtsk/trunk/src/net/jini/security/policy/DynamicPolicyProvider.java Sun Jun 27 10:32:18 2010
@@ -5,7 +5,9 @@
 
 package net.jini.security.policy;
 
-import java.security.cert.Certificate;
+import java.util.List;
+import org.apache.river.api.security.PermissionGrant;
+import org.apache.river.api.security.PermissionGrantBuilder;
 import org.apache.river.imp.security.policy.cdc.DynamicPolicyProviderImpl;
 import java.security.AccessControlException;
 import java.security.AccessController;
@@ -21,8 +23,9 @@ import java.util.Iterator;
 //import java.util.ServiceLoader;
 import java.util.logging.Logger;
 import java.util.logging.Level;
+import org.apache.river.api.security.RevokePermission;
+import org.apache.river.api.security.RevokeableDynamicPolicy;
 import sun.misc.Service;
-import org.apache.river.api.security.RevokeablePolicy;
 import org.apache.river.imp.security.policy.spi.RevokeableDynamicPolicySpi;
 
 /**
@@ -41,7 +44,7 @@ import org.apache.river.imp.security.pol
  * 
  * @author Peter Firmstone
  */
-public class DynamicPolicyProvider extends Policy implements RevokeablePolicy {
+public class DynamicPolicyProvider extends Policy implements RevokeableDynamicPolicy, DynamicPolicy {
   
     //Java 1.4 compatible
     @SuppressWarnings("unchecked")
@@ -307,32 +310,21 @@ public class DynamicPolicyProvider exten
         return instance.revokeSupported();
     }
 
-    public Object parameters() throws UnsupportedOperationException {
-        throw new UnsupportedOperationException("Not supported yet.");
+    public void add(List<PermissionGrant> grants) {
+        instance.add(grants);
     }
 
-    public void revoke(CodeSource cs, Principal[] principals, Permission[] permissions) throws UnsupportedOperationException {
-        instance.revoke(cs, principals, permissions);
+    public void remove(List<PermissionGrant> grants) {
+        AccessController.checkPermission(new RevokePermission());
+        instance.remove(grants);
     }
 
-    public void grantCodeSource(CodeSource cs, Principal[] principals, Permission[] permissions) throws UnsupportedOperationException {
-        instance.grantCodeSource(cs, principals, permissions);
+    public List<PermissionGrant> getPermissionGrants() {
+        return instance.getPermissionGrants();
     }
 
-    public void grantProtectionDomain(Class cl, Permission[] permissions) throws UnsupportedOperationException {
-        instance.grantProtectionDomain(cl, permissions);
-    }
-
-    public void revokeProtectionDomain(Class cl, Permission[] permissions) throws UnsupportedOperationException {
-        instance.revokeProtectionDomain(cl, permissions);
-    }
-
-    public void grant(Certificate[] certs, Principal[] principals, Permission[] permissions) throws UnsupportedOperationException {
-        instance.grant(certs, principals, permissions);
-    }
-
-    public void revoke(Certificate[] certs, Principal[] principals, Permission[] permissions) throws UnsupportedOperationException {
-        instance.revoke(certs, principals, permissions);
+    public PermissionGrantBuilder getPermissionGrantBuilder() {
+        return instance.getPermissionGrantBuilder();
     }
    
 }

Added: incubator/river/jtsk/trunk/src/org/apache/river/api/security/Deny.java
URL: http://svn.apache.org/viewvc/incubator/river/jtsk/trunk/src/org/apache/river/api/security/Deny.java?rev=958358&view=auto
==============================================================================
--- incubator/river/jtsk/trunk/src/org/apache/river/api/security/Deny.java (added)
+++ incubator/river/jtsk/trunk/src/org/apache/river/api/security/Deny.java Sun Jun 27 10:32:18 2010
@@ -0,0 +1,106 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ * 
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.river.api.security;
+
+import java.net.URL;
+import java.security.CodeSigner;
+import java.security.CodeSource;
+import java.security.ProtectionDomain;
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.Iterator;
+import java.util.List;
+import org.apache.river.imp.security.policy.util.PolicyUtils;
+
+/**
+ * Immutable List of codebase URL's and CodeSource's to deny in a PermissionGrant. 
+ * Supplied to a PermissionGrantBuilder.
+ * 
+ * Applies only to Certificate[] and ClassLoader grant's, serves no use for CodeSource
+ * or PermissionDomain grants.
+ * 
+ * This is not a global list, however since it is immutable, it can be shared
+ * among PermissionGrant's to save memory. 
+ * 
+ * The user is responsible for deciding how these apply to each PermissionGrant.
+ * 
+ * Usually this will be used in combination with Certificate[] grants, to
+ * circumvent security bugs identified in known jar files by trusted developers.
+ * 
+ * Deny does not allow any permission, only Deny.
+ * 
+ * This class may be extended. The caller must have a DenyPermission before it
+ * can be added to a PermissionGrantBuilder.
+ *
+ * @author Peter Firmstone
+ */
+public class Deny {
+    private final List<URL> uri;
+    private final List<CodeSource> code;
+    
+    public Deny(List<URL> denyURL, List<CodeSource> denyCode){
+        List<URL> denied = new ArrayList<URL>(denyURL.size());
+        Iterator<URL> itU = denyURL.iterator();
+        while (itU.hasNext()){
+            denied.add(PolicyUtils.normalizeURL(itU.next()));
+        }
+        uri = Collections.unmodifiableList(denied);
+        List<CodeSource> c = new ArrayList<CodeSource>(denyCode.size());
+        Iterator<CodeSource> itC = c.iterator();
+        while (itC.hasNext()){
+            c.add(normalizeCodeSource(itC.next()));
+        }
+        code = Collections.unmodifiableList(c);
+    }
+    
+    public List<URL> deniedURLs(){
+        return uri;
+    }
+    
+    public List<CodeSource> deniedCode() {
+        return code;
+    }
+    
+    public boolean allow(ProtectionDomain pd){
+        CodeSource cs = pd.getCodeSource();
+        cs = normalizeCodeSource(cs);
+        if (code.contains(cs)) return false;
+        URL codeSourceURL = cs.getLocation();
+        if (uri.contains(codeSourceURL)) return false;
+        return true;
+    }
+    
+    private CodeSource normalizeCodeSource(CodeSource codeSource) {
+        if (codeSource == null ) return null;
+        URL codeSourceURL = PolicyUtils.normalizeURL(codeSource.getLocation());
+        CodeSource result = codeSource;
+
+        if (codeSourceURL != codeSource.getLocation()) {
+            // URL was normalized - recreate codeSource with new URL
+            CodeSigner[] signers = codeSource.getCodeSigners();
+            if (signers == null) {
+                result = new CodeSource(codeSourceURL, codeSource
+                        .getCertificates());
+            } else {
+                result = new CodeSource(codeSourceURL, signers);
+            }
+        }
+        return result;
+    } 
+}

Propchange: incubator/river/jtsk/trunk/src/org/apache/river/api/security/Deny.java
------------------------------------------------------------------------------
    svn:eol-style = native

Added: incubator/river/jtsk/trunk/src/org/apache/river/api/security/DenyPermission.java
URL: http://svn.apache.org/viewvc/incubator/river/jtsk/trunk/src/org/apache/river/api/security/DenyPermission.java?rev=958358&view=auto
==============================================================================
--- incubator/river/jtsk/trunk/src/org/apache/river/api/security/DenyPermission.java (added)
+++ incubator/river/jtsk/trunk/src/org/apache/river/api/security/DenyPermission.java Sun Jun 27 10:32:18 2010
@@ -0,0 +1,52 @@
+/*
+ * To change this template, choose Tools | Templates
+ * and open the template in the editor.
+ */
+
+package org.apache.river.api.security;
+
+import java.security.Permission;
+
+/**
+ * <p>DenyPermission allows for a permission to be Denied at runtime provided
+ * it has been dynamically granted.<p>
+ * 
+ * A DenyPermission cannot dynamically grant itself a permission.<p>
+ * 
+ * A domain with DenyPermissoin can not deny a Permission
+ * unless it has been granted dynamically. </p>
+ *
+ * -- seems logical.
+ * 
+ * 
+ * @author Peter Firmstone
+ */
+public class DenyPermission extends Permission {
+    private static final long serialVersionUID = 1L;
+    
+    public DenyPermission(){
+        super("");
+    }
+    
+    @Override
+    public boolean implies(Permission permission) {
+        if (permission instanceof DenyPermission) return true;
+        return false;
+    }
+
+    @Override
+    public boolean equals(Object obj) {
+        if (obj instanceof DenyPermission) return true;
+        return false;
+    }
+
+    @Override
+    public int hashCode() {
+        return DenyPermission.class.hashCode();
+    }
+
+    @Override
+    public String getActions() {
+        return "";
+    }
+}

Propchange: incubator/river/jtsk/trunk/src/org/apache/river/api/security/DenyPermission.java
------------------------------------------------------------------------------
    svn:eol-style = native

Copied: incubator/river/jtsk/trunk/src/org/apache/river/api/security/PermissionGrant.java (from r957448, incubator/river/jtsk/trunk/src/org/apache/river/imp/security/policy/util/PermissionGrant.java)
URL: http://svn.apache.org/viewvc/incubator/river/jtsk/trunk/src/org/apache/river/api/security/PermissionGrant.java?p2=incubator/river/jtsk/trunk/src/org/apache/river/api/security/PermissionGrant.java&p1=incubator/river/jtsk/trunk/src/org/apache/river/imp/security/policy/util/PermissionGrant.java&r1=957448&r2=958358&rev=958358&view=diff
==============================================================================
--- incubator/river/jtsk/trunk/src/org/apache/river/imp/security/policy/util/PermissionGrant.java (original)
+++ incubator/river/jtsk/trunk/src/org/apache/river/api/security/PermissionGrant.java Sun Jun 27 10:32:18 2010
@@ -16,11 +16,13 @@
  * limitations under the License.
  */
 
-package org.apache.river.imp.security.policy.util;
+package org.apache.river.api.security;
 
+import java.security.AccessController;
 import java.security.CodeSource;
 import java.security.Permission;
 import java.security.Principal;
+import java.security.PrivilegedAction;
 import java.security.ProtectionDomain;
 import java.security.cert.Certificate;
 import java.util.Collection;
@@ -29,58 +31,174 @@ import java.util.Collection;
  * PermissionGrant's are expected to be effectively immutable,
  * threadsafe and have a good hashCode implementation to perform well in
  * Collections.
+ * 
+ * You shouldn't pass around PermissionGrant's to just anyone as they can
+ * provide an attacker with Permission's that may have been granted.
+ * The RevokeableDynamicPolicy must be asked for the PermissionGrantBulder which creates the
+ * PermissionGrant's for a less Privileged user.  The user must first have
+ * access to a Policy.
+ * 
  * @author Peter Firmstone
+ * @see RevokeableDynamicPolicy
  */
-public interface PermissionGrant {
+public abstract class PermissionGrant {
+    /**
+     * Implied Context of Grant
+     */ 
+    public static final int CLASSLOADER = 0;
+    public static final int CODESOURCE = 1;
+    public static final int PROTECTIONDOMAIN = 2;
+    public static final int CODESOURCE_CERTS = 3;
+    public PermissionGrant(){
+        AccessController.checkPermission(new RuntimePermission("getProtectionDomain"));
+        AccessController.checkPermission(new RuntimePermission("getClassLoader"));
+    }
+    
+    /**
+     * This is here to provide functionality for less privileged code / users who
+     * have Permission to get a Policy. For cases where that user / code doesn't
+     * have access to ProtectionDomain's or ClassLoaders.
+     * 
+     * This is equalivant to the methods below, with Privileges.
+     * 
+     * A user will still require specific GrantPermission's before being
+     * able to build a PermissionGrant.
+     * 
+     * @param clazz - The class file.
+     * @param pal - An array of Principal's
+     * @param context - PermissionGrantBuilder context constant.
+     * @return
+     */
+    @SuppressWarnings("unchecked")
+    public final boolean implies( final Class clazz, final Principal[] pal, final int context){
+        AccessController.doPrivileged(new PrivilegedAction() {
+            public Object run(){
+                switch (context){
+                    case CLASSLOADER: {
+                        return implies(clazz.getClassLoader(), pal);
+                    }
+                    case PROTECTIONDOMAIN: {
+                        return implies(clazz.getProtectionDomain(), pal);
+                    }
+                    case CODESOURCE: {
+                        return implies(clazz.getProtectionDomain().getCodeSource(), pal);
+                    }
+                    case CODESOURCE_CERTS: {
+                        return implies(clazz.getProtectionDomain()
+                                .getCodeSource().getCertificates(),
+                                pal);
+                    }
+                    default:
+                        throw new IllegalStateException("int context unknown");
+                }
+            }
+        });
+        return false;
+    }
+    
+    /**
+     * A DynamicPolicy implementation can use a PermissionGrant as a container
+     * for Dynamic Grant's.  A PermissionGrant is first asked by the Policy
+     * if it applies to a Particular ProtectionDomain, if it does, the Policy
+     * calls getPermissions.
+     * 
+     * Dynamic grants can be denied to some ProtectionDomains based on
+     * CodeSource or URL's for codebases, this is to remove the possiblity of
+     * executing Permissions for vulnerable codebases, once a vulnerability
+     * is identified after the fact.
+     * 
+     * @param pd ProtectionDomain
+     * @return
+     * @see RevokeableDynamicPolicy
+     */
+    public final boolean applicable(ProtectionDomain pd){
+        Deny check = getDenials();
+        if (check == null){
+            return implies(pd);
+        } else if ( check.allow(pd)) {
+            return implies(pd);
+        }
+        return false;
+    }
+    
+    protected abstract Deny getDenials();
+    
     /**
      * A DynamicPolicy implementation can use a PermissionGrant as a container
      * for Dynamic Grant's.  A PermissionGrant is first asked by the Policy
      * if it implies a Particular ProtectionDomain, if it does, the Policy
      * calls getPermissions.
+     * 
+     * Only this method is utilised by the RevokeableDynamicPolicy, 
+     * for Permission checks, extending classes must implement it.
+     * 
      * @param pd ProtectionDomain
      * @return
+     * @see RevokeableDynamicPolicy
+     */
+    protected abstract boolean implies(ProtectionDomain pd);
+    /**
+     * Checks if this PermissionGrant applies to the ProtectionDomain with
+     * the given principals, this is useful for Subject's where a Subject's
+     * Principals are added to a ProtectionDomain by a Policy check by the
+     * AccessController and DomainCombiner.  This is not used by the Policy.
+     * This is a utility method to determine if a ProtectionDomain had a set of
+     * Principals what the effect is.  
+     * 
+     * The ProtectionDomain's internal set of Principals are ignored for 
+     * this method.
+     * 
+     * @param pd
+     * @param pal
+     * @return
+     * @see AccessController
+     * @see DomainCombiner
      */
-    public boolean implies(ProtectionDomain pd);
+    public abstract boolean implies(ProtectionDomain pd, Principal[] pal);
     /**
      * Checks if this PermissionGrant applies to the passed in ClassLoader
      * and Principal's.
+     * 
+     * Note that if this method returns false, it doesn't necessarily mean
+     * that the grant will not apply to the ClassLoader, since it will depend on 
+     * the contents of the ClassLoader and that is inderterminate. It just
+     * indicates that the grant definitely does apply if it returns true.
+     * 
+     * If this method returns false, follow up using the ProtectionDomain for a
+     * more specific test, which may return true.
      */
-    public boolean implies(ClassLoader cl, Principal[] pal);
+    public abstract boolean implies(ClassLoader cl, Principal[] pal);
     /**
      * Checks if this PermissionGrant applies to the passed in CodeSource
      * and Principal's.
      * @param cs
      * @return 
      */
-    public boolean implies(CodeSource codeSource, Principal[] pal);
+    public abstract boolean implies(CodeSource codeSource, Principal[] pal);
     /**
      * Checks if this PermissionGrant applies to the passed in Certificate's
      * and Principal's.
      */
-    public boolean implies(Certificate[] certs, Principal[] pal);
+    public abstract boolean implies(Certificate[] certs, Principal[] pal);
     /**
      * Returns an unmodifiable collection of permissions defined by this
      * PolicyEntry, may be <code>null</code>.
      * @return 
      */
-    public Collection<Permission> getPermissions();
+    public abstract Collection<Permission> getPermissions();
     /**
      * Provides a builder that will replicate the PermissionGrant.  Useful
      * when you want to change the Permission's but not the
      * context.
      */
-    public PermissionGrantBuilder getBuilderTemplate();
+    public abstract PermissionGrantBuilder getBuilderTemplate();
     /**
      * Returns true if this PermissionGrant defines no Permissions, or if
      * a PermissionGrant was made to a ProtectionDomain that no longer exists.
      */
-    public boolean isVoid();
-    @Override
-    public boolean equals(Object o);
+    public abstract boolean isVoid();
     @Override
-    public int hashCode();
+    public abstract boolean equals(Object o);
     @Override
-    public String toString();
-    
-    
+    public abstract int hashCode();
 }



Mime
View raw message