comparison src/org/dancres/blitz/remote/perf/ProxyFactory.java @ 0:3dc0c5604566

Initial checkin of blitz 2.0 fcs - no installer yet.
author Dan Creswell <dan.creswell@gmail.com>
date Sat, 21 Mar 2009 11:00:06 +0000
parents
children
comparison
equal deleted inserted replaced
-1:000000000000 0:3dc0c5604566
1 package org.dancres.blitz.remote.perf;
2
3 import net.jini.id.Uuid;
4
5 import net.jini.core.constraint.RemoteMethodControl;
6
7 import org.dancres.blitz.lease.SpaceUID;
8
9 /**
10 This class instantiates appropriate proxy instances of the given types
11 based on whether we are running in secure mode or not (secure mode is
12 defined to be active when our exported stub reference supports
13 RemoteMethodControl which will be the result of config file containing
14 an appropriate Exporter setup).
15 */
16 class ProxyFactory {
17 private static boolean isSecure(Server aStub) {
18 return (aStub instanceof RemoteMethodControl);
19 }
20
21 static LeaseImpl newLeaseImpl(Server aStub, Uuid aUuid,
22 FakeUID aUID, long anExpiration) {
23 if (isSecure(aStub))
24 return new ConstrainableLeaseImpl(aStub, aUuid, aUID,
25 anExpiration);
26 else
27 return new LeaseImpl(aStub, aUuid, aUID, anExpiration);
28 }
29 }