[e-cvs] cvs commit: e/src/jsrc/org/erights/e/ui/jed BrickLayer.java EAction.java EDismissListener.java EItemListener.java EMenuBar.java ETextChangedListener.java EditGroup.java JedMain.java
markm@eros.cs.jhu.edu
markm@eros.cs.jhu.edu
Thu, 6 Sep 2001 05:55:59 -0400
markm 01/09/06 05:55:57
Modified: src/jsrc/net/captp/jcomm CapTPReplacer.java
CapTPResolver.java DelayedRedirector.java
Far3Desc.java FarHandler.java ImportDesc.java
IncomingDesc.java Introducer.java LocatorUnum.java
LookupHandler.java NewFarDesc.java
NewRemotePromiseDesc.java NonceLocator.java
ObjectID.java ObjectRefDesc.java Promise3Desc.java
ProxyConnection.java ProxyMgr.java Redirector.java
RemoteHandler.java RemotePromiseHandler.java
Sturdifier.java SturdyRef.java
src/jsrc/net/captp/tables AnswersTable.java CommTable.java
ExportsTable.java ImportsTable.java
NearGiftTable.java PromiseGiftTable.java
QuestionsTable.java SwissTable.java Vine.java
src/jsrc/net/ertp Assay.java
InsufficientERightsException.java Issuer.java
Purse.java
src/jsrc/net/vattp/data ConnectionAttemptFailed.java
ConnectionsMgr.java DES.java DataCommThunk.java
DataConnection.java DataPath.java Decrypt3DES.java
EARL.java Encrypt3DES.java ListenThread.java
Msg.java MsgHandler.java NetAddr.java
NetConfig.java NewConnectionReactor.java
RecvThread.java SendThread.java
StartUpProtocol.java StreamMessage.java
Suspend.java TripleDESKeyConstructor.java
UserThread.java VatIdentity.java
VatLocationLookup.java
src/jsrc/net/vattp/security ESecureRandom.java
MicroTime.java Native.java
SecureRandomCrewSeedIt.java TimerJitterEntropy.java
src/jsrc/net/vattp/tunnel HTTPClient.java
HTTPConnectionHandler.java HTTPInputStream.java
HTTPMsgID.java HTTPServeMain.java
HTTPSocketCtl.java TCPConnectionListener.java
src/jsrc/net/vattp/vls VatLocationServer.java
src/jsrc/org/apache/oro/text/regex CharStringPointer.java
MalformedPatternException.java MatchResult.java
OpCode.java Pattern.java PatternCompiler.java
PatternMatcher.java PatternMatcherInput.java
Perl5Compiler.java Perl5Debug.java
Perl5MatchResult.java Perl5Matcher.java
Perl5Pattern.java Perl5Repetition.java
Perl5Substitution.java StringSubstitution.java
Substitution.java Util.java
src/jsrc/org/capml/dom Element.java Node.java Text.java
src/jsrc/org/capml/quasi QuasiContent.java
QuasiContentExprHole.java QuasiContentList.java
QuasiContentPattHole.java QuasiElement.java
QuasiText.java XMLQuasiParser.java
src/jsrc/org/erights/build EYaccFixer.java
src/jsrc/org/erights/e/develop/assertion Assertion.java
AssertionFailed.java
src/jsrc/org/erights/e/develop/exception ExceptionMgr.java
ExceptionNoticer.java NestedError.java
NestedException.java NestedIOException.java
NestedThrowable.java PrintStreamWriter.java
ThrowableSugar.java
src/jsrc/org/erights/e/develop/format ETimeFormat.java
StringHelper.java
src/jsrc/org/erights/e/develop/trace Trace.java
TraceBuffer.java TraceCaller.java
TraceConstants.java TraceController.java
TraceDateToString.java TraceErrorWatcher.java
TraceExceptionNoticer.java
TraceLevelTranslator.java TraceLog.java
TraceLogDescriptor.java TraceMessage.java
TraceMessageAcceptor.java
TraceMessageStringifier.java
TraceSubsystemMediator.java
TraceTxtVersionNamer.java TraceVersionNamer.java
src/jsrc/org/erights/e/elang/evm AssignExpr.java
CallExpr.java CatchExpr.java CdrPattern.java
DefineExpr.java EExpr.java EImpl.java EMeta.java
EMethod.java ENode.java EScript.java
EscapeExpr.java Evaluator.java FinalPattern.java
FinallyExpr.java HideExpr.java IfExpr.java
IgnorePattern.java ListPattern.java
LiteralExpr.java MatchBindExpr.java Matcher.java
MetaExpr.java NounExpr.java ObjectExpr.java
Pattern.java QuasiLiteralExpr.java
QuasiLiteralPatt.java QuasiPatternExpr.java
QuasiPatternPatt.java ScopeExpr.java SendExpr.java
SeqExpr.java SlotExpr.java StaticScope.java
SuchThatPattern.java VarPattern.java
src/jsrc/org/erights/e/elang/interp Help.java
InteractiveInterp.java Interp.java InterpLoop.java
Interpreter.java LazyEvalSlot.java LoaderScope.java
Loop.java PackageScope.java ProtocolDesc.java
ResourceUriGetter.java ScopeSetup.java
URLGetter.java UnsafeLoaderScope.java
src/jsrc/org/erights/e/elang/scope MutableScope.java
Scope.java ScopeImpl.java
UndefinedVariableException.java
src/jsrc/org/erights/e/elang/syntax Assoc.java EBuilder.java
ELexer.java EParser.java FileFeeder.java
HilbertHotel.java LineFeeder.java Literal.java
MsgPatt.java PrettyFeeder.java QuasiFeeder.java
QuasiPart.java SyntaxException.java URI.java
src/jsrc/org/erights/e/elang/visitors
AlphaRenameVisitor.java CopyVisitor.java
ETreeVisitor.java RenameVisitor.java
SubstVisitor.java
src/jsrc/org/erights/e/elib/base Callable.java
ClassDesc.java Ejection.java Ejector.java
MessageDesc.java MethodNode.java
NonBlockingInputStream.java ParamDesc.java
ParseNode.java Script.java SourceSpan.java
TextWriter.java Thunk.java TypeDesc.java
UnQuote.java
src/jsrc/org/erights/e/elib/deflect Deflector.java
EventualDeflector.java ImmediateDeflector.java
src/jsrc/org/erights/e/elib/eio TextReader.java
src/jsrc/org/erights/e/elib/prim CallThunk.java
ConstructorNode.java E.java InstanceMethodNode.java
JavaMemberNode.java ListenerDeflector.java
Message.java MirandaMethods.java
OverloaderNode.java PendingEvent.java Queue.java
Runner.java RunnerThread.java ScriptMaker.java
ShutDownVatException.java StaticMaker.java
StaticMethodNode.java SugarMethodNode.java
SynchQueue.java Thrower.java VTable.java
VarGetterNode.java VarSetterNode.java WeakPtr.java
WeakPtrThread.java
src/jsrc/org/erights/e/elib/prim/tests ERunDemo.java
src/jsrc/org/erights/e/elib/quasi FirstCharSplitter.java
Identifiers.java IncompleteQuasiException.java
MatchMaker.java QuasiExprParser.java
QuasiPatternParser.java SimpleQuasiParser.java
Substituter.java ValueMaker.java
src/jsrc/org/erights/e/elib/ref BufferingRef.java
DeviceRef.java DisconnectedRef.java FarRef.java
LocalResolver.java NearRef.java
OneArgFuncAdapter.java Proxy.java ProxyHandler.java
ProxyResolver.java Ref.java RemotePromise.java
Resolver.java ResultResolver.java SlotRef.java
StemCell.java SwitchableRef.java Switcher.java
UnconnectedRef.java ViciousCycleException.java
WhenBrokenReactor.java WhenResolvedReactor.java
src/jsrc/org/erights/e/elib/sealing Amplifiable.java
Brand.java SealedBox.java Sealer.java Unsealer.java
UnsealingException.java
src/jsrc/org/erights/e/elib/serial PassByConstruction.java
PassByConstructionGuard.java PassByProxy.java
PassByProxyGuard.java PersistenceReplacer.java
PersistenceResolver.java Persistent.java
RemoteCall.java RemoteDelivery.java Serializer.java
Unserializer.java
src/jsrc/org/erights/e/elib/slot FinalSlot.java
FinalSlotMaker.java NullOkMaker.java
RuinedSlot.java SettableSlot.java
SettableSlotMaker.java SimpleSlot.java
SimpleSlotMaker.java Slot.java SlotDefiner.java
SlotGuard.java ValueGuard.java VoidMaker.java
src/jsrc/org/erights/e/elib/tables ArrayedList.java
AssocFunc.java AtomicTwine.java Column.java
CompFunc.java CompositeTwine.java ConstList.java
ConstListImpl.java ConstMap.java ConstMapImpl.java
ConstSubclassSet.java CycleBreaker.java EList.java
EMap.java EmptyTwine.java EqualityKeyColumn.java
Equalizer.java FlexList.java FlexListImpl.java
FlexMap.java FlexMapImpl.java
IdentityKeyColumn.java IdentityMap.java
IndirectCompFunc.java IntColumn.java IntTable.java
KeyColumn.java LocatedTwine.java
NotSettledException.java ROList.java ROMap.java
RefColumn.java SamenessKeyColumn.java
ScalarColumn.java Selfless.java ShareCount.java
SimpleCompFunc.java SimpleTwine.java Twine.java
VoidColumn.java WeakKey.java WeakKeyMap.java
WeakValue.java WeakValueMap.java
src/jsrc/org/erights/e/elib/tests TestELib.java
TestMultiQ.java
src/jsrc/org/erights/e/elib/util
AlreadyDefinedException.java
ArityMismatchException.java ClassCache.java
ConditionLock.java DeadManSwitch.java
DynamicCollection.java
DynamicCollectionEnumeration.java
HexStringUtils.java IdentityFunc.java Once.java
OneArgFunc.java TwineException.java
src/jsrc/org/erights/e/extern/file ConsoleInputHandler.java
ConsoleMaker.java ConsoleThread.java
src/jsrc/org/erights/e/extern/timer Clock.java
TickReactor.java Timeout.java Timer.java
TimerQEntry.java TimerThread.java TimerWatcher.java
src/jsrc/org/erights/e/meta/java/awt ComponentSugar.java
ContainerSugar.java
src/jsrc/org/erights/e/meta/java/awt/event
ActionListenerDeflector.java
FocusListenerDeflector.java
KeyListenerDeflector.java
MouseListenerDeflector.java WindowEventSugar.java
WindowListenerDeflector.java
src/jsrc/org/erights/e/meta/java/io BufferedReaderSugar.java
FileGetter.java FileSugar.java
InputStreamSugar.java ReadOnlyFile.java
ReaderSugar.java
src/jsrc/org/erights/e/meta/java/lang ArrayGuardSugar.java
BooleanSugar.java Bufferer.java ByteGuardSugar.java
CharacterSugar.java ClassGuardSugar.java
DoubleGuardSugar.java DoubleSugar.java
FloatGuardSugar.java IntegerGuardSugar.java
InterfaceGuardSugar.java LongGuardSugar.java
ProcessSugar.java RunnableDeflector.java
ShortGuardSugar.java StringBufferSugar.java
StringGuardSugar.java VoidGuardSugar.java
src/jsrc/org/erights/e/meta/java/math
BigIntegerGuardSugar.java BigIntegerMakerSugar.java
BigIntegerSugar.java
src/jsrc/org/erights/e/meta/java/net URLSugar.java
src/jsrc/org/erights/e/meta/java/util DictionarySugar.java
EnumerationDeflector.java EnumerationSugar.java
VectorSugar.java
src/jsrc/org/erights/e/meta/javax/swing/event
ListSelectionListenerDeflector.java
src/jsrc/org/erights/e/meta/net/vattp/data
MsgHandlerDeflector.java
NewConnectionReactorDeflector.java
src/jsrc/org/erights/e/meta/org/erights/e/elang/visitors
ETreeVisitorDeflector.java
src/jsrc/org/erights/e/meta/org/erights/e/elib/base
ThunkDeflector.java TypeDescGuardSugar.java
src/jsrc/org/erights/e/meta/org/erights/e/elib/ref
RefGuardSugar.java
src/jsrc/org/erights/e/meta/org/erights/e/elib/slot
SlotDeflector.java SlotGuardDeflector.java
SlotGuardGuardSugar.java ValueGuardDeflector.java
ValueGuardGuardSugar.java
src/jsrc/org/erights/e/meta/org/erights/e/elib/tables
AssocFuncDeflector.java EListGuardSugar.java
src/jsrc/org/erights/e/meta/org/erights/e/elib/util
OneArgFuncDeflector.java
src/jsrc/org/erights/e/meta/org/erights/e/extern/timer
TickReactorDeflector.java
src/jsrc/org/erights/e/ui/elmer EInterpAdapter.java
ElmerMain.java
src/jsrc/org/erights/e/ui/jed BrickLayer.java EAction.java
EDismissListener.java EItemListener.java
EMenuBar.java ETextChangedListener.java
EditGroup.java JedMain.java
Log:
just formatting and import cleanups
Revision Changes Path
1.3 +21 -21 e/src/jsrc/net/captp/jcomm/CapTPReplacer.java
Index: CapTPReplacer.java
===================================================================
RCS file: /cvs/e/src/jsrc/net/captp/jcomm/CapTPReplacer.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- CapTPReplacer.java 2001/08/29 00:20:15 1.2
+++ CapTPReplacer.java 2001/09/06 09:55:38 1.3
@@ -26,39 +26,39 @@
import org.erights.e.elib.util.OneArgFunc;
/**
- * Used to specialize the Serializer for encoding a reference over a CapTP
+ * Used to specialize the Serializer for encoding a reference over a CapTP
* connection.
* <p>
- * When our run method returns an {@link ObjectRefDesc}, the corresponding
- * decoded object is not simply this ObjectRefDesc. It is this ObjectRefDesc
- * as dereferenced by {@link CapTPResolver}.
+ * When our run method returns an {@link ObjectRefDesc}, the corresponding
+ * decoded object is not simply this ObjectRefDesc. It is this ObjectRefDesc
+ * as dereferenced by {@link CapTPResolver}.
*
* @author <a href="mailto:markm@erights.org">Mark S. Miller</a>
*/
/*package*/ class CapTPReplacer implements OneArgFunc {
-
- /**
- * The connection over which we are communicating
+
+ /**
+ * The connection over which we are communicating
*/
private ProxyConnection myConn;
/**
- *
+ *
*/
/*package*/ CapTPReplacer(ProxyConnection conn) {
myConn = conn;
}
-
+
/**
- * Replace any proxiable object (an implementer of PassByProxy, a Far
- * reference, a Promise, or a Broken reference) with an appropriate
- * over-the-wire representation, or if it's not a proxiable object, make
+ * Replace any proxiable object (an implementer of PassByProxy, a Far
+ * reference, a Promise, or a Broken reference) with an appropriate
+ * over-the-wire representation, or if it's not a proxiable object, make
* sure we're actually permitted to pass it by construction.
*/
public Object run(Object ref) {
ref = Ref.resolution(ref);
-
- //the following sequence of tests are cribbed from Ref.isPBC, except
+
+ //the following sequence of tests are cribbed from Ref.isPBC, except
//that we don't guard it with an isNear test, so as to include broken
//references.
if (null == ref) {
@@ -71,21 +71,21 @@
}
if (clazz.isArray()) {
//Because we try to pretend that arrays are PassByCopy lists,
- //we just pass arrays by copy. This is XXX a potential security
- //bug or at least a possible semantic confusion, since arrays are
- //not actually immutable. After passing, the original and passed
- //copy may diverge, whereas in an eventual send within a vat,
- //they wouldn't diverge.
+ //we just pass arrays by copy. This is XXX a potential security
+ //bug or at least a possible semantic confusion, since arrays are
+ //not actually immutable. After passing, the original and passed
+ //copy may diverge, whereas in an eventual send within a vat,
+ //they wouldn't diverge.
return ref;
}
if (PassByConstruction.HONORARY.has(clazz)) {
return ref;
}
//end PCB testing
-
+
if (Ref.isEventual(ref)) {
return myConn.makeEventualDesc(Ref.toRef(ref));
- }
+ }
if (Ref.isNear(ref)) {
if (Ref.isPassByProxy(ref)) {
return myConn.makeImportingDesc(ref);
1.3 +7 -7 e/src/jsrc/net/captp/jcomm/CapTPResolver.java
Index: CapTPResolver.java
===================================================================
RCS file: /cvs/e/src/jsrc/net/captp/jcomm/CapTPResolver.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- CapTPResolver.java 2001/08/29 00:20:15 1.2
+++ CapTPResolver.java 2001/09/06 09:55:38 1.3
@@ -31,22 +31,22 @@
* @author <a href="mailto:markm@erights.org">Mark S. Miller</a>
*/
/*package*/ class CapTPResolver implements OneArgFunc {
-
- /**
- * The connection over which we are communicating
+
+ /**
+ * The connection over which we are communicating
*/
private ProxyConnection myConn;
-
+
/**
- *
+ *
*/
/*package*/ CapTPResolver(ProxyConnection conn) {
myConn = conn;
}
-
+
/**
- * Replace ObjectRefDescs in the input stream with the object reference
+ * Replace ObjectRefDescs in the input stream with the object reference
* they {@link ObjectRefDesc#dereference(ProxyConnection)} to.
*/
public Object run(Object ref) {
1.7 +46 -46 e/src/jsrc/net/captp/jcomm/DelayedRedirector.java
Index: DelayedRedirector.java
===================================================================
RCS file: /cvs/e/src/jsrc/net/captp/jcomm/DelayedRedirector.java,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -r1.6 -r1.7
--- DelayedRedirector.java 2001/08/29 00:20:15 1.6
+++ DelayedRedirector.java 2001/09/06 09:55:38 1.7
@@ -18,102 +18,102 @@
The Initial Developer of the Original Code is Mark S. Miller.
Copyright (C) 1999 Mark S. Miller. All Rights Reserved.
-Contributor(s): ______________________________________.
+Contributor(s): ______________________________________.
*/
import org.erights.e.elib.prim.E;
-import org.erights.e.elib.ref.Ref;
import org.erights.e.elib.ref.ProxyResolver;
+import org.erights.e.elib.ref.Ref;
import org.erights.e.elib.ref.Resolver;
-import org.erights.e.elib.util.DeadManSwitch;
-import org.erights.e.elib.util.OneArgFunc;
import org.erights.e.elib.sealing.Brand;
import org.erights.e.elib.sealing.SealedBox;
import org.erights.e.elib.sealing.Unsealer;
import org.erights.e.elib.serial.PassByProxy;
+import org.erights.e.elib.util.DeadManSwitch;
+import org.erights.e.elib.util.OneArgFunc;
/**
- * Wraps a ProxyResolver for a RemotePromise in a way suitable for inclusion
- * as an argument in the first whenMoreResolved message, in order to preserve
- * reference-full-order.
+ * Wraps a ProxyResolver for a RemotePromise in a way suitable for inclusion
+ * as an argument in the first whenMoreResolved message, in order to preserve
+ * reference-full-order.
*
* @author Mark S. Miller
*/
-/*package*/ class DelayedRedirector
+/*package*/ class DelayedRedirector
implements DeadManSwitch, OneArgFunc, PassByProxy {
-
+
/**
*
*/
private ProxyResolver myOptResolver;
-
+
/**
*
*/
/*package*/ DelayedRedirector(ProxyResolver resolver) {
myOptResolver = resolver;
}
-
+
/**
- * On the first response, send a second whenMoreResolved on the original
- * RemotePromise, and then resolve the ProxyResolver to a Promise that
- * will be resolved by the answer to this second whenMoreResolved.
+ * On the first response, send a second whenMoreResolved on the original
+ * RemotePromise, and then resolve the ProxyResolver to a Promise that
+ * will be resolved by the answer to this second whenMoreResolved.
* <p>
- * This ensures that all messages have drained out of the previous path
- * before enabling the new path. Once I've done my one-time-job, I
- * become inoperative.
+ * This ensures that all messages have drained out of the previous path
+ * before enabling the new path. Once I've done my one-time-job, I
+ * become inoperative.
* <p>
- * The argument of this first response is ignored (thanks Dean!). The
- * argument of the second response is used as the true resolution of my
+ * The argument of this first response is ignored (thanks Dean!). The
+ * argument of the second response is used as the true resolution of my
* RemotePromise.
*/
public Object run(Object target) {
if (null == myOptResolver) {
- //If my RemotePromise is already resolved, then ignore further
+ //If my RemotePromise is already resolved, then ignore further
//resolution attempts
return null;
}
-
- RemotePromiseHandler rvh =
+
+ RemotePromiseHandler rvh =
(RemotePromiseHandler)myOptResolver.optHandler();
if (rvh.isFresh()) {
- //If no messages have yet been sent over my RemotePromise, then
- //there's no message ordering issue, so resolve to target
- //immediately.
+ //If no messages have yet been sent over my RemotePromise, then
+ //there's no message ordering issue, so resolve to target
+ //immediately.
myOptResolver.resolve(target);
return null;
}
-
+
ProxyConnection conn = rvh.myConn;
Unsealer unsealer = conn.getUnsealer();
Brand brand = unsealer.brand();
SealedBox optTargetBox = Ref.optMeta(target, brand);
- RemoteHandler optTargetHandler =
+ RemoteHandler optTargetHandler =
(RemoteHandler)unsealer.unseal(optTargetBox, RemoteHandler.class);
if (null != optTargetHandler && conn == optTargetHandler.myConn) {
-
- //If the new target is a remote reference into the same vat that
- //my RemotePromise is into, then messages to be sent over target
- //will only arrive after messages previously sent on this
- //RemotePromise, so again there's no message ordering issue, and
+
+ //If the new target is a remote reference into the same vat that
+ //my RemotePromise is into, then messages to be sent over target
+ //will only arrive after messages previously sent on this
+ //RemotePromise, so again there's no message ordering issue, and
//we can resolve to target immediately.
-
+
myOptResolver.resolve(target);
return null;
}
-
- //If we fall through the above special cases, then we're in the
- //general case, where we do need to deal with the message ordering
- //issue. In this case, ignore the run/1 argument, send a last
- //whenMoreResolved/1 message over the RemotePromise with a simple
- //redirector as argument, and then resolve to a promise whose
- //resolver is held by that redirector.
+
+ //If we fall through the above special cases, then we're in the
+ //general case, where we do need to deal with the message ordering
+ //issue. In this case, ignore the run/1 argument, send a last
+ //whenMoreResolved/1 message over the RemotePromise with a simple
+ //redirector as argument, and then resolve to a promise whose
+ //resolver is held by that redirector.
//
- //This will locally buffer messages until all previous messages have
- //been drained out, and will then resolve to the argument of the
- //second run/1 message (thereby delivering all buffered messages as
- //well).
-
+ //This will locally buffer messages until all previous messages have
+ //been drained out, and will then resolve to the argument of the
+ //second run/1 message (thereby delivering all buffered messages as
+ //well).
+
Object[] pair = Ref.promise();
Redirector rdr = new Redirector((Resolver)pair[1]);
E.sendOnly(myOptResolver.getProxy(), "whenMoreResolved", rdr);
@@ -121,7 +121,7 @@
myOptResolver = null;
return null;
}
-
+
/**
* Smash the ProxyResolver with the arg.
*/
1.5 +4 -3 e/src/jsrc/net/captp/jcomm/Far3Desc.java
Index: Far3Desc.java
===================================================================
RCS file: /cvs/e/src/jsrc/net/captp/jcomm/Far3Desc.java,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -r1.4 -r1.5
--- Far3Desc.java 2001/08/20 21:17:49 1.4
+++ Far3Desc.java 2001/09/06 09:55:38 1.5
@@ -19,11 +19,12 @@
Contributor(s): ______________________________________.
*/
-import java.math.BigInteger;
import net.captp.tables.Vine;
import org.erights.e.develop.trace.Trace;
import org.erights.e.elib.tables.ConstList;
+import java.math.BigInteger;
+
/**
* The encoding of FarRef over the wire to someone other than the vat
* it points into. <p>
@@ -34,9 +35,9 @@
* @author Mark Miller
*/
/*package*/ class Far3Desc implements ObjectRefDesc {
-
+
static private final long serialVersionUID = 1183670781832213637L;
-
+
private ConstList mySearchPath;
private String myHostID;
private BigInteger myNonce;
1.4 +4 -4 e/src/jsrc/net/captp/jcomm/FarHandler.java
Index: FarHandler.java
===================================================================
RCS file: /cvs/e/src/jsrc/net/captp/jcomm/FarHandler.java,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- FarHandler.java 2001/05/03 08:58:44 1.3
+++ FarHandler.java 2001/09/06 09:55:38 1.4
@@ -22,13 +22,13 @@
import java.math.BigInteger;
/**
- * A resolved reference that's still remote is necessarily a reference to a
- * PassByProxy object.
+ * A resolved reference that's still remote is necessarily a reference to a
+ * PassByProxy object.
*
* @author Mark S. Miller
*/
/*package*/ class FarHandler extends RemoteHandler {
-
+
/*package*/ BigInteger mySwissHash;
/**
@@ -36,7 +36,7 @@
*
* @param connection The ProxyConnection to communicate via
* @param pos The Imports or Questions map pos of the object
- * @param swissHash The identity (within the connection's remote vat) of
+ * @param swissHash The identity (within the connection's remote vat) of
* the object this FarRef designates.
*/
/*package*/ FarHandler(ProxyConnection conn,
1.5 +4 -4 e/src/jsrc/net/captp/jcomm/ImportDesc.java
Index: ImportDesc.java
===================================================================
RCS file: /cvs/e/src/jsrc/net/captp/jcomm/ImportDesc.java,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -r1.4 -r1.5
--- ImportDesc.java 2001/08/20 21:17:49 1.4
+++ ImportDesc.java 2001/09/06 09:55:38 1.5
@@ -32,11 +32,11 @@
* @author Mark Miller
*/
/*package*/ class ImportDesc implements ObjectRefDesc {
-
+
static private final long serialVersionUID = 5581130955096436339L;
-
+
private int myImportPos;
-
+
/**
*
*/
@@ -60,7 +60,7 @@
public Object dereference(ProxyConnection conn) {
validate();
Ref result = conn.getImport(myImportPos);
-
+
if (Trace.captp.debug && Trace.ON) {
Trace.captp.debugm("" + conn + "." + this.toString());
}
1.5 +2 -2 e/src/jsrc/net/captp/jcomm/IncomingDesc.java
Index: IncomingDesc.java
===================================================================
RCS file: /cvs/e/src/jsrc/net/captp/jcomm/IncomingDesc.java,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -r1.4 -r1.5
--- IncomingDesc.java 2001/08/20 21:17:49 1.4
+++ IncomingDesc.java 2001/09/06 09:55:38 1.5
@@ -33,9 +33,9 @@
* @author Mark Miller
*/
/*package*/ class IncomingDesc implements ObjectRefDesc {
-
+
static private final long serialVersionUID = 7071220903919564143L;
-
+
private int myIncomingPos;
/**
1.12 +52 -51 e/src/jsrc/net/captp/jcomm/Introducer.java
Index: Introducer.java
===================================================================
RCS file: /cvs/e/src/jsrc/net/captp/jcomm/Introducer.java,v
retrieving revision 1.11
retrieving revision 1.12
diff -u -r1.11 -r1.12
--- Introducer.java 2001/08/17 03:11:32 1.11
+++ Introducer.java 2001/09/06 09:55:38 1.12
@@ -1,27 +1,23 @@
package net.captp.jcomm;
/*
-The contents of this file are subject to the Electric Communities E Open
-Source Code License Version 1.0 (the "License"); you may not use this file
-except in compliance with the License. You may obtain a copy of the License
+The contents of this file are subject to the Electric Communities E Open
+Source Code License Version 1.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.communities.com/EL/.
-Software distributed under the License is distributed on an "AS IS" basis,
-WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License for
+Software distributed under the License is distributed on an "AS IS" basis,
+WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License for
the specific language governing rights and limitations under the License.
-The Original Code is the Distributed E Language Implementation, released
-July 20, 1998.
+The Original Code is the Distributed E Language Implementation, released
+July 20, 1998.
-The Initial Developer of the Original Code is Electric Communities.
-Copyright (C) 1998 Electric Communities. All Rights Reserved.
+The Initial Developer of the Original Code is Electric Communities.
+Copyright (C) 1998 Electric Communities. All Rights Reserved.
Contributor(s): ______________________________________.
*/
-import java.io.IOException;
-import java.net.MalformedURLException;
-import java.net.UnknownHostException;
-import java.security.KeyPair;
import net.captp.tables.SwissTable;
import net.vattp.data.EARL;
import net.vattp.data.NetConfig;
@@ -35,37 +31,42 @@
import org.erights.e.elib.tables.ConstMap;
import org.erights.e.extern.timer.Timer;
+import java.io.IOException;
+import java.net.MalformedURLException;
+import java.net.UnknownHostException;
+import java.security.KeyPair;
+
/**
- * This object is in the E-language programmer's top level namespace as the
+ * This object is in the E-language programmer's top level namespace as the
* representative of the CapTP system.
*
- * An Introducer may already have an identity assigned, in which case it's
- * identified, or not, in which case it's unidentified. Introducers start
+ * An Introducer may already have an identity assigned, in which case it's
+ * identified, or not, in which case it's unidentified. Introducers start
* off unidentified, but once identified, always identified.
*
- * An Introducer may be on-the-air or off-the-air. If an unidentified
- * Introducer goes on-the-air, it will first (privately) generate an identity
- * to identify itself. Since only an identified Introducer may be
- * on-the-air, we have three states altogether. For now, an on-the-air
- * Introducer doesn't yet have a way to go back off-the-air, but we expect to
- * add such an operation.
+ * An Introducer may be on-the-air or off-the-air. If an unidentified
+ * Introducer goes on-the-air, it will first (privately) generate an identity
+ * to identify itself. Since only an identified Introducer may be
+ * on-the-air, we have three states altogether. For now, an on-the-air
+ * Introducer doesn't yet have a way to go back off-the-air, but we expect to
+ * add such an operation.
*
* @author Mark S. Miller, markm@caplet.com
*/
public class Introducer implements PassByProxy, Persistent {
-
+
/** Changes by going on-the-air */
NetConfig myNetConfig;
ESecureRandom myEntropy;
Timer myPersistentTimer;
-
+
/** if identified */
KeyPair myOptVatIdentity = null;
/** if identified */
SwissTable myOptSwissTable = null;
/** if on-the-air */
LocatorUnum myOptLocatorUnum = null;
-
+
/**
*
*/
@@ -107,23 +108,23 @@
}
myNetConfig = newNetConfig;
}
-
+
/**
- * Is this Introducer's identity (and therefore, this vat's identity)
- * already determined?
+ * Is this Introducer's identity (and therefore, this vat's identity)
+ * already determined?
*/
public boolean hasIdentity() {
return null != myOptVatIdentity;
}
/**
- * If no identity has yet been determined, generate a new one, and return
+ * If no identity has yet been determined, generate a new one, and return
* its public/private key pair.
* <p>
- * This pair conveys the authority to claim to be this vat, so guard it
+ * This pair conveys the authority to claim to be this vat, so guard it
* well.
- *
- * @exception SecurityException if an identity has already been
+ *
+ * @exception SecurityException if an identity has already been
* determined.
*/
public KeyPair newVatIdentity() {
@@ -136,16 +137,16 @@
}
/**
- * If no identity has yet been determined, become identified as the
+ * If no identity has yet been determined, become identified as the
* identity represented by this key pair.
* <p>
- * To implement identity-persistence, the birth incarnation of a vat
- * should do a newVatIdentity and remember the resulting key pair.
- * Reincarnations of the "same" vat should then do a setVatIdentity with
- * the saved identity, in order to be the reincarnation of the previous
- * vat.
- *
- * @exception SecurityException if an identity has already been
+ * To implement identity-persistence, the birth incarnation of a vat
+ * should do a newVatIdentity and remember the resulting key pair.
+ * Reincarnations of the "same" vat should then do a setVatIdentity with
+ * the saved identity, in order to be the reincarnation of the previous
+ * vat.
+ *
+ * @exception SecurityException if an identity has already been
* determined.
*/
public void setVatIdentity(KeyPair identity) {
@@ -153,7 +154,7 @@
throw new SecurityException("Already identified");
}
myOptVatIdentity = identity;
- //XXX since we're not using it to generate a key pair, is there
+ //XXX since we're not using it to generate a key pair, is there
//anything else we need to do so myEntropy will be ready?
myOptSwissTable = new SwissTable(myEntropy);
}
@@ -167,9 +168,9 @@
}
return myOptSwissTable;
}
-
+
/**
- * The fingerprint of the public key of this Introducers identity (and
+ * The fingerprint of the public key of this Introducers identity (and
* therefore, this vat's identity). <p>
*
* An identity must have already been determined.
@@ -191,24 +192,24 @@
/**
* Become able to communicate. <p>
*
- * Change NetConfig according to the listen addresses we actually
+ * Change NetConfig according to the listen addresses we actually
* acquired. Return the list of negotiable protocols. <p>
*
- * If not yet identified, this will privately generate a new vat
- * identity, but not reveal it through any public protocol. Therefore,
- * applications that wish to do their own identity-persistence must first
+ * If not yet identified, this will privately generate a new vat
+ * identity, but not reveal it through any public protocol. Therefore,
+ * applications that wish to do their own identity-persistence must first
* call either newVatIdentity() or setVatIdentity(..).
*/
- public ConstList onTheAir()
+ public ConstList onTheAir()
throws UnknownHostException, IOException {
if (isOnTheAir()) {
return negotiable();
}
-
+
if (! hasIdentity()) {
newVatIdentity();
}
-
+
/* Turn on the comm system... */
ProxyMgr proxyMgr = new ProxyMgr(myOptVatIdentity,
myNetConfig,
@@ -230,7 +231,7 @@
}
/**
- * Same as sturdyFromURI, but named get/1 so the introducer can be used
+ * Same as sturdyFromURI, but named get/1 so the introducer can be used
* as a URIGetter.
*/
public SturdyRef get(String uriBody) throws MalformedURLException {
1.9 +32 -31 e/src/jsrc/net/captp/jcomm/LocatorUnum.java
Index: LocatorUnum.java
===================================================================
RCS file: /cvs/e/src/jsrc/net/captp/jcomm/LocatorUnum.java,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -r1.8 -r1.9
--- LocatorUnum.java 2001/08/29 00:20:15 1.8
+++ LocatorUnum.java 2001/09/06 09:55:38 1.9
@@ -21,51 +21,52 @@
Contributor(s): ______________________________________.
*/
-import java.io.IOException;
-import java.math.BigInteger;
import net.captp.tables.SwissTable;
import org.erights.e.develop.trace.Trace;
import org.erights.e.elib.prim.E;
import org.erights.e.elib.serial.Persistent;
import org.erights.e.elib.tables.ConstList;
+import java.io.IOException;
+import java.math.BigInteger;
+
/**
- * Each instance of this class represents a presence of the pervasive
+ * Each instance of this class represents a presence of the pervasive
* LocatorUnum service.
* <p>
- * For Una in general: To hold a reference to any presence of the Unum is
- * conceptually to hold a reference to the Unum as a whole. Therefore, a
- * reference to the Unum may as well always be a reference to a local
- * presence of the Unum. Since it can be, and since this would provide better
- * service, we specify that all references to an Unum will be local.
+ * For Una in general: To hold a reference to any presence of the Unum is
+ * conceptually to hold a reference to the Unum as a whole. Therefore, a
+ * reference to the Unum may as well always be a reference to a local
+ * presence of the Unum. Since it can be, and since this would provide better
+ * service, we specify that all references to an Unum will be local.
* <p>
- * Therefore, an encoded reference to a presence of Unum that's local to the
- * sending side will be decoded as a reference to a presence of the same Unum
- * local to the receiving side. Therefore, a fulfilled reference to an Unum is
- * always
- * <a href="http://www.erights.org/elib/concurrency/refmech.html">Near</a>,
+ * Therefore, an encoded reference to a presence of Unum that's local to the
+ * sending side will be decoded as a reference to a presence of the same Unum
+ * local to the receiving side. Therefore, a fulfilled reference to an Unum is
+ * always
+ * <a href="http://www.erights.org/elib/concurrency/refmech.html">Near</a>,
* and therefore a reference to an Unum is always eventually Near or Broken.
* <p>
- * The LocatorUnum is the only Unum built in to E itself, and the only Unum
- * currently supported. It represents the pervasive vatID/swissNumber lookup
- * service built jointly out of all vats and VLSes. It is used only by
- * SturdyRefs to establish their authority to perform a lookup, and to enable
+ * The LocatorUnum is the only Unum built in to E itself, and the only Unum
+ * currently supported. It represents the pervasive vatID/swissNumber lookup
+ * service built jointly out of all vats and VLSes. It is used only by
+ * SturdyRefs to establish their authority to perform a lookup, and to enable
* SturdyRefs to maintain this authority as they are copied between vats.
*
* @author Mark S. Miller
*/
public class LocatorUnum implements Persistent {
-
+
/**
* XXX Need to recover a valid value somehow on revival
*/
private transient SwissTable mySwissTable;
-
+
/**
* XXX Need to recover a valid value somehow on revival
*/
private transient ProxyMgr myProxyMgr;
-
+
/**
*
*/
@@ -73,31 +74,31 @@
mySwissTable = swissTable;
myProxyMgr = proxyMgr;
}
-
+
/**
* The basic operation underlying 'SturdyRef.getGrip()'. This is where
- * a reference to a remote object actually gets the various underlying
+ * a reference to a remote object actually gets the various underlying
* comm systems connected so that we can send messages.
*
* @param searchPath A list of places to try to find the vat
- * @param vatID The vat from which the object reference should be
- * obtained
+ * @param vatID The vat from which the object reference should be
+ * obtained
* @param swissNum The SwissNumber of the desired object
- * @param optFarVine Optional object for holding onto a Remote reference
- * via whoever we got it from long enough to fetch our
- * own Remote reference via this lookup.
+ * @param optFarVine Optional object for holding onto a Remote reference
+ * via whoever we got it from long enough to fetch our
+ * own Remote reference via this lookup.
*/
public Object getGrip(ConstList searchPath,
- String vatID,
+ String vatID,
BigInteger swissNum,
Object optFarVine)
throws IOException, IndexOutOfBoundsException {
if (Trace.captp.debug && Trace.ON) {
Trace.captp.debugm
- ("" + this + ".getGrip(" + searchPath + ", " + vatID +
+ ("" + this + ".getGrip(" + searchPath + ", " + vatID +
", " + swissNum + ", " + optFarVine + ")");
}
- ProxyConnection optProxyConn =
+ ProxyConnection optProxyConn =
myProxyMgr.getOrMakeProxyConnection(searchPath, vatID);
if (optProxyConn == null) {
@@ -108,7 +109,7 @@
Object remoteNonceLocator = optProxyConn.getRemoteNonceLocator();
return E.send(remoteNonceLocator,
"lookupSwiss",
- swissNum,
+ swissNum,
optFarVine);
}
}
1.3 +1 -1 e/src/jsrc/net/captp/jcomm/LookupHandler.java
Index: LookupHandler.java
===================================================================
RCS file: /cvs/e/src/jsrc/net/captp/jcomm/LookupHandler.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- LookupHandler.java 2001/08/13 01:47:02 1.2
+++ LookupHandler.java 2001/09/06 09:55:38 1.3
@@ -21,7 +21,7 @@
/**
- * A handler for the special remote reference at position zero to the other
+ * A handler for the special remote reference at position zero to the other
* side's NonceLocator
*
* @author Mark S. Miller
1.6 +8 -7 e/src/jsrc/net/captp/jcomm/NewFarDesc.java
Index: NewFarDesc.java
===================================================================
RCS file: /cvs/e/src/jsrc/net/captp/jcomm/NewFarDesc.java,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -r1.5 -r1.6
--- NewFarDesc.java 2001/08/20 21:17:49 1.5
+++ NewFarDesc.java 2001/09/06 09:55:38 1.6
@@ -19,10 +19,11 @@
Contributor(s): ______________________________________.
*/
-import java.math.BigInteger;
import org.erights.e.develop.trace.Trace;
import org.erights.e.elib.ref.Ref;
+import java.math.BigInteger;
+
/**
* The first-time encoding of an exported pass-by-proxy object over
* the wire, to be imported as a new Far reference. <p>
@@ -35,12 +36,12 @@
* @author Mark Miller
*/
/*package*/ class NewFarDesc implements ObjectRefDesc {
-
+
static private final long serialVersionUID = 2229110355967576618L;
-
+
private int myImportPos;
private BigInteger mySwissHash;
-
+
/**
*
*/
@@ -52,7 +53,7 @@
if (null == mySwissHash || mySwissHash.signum() <= 0) {
throw new RuntimeException("swissHash must be positive: " +
mySwissHash);
- }
+ }
}
/**
@@ -65,13 +66,13 @@
}
/**
- * What the other side exported, we dereference as the "new" Far
+ * What the other side exported, we dereference as the "new" Far
* reference we will now import.
*/
public Object dereference(ProxyConnection conn) {
validate();
Ref result = conn.newFarRef(myImportPos, mySwissHash);
-
+
if (Trace.captp.debug && Trace.ON) {
Trace.captp.debugm("" + conn + "." + this.toString());
}
1.3 +8 -7 e/src/jsrc/net/captp/jcomm/NewRemotePromiseDesc.java
Index: NewRemotePromiseDesc.java
===================================================================
RCS file: /cvs/e/src/jsrc/net/captp/jcomm/NewRemotePromiseDesc.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- NewRemotePromiseDesc.java 2001/08/21 14:28:14 1.2
+++ NewRemotePromiseDesc.java 2001/09/06 09:55:38 1.3
@@ -20,6 +20,7 @@
*/
import org.erights.e.develop.trace.Trace;
+
import java.math.BigInteger;
/**
@@ -28,15 +29,15 @@
*
* This is a separate class because the first time we export we also
* need to hook up the redirector, whereas the rest of the time we
- * can just use ImportDesc(importPos).
+ * can just use ImportDesc(importPos).
*
* @author Chip Morningstar
* @author Mark Miller
*/
/*package*/ class NewRemotePromiseDesc implements ObjectRefDesc {
-
+
static private final long serialVersionUID = -6186892267621515701L;
-
+
private int myImportPos;
private int myRdrPos;
private BigInteger myRdrBase;
@@ -56,7 +57,7 @@
if (null == myRdrBase || myRdrBase.signum() <= 0) {
throw new RuntimeException("rdrBase must be positive: " +
myRdrBase);
- }
+ }
}
/**
@@ -76,9 +77,9 @@
public Object dereference(ProxyConnection conn) {
Object result = conn.newRemotePromise(myImportPos,
- myRdrPos,
+ myRdrPos,
myRdrBase);
-
+
if (Trace.captp.debug && Trace.ON) {
Trace.captp.debugm("ProxyConnection " + conn +
" deref " + toString());
@@ -90,7 +91,7 @@
*
*/
public String toString() {
- return "NewRemotePromiseDesc(" + myImportPos + ", " +
+ return "NewRemotePromiseDesc(" + myImportPos + ", " +
myRdrPos + ", " +
myRdrBase + ")";
}
1.7 +34 -33 e/src/jsrc/net/captp/jcomm/NonceLocator.java
Index: NonceLocator.java
===================================================================
RCS file: /cvs/e/src/jsrc/net/captp/jcomm/NonceLocator.java,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -r1.6 -r1.7
--- NonceLocator.java 2001/08/29 00:20:15 1.6
+++ NonceLocator.java 2001/09/06 09:55:38 1.7
@@ -21,51 +21,52 @@
Contributor(s): ______________________________________.
*/
-import java.io.IOException;
-import java.math.BigInteger;
-import net.captp.tables.PromiseGiftTable;
import net.captp.tables.NearGiftTable;
+import net.captp.tables.PromiseGiftTable;
import net.captp.tables.SwissTable;
import net.captp.tables.Vine;
import org.erights.e.develop.trace.Trace;
import org.erights.e.elib.ref.Ref;
import org.erights.e.meta.java.math.BigIntegerSugar;
+import java.io.IOException;
+import java.math.BigInteger;
+
/**
* Made magically available at incoming position 0.
* <p>
- * Used to resolve 3-vat live Granovetter introductions, and to log tracing
+ * Used to resolve 3-vat live Granovetter introductions, and to log tracing
* info sent from the other vat.
*
* @author Mark S. Miller
*/
public class NonceLocator {
-
+
/**
*
*/
private PromiseGiftTable myPGifts;
-
+
/**
*
*/
private NearGiftTable myNGifts;
-
+
/**
*
*/
private String myOwnID;
-
+
/**
*
*/
private ProxyMgr myProxyMgr;
-
+
/**
*
*/
private SwissTable mySwissTable;
-
+
/**
*
*/
@@ -81,7 +82,7 @@
myProxyMgr = proxyMgr;
mySwissTable = swissTable;
}
-
+
/**
*
*/
@@ -91,7 +92,7 @@
{
return myPGifts.provideFor(gift, recipID, nonce);
}
-
+
/**
*
*/
@@ -103,7 +104,7 @@
if (! Ref.isNear(gift)) {
throw new RuntimeException("not Near: " + gift);
}
- //If gift isn't Selfish, this will throw an exception,
+ //If gift isn't Selfish, this will throw an exception,
//which is as it should be.
BigInteger giftSwiss = mySwissTable.getIdentity(gift);
BigInteger giftHash = BigIntegerSugar.cryptoHash(giftSwiss);
@@ -112,14 +113,14 @@
}
return myNGifts.provideFor(gift, recipID, nonce, swissHash);
}
-
+
/**
*
- * @param donorID The vatID of the vat (Alice, the gift giver) that
+ * @param donorID The vatID of the vat (Alice, the gift giver) that
* provided the gift we're picking up.
- * @param nonce Identifies (together with myOwnID) the gift in the
+ * @param nonce Identifies (together with myOwnID) the gift in the
* donor's table.
- * @param optFarVine Justs hold onto it until the request is done, to
+ * @param optFarVine Justs hold onto it until the request is done, to
* prevent it from being gced.
*/
public Object acceptFrom(String donorID,
@@ -133,17 +134,17 @@
PromiseGiftTable donorTable = optDonorConn.getPromiseGiftTable();
return donorTable.acceptFor(myOwnID, nonce);
}
-
+
/**
*
- * @param donorID The vatID of the vat (Alice, the gift giver) that
+ * @param donorID The vatID of the vat (Alice, the gift giver) that
* provided the gift we're picking up.
- * @param nonce Identifies (together with myOwnID) the gift in the
+ * @param nonce Identifies (together with myOwnID) the gift in the
* donor's table.
- * @param swissHash The gift should only be returned if it has this
- * identity. Otherwise the recipient should get a
- * DisconnectedRef. This isn't yet fully implemented.
- * @param optFarVine Justs hold onto it until the request is done, to
+ * @param swissHash The gift should only be returned if it has this
+ * identity. Otherwise the recipient should get a
+ * DisconnectedRef. This isn't yet fully implemented.
+ * @param optFarVine Justs hold onto it until the request is done, to
* prevent it from being gced.
*/
public Object acceptFrom(String donorID,
@@ -158,40 +159,40 @@
NearGiftTable donorTable = optDonorConn.getNearGiftTable();
Object result = donorTable.acceptFor(myOwnID, nonce, swissHash);
if (! Ref.isNear(result)) {
- throw new RuntimeException("internal: non-near gift for " +
+ throw new RuntimeException("internal: non-near gift for " +
swissHash);
}
- //If result isn't Selfish, this will throw an exception,
+ //If result isn't Selfish, this will throw an exception,
//which is as it should be.
BigInteger id = mySwissTable.getIdentity(result);
BigInteger idHash = BigIntegerSugar.cryptoHash(id);
if (! swissHash.equals(idHash)) {
- throw new RuntimeException("internal: hash mismatch: " +
+ throw new RuntimeException("internal: hash mismatch: " +
swissHash);
}
return result;
}
-
+
/**
* Do nothing, letting the argument become garbage. <p>
*
- * The purpose of the message is to ensure that the argument isn't
+ * The purpose of the message is to ensure that the argument isn't
* garbage until the message is delivered.
*/
public void ignore(Object optFarVine) {}
-
+
/**
*
*/
public Object lookupSwiss(BigInteger swissNum, Object optFarVine) {
return mySwissTable.lookupSwiss(swissNum);
}
-
+
/**
* Enables our counterparty to log a message to our tracing system.
* <p>
- * These messages are tagged with the vatID of our counterparty. They
- * are logged at debug level, and currently to the "captp" subsystem.
+ * These messages are tagged with the vatID of our counterparty. They
+ * are logged at debug level, and currently to the "captp" subsystem.
* These should probably instead have their own subsystem.
*/
public void traceRemote(String message) {
1.5 +10 -9 e/src/jsrc/net/captp/jcomm/ObjectID.java
Index: ObjectID.java
===================================================================
RCS file: /cvs/e/src/jsrc/net/captp/jcomm/ObjectID.java,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -r1.4 -r1.5
--- ObjectID.java 2001/08/20 21:17:49 1.4
+++ ObjectID.java 2001/09/06 09:55:38 1.5
@@ -19,28 +19,29 @@
Contributor(s): ______________________________________.
*/
-import java.math.BigInteger;
-import org.erights.e.elib.serial.Persistent;
import org.erights.e.elib.serial.PassByConstruction;
+import org.erights.e.elib.serial.Persistent;
import org.erights.e.meta.java.math.BigIntegerSugar;
+import java.math.BigInteger;
+
/**
- * A pairing of a VatID and a SwissHash, uniquely identifying a Selfish
+ * A pairing of a VatID and a SwissHash, uniquely identifying a Selfish
* object without providing access to the object. <p>
*
* @author Chip Morningstar
* @author Mark Miller
*/
public class ObjectID implements Persistent, PassByConstruction {
-
+
static private final long serialVersionUID = 2221338666124259513L;
-
+
/** The vat this ID is relative to (i.e., the vat that created this ID). */
private String myVatID;
/** The object's identity, relative to that vat */
private BigInteger mySwissHash;
-
+
/**
* Construct an object identifier given the SwissHash directly
*/
@@ -61,7 +62,7 @@
return false;
}
}
-
+
/**
*
*/
@@ -82,12 +83,12 @@
public BigInteger getSwissHash() {
return mySwissHash;
}
-
+
/**
*
*/
public String toString() {
- return (myVatID.substring(0,4) + "/##" +
+ return (myVatID.substring(0,4) + "/##" +
BigIntegerSugar.toString64(mySwissHash).substring(0,4));
}
}
1.6 +1 -1 e/src/jsrc/net/captp/jcomm/ObjectRefDesc.java
Index: ObjectRefDesc.java
===================================================================
RCS file: /cvs/e/src/jsrc/net/captp/jcomm/ObjectRefDesc.java,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -r1.5 -r1.6
--- ObjectRefDesc.java 2001/08/20 21:17:49 1.5
+++ ObjectRefDesc.java 2001/09/06 09:55:38 1.6
@@ -37,7 +37,7 @@
* @author Mark Miller
*/
/*package*/ interface ObjectRefDesc extends PassByConstruction {
-
+
/**
* Return an appropriate object (eg, a Proxy) matching this
* description.
1.3 +5 -4 e/src/jsrc/net/captp/jcomm/Promise3Desc.java
Index: Promise3Desc.java
===================================================================
RCS file: /cvs/e/src/jsrc/net/captp/jcomm/Promise3Desc.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- Promise3Desc.java 2001/08/21 14:28:14 1.2
+++ Promise3Desc.java 2001/09/06 09:55:38 1.3
@@ -19,11 +19,12 @@
Contributor(s): ______________________________________.
*/
-import java.math.BigInteger;
import net.captp.tables.Vine;
import org.erights.e.develop.trace.Trace;
import org.erights.e.elib.tables.ConstList;
+import java.math.BigInteger;
+
/**
* The encoding of a RemotePromise over the wire to someone other than the
* vat it points into.
@@ -32,9 +33,9 @@
* @author Mark Miller
*/
/*package*/ class Promise3Desc implements ObjectRefDesc {
-
+
static private final long serialVersionUID = -3922505236390332859L;
-
+
private ConstList mySearchPath;
private String myHostID;
private BigInteger myNonce;
@@ -59,7 +60,7 @@
/**
* What the other side imported (from somebody other than
* ourselves), we dereference as a RemotePromise to the same
- * arrowhead.
+ * arrowhead.
*/
public Object dereference(ProxyConnection conn) {
if (Trace.captp.debug && Trace.ON) {
1.25 +123 -122 e/src/jsrc/net/captp/jcomm/ProxyConnection.java
Index: ProxyConnection.java
===================================================================
RCS file: /cvs/e/src/jsrc/net/captp/jcomm/ProxyConnection.java,v
retrieving revision 1.24
retrieving revision 1.25
diff -u -r1.24 -r1.25
--- ProxyConnection.java 2001/08/24 19:02:37 1.24
+++ ProxyConnection.java 2001/09/06 09:55:38 1.25
@@ -19,16 +19,11 @@
Contributor(s): ______________________________________.
*/
-import java.io.ByteArrayInputStream;
-import java.io.ByteArrayOutputStream;
-import java.io.IOException;
-import java.io.OptionalDataException;
-import java.math.BigInteger;
import net.captp.tables.AnswersTable;
import net.captp.tables.ExportsTable;
-import net.captp.tables.PromiseGiftTable;
import net.captp.tables.ImportsTable;
import net.captp.tables.NearGiftTable;
+import net.captp.tables.PromiseGiftTable;
import net.captp.tables.QuestionsTable;
import net.captp.tables.SwissTable;
import net.vattp.data.DataConnection;
@@ -40,9 +35,9 @@
import org.erights.e.develop.exception.ThrowableSugar;
import org.erights.e.develop.trace.Trace;
import org.erights.e.elib.prim.E;
+import org.erights.e.elib.ref.ProxyResolver;
import org.erights.e.elib.ref.Ref;
import org.erights.e.elib.ref.Resolver;
-import org.erights.e.elib.ref.ProxyResolver;
import org.erights.e.elib.sealing.Brand;
import org.erights.e.elib.sealing.SealedBox;
import org.erights.e.elib.sealing.Sealer;
@@ -53,8 +48,14 @@
import org.erights.e.elib.util.OneArgFunc;
import org.erights.e.meta.java.math.BigIntegerSugar;
+import java.io.ByteArrayInputStream;
+import java.io.ByteArrayOutputStream;
+import java.io.IOException;
+import java.io.OptionalDataException;
+import java.math.BigInteger;
+
/**
- * Object which manages a CapTP protocol connection to a remote
+ * Object which manages a CapTP protocol connection to a remote
* vat and which will receive incoming CapTP protocol messages.<p>
*
* The processMessage(byte[] message, DataConnection) method will be
@@ -62,7 +63,7 @@
*
* ProxyConnection manages four tables for 2-vat interactions:
* <UL>
- * <LI>Questions: Handlers for remote objects we requested </LI>
+ * <LI>Questions: Handlers for remote objects we requested </LI>
* <LI>Imports: Handlers for remote objects exported to us unsolicited </LI>
* <LI>Answers: Answers for remote Questions </LI>
* <LI>Exports: local objects matching remote Imports </LI>
@@ -71,7 +72,7 @@
* The four tables can be arranged into a matrix: <pre>
*
* | we generate pos | remote generates pos
- * | |
+ * | |
* --------------------+---------------------+----------------------
* outgoing remote ref | |
* we have handler | Questions | Imports
@@ -82,7 +83,7 @@
* remote has handler | + | -
* --------------------+---------------------+----------------------
* </pre>
- *
+ *
* When referencing an object or handler by pos number alone
* (independent of what table it should be looked up in), we
* distinguish the table by the sign of pos: Questions and Answers
@@ -101,37 +102,37 @@
*/
/*package*/ class ProxyConnection implements MsgHandler {
- /**
+ /**
* Queue delivery of message, no answer expected. <p>
*
* Start counting at 8 since the previous version of the protocol
- * (0.8.9) stopped at 7.
+ * (0.8.9) stopped at 7.
*/
static private final byte DELIVER_ONLY_OP = 8;
- /**
+ /**
* Queue delivery of message, resolve answer to the outcome.
* <p>
* DELIVER_OP as 9 had a different argument order
*/
static private final byte DELIVER_OP = 13;
- /**
- * An import on the other has gone away dropping some number of
- * wireCounts. Clean up the export table.
+ /**
+ * An import on the other has gone away dropping some number of
+ * wireCounts. Clean up the export table.
*/
static private final byte GC_EXPORT_OP = 10;
- /**
+ /**
* A question on the other has gone away. Clean up the answer table.
*/
static private final byte GC_ANSWER_OP = 11;
-
+
/**
* Please shut down the connection if you have no messages pending.
*/
static private final byte SHUTDOWN_OP = 12;
-
+
/** The ProxyMgr for our vat */
@@ -144,9 +145,9 @@
private DataConnection myDataConnection;
/**
- * Number of things (XXX what's a "thing"?) which are currently holding
+ * Number of things (XXX what's a "thing"?) which are currently holding
* the connection open
- */
+ */
private int myUseCount;
/** Number of messages sent on this connection */
@@ -158,35 +159,35 @@
/** Flag indicating we are in the midst of shutting down the connection */
private boolean myShuttingDownFlag;
- /**
+ /**
* If the connection died, anybody who talks to us will get this. <p>
*
* This should be null exactly when the connection is still alive.
*/
private Throwable myOptProblem;
- /**
- * Resolver of the promise used to buffer lookup requests made in midst
+ /**
+ * Resolver of the promise used to buffer lookup requests made in midst
* of connection shutdown.
- */
+ */
private Resolver myOptBufferedLookups;
-
+
/** Generates new swiss numbers */
private ESecureRandom myEntropy;
/**
- * The Questions table: these are handlers this end created and is
- * expecting the other end to hook up to the relevent objects themselves
+ * The Questions table: these are handlers this end created and is
+ * expecting the other end to hook up to the relevent objects themselves
* (e.g., results of sendAll()s).
*/
private QuestionsTable myQuestions;
- /**
+ /**
* The Answers table: this is the counterpart to the Questions table
* at the other end of the connection. <p>
*
* Messages sent through a handler in the questions table will be
- * delivered to the corresponding answer.
+ * delivered to the corresponding answer.
*/
private AnswersTable myAnswers;
@@ -204,23 +205,23 @@
*
* These are objects that have been exported from this end (i.e.,
* mentioned by us in the parameters of a message). The other end
- * installs them in the same spot in its Imports table.
+ * installs them in the same spot in its Imports table.
*/
private ExportsTable myExports;
-
+
/**
* At incoming position 0, for bringing about 3-vat introductions
- * using nonces.
+ * using nonces.
*/
private NonceLocator myLocalNonceLocator;
-
+
/**
* A remote reference to the other side's myLocalNonceLocator, at
* outgoing position 0, for bringing about 3-vat introductions
- * using nonces.
+ * using nonces.
*/
private Object myRemoteNonceLocator;
-
+
/**
* For bringing about 3-vat introductions of unresolved references
* using nonces.
@@ -229,7 +230,7 @@
/**
* For bringing about 3-vat introductions of Near references using
- * nonces.
+ * nonces.
*/
private NearGiftTable myNGifts;
@@ -262,17 +263,17 @@
myAnswers = new AnswersTable();
myImports = new ImportsTable();
myExports = new ExportsTable();
-
+
//XXX for now
LookupHandler lookupHandler = new LookupHandler(this);
myRemoteNonceLocator = lookupHandler.myResolver.getProxy();
myPGifts = new PromiseGiftTable(myRemoteNonceLocator);
myNGifts = new NearGiftTable();
- myLocalNonceLocator = new NonceLocator(myPGifts,
- myNGifts,
- dataConn.getRemoteVatID(),
- proxyMgr,
+ myLocalNonceLocator = new NonceLocator(myPGifts,
+ myNGifts,
+ dataConn.getRemoteVatID(),
+ proxyMgr,
proxyMgr.getSwissTable());
if (Trace.captp.debug && Trace.ON) {
@@ -283,24 +284,24 @@
"/%" + dataConn.getLocalVatID());
}
}
-
+
/**
*
*/
/*package*/ PromiseGiftTable getPromiseGiftTable() { return myPGifts; }
-
+
/**
*
*/
/*package*/ NearGiftTable getNearGiftTable() { return myNGifts; }
-
+
/**
*
*/
/*package*/ Object getRemoteNonceLocator() {
return myRemoteNonceLocator;
}
-
+
/**
*
*/
@@ -310,7 +311,7 @@
*
*/
/*package*/ Unsealer getUnsealer() { return myProxyMgr.myUnsealer; }
-
+
/**
* Return our identity.
*/
@@ -324,14 +325,14 @@
/*package*/ String remoteVatID() {
return myDataConnection.getRemoteVatID();
}
-
+
/**
*
*/
/*package*/ ConstList remoteSearchPath() {
return myDataConnection.getRemoteSearchPath();
}
-
+
/**
*
*/
@@ -342,16 +343,16 @@
myQuestions.put(-pos, result);
return result;
}
-
+
/**
- * Drop this index in our own Questions table, and in the other vat's
+ * Drop this index in our own Questions table, and in the other vat's
* Answers table.
*/
/*package*/ void dropQuestion(int pos) {
myQuestions.free(-pos);
sendGCAnswerOp(pos);
}
-
+
/************************ Desc Creation *********************/
@@ -364,13 +365,13 @@
BigInteger hash = BigIntegerSugar.cryptoHash(id);
return new NewFarDesc(myExports.newFarPos(obj), hash);
}
-
+
/**
*
*/
/*package*/ NewRemotePromiseDesc newRemotePromiseDesc(Object promise) {
int importPos = myExports.bind(promise);
-
+
BigInteger rdrBase = myEntropy.nextSwiss();
BigInteger rdrNum = BigIntegerSugar.cryptoHash(rdrBase);
BigInteger rdrHash = BigIntegerSugar.cryptoHash(rdrNum);
@@ -381,16 +382,16 @@
myQuestions.put(-rdrPos, rdrResolver);
Object farRdr = rdrResolver.getProxy();
E.sendOnly(promise, "whenMoreResolved", farRdr);
-
+
return new NewRemotePromiseDesc(importPos, rdrPos, rdrBase);
}
-
+
/**
- * Returns a NewFarDesc, NewRemotePromiseDesc, or an ImportDesc for
- * exporting obj, which is assumed to be suitable for being in our
- * exports table.
+ * Returns a NewFarDesc, NewRemotePromiseDesc, or an ImportDesc for
+ * exporting obj, which is assumed to be suitable for being in our
+ * exports table.
* <p>
- * obj is assumes to be a Near reference to a PassByProxy object (actual
+ * obj is assumes to be a Near reference to a PassByProxy object (actual
* or HONORARY), or eventual.
*/
/*package*/ ObjectRefDesc makeImportingDesc(Object obj) {
@@ -407,16 +408,16 @@
throw new RuntimeException("internal: Not exportable");
}
}
-
+
/**
- * Figure out what kind of eventual reference 'ref' is, and return an
+ * Figure out what kind of eventual reference 'ref' is, and return an
* appropriate descriptor for encoding it over the wire.
*/
/*package*/ ObjectRefDesc makeEventualDesc(Ref ref) {
Unsealer unsealer = getUnsealer();
Brand brand = unsealer.brand();
SealedBox optBox = ref.optMeta(brand);
- RemoteHandler optHandler =
+ RemoteHandler optHandler =
(RemoteHandler)unsealer.unseal(optBox, RemoteHandler.class);
if (null == optHandler) {
//a local promise
@@ -430,14 +431,14 @@
}
}
}
-
+
/************************ Desc Messages *********************/
/**
* Dereferencing of a NewFarDesc. <p>
*
- * On entry, importPos may be free, or may be allocated to an entry with
+ * On entry, importPos may be free, or may be allocated to an entry with
* a zero wireCount. (XXX we don't currently check the wirecount.)
* In the latter case, the entry is overwritten.
*
@@ -457,22 +458,22 @@
/**
* Dereferencing of a NewRemotePromiseDesc. <p>
*
- * On entry, importPos may be free, or may be allocated to an entry with
+ * On entry, importPos may be free, or may be allocated to an entry with
* a zero wireCount. In the latter case, the entry is overwritten.
*
- * @param importPos The import position at which the new RemotePromise
+ * @param importPos The import position at which the new RemotePromise
* should be created.
- * @param rdrPos The answers position at which the Redirector of that
+ * @param rdrPos The answers position at which the Redirector of that
* new RemotePromise is made available.
- * @param rdrBase The sameness identity of that Redirector must be the
+ * @param rdrBase The sameness identity of that Redirector must be the
* cryptohash of rdrBase.
* @return The newly created RemotePromise.
*/
- /*package*/ Ref newRemotePromise(int importPos,
+ /*package*/ Ref newRemotePromise(int importPos,
int rdrPos,
BigInteger rdrBase)
{
- RemotePromiseHandler handler =
+ RemotePromiseHandler handler =
new RemotePromiseHandler(this, importPos);
ProxyResolver resolver = handler.myResolver;
myImports.put(importPos, resolver);
@@ -481,19 +482,19 @@
myProxyMgr.getSwissTable().registerNewSwiss(rdr, rdrBase);
return resolver.getProxy();
}
-
+
/**
* Dereferencing of an ImportDesc. <p>
*
- * On entry, importPos must be allocated, but may be allocated to an
+ * On entry, importPos must be allocated, but may be allocated to an
* entry with a zero wireCount. <p>
*
- * Return an imported Proxy, or its resolution, and, if it still has
- * a handler (ie, it isn't resolved) increment its wire count.
+ * Return an imported Proxy, or its resolution, and, if it still has
+ * a handler (ie, it isn't resolved) increment its wire count.
*
* @param importPos The position of the import in the Imports table
- * @return Whatever the resolution is of the Proxy in the appropriate
- * table at importPos
+ * @return Whatever the resolution is of the Proxy in the appropriate
+ * table at importPos
*/
/*package*/ Ref getImport(int importPos) {
ProxyResolver pr = myImports.getProxyResolver(importPos);
@@ -503,13 +504,13 @@
}
return pr.getProxy();
}
-
+
/**
* Dereferencing of an IncomingDesc
*
* Return an Exports or Answers table entry.
*
- * @param incomingPos A positive pos refer to the Exports table, a
+ * @param incomingPos A positive pos refer to the Exports table, a
* negative one to the Answers table.
* @return Whatever object was in the appropriate table at
* incomingPos.
@@ -523,14 +524,14 @@
return myLocalNonceLocator;
}
}
-
+
/**
* Dereferencing of a Promise3Desc
*
* @param searchPath hints to find the vat identified by vatID
- * @param vatID The fingerprint of the public key of the vat hosting the
+ * @param vatID The fingerprint of the public key of the vat hosting the
* object to be looked up.
- * @param nonce Identifies the object in that vat's appropriate
+ * @param nonce Identifies the object in that vat's appropriate
* gift table.
* @param optFarVine Hold on to this until the object has been retrieved.
* @return A promise for the looked up object.
@@ -547,14 +548,14 @@
* Dereferencing of a Far3Desc
*
* @param searchPath hints to find the vat identified by vatID
- * @param vatID The fingerprint of the public key of the vat hosting the
+ * @param vatID The fingerprint of the public key of the vat hosting the
* object to be looked up.
- * @param nonce Identifies the object in that vat's appropriate
+ * @param nonce Identifies the object in that vat's appropriate
* gift table.
- * @param swissHash Identity of object being looked up. getLookup
- * returns a resolved reference with that identity. If
- * it can't return a FarRef with that identity, then it
- * returns a DisconnectedRef with that identity.
+ * @param swissHash Identity of object being looked up. getLookup
+ * returns a resolved reference with that identity. If
+ * it can't return a FarRef with that identity, then it
+ * returns a DisconnectedRef with that identity.
* @param optFarVine Hold on to this until the object has been retrieved.
* @return A promise for the looked up object.
*/
@@ -569,7 +570,7 @@
/***************************** receiving ************************/
-
+
/**
* Process an incoming message from the DataConnection.
@@ -634,7 +635,7 @@
String verb = ((String)uns.readUTF()).intern();
try {
Object[] args = (Object[])uns.readObject();
-
+
execDeliverOnlyOp(recipPos, verb, args);
} catch (Throwable problem) {
whyNoDeliverOnlyOp(recipPos, verb, problem);
@@ -648,7 +649,7 @@
String verb = ((String)uns.readUTF()).intern();
try {
Object[] args = (Object[])uns.readObject();
-
+
execDeliverOp(answerPos, rdr,
recipPos, verb, args);
} catch (Throwable problem) {
@@ -660,19 +661,19 @@
case GC_EXPORT_OP: {
int exportPos = uns.readInt();
int wireCount = uns.readInt();
-
+
execGCExportOp(exportPos, wireCount);
break;
}
case GC_ANSWER_OP: {
int answerPos = uns.readInt();
-
+
execGCAnswerOp(answerPos);
break;
}
case SHUTDOWN_OP: {
int receivedCount = uns.readInt();
-
+
execShutdownOp(receivedCount);
break;
}
@@ -681,7 +682,7 @@
}
}
}
-
+
/**
* Pretty print the args of a message send, for debugging purposes.
*/
@@ -704,13 +705,13 @@
{
if (Trace.captp.debug && Trace.ON) {
Trace.captp.debugm(
- "exec DeliverOnlyOp(" + recipPos + ", " + verb + ", " +
+ "exec DeliverOnlyOp(" + recipPos + ", " + verb + ", " +
argsString(args) + ")");
}
Object recip = getIncoming(recipPos);
E.sendAllOnly(recip, verb, args);
}
-
+
/**
*
*/
@@ -730,7 +731,7 @@
E.sendOnly(myRemoteNonceLocator, "traceRemote", msg);
}
}
-
+
/**
*
*/
@@ -740,7 +741,7 @@
if (Trace.captp.debug && Trace.ON) {
Trace.captp.debugm(
"exec DeliverOp(" + answerPos + ", " + rdr + ",\n " +
- recipPos + ", " + verb + ", " +
+ recipPos + ", " + verb + ", " +
argsString(args) + ")");
}
Object recip = getIncoming(recipPos);
@@ -748,7 +749,7 @@
myAnswers.put(-answerPos, answer, true);
E.sendOnly(answer, "whenMoreResolved", rdr);
}
-
+
/**
*
*/
@@ -765,9 +766,9 @@
myAnswers.put(-answerPos, problem, true);
E.sendOnly(problem, "whenMoreResolved", rdr);
}
-
+
/**
- *
+ *
*/
private void execGCExportOp(int exportPos, int wireCount) {
if (Trace.captp.debug && Trace.ON) {
@@ -776,9 +777,9 @@
}
myExports.decr(exportPos, wireCount);
}
-
+
/**
- *
+ *
*/
private void execGCAnswerOp(int answerPos) {
if (Trace.captp.debug && Trace.ON) {
@@ -787,7 +788,7 @@
}
myAnswers.free(-answerPos);
}
-
+
/**
* Receive a shutdown message from the other end. If we don't have any
* messages in flight, we shutdown the connection.
@@ -805,7 +806,7 @@
/************************** sending ************************/
-
+
/**
*
*/
@@ -832,7 +833,7 @@
myDataConnection.sendMsg(msg);
}
-
+
/**
*
*/
@@ -842,7 +843,7 @@
{
if (Trace.captp.debug && Trace.ON) {
Trace.captp.debugm(
- "send DeliverOnlyOp(" + recipPos + ", " + verb + ", " +
+ "send DeliverOnlyOp(" + recipPos + ", " + verb + ", " +
argsString(args) + ")");
}
if (null != myOptProblem) {
@@ -860,7 +861,7 @@
throw ExceptionMgr.asSafe(problem);
}
}
-
+
/**
*
*/
@@ -873,7 +874,7 @@
if (Trace.captp.debug && Trace.ON) {
Trace.captp.debugm(
"send DeliverOp(" + answerPos + ", " + rdr + ",\n " +
- recipPos + ", " + verb + ", " +
+ recipPos + ", " + verb + ", " +
argsString(args) + ")");
}
if (null != myOptProblem) {
@@ -893,9 +894,9 @@
throw ExceptionMgr.asSafe(problem);
}
}
-
+
/**
- *
+ *
*/
/*package*/ void sendGCExportOp(int exportPos, int wireCount) {
if (Trace.captp.debug && Trace.ON) {
@@ -916,9 +917,9 @@
throw ExceptionMgr.asSafe(problem);
}
}
-
+
/**
- *
+ *
*/
private void sendGCAnswerOp(int answerPos) {
if (Trace.captp.debug && Trace.ON) {
@@ -938,7 +939,7 @@
throw ExceptionMgr.asSafe(problem);
}
}
-
+
/**
*
*/
@@ -963,14 +964,14 @@
/**************** lookup, gc, & shutdown *****************/
-
+
/**
*
*/
/*package*/ void submitLookups(Resolver bufferedLookups) {
throw new RuntimeException("XXX submitLookups not yet implemented");
}
-
+
/**
* Decrement the use count. If it reaches 0, we have no references active
* over this connection and the connection can (and should) be shut down.
@@ -1018,7 +1019,7 @@
Trace.captp.debugm("shutdown " + this, problem);
}
} else {
- //at warning level because lost connections should be traced by
+ //at warning level because lost connections should be traced by
//default.
if (Trace.captp.warning && Trace.ON) {
Trace.captp.warningm("lost " + this, problem);
@@ -1026,14 +1027,14 @@
}
if (null == myOptProblem) { /* If this is the first time we've died... */
myOptProblem = problem;
-
+
myQuestions.smash(problem);
myAnswers.smash(problem);
myImports.smash(problem);
myExports.smash(problem);
myPGifts.smash(problem);
myNGifts.smash(problem);
-
+
myQuestions= null;
myAnswers= null;
myImports= null;
@@ -1043,7 +1044,7 @@
if (deliberate) {
//transfer buffered lookups to a newly spawned connection
- myProxyMgr.connectionDead(myDataConnection,
+ myProxyMgr.connectionDead(myDataConnection,
myOptBufferedLookups);
} else {
//XXX smash buffered lookups
1.12 +21 -20 e/src/jsrc/net/captp/jcomm/ProxyMgr.java
Index: ProxyMgr.java
===================================================================
RCS file: /cvs/e/src/jsrc/net/captp/jcomm/ProxyMgr.java,v
retrieving revision 1.11
retrieving revision 1.12
diff -u -r1.11 -r1.12
--- ProxyMgr.java 2001/08/17 03:11:32 1.11
+++ ProxyMgr.java 2001/09/06 09:55:38 1.12
@@ -19,9 +19,6 @@
Contributor(s): ______________________________________.
*/
-import java.io.IOException;
-import java.net.UnknownHostException;
-import java.security.KeyPair;
import net.captp.tables.SwissTable;
import net.vattp.data.ConnectionsMgr;
import net.vattp.data.DataConnection;
@@ -38,6 +35,10 @@
import org.erights.e.elib.tables.ConstList;
import org.erights.e.elib.tables.FlexMap;
+import java.io.IOException;
+import java.net.UnknownHostException;
+import java.security.KeyPair;
+
/**
* Manage the interface between this vat and other vats. <p>
*
@@ -46,19 +47,19 @@
* the low-level comm system.
*/
public class ProxyMgr implements NewConnectionReactor {
-
+
/** Registration table to use for map between ObjectIDs and objs */
private SwissTable mySwissTable;
-
+
/** map from DataConnections to ProxyConnections */
private FlexMap myProxyConnections = null;
/** The connections manager to talk to */
private ConnectionsMgr myConnMgr = null;
-
+
/** makes new unguessable numbers */
private ESecureRandom myEntropy;
-
+
/** for self recognition */
/*package*/ Sealer mySealer;
/*package*/ Unsealer myUnsealer;
@@ -66,9 +67,9 @@
/**
* Constructor
*
- * @param vat The identity of the vat we are managing remote references
+ * @param vat The identity of the vat we are managing remote references
* into.
- * @param netConfig Where to listen, register, and tell other to look for
+ * @param netConfig Where to listen, register, and tell other to look for
* me.
* @param swissTable Associates swissNumbers with references.
* @param entropy Provides new unguessable numbers.
@@ -78,7 +79,7 @@
SwissTable swissTable,
ESecureRandom entropy)
throws UnknownHostException, IOException {
-
+
myConnMgr = new ConnectionsMgr(identityKeys, netConfig);
myConnMgr.addNewConnectionReactor(this);
@@ -87,11 +88,11 @@
myProxyConnections = FlexMap.fromTypes(DataConnection.class,
ProxyConnection.class);
myEntropy = entropy;
-
+
Object[] pair = Brand.pair("captp");
mySealer = (Sealer)pair[0];
myUnsealer = (Unsealer)pair[1];
-
+
if (Trace.captp.debug && Trace.ON) {
Trace.captp.debugm("Create ProxyMgr " + this +
" connMgr=" + myConnMgr);
@@ -135,12 +136,12 @@
*/
void connectionDead(DataConnection connection, Resolver optBufferedLookups) {
myProxyConnections.removeKey(connection, true);
- if (null == optBufferedLookups) {
+ if (null == optBufferedLookups) {
return;
}
/* Get back into it, then */
try {
- ProxyConnection proxyConn =
+ ProxyConnection proxyConn =
getOrMakeProxyConnection(connection.getRemoteSearchPath(),
connection.getRemoteVatID());
proxyConn.submitLookups(optBufferedLookups);
@@ -151,12 +152,12 @@
throw ExceptionMgr.asSafe(problem);
}
}
-
+
/**
*
*/
/*package*/ SwissTable getSwissTable() { return mySwissTable; }
-
+
/**
* Notice that a new (inbound) data connection has appeared.
*
@@ -179,14 +180,14 @@
}
/**
- * If I've got a live ProxyConnection for that vatID, return it, else
+ * If I've got a live ProxyConnection for that vatID, return it, else
* null. <p>
*
* This does *not* initiate a connection attempt.
*/
/*package*/ ProxyConnection optProxyConnection(String vatID)
throws IOException {
- DataConnection optDataConn =
+ DataConnection optDataConn =
myConnMgr.optConnection(vatID);
if (null == optDataConn) {
return null;
@@ -196,13 +197,13 @@
}
/**
- * If vatID is me, return null, else get or make a live ProxyConnection
+ * If vatID is me, return null, else get or make a live ProxyConnection
* for vatID. <p>
*/
/*package*/ ProxyConnection getOrMakeProxyConnection(ConstList searchPath,
String vatID)
throws IOException {
- DataConnection optDataConn =
+ DataConnection optDataConn =
myConnMgr.getConnection(vatID, searchPath);
if (null == optDataConn) {
return null;
1.8 +7 -7 e/src/jsrc/net/captp/jcomm/Redirector.java
Index: Redirector.java
===================================================================
RCS file: /cvs/e/src/jsrc/net/captp/jcomm/Redirector.java,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -r1.7 -r1.8
--- Redirector.java 2001/08/29 00:20:15 1.7
+++ Redirector.java 2001/09/06 09:55:38 1.8
@@ -18,7 +18,7 @@
The Initial Developer of the Original Code is Mark S. Miller.
Copyright (C) 1999 Mark S. Miller. All Rights Reserved.
-Contributor(s): ______________________________________.
+Contributor(s): ______________________________________.
*/
import org.erights.e.elib.ref.Resolver;
@@ -27,28 +27,28 @@
import org.erights.e.elib.util.OneArgFunc;
/**
- * Wraps a Resolver in a way suitable for inclusion as an argument in a
+ * Wraps a Resolver in a way suitable for inclusion as an argument in a
* whenMoreResolved message. <p>
*
* Turns the first response such an argument may get into a resolution of the
- * Resolver, and then become inoperative. <p>
+ * Resolver, and then become inoperative. <p>
*
* @author Mark S. Miller
*/
/*package*/ class Redirector implements DeadManSwitch, OneArgFunc, PassByProxy {
-
+
/**
*
*/
private Resolver myOptResolver;
-
+
/**
*
*/
/*package*/ Redirector(Resolver resolver) {
myOptResolver = resolver;
}
-
+
/**
* Resolve the Resolver to the arg.
*/
@@ -59,7 +59,7 @@
}
return null;
}
-
+
/**
* Smash the Resolver with the arg.
*/
1.13 +46 -46 e/src/jsrc/net/captp/jcomm/RemoteHandler.java
Index: RemoteHandler.java
===================================================================
RCS file: /cvs/e/src/jsrc/net/captp/jcomm/RemoteHandler.java,v
retrieving revision 1.12
retrieving revision 1.13
diff -u -r1.12 -r1.13
--- RemoteHandler.java 2001/08/22 14:26:14 1.12
+++ RemoteHandler.java 2001/09/06 09:55:38 1.13
@@ -20,9 +20,9 @@
*/
import org.erights.e.elib.prim.E;
+import org.erights.e.elib.ref.ProxyHandler;
import org.erights.e.elib.ref.ProxyResolver;
import org.erights.e.elib.ref.Ref;
-import org.erights.e.elib.ref.ProxyHandler;
import org.erights.e.elib.sealing.Brand;
import org.erights.e.elib.sealing.SealedBox;
import org.erights.e.elib.sealing.Sealer;
@@ -31,51 +31,51 @@
/**
* Handles the tail-ends of remote references. <p>
*
- * There is a 3x2 taxonomy of RemoteHandlers. The first distinction is
- * between a) handlers in the Imports table (or "imported handlers"), for
- * which the position is positive, b) handlers in the questions table (or
- * "question handlers"), for which the position is negative, and c) the
- * handler of the other side's NonceLocator, for which the position is zero.
- * <p>
+ * There is a 3x2 taxonomy of RemoteHandlers. The first distinction is
+ * between a) handlers in the Imports table (or "imported handlers"), for
+ * which the position is positive, b) handlers in the questions table (or
+ * "question handlers"), for which the position is negative, and c) the
+ * handler of the other side's NonceLocator, for which the position is zero.
+ * <p>
*
- * The second distinction is between handlers for resolved remote references,
- * represented by the concrete subclass FarHandler, and handlers for
- * remote references that aren't yet resolved, represented by the concrete
- * subclass RemotePromiseHandler. As a special case, the handler at zero for
- * the other side's NonceLocator is a RemotePromiseHandler, since shutdown
- * attempts may cause it to be retargeted at a newly incarnated NonceLocator
- * from the other side, which may have a new identity.
+ * The second distinction is between handlers for resolved remote references,
+ * represented by the concrete subclass FarHandler, and handlers for
+ * remote references that aren't yet resolved, represented by the concrete
+ * subclass RemotePromiseHandler. As a special case, the handler at zero for
+ * the other side's NonceLocator is a RemotePromiseHandler, since shutdown
+ * attempts may cause it to be retargeted at a newly incarnated NonceLocator
+ * from the other side, which may have a new identity.
*
* @author Mark S. Miller
*/
/*package*/ abstract class RemoteHandler implements ProxyHandler {
-
- /**
+
+ /**
* Connection to the vat I point into
*/
/*package*/ ProxyConnection myConn;
- /**
+ /**
* My outgoing position. <p>
*
* If < 0, in the Questions table.
- * If == 0, the special RemotePromiseHandler for the other side's
+ * If == 0, the special RemotePromiseHandler for the other side's
* NonceLocator.
* If > 0, in the Imports table.
*/
/*package*/ int myPos;
-
+
/**
- * Only relevant if myPos > 0. A count for all wire references that we
+ * Only relevant if myPos > 0. A count for all wire references that we
* haven't yet accounted for to the other side.
*/
/*package*/ int myWireCount;
-
+
/**
* The Resolver of out Proxy, which also revives the Proxy on demand.
*/
/*package*/ ProxyResolver myResolver;
-
+
/**
*
*/
@@ -84,8 +84,8 @@
/**
* @param connection The ProxyConnection to communicate via
* @param pos The Imports or Questions map pos of the object
- * @param optIdentity null, or the sameness identity of the far
- * reference.
+ * @param optIdentity null, or the sameness identity of the far
+ * reference.
*/
/*package*/ RemoteHandler(ProxyConnection connection,
int pos,
@@ -97,33 +97,33 @@
myResolver = new ProxyResolver(this, optIdentity);
myBreakageReactors = FlexList.make();
}
-
+
/**
- * Handles this special case separately, so subclasses can override
+ * Handles this special case separately, so subclasses can override
* separately, and returns whether the case was specially handled.
* <p>
* The default implementation up here currently just returns false.
*/
/*package*/ boolean handleWhenMoreResolved(Object reactor) {
- //when we do three vats, we should check if reactor is a remote
- //reference to yet a third vat, in which case we should shorten
+ //when we do three vats, we should check if reactor is a remote
+ //reference to yet a third vat, in which case we should shorten
//rather than forward.
return false; //XXX for now
}
-
+
/**
- * Handles this special case separately, so subclasses can override
+ * Handles this special case separately, so subclasses can override
* separately.
* <p>
- * The default implementation up here stores the reactor in
+ * The default implementation up here stores the reactor in
* myBreakageReactors.
*/
/*package*/ boolean handleWhenBroken(Object reactor) {
myBreakageReactors.push(reactor);
return true;
}
-
+
/**
* How should my ref respond to an optMeta request?
*/
@@ -134,17 +134,17 @@
}
return sealer.seal(this);
}
-
+
/**
- *
+ *
*/
public void handleSendAllOnly(String verb, Object[] args) {
if (1 == args.length) {
- if ("whenMoreResolved".equals(verb) &&
+ if ("whenMoreResolved".equals(verb) &&
handleWhenMoreResolved(args[0])) {
return;
-
+
} else if ("whenBroken".equals(verb) &&
handleWhenBroken(args[0])) {
return;
@@ -152,17 +152,17 @@
}
myConn.sendDeliverOnlyOp(myPos, verb, args);
}
-
+
/**
- *
+ *
*/
public Ref handleSendAll(String verb, Object[] args) {
if (1 == args.length) {
if ("whenMoreResolved".equals(verb) &&
handleWhenMoreResolved(args[0])) {
-
+
return E.send(null, "yourself");
-
+
} else if ("whenBroken".equals(verb) &&
handleWhenBroken(args[0])) {
return E.send(null, "yourself");
@@ -177,9 +177,9 @@
args);
return pr.getProxy();
}
-
+
/**
- *
+ *
*/
public void handleResolution(Object newTarget) {
int len = myBreakageReactors.size();
@@ -190,9 +190,9 @@
//XXX should we allow throws to propogate?
reactToGC();
}
-
+
/**
- *
+ *
*/
public void reactToGC() {
if (myPos > 0) {
@@ -202,12 +202,12 @@
myConn.dropQuestion(myPos);
}
}
-
+
/**
*
*/
/*package*/ int getPos() { return myPos; }
-
+
/**
*
*/
1.2 +4 -4 e/src/jsrc/net/captp/jcomm/RemotePromiseHandler.java
Index: RemotePromiseHandler.java
===================================================================
RCS file: /cvs/e/src/jsrc/net/captp/jcomm/RemotePromiseHandler.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- RemotePromiseHandler.java 2001/08/20 21:17:49 1.1
+++ RemotePromiseHandler.java 2001/09/06 09:55:38 1.2
@@ -27,7 +27,7 @@
* @author Mark S. Miller
*/
/*package*/ class RemotePromiseHandler extends RemoteHandler {
-
+
/**
* Flag to remember whether any E-level messages have been sent over me.
*/
@@ -42,7 +42,7 @@
/*package*/ RemotePromiseHandler(ProxyConnection connection, int pos) {
super(connection, pos, null);
}
-
+
/**
* Override to also clear myFreshFlag
*/
@@ -50,7 +50,7 @@
myFreshFlag = false;
super.handleSendAllOnly(verb, args);
}
-
+
/**
* Override to also clear myFreshFlag
*/
@@ -58,7 +58,7 @@
myFreshFlag = false;
return super.handleSendAll(verb, args);
}
-
+
/**
* Have no E-level messages yet been sent over me?
*/
1.10 +60 -59 e/src/jsrc/net/captp/jcomm/Sturdifier.java
Index: Sturdifier.java
===================================================================
RCS file: /cvs/e/src/jsrc/net/captp/jcomm/Sturdifier.java,v
retrieving revision 1.9
retrieving revision 1.10
diff -u -r1.9 -r1.10
--- Sturdifier.java 2001/08/20 05:07:43 1.9
+++ Sturdifier.java 2001/09/06 09:55:38 1.10
@@ -1,40 +1,41 @@
package net.captp.jcomm;
/*
-The contents of this file are subject to the Electric Communities E Open
-Source Code License Version 1.0 (the "License"); you may not use this file
-except in compliance with the License. You may obtain a copy of the License
+The contents of this file are subject to the Electric Communities E Open
+Source Code License Version 1.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.communities.com/EL/.
-Software distributed under the License is distributed on an "AS IS" basis,
-WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License for
+Software distributed under the License is distributed on an "AS IS" basis,
+WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License for
the specific language governing rights and limitations under the License.
-The Original Code is the Distributed E Language Implementation, released
-July 20, 1998.
+The Original Code is the Distributed E Language Implementation, released
+July 20, 1998.
-The Initial Developer of the Original Code is Electric Communities.
-Copyright (C) 1998 Electric Communities. All Rights Reserved.
+The Initial Developer of the Original Code is Electric Communities.
+Copyright (C) 1998 Electric Communities. All Rights Reserved.
Contributor(s): ______________________________________.
*/
-import java.io.IOException;
-import java.math.BigInteger;
import net.captp.tables.SwissTable;
import net.captp.tables.Vine;
import net.vattp.data.NetConfig;
import org.erights.e.elib.base.TextWriter;
import org.erights.e.extern.timer.Timer;
+import java.io.IOException;
+import java.math.BigInteger;
+
/**
- * Enables one to make SturdyRefs for an object, even if one is in a
+ * Enables one to make SturdyRefs for an object, even if one is in a
* distributed confinement box.
*
* @author Mark S. Miller, markm@caplet.com
*/
public class Sturdifier {
-
+
private Introducer myIntroducer;
private Timer myPersistentTimer;
@@ -47,16 +48,16 @@
}
/**
- * Given an obj-swissNum association, arrange for the object to last
- * until an expiration time (so that the weak association will last till
- * then as well) and make a SturdyRef that uses this arrangement to
+ * Given an obj-swissNum association, arrange for the object to last
+ * until an expiration time (so that the weak association will last till
+ * then as well) and make a SturdyRef that uses this arrangement to
* designate the object across time and space.
*
* @param obj The object for which a SturdyRef is desired
- * @param swissNum The swissNum already associated with this object
+ * @param swissNum The swissNum already associated with this object
* (presumably because of an action taken by our caller).
* @param optExpirationDate The date after which the SturdyRef will not
- * longer be guaranteed to be valid. If
+ * longer be guaranteed to be valid. If
* Long.MAX_VALUE, then it's always valid.
* @return A new SturdyRef for the indicated object
*/
@@ -65,19 +66,19 @@
long optExpirationDate)
{
/*
- * We don't bother checking for Long.MAX_VALUE == optExpirationDate,
- * which is technically a XXX bug: these registrations will expire
- * before the year 300,000,000. Assuming no processes stay live that
- * long, I think it's safe to assume that a future upgrade of E will
- * rescue such persistent state before then. Let's call this the
+ * We don't bother checking for Long.MAX_VALUE == optExpirationDate,
+ * which is technically a XXX bug: these registrations will expire
+ * before the year 300,000,000. Assuming no processes stay live that
+ * long, I think it's safe to assume that a future upgrade of E will
+ * rescue such persistent state before then. Let's call this the
* "Y Three Hundred M problem".
*
- * We don't bother capturing the Timeout returned by whenAlarm
- * below, as this API provides no mean for cancelling these
+ * We don't bother capturing the Timeout returned by whenAlarm
+ * below, as this API provides no mean for cancelling these
* registrations.
*/
myPersistentTimer.whenAlarm(optExpirationDate, new Vine(obj));
-
+
NetConfig netConfig = myIntroducer.getNetConfig();
LocatorUnum locatorUnum = myIntroducer.getLocatorUnum();
return new SturdyRef(locatorUnum,
@@ -86,7 +87,7 @@
swissNum,
optExpirationDate);
}
-
+
/**
* Produce a perpetual SturdyRef for an object. <p>
*
@@ -98,17 +99,17 @@
public SturdyRef run(Object obj) {
return run(obj, Long.MAX_VALUE);
}
-
+
/**
* Produce a SturdyRef for an object.
* <p>
- * The SturdyRef will designate the object across time and space, at
- * least until the expiration time, so long as the hosting vat (this vat)
+ * The SturdyRef will designate the object across time and space, at
+ * least until the expiration time, so long as the hosting vat (this vat)
* is accessible.
*
* @param obj The object for which a SturdyRef is desired
* @param optExpirationDate The date after which the SturdyRef will not
- * longer be guaranteed to be valid. If
+ * longer be guaranteed to be valid. If
* Long.MAX_VALUE, then it's always valid.
* @return A new SturdyRef for the indicated object
*/
@@ -124,63 +125,63 @@
public Object[] incarnate(Object obj) {
return incarnate(obj, Long.MAX_VALUE);
}
-
+
/**
- * Produce a SturdyRef, and a swissBase so in a later incarnation of this
- * vat a newly created object can be made to be the reincarnation of this
- * one (from the perspective of those holding the SturdyRef).
+ * Produce a SturdyRef, and a swissBase so in a later incarnation of this
+ * vat a newly created object can be made to be the reincarnation of this
+ * one (from the perspective of those holding the SturdyRef).
* <p>
- * An object is that which object references to it designate. From one
- * vat incarnation to another, the only intervat references which survive
- * are SturdyRefs. When doing identity-persistence (as opposed to object
- * persistence), the application creates the first SturdyRef to a
- * persistent object using incarnate(..), and makes sure to store the
- * swissBase somewhere for use during this vat's next incarnation.
- * (In identity-persistence, where this precious information is stored is
+ * An object is that which object references to it designate. From one
+ * vat incarnation to another, the only intervat references which survive
+ * are SturdyRefs. When doing identity-persistence (as opposed to object
+ * persistence), the application creates the first SturdyRef to a
+ * persistent object using incarnate(..), and makes sure to store the
+ * swissBase somewhere for use during this vat's next incarnation.
+ * (In identity-persistence, where this precious information is stored is
* up to the app.)
* <p>
- * On the next incarnation of the vat, the app creates a fresh object to
- * serve as the reincarnation of the original object, and calls
- * reincarnate(..) so the old SturdyRef will now designate the new
- * object.
+ * On the next incarnation of the vat, the app creates a fresh object to
+ * serve as the reincarnation of the original object, and calls
+ * reincarnate(..) so the old SturdyRef will now designate the new
+ * object.
*
* @param obj The object for which a SturdyRef is desired
* @param optExpirationDate The date after which the SturdyRef will not
- * longer be guaranteed to be valid. If
+ * longer be guaranteed to be valid. If
* Long.MAX_VALUE, then it's always valid.
- * @return A pair of a new SturdyRef for 'obj', and a swissBase for
+ * @return A pair of a new SturdyRef for 'obj', and a swissBase for
* reincarnating the identity assigned to 'obj'.
*/
public Object[] incarnate(Object obj, long optExpirationDate) {
SwissTable swissTable = myIntroducer.getSwissTable();
BigInteger swissBase = swissTable.nextSwiss();
BigInteger swissNum = swissTable.registerNewSwiss(obj, swissBase);
-
+
SturdyRef sr = makeSturdy(obj, swissNum, optExpirationDate);
Object[] result = { sr, swissBase };
return result;
}
-
+
/**
* optExpirationDate defaults to forever
*/
public SturdyRef reincarnate(Object obj, BigInteger swissBase) {
return reincarnate(obj, swissBase, Long.MAX_VALUE);
}
-
+
/**
- * Cause 'obj' to be the object designated by 'swissHash cryptoHash()' in
+ * Cause 'obj' to be the object designated by 'swissHash cryptoHash()' in
* this vat.
* <p>
- * Used by an identity-persistent app (as opposed to an object-persistent
- * app) to cause old SturdyRefs that were given out by a previous
- * incarnation of this vat to continue to function. It's polite for an
- * identity-peristent app to use an expiration date that's at least as
- * big as the ones used in previous incarnations. To do otherwise is to
+ * Used by an identity-persistent app (as opposed to an object-persistent
+ * app) to cause old SturdyRefs that were given out by a previous
+ * incarnation of this vat to continue to function. It's polite for an
+ * identity-peristent app to use an expiration date that's at least as
+ * big as the ones used in previous incarnations. To do otherwise is to
* not honor the previously implied obligation.
*
*/
- public SturdyRef reincarnate(Object obj,
+ public SturdyRef reincarnate(Object obj,
BigInteger swissBase,
long optExpirationDate)
{
@@ -188,7 +189,7 @@
BigInteger swissNum = swissTable.registerNewSwiss(obj, swissBase);
return makeSturdy(obj, swissNum, optExpirationDate);
}
-
+
/**
*
1.12 +9 -9 e/src/jsrc/net/captp/jcomm/SturdyRef.java
Index: SturdyRef.java
===================================================================
RCS file: /cvs/e/src/jsrc/net/captp/jcomm/SturdyRef.java,v
retrieving revision 1.11
retrieving revision 1.12
diff -u -r1.11 -r1.12
--- SturdyRef.java 2001/08/22 14:26:14 1.11
+++ SturdyRef.java 2001/09/06 09:55:38 1.12
@@ -19,20 +19,20 @@
Contributor(s): ______________________________________.
*/
-import java.io.IOException;
-import java.math.BigInteger;
import net.vattp.data.EARL;
import org.erights.e.elib.base.TextWriter;
-import org.erights.e.elib.prim.E;
import org.erights.e.elib.serial.Persistent;
import org.erights.e.elib.tables.ConstList;
+import java.io.IOException;
+import java.math.BigInteger;
+
/**
* An object reference that be checkpointed and/or externalized and which can
* survive network partitions.
*/
public final class SturdyRef implements Persistent {
-
+
/** The LocatorUnum that links us to the outside world. */
private LocatorUnum myLocatorUnum;
@@ -44,7 +44,7 @@
/** Bound to an object in the vat identified by myHostID */
private BigInteger mySwissNum;
-
+
/** How long is the object obligated to stay around? */
private long myExpiration;
@@ -72,11 +72,11 @@
* Test if this SturdyRef and another designate the same object. <p>
*
* @param other SturdyRef against which we are to be tested for equality
- * @return 0.0 iff this and other designate the same object. Otherwise
+ * @return 0.0 iff this and other designate the same object. Otherwise
* NaN.
*/
public double compareTo(SturdyRef other) {
- if (myHostID.equals(other.myHostID) &&
+ if (myHostID.equals(other.myHostID) &&
mySwissNum.equals(other.mySwissNum))
{
return 0.0;
@@ -125,11 +125,11 @@
}
/**
- * Return a (live) reference to the object which this SturdyRef
+ * Return a (live) reference to the object which this SturdyRef
* designates. The result may be either a direct or eventual reference.
*/
public Object getGrip() throws IOException {
- return myLocatorUnum.getGrip(mySearchPath,
+ return myLocatorUnum.getGrip(mySearchPath,
myHostID,
mySwissNum,
null);
1.3 +3 -3 e/src/jsrc/net/captp/tables/AnswersTable.java
Index: AnswersTable.java
===================================================================
RCS file: /cvs/e/src/jsrc/net/captp/tables/AnswersTable.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- AnswersTable.java 2001/08/29 00:20:15 1.2
+++ AnswersTable.java 2001/09/06 09:55:39 1.3
@@ -18,7 +18,7 @@
The Initial Developer of the Original Code is Mark S. Miller.
Copyright (C) 1999 Mark S. Miller. All Rights Reserved.
-Contributor(s): ______________________________________.
+Contributor(s): ______________________________________.
*/
import org.erights.e.elib.prim.E;
@@ -27,12 +27,12 @@
*
*/
public class AnswersTable extends CommTable {
-
+
/**
*
*/
public AnswersTable() {}
-
+
/**
*
*/
1.6 +49 -48 e/src/jsrc/net/captp/tables/CommTable.java
Index: CommTable.java
===================================================================
RCS file: /cvs/e/src/jsrc/net/captp/tables/CommTable.java,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -r1.5 -r1.6
--- CommTable.java 2001/08/29 00:20:15 1.5
+++ CommTable.java 2001/09/06 09:55:39 1.6
@@ -18,52 +18,53 @@
The Initial Developer of the Original Code is Mark S. Miller.
Copyright (C) 1999 Mark S. Miller. All Rights Reserved.
-Contributor(s): ______________________________________.
+Contributor(s): ______________________________________.
*/
-import java.lang.reflect.Array;
-import java.io.IOException;
import org.erights.e.elib.base.TextWriter;
+import java.io.IOException;
+import java.lang.reflect.Array;
+
/**
- * Just some common mechanism made available to the CommTable
- * implementations. <p>
+ * Just some common mechanism made available to the CommTable
+ * implementations. <p>
*
- * CommTables are defined in terms of indices
- * (always positive), not position. At a higher level, positions use
- * positive or negative to encode choice of table (questions vs imports,
- * answers vs exports). This can be a bit confusing because CommTable
- * internally uses negated indices for free list entries, and these two uses
+ * CommTables are defined in terms of indices
+ * (always positive), not position. At a higher level, positions use
+ * positive or negative to encode choice of table (questions vs imports,
+ * answers vs exports). This can be a bit confusing because CommTable
+ * internally uses negated indices for free list entries, and these two uses
* of negation are completely independent.
*
- * The rest of CapTP depends on the tables, but for the
- * sake of unit testing, each table stands alone to the greatest reasonable
- * degree. Since AnswersTable adds almost nothing to CommTable, you can unit
- * test CommTable by testing AnswersTable.
+ * The rest of CapTP depends on the tables, but for the
+ * sake of unit testing, each table stands alone to the greatest reasonable
+ * degree. Since AnswersTable adds almost nothing to CommTable, you can unit
+ * test CommTable by testing AnswersTable.
*
* @author Mark Miller, markm@caplet.com
*/
public abstract class CommTable {
-
+
/**
* Used to indicate the absence of any other object
*/
static /*package*/ final Object ThePumpkin = new Object();
-
+
/** Default initial capacity */
static private final int INIT_CAPACITY = 16;
static private final int GROWTH_FACTOR = 2;
-
+
/**
* How many allocated entries do I have?
*/
/*package*/ int mySize;
-
+
/**
* What is the size of my parallel arrays?
*/
/*package*/ int myCapacity;
-
+
/**
* Keeps track of the allocation of my indices. <p>
*
@@ -74,19 +75,19 @@
* If next == 0, we're at the end of the list.
*/
/*package*/ int[] myFreeList;
-
+
/**
* Let first = -myFreeHead;
* If first >= 1, it's the index of the first free entry in myFreeList.
* If first == 0, the list is empty.
*/
/*package*/ int myFreeHead;
-
+
/**
* The actual contents of the table.
*/
/*package*/ Object[] myStuff;
-
+
/**
* Starts will all inidices free.
*/
@@ -108,7 +109,7 @@
myStuff[i] = ThePumpkin;
}
}
-
+
/**
* Drop all state and make sure nothing ever works again.
*/
@@ -119,12 +120,12 @@
myFreeHead = 1;
myStuff = null;
}
-
+
/**
* How many allocated entries?
*/
public int size() { return mySize; }
-
+
/**
* Is this index free? If it's past the end, yes.
* If it's before the beginning, it's not valid, so no.
@@ -147,7 +148,7 @@
throw new IllegalArgumentException("not free: " + index);
}
}
-
+
/**
* Complain if not allocated
*/
@@ -156,7 +157,7 @@
throw new IllegalArgumentException("not alloced: " + index);
}
}
-
+
/**
* What the next capacity big enough to represent index?
*/
@@ -166,13 +167,13 @@
}
int result = myCapacity;
while (index >= result) {
- //XXX it's stupid to have an iterative algorithm. How do I
+ //XXX it's stupid to have an iterative algorithm. How do I
//calculate the smallest power of 2 > index?
result += GROWTH_FACTOR;
}
return result;
}
-
+
/**
* Returns array or a copy of array sized to capacity.
*/
@@ -186,7 +187,7 @@
System.arraycopy(array, 0, result, 0, len);
return result;
}
-
+
/**
* Become big enough to hold index. <p>
*
@@ -208,12 +209,12 @@
//overwrite the last entry
myFreeList[myCapacity-1] = myFreeHead;
myFreeHead = -oldCapacity;
- }
+ }
/**
* Deallocates an allocated index. <p>
*
- * Subclasses may override and send-super in order to clear their
+ * Subclasses may override and send-super in order to clear their
* parallel arrays.
*/
public void free(int index) {
@@ -223,7 +224,7 @@
myStuff[index] = ThePumpkin;
mySize--;
}
-
+
/**
* Increment index's allocation count. <p>
*
@@ -233,7 +234,7 @@
mustBeAlloced(index);
myFreeList[index]++;
}
-
+
/**
* Decrement index's allocation count delta, and free it if it reaches zero. <p>
*
@@ -252,15 +253,15 @@
return false;
}
}
-
+
/**
* Allocate a particular index. <p>
*
* On entry, index must be free. <p>
*
- * Since the free list is singly linked, we can't generally do this in
- * constant time. However, by far the typical case is for the requested
- * index to be the same as the one that zero-argument alloc would have
+ * Since the free list is singly linked, we can't generally do this in
+ * constant time. However, by far the typical case is for the requested
+ * index to be the same as the one that zero-argument alloc would have
* allocated, so we need merely assure that this case is constant time.
*/
private void alloc(int index) {
@@ -287,8 +288,8 @@
}
throw new RuntimeException("internal: broken free list");
}
-
-
+
+
/**
* Gets the object at the allocated index.
*/
@@ -300,14 +301,14 @@
}
return result;
}
-
+
/**
*
*/
public void put(int index, Object value) {
put(index, value, false);
}
-
+
/**
*
*/
@@ -319,14 +320,14 @@
throw new IllegalArgumentException("not alloced: " + index);
} else {
myStuff[index] = value;
- }
+ }
}
-
+
/**
* Allocates a free index, put value there, and returns that index. <p>
*
- * Subclasses may override and send-super to initialize their parallel
- * arrays.
+ * Subclasses may override and send-super to initialize their parallel
+ * arrays.
*/
public int bind(Object value) {
if (myFreeHead == 0) {
@@ -340,9 +341,9 @@
mySize++;
return result;
}
-
+
/**
- *
+ *
*/
public void printOn(TextWriter out) throws IOException {
if (myFreeList == null) {
1.7 +10 -10 e/src/jsrc/net/captp/tables/ExportsTable.java
Index: ExportsTable.java
===================================================================
RCS file: /cvs/e/src/jsrc/net/captp/tables/ExportsTable.java,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -r1.6 -r1.7
--- ExportsTable.java 2001/08/29 00:20:15 1.6
+++ ExportsTable.java 2001/09/06 09:55:39 1.7
@@ -18,7 +18,7 @@
The Initial Developer of the Original Code is Mark S. Miller.
Copyright (C) 1999 Mark S. Miller. All Rights Reserved.
-Contributor(s): ______________________________________.
+Contributor(s): ______________________________________.
*/
import org.erights.e.elib.prim.E;
@@ -34,14 +34,14 @@
* Gets the index for a near export.
*/
private IntTable myPBPMap;
-
+
/**
*
*/
public ExportsTable() {
myPBPMap = new IntTable();
}
-
+
/**
*
*/
@@ -54,7 +54,7 @@
super.smash(problem);
myPBPMap = null;
}
-
+
/**
* Frees the index, including its entry, if any, in the pbp map.
*/
@@ -62,22 +62,22 @@
myPBPMap.removeKey(myStuff[index]);
super.free(index);
}
-
+
/**
- *
+ *
*/
public int indexFor(Object obj) {
return myPBPMap.getInt(obj, -1);
}
-
+
/**
- * Allocates and returns the index of a newly exported local
+ * Allocates and returns the index of a newly exported local
* PassByProxy object.
*
* @param pbp The local PassByProxy object to be exported
*
- * @return The index of the FarRef to be created-imported on the
- * other end.
+ * @return The index of the FarRef to be created-imported on the
+ * other end.
*/
public int newFarPos(Object pbp) {
pbp = PassByProxyGuard.THE_ONE.coerce(pbp, null);
1.4 +6 -6 e/src/jsrc/net/captp/tables/ImportsTable.java
Index: ImportsTable.java
===================================================================
RCS file: /cvs/e/src/jsrc/net/captp/tables/ImportsTable.java,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- ImportsTable.java 2001/08/29 00:20:15 1.3
+++ ImportsTable.java 2001/09/06 09:55:39 1.4
@@ -18,18 +18,18 @@
The Initial Developer of the Original Code is Mark S. Miller.
Copyright (C) 1999 Mark S. Miller. All Rights Reserved.
-Contributor(s): ______________________________________.
+Contributor(s): ______________________________________.
*/
-import org.erights.e.elib.ref.Ref;
import org.erights.e.elib.ref.ProxyHandler;
import org.erights.e.elib.ref.ProxyResolver;
+import org.erights.e.elib.ref.Ref;
/**
*
*/
public class ImportsTable extends CommTable {
-
+
/**
*
*/
@@ -47,21 +47,21 @@
}
super.smash(problem);
}
-
+
/**
*
*/
public ProxyResolver getProxyResolver(int index) {
return (ProxyResolver)get(index);
}
-
+
/**
*
*/
public Ref getProxy(int index) {
return getProxyResolver(index).getProxy();
}
-
+
/**
*
*/
1.5 +45 -45 e/src/jsrc/net/captp/tables/NearGiftTable.java
Index: NearGiftTable.java
===================================================================
RCS file: /cvs/e/src/jsrc/net/captp/tables/NearGiftTable.java,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -r1.4 -r1.5
--- NearGiftTable.java 2001/08/29 00:20:15 1.4
+++ NearGiftTable.java 2001/09/06 09:55:39 1.5
@@ -21,80 +21,80 @@
Contributor(s): ______________________________________.
*/
-import java.math.BigInteger;
-import org.erights.e.elib.prim.E;
import org.erights.e.elib.prim.WeakPtr;
import org.erights.e.elib.tables.FlexMap;
+import java.math.BigInteger;
+
/**
- * Rendezvous point for 3-vat live Granovetter introductions of Resolved
+ * Rendezvous point for 3-vat live Granovetter introductions of Resolved
* remote references (FarRefs). <p>
*
- * Where we normally speak of Alice giving Bob a reference to Carol, we here
- * speak of the Donor (VatA) giving to the Recipient (VatB) a reference to
- * the Gift (Carol) residing on the Host (VatC). There is one NearGiftTable in
- * the Host per Donor. The Donor associates the gift with a Nonce, the
- * Recipient's ID, and the SwissHash of the gift. She then tells the Nonce
- * and swissHash to the Recipient. The Rec