You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@river.apache.org by jc...@apache.org on 2010/09/16 01:45:53 UTC
svn commit: r997542 [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/spec/joinmanager/ src/com/sun/jini/discovery/
src/com/sun/jini/discovery/inte...
Author: jcosters
Date: Wed Sep 15 23:45:52 2010
New Revision: 997542
URL: http://svn.apache.org/viewvc?rev=997542&view=rev
Log:
backout more recent experimental changes (MarshalledInstance related)
Removed:
incubator/river/jtsk/trunk/src/net/jini/io/Convert.java
incubator/river/jtsk/trunk/src/net/jini/lookup/ServiceRegistrarFacade.java
incubator/river/jtsk/trunk/src/net/jini/lookup/StreamServiceRegistrarFacade.java
incubator/river/jtsk/trunk/test/src/net/jini/io/ConvertTest.java
Modified:
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/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/RegisterStorm.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/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/src/com/sun/jini/discovery/DiscoveryV1.java
incubator/river/jtsk/trunk/src/com/sun/jini/discovery/UnicastResponse.java
incubator/river/jtsk/trunk/src/com/sun/jini/discovery/internal/Plaintext.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/reggie/RegistrarImpl.java
incubator/river/jtsk/trunk/src/net/jini/core/discovery/LookupLocator.java
incubator/river/jtsk/trunk/src/net/jini/discovery/ConstrainableLookupLocator.java
incubator/river/jtsk/trunk/src/net/jini/discovery/DiscoveryEvent.java
incubator/river/jtsk/trunk/src/net/jini/discovery/IncomingUnicastResponse.java
incubator/river/jtsk/trunk/src/net/jini/discovery/LookupUnmarshalException.java
incubator/river/jtsk/trunk/src/net/jini/io/MarshalledInstance.java
incubator/river/jtsk/trunk/src/net/jini/lookup/JoinManager.java
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=997542&r1=997541&r2=997542&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 Wed Sep 15 23:45:52 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.DiscoveryListenerManagement;
+import net.jini.discovery.DiscoveryManagement;
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 */
- DiscoveryListenerManagement discoveryManager;
+ DiscoveryManagement discoveryManager;
try {
- discoveryManager = (DiscoveryListenerManagement) config.getEntry(
+ discoveryManager = (DiscoveryManagement) config.getEntry(
"com.sun.jini.example.hello.Server", "discoveryManager",
- DiscoveryListenerManagement.class);
+ DiscoveryManagement.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=997542&r1=997541&r2=997542&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 Wed Sep 15 23:45:52 2010
@@ -31,7 +31,6 @@ 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.
*
@@ -169,7 +168,7 @@ public class AddAttributesRace extends A
joinMgrSrvcID = new JoinManager(testService,
serviceAttrs,
serviceID,
- (DiscoveryListenerManagement) ldm,
+ ldm,
leaseMgr,
getConfig().getConfiguration());
joinMgrList.add(joinMgrSrvcID);
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=997542&r1=997541&r2=997542&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 Wed Sep 15 23:45:52 2010
@@ -24,7 +24,6 @@ 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).
*
@@ -63,8 +62,7 @@ public class RaceAttrsVsTerminateISE ext
removeDups( addAttrsDup1DupAll(serviceAttrs,newServiceAttrs) );
/* Discover & join lookups just started */
jm = new JoinManager(testService,serviceAttrs,serviceID,
- (DiscoveryListenerManagement) getLookupDiscoveryManager(),
- leaseMgr,
+ 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=997542&r1=997541&r2=997542&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 Wed Sep 15 23:45:52 2010
@@ -24,7 +24,6 @@ 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).
*
@@ -63,8 +62,7 @@ public class RaceAttrsVsTerminateULE ext
removeDups( addAttrsDup1DupAll(serviceAttrs,newServiceAttrs) );
/* Discover & join lookups just started */
jm = new JoinManager(testService,serviceAttrs,serviceID,
- (DiscoveryListenerManagement) getLookupDiscoveryManager(),
- leaseMgr,
+ getLookupDiscoveryManager(),leaseMgr,
sysConfig.getConfiguration());
}//end setup
Modified: incubator/river/jtsk/trunk/qa/src/com/sun/jini/test/impl/joinmanager/RegisterStorm.java
URL: http://svn.apache.org/viewvc/incubator/river/jtsk/trunk/qa/src/com/sun/jini/test/impl/joinmanager/RegisterStorm.java?rev=997542&r1=997541&r2=997542&view=diff
==============================================================================
--- incubator/river/jtsk/trunk/qa/src/com/sun/jini/test/impl/joinmanager/RegisterStorm.java (original)
+++ incubator/river/jtsk/trunk/qa/src/com/sun/jini/test/impl/joinmanager/RegisterStorm.java Wed Sep 15 23:45:52 2010
@@ -34,7 +34,6 @@ import net.jini.core.lookup.ServiceMatch
import java.rmi.RemoteException;
import java.util.ArrayList;
-import net.jini.discovery.DiscoveryListenerManagement;
/**
* This class verifies that the <code>JoinManager</code> utility class
@@ -106,7 +105,7 @@ public class RegisterStorm extends Abstr
JoinManager jm =
new JoinManager(ts,serviceAttrs,
sidListener,
- (DiscoveryListenerManagement) ldm,leaseMgr,
+ ldm,leaseMgr,
getConfig().getConfiguration());
joinMgrList.add(jm);
}//end loop
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=997542&r1=997541&r2=997542&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 Wed Sep 15 23:45:52 2010
@@ -29,7 +29,6 @@ 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>
@@ -67,8 +66,7 @@ public class TerminateSemantics extends
super.setup(sysConfig);
logger.log(Level.FINE, "creating a service ID join manager ...");
joinMgrSrvcID = new JoinManager(testService,serviceAttrs,serviceID,
- (DiscoveryListenerManagement) null,
- null,
+ null,null,
sysConfig.getConfiguration());
}//end setup
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=997542&r1=997541&r2=997542&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 Wed Sep 15 23:45:52 2010
@@ -27,7 +27,6 @@ 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
@@ -58,7 +57,7 @@ public class Equality extends AbstractBa
joinMgrCallback = new JoinManager(testService,
serviceAttrs,
callback,
- (DiscoveryListenerManagement) discoveryMgr,
+ discoveryMgr,
leaseMgr,
sysConfig.getConfiguration());
joinMgrList.add(joinMgrCallback);
@@ -66,7 +65,7 @@ public class Equality extends AbstractBa
joinMgrSrvcID = new JoinManager(testService,
serviceAttrs,
serviceID,
- (DiscoveryListenerManagement) discoveryMgr,
+ discoveryMgr,
leaseMgr,
sysConfig.getConfiguration());
joinMgrList.add(joinMgrSrvcID);
@@ -108,7 +107,7 @@ public class Equality extends AbstractBa
newJM = new JoinManager(testService,
serviceAttrs,
serviceID,
- (DiscoveryListenerManagement) discoveryMgr,
+ 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=997542&r1=997541&r2=997542&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 Wed Sep 15 23:45:52 2010
@@ -27,7 +27,6 @@ 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
@@ -59,8 +58,7 @@ 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,
- (DiscoveryListenerManagement) getLookupDiscoveryManager(),
- leaseMgr,
+ 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=997542&r1=997541&r2=997542&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 Wed Sep 15 23:45:52 2010
@@ -27,7 +27,6 @@ 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
@@ -70,14 +69,12 @@ public class GetJoinSetCallback extends
if(callbackJM) {
jm = new JoinManager(testService,serviceAttrs,
new SrvcIDListener(testService),
- (DiscoveryListenerManagement) getLookupDiscoveryManager(),
- leaseMgr,
+ 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,
- (DiscoveryListenerManagement) getLookupDiscoveryManager(),
- leaseMgr,
+ 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=997542&r1=997541&r2=997542&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 Wed Sep 15 23:45:52 2010
@@ -32,7 +32,6 @@ 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
@@ -65,14 +64,12 @@ public class LDMNullPublicGroup extends
super.setup(sysConfig);
logger.log(Level.FINE, "creating a callback join manager ...");
joinMgrCallback = new JoinManager(testService,serviceAttrs,callback,
- (DiscoveryListenerManagement) discoveryMgr,
- leaseMgr,
+ discoveryMgr,leaseMgr,
sysConfig.getConfiguration());
joinMgrList.add(joinMgrCallback);
logger.log(Level.FINE, "creating a service ID join manager ...");
joinMgrSrvcID = new JoinManager(testService,serviceAttrs,serviceID,
- (DiscoveryListenerManagement) discoveryMgr,
- leaseMgr,
+ 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=997542&r1=997541&r2=997542&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 Wed Sep 15 23:45:52 2010
@@ -27,7 +27,6 @@ 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
@@ -101,8 +100,7 @@ public class ModifyAttributesServiceCont
}//end loop
logger.log(Level.FINE, "creating a service ID join manager ...");
joinMgrSrvcID = new JoinManager(testService,serviceAttrs,serviceID,
- (DiscoveryListenerManagement) getLookupDiscoveryManager(),
- leaseMgr,
+ 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=997542&r1=997541&r2=997542&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 Wed Sep 15 23:45:52 2010
@@ -23,7 +23,6 @@ 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;
/**
@@ -56,8 +55,7 @@ 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,
- (DiscoveryListenerManagement) getLookupDiscoveryManager(),
- leaseMgr,
+ 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=997542&r1=997541&r2=997542&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 Wed Sep 15 23:45:52 2010
@@ -23,7 +23,6 @@ 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;
@@ -62,14 +61,13 @@ 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,
- (DiscoveryListenerManagement) null,
- null,sysConfig.getConfiguration());
+ 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.discoveryManager());
+ = (LookupDiscoveryManager)(joinMgrSrvcID.getDiscoveryManager());
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=997542&r1=997541&r2=997542&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 Wed Sep 15 23:45:52 2010
@@ -23,7 +23,6 @@ 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;
@@ -55,8 +54,7 @@ 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,
- (DiscoveryListenerManagement) getLookupDiscoveryManager(),
- null,
+ 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/src/com/sun/jini/discovery/DiscoveryV1.java
URL: http://svn.apache.org/viewvc/incubator/river/jtsk/trunk/src/com/sun/jini/discovery/DiscoveryV1.java?rev=997542&r1=997541&r2=997542&view=diff
==============================================================================
--- incubator/river/jtsk/trunk/src/com/sun/jini/discovery/DiscoveryV1.java (original)
+++ incubator/river/jtsk/trunk/src/com/sun/jini/discovery/DiscoveryV1.java Wed Sep 15 23:45:52 2010
@@ -21,13 +21,17 @@ package com.sun.jini.discovery;
import com.sun.jini.discovery.internal.Plaintext;
import java.io.BufferedInputStream;
import java.io.BufferedOutputStream;
+import java.io.ByteArrayOutputStream;
+import java.io.DataOutput;
import java.io.DataOutputStream;
import java.io.IOException;
import java.io.ObjectInputStream;
import java.io.ObjectOutputStream;
+import java.io.UTFDataFormatException;
import java.net.DatagramPacket;
import java.net.Socket;
import java.nio.ByteBuffer;
+import java.rmi.MarshalledObject;
import java.util.ArrayList;
import java.util.Collection;
import java.util.LinkedList;
@@ -39,8 +43,6 @@ import net.jini.core.lookup.ServiceID;
import net.jini.core.lookup.ServiceRegistrar;
import net.jini.discovery.Constants;
import net.jini.io.MarshalledInstance;
-import net.jini.io.MiToMoOutputStream;
-import net.jini.io.MoToMiInputStream;
import net.jini.io.UnsupportedConstraintException;
/**
@@ -387,10 +389,11 @@ class DiscoveryV1 extends Discovery {
String host = socket.getInetAddress().getHostAddress();
int port = socket.getPort();
- // read LUS proxy - Converted from java.rmi.MarshalledObject form.
- ObjectInputStream oin = new MoToMiInputStream(
+ // read LUS proxy
+ ObjectInputStream oin = new ObjectInputStream(
new BufferedInputStream(socket.getInputStream()));
- MarshalledInstance mi = (MarshalledInstance) oin.readObject();
+ MarshalledInstance mi =
+ new MarshalledInstance((MarshalledObject) oin.readObject());
ServiceRegistrar reg =
(ServiceRegistrar) mi.get(defaultLoader, false, null, context);
@@ -432,11 +435,11 @@ class DiscoveryV1 extends Discovery {
// note: unicast request (the protocol version) already consumed
// write LUS proxy
- ObjectOutputStream oout = new MiToMoOutputStream(
+ ObjectOutputStream oout = new ObjectOutputStream(
new BufferedOutputStream(socket.getOutputStream()));
oout.writeObject(
new MarshalledInstance(
- response.getPRegistrar(), context));
+ response.getRegistrar(), context).convertToMarshalledObject());
// write LUS member groups
String[] groups = response.getGroups();
Modified: incubator/river/jtsk/trunk/src/com/sun/jini/discovery/UnicastResponse.java
URL: http://svn.apache.org/viewvc/incubator/river/jtsk/trunk/src/com/sun/jini/discovery/UnicastResponse.java?rev=997542&r1=997541&r2=997542&view=diff
==============================================================================
--- incubator/river/jtsk/trunk/src/com/sun/jini/discovery/UnicastResponse.java (original)
+++ incubator/river/jtsk/trunk/src/com/sun/jini/discovery/UnicastResponse.java Wed Sep 15 23:45:52 2010
@@ -19,9 +19,7 @@
package com.sun.jini.discovery;
import java.util.Arrays;
-import net.jini.core.lookup.PortableServiceRegistrar;
import net.jini.core.lookup.ServiceRegistrar;
-import net.jini.lookup.ServiceRegistrarFacade;
/**
* Class representing the values obtained as the result of unicast discovery.
@@ -38,16 +36,12 @@ public class UnicastResponse {
/** The lookup service member groups. */
protected String[] groups;
/** The lookup service proxy. */
- protected PortableServiceRegistrar registrar;
-
+ protected ServiceRegistrar registrar;
+
/**
* Creates new <code>UnicastResponse</code> instance containing the given
* values. The <code>groups</code> array is copied; a <code>null</code>
* value is considered equivalent to an empty array.
- *
- * This constructor has been changed in 2.2.0 to break binary compatibility
- * with 2.2.1 however it is still compile time compatible. I figured
- * that client code will utilise this class, but be unlikely to construct it.
*
* @param host the lookup service host
* @param port the lookup service listen port
@@ -61,9 +55,9 @@ public class UnicastResponse {
public UnicastResponse(String host,
int port,
String[] groups,
- PortableServiceRegistrar registrar)
+ ServiceRegistrar registrar)
{
- groups = (groups != null) ? groups.clone() : new String[0];
+ groups = (groups != null) ? (String[]) groups.clone() : new String[0];
if (host == null ||
registrar == null ||
Arrays.asList(groups).contains(null))
@@ -108,28 +102,13 @@ public class UnicastResponse {
/**
* Returns the lookup service proxy.
- *
- * @return the lookup service proxy
- * @since 2.2.0
- */
- public PortableServiceRegistrar getPRegistrar() {
- return registrar;
- }
-
- /**
- * Returns the lookup service proxy.
- *
+ *
* @return the lookup service proxy
- * @deprecated replaced by {@link #getPRegistrar()}
*/
- @Deprecated
public ServiceRegistrar getRegistrar() {
- if(registrar instanceof ServiceRegistrar ){
- return (ServiceRegistrar)registrar;
- }
- return new ServiceRegistrarFacade(registrar);
+ return registrar;
}
-
+
/**
* Returns a string representation of this response.
*
Modified: incubator/river/jtsk/trunk/src/com/sun/jini/discovery/internal/Plaintext.java
URL: http://svn.apache.org/viewvc/incubator/river/jtsk/trunk/src/com/sun/jini/discovery/internal/Plaintext.java?rev=997542&r1=997541&r2=997542&view=diff
==============================================================================
--- incubator/river/jtsk/trunk/src/com/sun/jini/discovery/internal/Plaintext.java (original)
+++ incubator/river/jtsk/trunk/src/com/sun/jini/discovery/internal/Plaintext.java Wed Sep 15 23:45:52 2010
@@ -424,7 +424,7 @@ public class Plaintext {
// write LUS proxy
new ObjectOutputStream(out).writeObject(
- new MarshalledInstance(response.getPRegistrar(), context));
+ new MarshalledInstance(response.getRegistrar(), context));
} catch (RuntimeException e) {
throw new DiscoveryProtocolException(null, e);
}
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=997542&r1=997541&r2=997542&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 Wed Sep 15 23:45:52 2010
@@ -59,6 +59,7 @@ import net.jini.discovery.DiscoveryEvent
import net.jini.discovery.DiscoveryChangeListener;
import net.jini.discovery.DiscoveryGroupManagement;
import net.jini.discovery.DiscoveryLocatorManagement;
+import net.jini.discovery.DiscoveryManagement;
import net.jini.discovery.LookupDiscoveryManager;
import net.jini.discovery.LookupDiscoveryRegistration;
import net.jini.discovery.RemoteDiscoveryEvent;
@@ -139,7 +140,6 @@ 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 +278,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 DiscoveryListenerManagement joinMgrLDM;
+ private DiscoveryManagement joinMgrLDM;
/** Manager for discovering and registering with lookup services */
private JoinManager joinMgr;
/** Task manager for sending remote discovery events */
@@ -5290,11 +5290,11 @@ class FiddlerImpl implements ServerProxy
/* Get the discovery manager to pass to this service's join manager. */
try {
joinMgrLDM =
- (DiscoveryListenerManagement)Config.getNonNullEntry
+ (DiscoveryManagement)Config.getNonNullEntry
(config,
COMPONENT_NAME,
"discoveryManager",
- DiscoveryListenerManagement.class);
+ DiscoveryManagement.class);
if( joinMgrLDM instanceof DiscoveryGroupManagement ) {
String[] groups0 =
((DiscoveryGroupManagement)joinMgrLDM).getGroups();
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=997542&r1=997541&r2=997542&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 Wed Sep 15 23:45:52 2010
@@ -36,11 +36,13 @@ import net.jini.config.ConfigurationExce
import net.jini.core.discovery.LookupLocator;
import net.jini.core.entry.Entry;
import net.jini.core.lookup.ServiceID;
+import net.jini.discovery.DiscoveryManagement;
import net.jini.discovery.DiscoveryLocatorManagement;
import net.jini.discovery.DiscoveryGroupManagement;
import net.jini.discovery.LookupDiscoveryManager;
import net.jini.id.Uuid;
import net.jini.lookup.JoinManager;
+import net.jini.lookup.ServiceIDListener;
import net.jini.security.ProxyPreparer;
@@ -48,7 +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;
/**
* <code>JoinStateManager</code> provides a utility that manages
@@ -78,7 +80,7 @@ class JoinStateManager extends LogHandle
* Object used to find lookups. Has to implement DiscoveryManagement
* and DiscoveryLocatorManagement as well as DiscoveryGroupManagement.
*/
- private DiscoveryListenerManagement dm;
+ private DiscoveryManagement dm;
/**
* <code>JoinManager</code> that is handling the details of binding
@@ -180,9 +182,9 @@ class JoinStateManager extends LogHandle
lookupLocatorPreparer);
}
//TODO - defer creation of default LDM
- dm = (DiscoveryListenerManagement)
+ dm = (DiscoveryManagement)
Config.getNonNullEntry(config, TxnManager.MAHALO,
- "discoveryManager", DiscoveryListenerManagement.class,
+ "discoveryManager", DiscoveryManagement.class,
new LookupDiscoveryManager(
DiscoveryGroupManagement.NO_GROUPS, null, null, config));
if(initlogger.isLoggable(Level.CONFIG)) {
@@ -321,7 +323,7 @@ class JoinStateManager extends LogHandle
initlogger.log(Level.FINEST, "Creating JoinManager");
}
mgr = new JoinManager(service, attributes, serviceID,
- (DiscoveryListenerManagement) dm, null, config);
+ 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=997542&r1=997541&r2=997542&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 Wed Sep 15 23:45:52 2010
@@ -130,7 +130,6 @@ 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;
@@ -394,7 +393,7 @@ class MailboxImpl implements MailboxBack
* This can always be obtained from the JoinManager, so
* this is just used as a shortcut.
*/
- private DiscoveryListenerManagement lookupDiscMgr = null;
+ private DiscoveryManagement 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=997542&r1=997541&r2=997542&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 Wed Sep 15 23:45:52 2010
@@ -38,6 +38,7 @@ import net.jini.core.entry.Entry;
import net.jini.core.lookup.ServiceID;
import net.jini.discovery.DiscoveryGroupManagement;
import net.jini.discovery.DiscoveryLocatorManagement;
+import net.jini.discovery.DiscoveryManagement;
import net.jini.discovery.LookupDiscoveryManager;
import net.jini.lease.LeaseRenewalManager;
import net.jini.lookup.JoinManager;
@@ -47,7 +48,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.discovery.DiscoveryListenerManagement;
/**
* Utility class that combines <code>JoinManager</code> with persistence.
@@ -120,7 +120,7 @@ public class JoinState extends LogHandle
* must also implement <code>DiscoveryGroupManagement</code> and
* <code>DiscoveryLocatorManagement</code>.
*/
- private DiscoveryListenerManagement dm;
+ private DiscoveryManagement dm;
/** Our join manager */
private JoinManager joinMgr;
@@ -302,8 +302,8 @@ public class JoinState extends LogHandle
throws ConfigurationException, IOException
{
try {
- dm = (DiscoveryListenerManagement) Config.getNonNullEntry(
- config, NORM, "discoveryManager", DiscoveryListenerManagement.class);
+ dm = (DiscoveryManagement) Config.getNonNullEntry(
+ config, NORM, "discoveryManager", DiscoveryManagement.class);
if (!(dm instanceof DiscoveryGroupManagement)) {
throw new ConfigurationException(
"Entry for component " + NORM +
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=997542&r1=997541&r2=997542&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 Wed Sep 15 23:45:52 2010
@@ -109,7 +109,6 @@ 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;
@@ -4671,7 +4670,7 @@ class RegistrarImpl implements Registrar
throw new ConfigurationException(null, e);
}
joiner = new JoinManager(proxy, lookupAttrs, myServiceID,
- (DiscoveryListenerManagement) discoer, null, config);
+ discoer, null, config);
/* start up all the daemon threads */
serviceExpirer.start();
Modified: incubator/river/jtsk/trunk/src/net/jini/core/discovery/LookupLocator.java
URL: http://svn.apache.org/viewvc/incubator/river/jtsk/trunk/src/net/jini/core/discovery/LookupLocator.java?rev=997542&r1=997541&r2=997542&view=diff
==============================================================================
--- incubator/river/jtsk/trunk/src/net/jini/core/discovery/LookupLocator.java (original)
+++ incubator/river/jtsk/trunk/src/net/jini/core/discovery/LookupLocator.java Wed Sep 15 23:45:52 2010
@@ -29,16 +29,11 @@ import java.net.SocketException;
import java.net.URI;
import java.net.URISyntaxException;
import java.net.UnknownHostException;
+import java.rmi.MarshalledObject;
import java.security.AccessController;
import java.security.PrivilegedAction;
import javax.net.SocketFactory;
-import net.jini.core.lookup.PortableServiceRegistrar;
import net.jini.core.lookup.ServiceRegistrar;
-import net.jini.core.lookup.StreamServiceRegistrar;
-import net.jini.lookup.ServiceRegistrarFacade;
-import net.jini.lookup.StreamServiceRegistrarFacade;
-import net.jini.io.MarshalledInstance;
-import net.jini.io.MoToMiInputStream;
/**
* A utility class that performs unicast discovery, using version 1 of the
@@ -47,7 +42,6 @@ import net.jini.io.MoToMiInputStream;
* @author Sun Microsystems, Inc.
*
* @since 1.0
- * @see{net.jini.discovery.LookupLocatorDiscovery}
*/
public class LookupLocator implements Serializable {
private static final long serialVersionUID = 1448769379829432795L;
@@ -313,7 +307,6 @@ public class LookupLocator implements Se
return port;
}
-
/**
* Perform unicast discovery and return the ServiceRegistrar
* object for the given lookup service. Unicast discovery is
@@ -330,38 +323,13 @@ public class LookupLocator implements Se
* @throws IOException an error occurred during discovery
* @throws ClassNotFoundException if a class required to unmarshal the
* <code>ServiceRegistrar</code> proxy cannot be found
- * @deprecated replaced by {@link #reveal()}
*/
- @Deprecated
public ServiceRegistrar getRegistrar()
throws IOException, ClassNotFoundException
{
return getRegistrar(defaultTimeout);
}
-
- /**
- * Perform unicast discovery and return the PortableServiceRegistrar
- * object for the given lookup service. Unicast discovery is
- * performed anew each time this method is called.
- * <code>LookupLocator</code> implements this method to simply invoke
- * {@link #getRegistrar(int)} with a timeout value, which is determined
- * by the value of the <code>net.jini.discovery.timeout</code> system
- * property. If the property is set, is not negative, and can be parsed as
- * an <code>Integer</code>, the value of the property is used as the timeout
- * value. Otherwise, a default value of <code>60</code> seconds is assumed.
- *
- * @return the PortableServiceRegistrar for the lookup service denoted by
- * this LookupLocator object
- * @throws IOException an error occurred during discovery
- * @throws ClassNotFoundException if a class required to unmarshal the
- * <code>ServiceRegistrar</code> proxy cannot be found
- */
- public StreamServiceRegistrar getStreamRegistrar()
- throws IOException, ClassNotFoundException
- {
- return getStreamRegistrar(defaultTimeout);
- }
-
+
/**
* Perform unicast discovery and return the ServiceRegistrar
* object for the given lookup service, with the given discovery timeout.
@@ -383,82 +351,8 @@ public class LookupLocator implements Se
* @throws ClassNotFoundException if a class required to unmarshal the
* <code>ServiceRegistrar</code> proxy cannot be found
* @throws IllegalArgumentException if <code>timeout</code> is negative
- * @deprecated replaced by {@link #reveal(int)}
*/
- @Deprecated
public ServiceRegistrar getRegistrar(int timeout)
- throws IOException, ClassNotFoundException
- {
- PortableServiceRegistrar psr = getPortableRegistrar(timeout);
- if ( psr instanceof ServiceRegistrar) {
- return (ServiceRegistrar) psr;
- }
- return new ServiceRegistrarFacade(psr);
- }
-
- /**
- * Perform unicast discovery and return the StreamServiceRegistrar
- * object for the given lookup service, with the given discovery timeout.
- * Unicast discovery is performed anew each time this method is called.
- * <code>LookupLocator</code> implements this method to use the values
- * of the <code>host</code> and <code>port</code> field in determining
- * the host and port to connect to.
- *
- * The Java CDC platform can only recieve implementations of
- * PortableServiceRegistrar or StreamServiceRegistrar, however this
- * method will return a ServiceRegistrar, wrapped as
- * a StreamServiceRegistrar, the notify method will be converted on
- * platforms that support java.rmi.MarshalledObject and will throw
- * an UnsupportedMethodException on those that don't.
- *
- * <p>
- * If a connection can be established to start unicast discovery
- * but the remote end fails to respond within the given time
- * limit, an exception is thrown.
- *
- * @param timeout the maximum time to wait for a response, in
- * milliseconds. A value of <code>0</code> specifies an infinite timeout.
- * @return the StreamServiceRegistrar for the lookup service denoted by
- * this LookupLocator object
- * @throws IOException an error occurred during discovery
- * @throws ClassNotFoundException if a class required to unmarshal the
- * <code>ServiceRegistrar</code> proxy cannot be found
- * @throws IllegalArgumentException if <code>timeout</code> is negative
- */
- public StreamServiceRegistrar getStreamRegistrar(int timeout)
- throws IOException, ClassNotFoundException
- {
- PortableServiceRegistrar psr = getPortableRegistrar(timeout);
- if ( psr instanceof StreamServiceRegistrar){
- return (StreamServiceRegistrar) psr;
- }
- return new StreamServiceRegistrarFacade(psr);
- }
-
- /**
- * Perform unicast discovery and return the PortableServiceRegistrar
- * object for the given lookup service, with the given discovery timeout.
- * Unicast discovery is performed anew each time this method is called.
- * <code>LookupLocator</code> implements this method to use the values
- * of the <code>host</code> and <code>port</code> field in determining
- * the host and port to connect to.
- *
- * <p>
- * If a connection can be established to start unicast discovery
- * but the remote end fails to respond within the given time
- * limit, an exception is thrown.
- *
- * @param timeout the maximum time to wait for a response, in
- * milliseconds. A value of <code>0</code> specifies an infinite timeout.
- * @param true if a ServiceRegistrar instance is to be returned.
- * @return the ServiceRegistrar for the lookup service denoted by
- * this LookupLocator object
- * @throws IOException an error occurred during discovery
- * @throws ClassNotFoundException if a class required to unmarshal the
- * <code>PortableServiceRegistrar</code> proxy cannot be found
- * @throws IllegalArgumentException if <code>timeout</code> is negative
- */
- private PortableServiceRegistrar getPortableRegistrar(int timeout)
throws IOException, ClassNotFoundException
{
InetAddress[] addrs = null;
@@ -473,9 +367,7 @@ public class LookupLocator implements Se
} else {
sock = sf.createSocket(host, port);
}
- PortableServiceRegistrar psr =
- getRegistrarFromSocket(sock, timeout);
- return psr;
+ return getRegistrarFromSocket(sock, timeout);
}
IOException ioEx = null;
SecurityException secEx = null;
@@ -488,9 +380,7 @@ public class LookupLocator implements Se
} else {
sock = sf.createSocket(addrs[i], port);
}
- PortableServiceRegistrar psr =
- getRegistrarFromSocket(sock, timeout);
- return psr;
+ return getRegistrarFromSocket(sock, timeout);
} catch (ClassNotFoundException ex) {
cnfEx = ex;
} catch (IOException ex) {
@@ -512,7 +402,7 @@ public class LookupLocator implements Se
}
// Convenience method to do unicast discovery on a socket
- private static PortableServiceRegistrar getRegistrarFromSocket(Socket sock,
+ private static ServiceRegistrar getRegistrarFromSocket(Socket sock,
int timeout)
throws IOException, ClassNotFoundException
{
@@ -532,12 +422,10 @@ public class LookupLocator implements Se
new DataOutputStream(sock.getOutputStream());
dstr.writeInt(protoVersion);
dstr.flush();
- // Convert any MarshalledObject into MarshalledInstance.
ObjectInputStream istr =
- new MoToMiInputStream(sock.getInputStream());
- // Reminder, should we check codebase integrity or make it an option?
- PortableServiceRegistrar registrar =
- (PortableServiceRegistrar)((MarshalledInstance)istr.readObject()).get(false);
+ new ObjectInputStream(sock.getInputStream());
+ ServiceRegistrar registrar =
+ (ServiceRegistrar)((MarshalledObject)istr.readObject()).get();
for (int grpCount = istr.readInt(); --grpCount >= 0; ) {
istr.readUTF(); // ensure proper format, then discard
}
Modified: incubator/river/jtsk/trunk/src/net/jini/discovery/ConstrainableLookupLocator.java
URL: http://svn.apache.org/viewvc/incubator/river/jtsk/trunk/src/net/jini/discovery/ConstrainableLookupLocator.java?rev=997542&r1=997541&r2=997542&view=diff
==============================================================================
--- incubator/river/jtsk/trunk/src/net/jini/discovery/ConstrainableLookupLocator.java (original)
+++ incubator/river/jtsk/trunk/src/net/jini/discovery/ConstrainableLookupLocator.java Wed Sep 15 23:45:52 2010
@@ -18,8 +18,6 @@
package net.jini.discovery;
-import net.jini.lookup.StreamServiceRegistrarFacade;
-import net.jini.lookup.ServiceRegistrarFacade;
import com.sun.jini.discovery.Discovery;
import com.sun.jini.discovery.DiscoveryConstraints;
import com.sun.jini.discovery.UnicastResponse;
@@ -35,17 +33,15 @@ import net.jini.core.constraint.Invocati
import net.jini.core.constraint.MethodConstraints;
import net.jini.core.constraint.RemoteMethodControl;
import net.jini.core.discovery.LookupLocator;
-import net.jini.core.lookup.PortableServiceRegistrar;
import net.jini.core.lookup.ServiceRegistrar;
-import net.jini.core.lookup.StreamServiceRegistrar;
/**
* <code>LookupLocator</code> subclass which supports constraint operations
* through the {@link RemoteMethodControl} interface. The constraints of a
* <code>ConstrainableLookupLocator</code> instance control how it performs
- * unicast discovery, and apply only to its {@link LookupLocator#getPRegistrar()
- * getPRegistrar()} and {@link LookupLocator#getPRegistrar(int)
- * getPRegistrar(int)} methods. The constraints may also be used by other
+ * unicast discovery, and apply only to its {@link LookupLocator#getRegistrar()
+ * getRegistrar()} and {@link LookupLocator#getRegistrar(int)
+ * getRegistrar(int)} methods. The constraints may also be used by other
* utilities, such as {@link LookupLocatorDiscovery}, to determine how unicast
* discovery should be performed on behalf of a given
* <code>ConstrainableLookupLocator</code> instance. Untrusted
@@ -92,7 +88,7 @@ import net.jini.core.lookup.StreamServic
* used) perform unicast discovery to the host <code>target_host</code> on port
* 4160 using discovery protocol version 2, with a socket read timeout of
* 120000 milliseconds unless one was explicitly specified using the {@link
- * #getPRegistrar(int)} method.
+ * #getRegistrar(int)} method.
*/
public final class ConstrainableLookupLocator
extends LookupLocator implements RemoteMethodControl
@@ -101,9 +97,7 @@ public final class ConstrainableLookupLo
private static final int DEFAULT_TIMEOUT = 60 * 1000;
private static final Method getRegistrarMethod;
- private static final Method getStreamRegistrarMethod;
private static final Method getRegistrarTimeoutMethod;
- private static final Method getStreamRegistrarTimeoutMethod;
static {
try {
// REMIND: lookup methods on ConstrainableLookupLocator instead?
@@ -111,10 +105,6 @@ public final class ConstrainableLookupLo
"getRegistrar", new Class[0]);
getRegistrarTimeoutMethod = LookupLocator.class.getMethod(
"getRegistrar", new Class[]{ int.class });
- getStreamRegistrarMethod = LookupLocator.class.getMethod(
- "getStreamRegistrar", new Class[0]);
- getStreamRegistrarTimeoutMethod = LookupLocator.class.getMethod(
- "getStreamRegistrar", new Class[]{ int.class });
} catch (NoSuchMethodException e) {
throw new AssertionError(e);
}
@@ -137,7 +127,7 @@ public final class ConstrainableLookupLo
* The <code>url</code> must be a valid URL of scheme <code>"jini"</code> as
* described in <code>LookupLocator(String)</code>. A <code>null
* constraints</code> value is interpreted as mapping both
- * <code>getPRegistrar</code> methods to empty constraints.
+ * <code>getRegistrar</code> methods to empty constraints.
*
* @param url the URL to use
* @param constraints the constraints to apply to unicast discovery, or
@@ -162,7 +152,7 @@ public final class ConstrainableLookupLo
* rethrown.
*
* <p>A <code>null constraints</code> value is interpreted as mapping both
- * <code>getPRegistrar</code> methods to empty constraints. The
+ * <code>getRegistrar</code> methods to empty constraints. The
* <code>host</code> and <code>port</code> must satisfy the requirements of
* the <code>LookupLocator(String, int)</code> constructor.
*
@@ -184,10 +174,10 @@ public final class ConstrainableLookupLo
/**
* Performs unicast discovery as specified by
- * <code>LookupLocator.getPRegistrar()</code> with the following differences.
+ * <code>LookupLocator.getRegistrar()</code> with the following differences.
* <ul>
* <li> It applies the supplied constraints (if any) for this method.
- * <li> It does not invoke the <code>getPRegistrar(int)</code> method.
+ * <li> It does not invoke the <code>getRegistrar(int)</code> method.
* <li> If no timeout constraints are specified, this method assumes a
* default timeout of 60 seconds. A non default timeout can only be
* specified through the supplied constraints, the
@@ -199,69 +189,25 @@ public final class ConstrainableLookupLo
* @throws net.jini.io.UnsupportedConstraintException if the
* discovery-related constraints contain conflicts, or otherwise cannot be
* processed
- * @deprecated replaced by {@link #getStreamRegistrar()}
*/
- @Deprecated
- @Override
public ServiceRegistrar getRegistrar()
throws IOException, ClassNotFoundException
{
- PortableServiceRegistrar psr = getRegistrar((constraints != null) ?
+ return getRegistrar((constraints != null) ?
constraints.getConstraints(getRegistrarMethod) :
InvocationConstraints.EMPTY);
- if ( psr instanceof ServiceRegistrar){
- return (ServiceRegistrar) psr;
- }
- return new ServiceRegistrarFacade(psr);
}
-
- /**
- * Performs unicast discovery as specified by
- * <code>LookupLocator.getStreeamRegistrar()</code> with the following differences.
- * <ul>
- * <li> It applies the supplied constraints (if any) for this method.
- * <li> It does not invoke the <code>getPRegistrar(int)</code> method.
- * <li> If no timeout constraints are specified, this method assumes a
- * default timeout of 60 seconds. A non default timeout can only be
- * specified through the supplied constraints, the
- * <code>net.jini.discovery.timeout</code> system property is ignored.
- * </ul>
- * <code>ConstrainableLookupLocator</code> implements this method to use the
- * values of the <code>host</code> and <code>port</code> field in
- * determining the host and port to connect to.
- * @throws java.io.IOException
- * @throws java.lang.ClassNotFoundException
- * @throws net.jini.io.UnsupportedConstraintException if the
- * discovery-related constraints contain conflicts, or otherwise cannot be
- * processed
- * @since 2.2.0
- */
- @Override
- public StreamServiceRegistrar getStreamRegistrar()
- throws IOException, ClassNotFoundException
- {
- PortableServiceRegistrar psr = getRegistrar((constraints != null) ?
- constraints.getConstraints(getStreamRegistrarMethod) :
- InvocationConstraints.EMPTY);
- if ( psr instanceof StreamServiceRegistrar){
- return (StreamServiceRegistrar) psr;
- }
- return new StreamServiceRegistrarFacade(psr);
- }
-
+
/**
* Performs unicast discovery as specified by
- * <code>LookupLocator.getPRegistrar(int)</code>, additionally applying the
+ * <code>LookupLocator.getRegistrar(int)</code>, additionally applying the
* supplied discovery constraints. The <code>timeout</code> is considered a
* requirement with respect to other constraints specified for this
* instance.
* @throws net.jini.io.UnsupportedConstraintException if the
* discovery-related constraints contain conflicts, or otherwise cannot be
* processed
- * @deprecated replaced by {@link #getStreamRegistrar(int)}
*/
- @Deprecated
- @Override
public ServiceRegistrar getRegistrar(int timeout)
throws IOException, ClassNotFoundException
{
@@ -270,42 +216,7 @@ public final class ConstrainableLookupLo
InvocationConstraints.EMPTY;
Collection reqs = new ArrayList(ic.requirements());
reqs.add(new UnicastSocketTimeout(timeout));
- PortableServiceRegistrar psr =
- getRegistrar(new InvocationConstraints(reqs, ic.preferences()));
- if ( psr instanceof ServiceRegistrar){
- return (ServiceRegistrar) psr;
- }
- return new ServiceRegistrarFacade(psr);
- }
-
- /**
- * Performs unicast discovery as specified by
- * <code>LookupLocator.getStreamRegistrar(int)</code>, additionally applying the
- * supplied discovery constraints. The <code>timeout</code> is considered a
- * requirement with respect to other constraints specified for this
- * instance.
- * @throws java.io.IOException
- * @throws java.lang.ClassNotFoundException
- * @throws net.jini.io.UnsupportedConstraintException if the
- * discovery-related constraints contain conflicts, or otherwise cannot be
- * processed
- * @since 2.2.0
- */
- @Override
- public StreamServiceRegistrar getStreamRegistrar(int timeout)
- throws IOException, ClassNotFoundException
- {
- InvocationConstraints ic = (constraints != null) ?
- constraints.getConstraints(getStreamRegistrarTimeoutMethod) :
- InvocationConstraints.EMPTY;
- Collection reqs = new ArrayList(ic.requirements());
- reqs.add(new UnicastSocketTimeout(timeout));
- PortableServiceRegistrar psr =
- getRegistrar(new InvocationConstraints(reqs, ic.preferences()));
- if ( psr instanceof StreamServiceRegistrar){
- return (StreamServiceRegistrar) psr;
- }
- return new StreamServiceRegistrarFacade(psr);
+ return getRegistrar(new InvocationConstraints(reqs, ic.preferences()));
}
/**
@@ -327,7 +238,7 @@ public final class ConstrainableLookupLo
return constraints;
}
- private PortableServiceRegistrar getRegistrar(InvocationConstraints constraints)
+ private ServiceRegistrar getRegistrar(InvocationConstraints constraints)
throws IOException, ClassNotFoundException
{
UnicastResponse resp = new MultiIPDiscovery() {
@@ -340,6 +251,6 @@ public final class ConstrainableLookupLo
s, dc.getUnfulfilledConstraints(), null, null, null);
}
}.getResponse(host, port, constraints);
- return resp.getPRegistrar();
+ return resp.getRegistrar();
}
}
\ No newline at end of file
Modified: incubator/river/jtsk/trunk/src/net/jini/discovery/DiscoveryEvent.java
URL: http://svn.apache.org/viewvc/incubator/river/jtsk/trunk/src/net/jini/discovery/DiscoveryEvent.java?rev=997542&r1=997541&r2=997542&view=diff
==============================================================================
--- incubator/river/jtsk/trunk/src/net/jini/discovery/DiscoveryEvent.java (original)
+++ incubator/river/jtsk/trunk/src/net/jini/discovery/DiscoveryEvent.java Wed Sep 15 23:45:52 2010
@@ -17,14 +17,9 @@
*/
package net.jini.discovery;
-import net.jini.lookup.StreamServiceRegistrarFacade;
-import net.jini.lookup.ServiceRegistrarFacade;
-import java.util.ArrayList;
import java.util.EventObject;
import java.util.Map;
-import net.jini.core.lookup.PortableServiceRegistrar;
import net.jini.core.lookup.ServiceRegistrar;
-import net.jini.core.lookup.StreamServiceRegistrar;
/**
* Event object passed (via either the <code>DiscoveryListener</code>
@@ -49,7 +44,7 @@ public class DiscoveryEvent extends Even
*
* @serial
*/
- private PortableServiceRegistrar[] regs;
+ protected ServiceRegistrar[] regs;
/**
* Map from the registrars of this event to the groups in which each
@@ -57,34 +52,17 @@ public class DiscoveryEvent extends Even
*
* @serial
*/
- private Map groups;
+ protected Map groups;
/**
* Construct a new <code>DiscoveryEvent</code> object, with the given
* source and set of registrars. The set of registrars should not be
- * empty. This constructor has been left in place to maintain binary
- * compatibility.
- *
- * @param source the source of this event
- * @param regs the registrars to which this event applies
- * @deprecated
- */
- @Deprecated
- public DiscoveryEvent(Object source, ServiceRegistrar[] regs) {
- super(source);
- this.regs = regs;
- this.groups = null;
- }
-
- /**
- * Construct a new <code>DiscoveryEvent</code> object, with the given
- * source and set of registrars. The set of registrars should not be
* empty.
*
* @param source the source of this event
* @param regs the registrars to which this event applies
*/
- public DiscoveryEvent(Object source, PortableServiceRegistrar[] regs) {
+ public DiscoveryEvent(Object source, ServiceRegistrar[] regs) {
super(source);
this.regs = regs;
this.groups = null;
@@ -103,46 +81,19 @@ public class DiscoveryEvent extends Even
public DiscoveryEvent(Object source, Map groups) {
super(source);
this.groups = groups;
- this.regs = (PortableServiceRegistrar[])(groups.keySet()).toArray
- (new PortableServiceRegistrar[groups.size()]);
+ this.regs = (ServiceRegistrar[])(groups.keySet()).toArray
+ (new ServiceRegistrar[groups.size()]);
}
/**
* Return the set of registrars to which this event applies.
* The same array is returned on every call; a copy is not made.
- *
- * I'm going to experiment with returning a copy to see if anything
- * breaks.
- *
* @return the set of registrars to which this event applies.
*/
public ServiceRegistrar[] getRegistrars() {
- int l = regs.length;
- ArrayList<ServiceRegistrar> sr = new ArrayList<ServiceRegistrar>(l);
- for ( int i = 0; i < l; i++ ){
- if (regs[i] instanceof ServiceRegistrar) {
- sr.add( (ServiceRegistrar) regs[i]);
- } else {
- sr.add( new ServiceRegistrarFacade(regs[i]));
- }
- }
- ServiceRegistrar[] sra = new ServiceRegistrar[sr.size()];
- return sr.toArray(sra);
- }
-
- /**
- * Return the set of registrars to which this event applies.
- * The same array is returned on every call; a copy is not made.
- *
- * I'm going to experiment with returning a copy to see if anything
- * breaks.
- *
- * @return the set of registrars to which this event applies.
- */
- public PortableServiceRegistrar[] getPRegistrars() {
- return regs;
+ return regs;
}
-
+
/**
* Returns a set that maps to each registrar referenced by this event,
* the current set of groups in which each registrar is a member.
Modified: incubator/river/jtsk/trunk/src/net/jini/discovery/IncomingUnicastResponse.java
URL: http://svn.apache.org/viewvc/incubator/river/jtsk/trunk/src/net/jini/discovery/IncomingUnicastResponse.java?rev=997542&r1=997541&r2=997542&view=diff
==============================================================================
--- incubator/river/jtsk/trunk/src/net/jini/discovery/IncomingUnicastResponse.java (original)
+++ incubator/river/jtsk/trunk/src/net/jini/discovery/IncomingUnicastResponse.java Wed Sep 15 23:45:52 2010
@@ -17,15 +17,11 @@
*/
package net.jini.discovery;
-import net.jini.lookup.ServiceRegistrarFacade;
import java.io.InputStream;
import java.io.IOException;
import java.io.ObjectInputStream;
-import net.jini.core.lookup.PortableServiceRegistrar;
+import java.rmi.MarshalledObject;
import net.jini.core.lookup.ServiceRegistrar;
-import net.jini.core.lookup.StreamServiceRegistrar;
-import net.jini.io.MarshalledInstance;
-import net.jini.io.MoToMiInputStream;
/**
* This class encapsulates the details of unmarshaling an incoming
@@ -38,23 +34,17 @@ import net.jini.io.MoToMiInputStream;
public class IncomingUnicastResponse {
/**
* The registrar we have discovered.
- * Changed from protected to private in 2.2.0
*/
- private PortableServiceRegistrar registrar;
+ protected ServiceRegistrar registrar;
/**
* The groups the lookup service was a member of, at the time
* discovery was performed. This may be out of date.
- * Changed from protected to private in 2.2.0
*/
- private String[] groups;
+ protected String[] groups;
/**
* Construct a new object, initialized by unmarshaling the
* contents of an input stream.
- *
- * This class remains backward compatible with earlier releases of Jini
- * since 2.0, however it will be eventually dropped and only support
- * versions 2.2.0 and later.
*
* @param str the stream from which to unmarshal the response
* @exception IOException an error occurred while unmarshaling the
@@ -65,11 +55,9 @@ public class IncomingUnicastResponse {
public IncomingUnicastResponse(InputStream str)
throws IOException, ClassNotFoundException
{
- ObjectInputStream istr = new MoToMiInputStream(str);
- // need to look at configurable option for verify codebase integrity.
- boolean verifyCodebaseIntegrity = false;
+ ObjectInputStream istr = new ObjectInputStream(str);
registrar =
- (PortableServiceRegistrar)((MarshalledInstance)istr.readObject()).get(verifyCodebaseIntegrity);
+ (ServiceRegistrar)((MarshalledObject)istr.readObject()).get();
int grpCount = istr.readInt();
groups = new String[grpCount];
for (int i = 0; i < groups.length; i++) {
@@ -79,28 +67,11 @@ public class IncomingUnicastResponse {
/**
* Return the lookup service registrar we have discovered.
- * This method won't be available on Java CDC.
*
* @return the lookup service registrar we have discovered
- * @deprecated replaced by {@link #getPRegistrar()}
*/
- @Deprecated
public ServiceRegistrar getRegistrar() {
- if (registrar instanceof ServiceRegistrar ) return (ServiceRegistrar) registrar;
- return new ServiceRegistrarFacade(registrar);
- }
-
- /**
- * Return the lookup portable service registrar we have discovered.
- *
- * For maximum platform compatbility don't downcast,
- * use PortableServiceRegistrar where possible.
- *
- * @return the lookup service registrar we have discovered
- * @since 2.2.0
- */
- public PortableServiceRegistrar getPRegistrar () {
- return registrar;
+ return registrar;
}
/**
Modified: incubator/river/jtsk/trunk/src/net/jini/discovery/LookupUnmarshalException.java
URL: http://svn.apache.org/viewvc/incubator/river/jtsk/trunk/src/net/jini/discovery/LookupUnmarshalException.java?rev=997542&r1=997541&r2=997542&view=diff
==============================================================================
--- incubator/river/jtsk/trunk/src/net/jini/discovery/LookupUnmarshalException.java (original)
+++ incubator/river/jtsk/trunk/src/net/jini/discovery/LookupUnmarshalException.java Wed Sep 15 23:45:52 2010
@@ -18,22 +18,12 @@
package net.jini.discovery;
-import net.jini.lookup.StreamServiceRegistrarFacade;
-import net.jini.lookup.ServiceRegistrarFacade;
import net.jini.core.lookup.ServiceRegistrar;
-import net.jini.core.lookup.PortableServiceRegistrar;
import java.io.InvalidObjectException;
import java.io.IOException;
import java.io.ObjectInputStream;
-import java.io.ObjectOutputStream;
import java.rmi.MarshalledObject;
-import java.util.ArrayList;
-import java.util.Arrays;
-import net.jini.io.Convert;
-import net.jini.io.MarshalledInstance;
-import net.jini.io.MiToMoOutputStream;
-import net.jini.io.MoToMiInputStream;
/**
* When unmarshalling an instance of <code>MarshalledObject</code>, different
@@ -49,22 +39,22 @@ import net.jini.io.MoToMiInputStream;
* This class provides a mechanism that clients of the lookup discovery
* service may use for efficient handling of the exceptions that may
* occur when unmarshalling elements of a set of marshalled instances
- * of the <code>PortableServiceRegistrar</code> interface. When elements in such
+ * of the <code>ServiceRegistrar</code> interface. When elements in such
* a set are unmarshalled, the <code>LookupUnmarshalException</code> class
* may be used to collect and report pertinent information generated when
* failure occurs while unmarshalling the elements of the set.
* <p>
* The information that may be of interest to entities that receive this
* exception class is contained in the following fields: a set of
- * <code>PortableServiceRegistrar</code> instances in which each element is the
+ * <code>ServiceRegistrar</code> instances in which each element is the
* result of a successful unmarshalling attempt, a set of marshalled instances
- * of <code>PortableServiceRegistrar</code> in which each element could not be
+ * of <code>ServiceRegistrar</code> in which each element could not be
* successfully unmarshalled, and a set of exceptions (<code>IOException<code>,
* <code>ClassNotFoundException</code>, or some unchecked exception) in which
* each element corresponds to one of the unmarshalling failures.
* <p>
* Thus, when exceptional conditions occur while unmarshalling a set of
- * marshalled instances of <code>PortableServiceRegistrar</code>, this class can
+ * marshalled instances of <code>ServiceRegistrar</code>, this class can
* be used not only to indicate that an exceptional condition has occurred,
* but also to provide information that can be used to perform error handling
* activities such as: determining if it is feasible to continue with
@@ -72,12 +62,11 @@ import net.jini.io.MoToMiInputStream;
* <p>
* Note that this exception class should be used only to report exceptional
* conditions occurring when unmarshalling a set of marshalled instances
- * of the <code>PortableServiceRegistrar</code> interface.
+ * of the <code>ServiceRegistrar</code> interface.
*
* @author Sun Microsystems, Inc.
*
* @see net.jini.core.lookup.ServiceRegistrar
- * @see net.jini.core.lookup.PortableServiceRegistrar
*/
public class LookupUnmarshalException extends Exception {
@@ -91,16 +80,16 @@ public class LookupUnmarshalException ex
*
* @serial
*/
- private PortableServiceRegistrar[] registrars = null;
+ private ServiceRegistrar[] registrars = null;
/**
- * Array containing the set of <code>PortableServiceRegistrar</code> instances
+ * Array containing the set of <code>ServiceRegistrar</code> instances
* that could not be unmarshalled. This set should not be <code>null</code>
* and should contain at least one element.
*
* @serial
*/
- private MarshalledInstance[] marshalledRegistrars = null;
+ private MarshalledObject[] marshalledRegistrars = null;
/**
* Array containing the set of exceptions that occurred during the
@@ -108,7 +97,7 @@ public class LookupUnmarshalException ex
* of <code>IOException</code>, <code>ClassNotFoundException</code>, or
* some unchecked exception. Furthermore, there should be a one-to-one
* correspondence between each element in this set and each element in
- * the set of still-to-be-unmarshalled <code>PortableServiceRegistrar</code>
+ * the set of still-to-be-unmarshalled <code>ServiceRegistrar</code>
* instances. That is, the element of this set corresponding to index i
* should be an instance of the exception that occurred while attempting
* to unmarshal the element at index i of <code>marshalledRegistrars<code>.
@@ -123,11 +112,11 @@ public class LookupUnmarshalException ex
* Constructs a new instance of <code>LookupUnmarshalException</code>.
*
* @param registrars Array containing the set of instances of
- * <code>PortableServiceRegistrar</code> that were
+ * <code>ServiceRegistrar</code> that were
* successfully unmarshalled.
*
* @param marshalledRegistrars Array containing the set of marshalled
- * <code>PortableServiceRegistrar</code> instances
+ * <code>ServiceRegistrar</code> instances
* that could not be unmarshalled.
*
* @param exceptions Array containing the set of exceptions that
@@ -156,27 +145,24 @@ public class LookupUnmarshalException ex
* either the <code>marshalledRegistrars</code> parameter or the
* <code>exceptions</code> parameter has zero length; or when the
* lengths of those two parameters are not equal.
- * @deprecated
*/
- @Deprecated
- public LookupUnmarshalException(PortableServiceRegistrar[] registrars,
+ public LookupUnmarshalException(ServiceRegistrar[] registrars,
MarshalledObject[] marshalledRegistrars,
Throwable[] exceptions)
{
super();
- MarshalledInstance[] jmo = asMarshalledInstance(marshalledRegistrars);
- init(registrars,jmo,exceptions);
+ init(registrars,marshalledRegistrars,exceptions);
}//end constructor
/**
* Constructs a new instance of <code>LookupUnmarshalException</code>.
*
* @param registrars Array containing the set of instances of
- * <code>PortableServiceRegistrar</code> that were
+ * <code>ServiceRegistrar</code> that were
* successfully unmarshalled.
*
* @param marshalledRegistrars Array containing the set of marshalled
- * <code>PortableServiceRegistrar</code> instances
+ * <code>ServiceRegistrar</code> instances
* that could not be unmarshalled.
*
* @param exceptions Array containing the set of exceptions that
@@ -208,116 +194,17 @@ public class LookupUnmarshalException ex
* either the <code>marshalledRegistrars</code> parameter or the
* <code>exceptions</code> parameter has zero length; or when the
* lengths of those two parameters are not equal.
- * @deprecated
*/
- @Deprecated
- public LookupUnmarshalException(PortableServiceRegistrar[] registrars,
+ public LookupUnmarshalException(ServiceRegistrar[] registrars,
MarshalledObject[] marshalledRegistrars,
Throwable[] exceptions,
String message)
{
super(message);
- MarshalledInstance[] mi = asMarshalledInstance(marshalledRegistrars);
- init(registrars,mi,exceptions);
- }//end constructor
-
- /**
- * Constructs a new instance of <code>LookupUnmarshalException</code>.
- *
- * @param registrars Array containing the set of instances of
- * <code>PortableServiceRegistrar</code> that were
- * successfully unmarshalled.
- *
- * @param marshalledRegistrars Array containing the set of marshalled
- * <code>PortableServiceRegistrar</code> instances
- * that could not be unmarshalled.
- *
- * @param exceptions Array containing the set of exceptions that
- * occurred during the unmarshalling process.
- * Each element in this set should be an
- * instance of <code>IOException</code>,
- * <code>ClassNotFoundException</code>, or
- * some unchecked exception. Furthermore,
- * there should be a one-to-one correspondence
- * between each element in this set and
- * each element in the
- * <code>marshalledRegistrars</code> parameter.
- * <p>
- * That is, the element of this set
- * corresponding to index i should be an
- * instance of the exception that occurred
- * while attempting to unmarshal the element
- * at index i of the
- * <code>marshalledRegistrars</code> parameter.
- *
- * @throws java.lang.NullPointerException this exception occurs
- * when <code>null</code> is input for either the
- * <code>marshalledRegistrars</code> parameter or the
- * <code>exceptions</code> parameter.
- * @throws java.lang.IllegalArgumentException this exception occurs when
- * either the <code>marshalledRegistrars</code> parameter or the
- * <code>exceptions</code> parameter has zero length; or when the
- * lengths of those two parameters are not equal.
- */
- public LookupUnmarshalException(PortableServiceRegistrar[] registrars,
- MarshalledInstance[] marshalledRegistrars,
- Throwable[] exceptions)
- {
- super();
init(registrars,marshalledRegistrars,exceptions);
}//end constructor
/**
- * Constructs a new instance of <code>LookupUnmarshalException</code>.
- *
- * @param registrars Array containing the set of instances of
- * <code>PortableServiceRegistrar</code> that were
- * successfully unmarshalled.
- *
- * @param marshalledRegistrars Array containing the set of marshalled
- * <code>PortableServiceRegistrar</code> instances
- * that could not be unmarshalled.
- *
- * @param exceptions Array containing the set of exceptions that
- * occurred during the unmarshalling process.
- * Each element in this set should be an
- * instance of <code>IOException</code>,
- * <code>ClassNotFoundException</code>, or
- * some unchecked exception. Furthermore,
- * there should be a one-to-one correspondence
- * between each element in this set and
- * each element in the
- * <code>marshalledRegistrars</code> parameter.
- * <p>
- * That is, the element of this set
- * corresponding to index i should be an
- * instance of the exception that occurred
- * while attempting to unmarshal the element
- * at index i of the
- * <code>marshalledRegistrars</code> parameter.
- *
- * @param message <code>String</code> describing the nature
- * of the exception
- *
- * @throws java.lang.NullPointerException this exception occurs
- * when <code>null</code> is input for either the
- * <code>marshalledRegistrars</code> parameter or the
- * <code>exceptions</code> parameter.
- * @throws java.lang.IllegalArgumentException this exception occurs when
- * either the <code>marshalledRegistrars</code> parameter or the
- * <code>exceptions</code> parameter has zero length; or when the
- * lengths of those two parameters are not equal.
- */
- public LookupUnmarshalException(PortableServiceRegistrar[] registrars,
- MarshalledInstance[] marshalledRegistrars,
- Throwable[] exceptions,
- String message)
- {
- super(message);
- init(registrars,marshalledRegistrars,exceptions);
- }//end constructor
-
- /**
* Accessor method that returns an array consisting of instances of
* <code>ServiceRegistrar</code>, where each element of the array
* corresponds to a successfully unmarshalled object. Note that the
@@ -328,77 +215,25 @@ public class LookupUnmarshalException ex
* each element corresponds to a successfully unmarshalled object.
*/
public ServiceRegistrar[] getRegistrars() {
- ArrayList<ServiceRegistrar> sr = new ArrayList<ServiceRegistrar>();
- int l = registrars.length;
- for ( int i = 0; i < l; i++){
- if (registrars[i] instanceof ServiceRegistrar) {
- sr.add((ServiceRegistrar) registrars[i]);
- }
- }
- ServiceRegistrar[] sra = new ServiceRegistrar[sr.size()];
- return sr.toArray(sra);
- }//end getRegistrars
-
- /**
- * Accessor method that returns an array consisting of instances of
- * <code>PortableServiceRegistrar</code>, where each element of the array
- * corresponds to a successfully unmarshalled object. Note that the
- * same array is returned on each invocation of this method; that is,
- * a copy is not made.
- *
- * @return array of instances of <code>PortableServiceRegistrar</code>, where
- * each element corresponds to a successfully unmarshalled object.
- */
- public PortableServiceRegistrar[] getPRegistrars() {
- // Defensive copy.
- return Arrays.copyOf(registrars, registrars.length);
+ return registrars;
}//end getRegistrars
/**
* Accessor method that returns an array consisting of instances of
* <code>MarshalledObject</code>, where each element of the array is a
- * marshalled instance of the <code>PortableServiceRegistrar</code> interface,
+ * marshalled instance of the <code>ServiceRegistrar</code> interface,
* and corresponds to an object that could not be successfully
* unmarshalled. Note that the same array is returned on each invocation
* of this method; that is, a copy is not made.
*
- * @return array of marshalled instances of <code>PortableServiceRegistrar</code>,
+ * @return array of marshalled instances of <code>ServiceRegistrar</code>,
* where each element corresponds to an object in which failure
* occurred while attempting to unmarshal the object.
*/
- @Deprecated
public MarshalledObject[] getMarshalledRegistrars() {
- return asMarshalledObject(marshalledRegistrars);
+ return marshalledRegistrars;
}//end getMarshalledRegistrars
-
- @Deprecated
- private MarshalledInstance[] asMarshalledInstance(MarshalledObject[] mo) {
- Convert convert = Convert.getInstance();
- int l = mo.length;
- MarshalledInstance[] mi = new MarshalledInstance[l];
- for (int i = 0; i < l; i++){
- mi[i] = convert.toMarshalledInstance(mo[i]);
- }
- return mi;
- }
-
- @Deprecated
- @SuppressWarnings("unchecked")
- private MarshalledObject[] asMarshalledObject(MarshalledInstance[] mi){
- Convert convert = Convert.getInstance();
- int l = mi.length;
- MarshalledObject[] rmiMo = new MarshalledObject[l];
- for (int i = 0; i < l; i++){
- rmiMo[i] = convert.toRmiMarshalledObject(mi[i]);
- }
- return rmiMo;
- }
-
- public MarshalledInstance[] getMarshalledInstRegistrars(){
- // Defensive copy.
- return Arrays.copyOf(marshalledRegistrars, marshalledRegistrars.length);
- }
-
+
/**
* Accessor method that returns an array consisting of instances of
* <code>Throwable</code>, where each element of the array corresponds
@@ -421,19 +256,18 @@ public class LookupUnmarshalException ex
* the unmarshalling process.
*/
public Throwable[] getExceptions() {
- // Defensive copy.
- return Arrays.copyOf(exceptions, exceptions.length);
+ return exceptions;
}//end getExceptions
/**
* Initializes the abstract state of this class.
*
* @param registrars Array containing the set of instances of
- * <code>PortableServiceRegistrar</code> that were
+ * <code>ServiceRegistrar</code> that were
* successfully unmarshalled.
*
* @param marshalledRegistrars Array containing the set of marshalled
- * <code>PortableServiceRegistrar</code> instances
+ * <code>ServiceRegistrar</code> instances
* that could not be unmarshalled.
*
* @param exceptions Array containing the set of exceptions that
@@ -448,8 +282,8 @@ public class LookupUnmarshalException ex
* <code>exceptions</code> parameter has zero length; or when the
* lengths of those two parameters are not equal.
*/
- private void init(PortableServiceRegistrar[] registrars,
- MarshalledInstance[] marshalledRegistrars,
+ private void init(ServiceRegistrar[] registrars,
+ MarshalledObject[] marshalledRegistrars,
Throwable[] exceptions) {
/* Verify the input arguments */
if(marshalledRegistrars == null) {
@@ -485,8 +319,7 @@ public class LookupUnmarshalException ex
private void readObject(ObjectInputStream s)
throws IOException, ClassNotFoundException
{
- ObjectInputStream fois = new MoToMiInputStream(s); // convert to java.rmi.MarshalledObject
- fois.defaultReadObject();
+ s.defaultReadObject();
/* Verify marshalledRegistrars and exceptions fields */
if(marshalledRegistrars == null) {
throw new InvalidObjectException
@@ -512,17 +345,5 @@ public class LookupUnmarshalException ex
}//endif
}//end readObject
-
- /**
- * This method is an interim temporary measure to provide a transition
- * period for the Serialized form in Apache River versions prior to
- * 2.2.0
- * @param stream
- * @throws java.io.IOException
- */
- private void writeObject(java.io.ObjectOutputStream stream) throws IOException{
- ObjectOutputStream newOutStream = new MiToMoOutputStream(stream); // Convert from java.rmi.MarshalledObject
- newOutStream.defaultWriteObject();
- }
}//end class LookupUnmarshalException