comparison src/org/dancres/blitz/remote/LocalSpace.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;
2
3 import java.io.IOException;
4
5 import java.rmi.RemoteException;
6 import java.rmi.MarshalledObject;
7 import java.rmi.NoSuchObjectException;
8 import java.util.logging.Level;
9 import java.util.logging.Logger;
10 import java.util.ArrayList;
11 import java.util.List;
12
13 import net.jini.core.event.RemoteEventListener;
14 import net.jini.core.event.EventRegistration;
15
16 import net.jini.core.entry.Entry;
17
18 import net.jini.core.lease.Lease;
19 import net.jini.core.lease.UnknownLeaseException;
20 import net.jini.core.lease.LeaseDeniedException;
21
22 import net.jini.core.transaction.Transaction;
23 import net.jini.core.transaction.TransactionException;
24 import net.jini.core.transaction.UnknownTransactionException;
25 import net.jini.core.transaction.server.TransactionManager;
26 import net.jini.core.discovery.LookupLocator;
27 import net.jini.discovery.DiscoveryLocatorManagement;
28 import net.jini.space.JavaSpace;
29 import net.jini.space.JavaSpace05;
30 import net.jini.config.Configuration;
31 import net.jini.config.ConfigurationException;
32 import net.jini.id.UuidFactory;
33 import net.jini.id.Uuid;
34
35 import org.dancres.blitz.*;
36 import org.dancres.blitz.config.ConfigurationFactory;
37 import org.dancres.blitz.remote.view.ViewRegistration;
38 import org.dancres.blitz.remote.view.EntryViewFactory;
39 import org.dancres.blitz.remote.view.EntryViewUID;
40 import org.dancres.blitz.stats.Stat;
41 import org.dancres.blitz.stats.StatsBoard;
42 import org.dancres.blitz.stats.Switch;
43 import org.dancres.blitz.stats.SwitchSettings;
44 import org.dancres.blitz.lease.SpaceUID;
45 import org.dancres.blitz.lease.LeaseBounds;
46 import org.dancres.blitz.notify.RemoteEventDispatcher;
47
48 import org.dancres.blitz.mangler.MangledEntry;
49
50 import org.dancres.blitz.txn.TxnGateway;
51 import org.dancres.blitz.txn.StoragePersonalityFactory;
52
53 /**
54 <p>An entirely local implementation of a JavaSpace using Blitz. Useful for
55 debugging where one would like client and server co-located. An instance
56 of this class, when configured with an appropriate
57 <code>TxnGateway</code> instance, can provide an embedded space
58 implementation. For an example, see <code>TxnStress</code></p>
59
60 @see org.dancres.blitz.txn.TxnGateway
61 @see org.dancres.blitz.test.TxnStress
62
63 @todo Add support for lease renewal.
64 */
65 public class LocalSpace implements BlitzServer {
66 static final Logger theLogger =
67 Logging.newLogger("org.dancres.blitz.remote.LocalSpace", Level.INFO);
68
69 private Uuid theUuid;
70
71 private BlitzProxy theSpaceProxy;
72
73 private TxnGateway theTxnGate;
74
75 private AdminProxy theAdminProxy;
76
77 private TxnParticipantProxy theTxnProxy;
78
79 private boolean isStopped;
80
81 private SpaceImpl theSpace;
82
83 public LocalSpace(TxnGateway aGateway) throws Exception {
84 init(aGateway);
85 }
86
87 public LocalSpace() throws Exception {
88 init(null);
89 }
90
91 public JavaSpace05 getProxy() {
92 return theSpaceProxy;
93 }
94
95 private void init(TxnGateway aGateway)
96 throws RemoteException, ConfigurationException {
97
98 theUuid = UuidFactory.generate();
99
100 StoragePersonalityFactory.getPersonality();
101
102 theAdminProxy =
103 ProxyFactory.newAdminProxy(this, theUuid);
104
105 theSpaceProxy =
106 ProxyFactory.newBlitzProxy(this, theUuid);
107
108 theTxnProxy =
109 ProxyFactory.newTxnParticipantProxy(this, theUuid);
110 theTxnGate = aGateway;
111
112 RemoteEventDispatcher.setSource(theSpaceProxy);
113
114 try {
115 theSpace = new SpaceImpl(theTxnGate);
116
117 } catch (Exception anE) {
118 theLogger.log(Level.SEVERE, "Failed to start space", anE);
119 throw new RemoteException("Failed to start space", anE);
120 }
121 }
122
123 public LeaseImpl write(MangledEntry anEntry, Transaction aTxn,
124 long aLeaseTime)
125 throws RemoteException, TransactionException {
126
127 stopBarrier();
128
129 try {
130 WriteTicket myTicket = theSpace.write(anEntry, aTxn, aLeaseTime);
131
132 return
133 ProxyFactory.newEntryLeaseImpl(this, theUuid,
134 myTicket.getUID(),
135 myTicket.getExpirationTime());
136 } catch (IOException anIOE) {
137 theLogger.log(Level.SEVERE, "SpaceImpl has disk problems", anIOE);
138 throw new RemoteException("Space has disk problems", anIOE);
139 }
140 }
141
142 public MangledEntry take(MangledEntry anEntry, Transaction aTxn,
143 long aWaitTime)
144 throws RemoteException, TransactionException {
145
146 stopBarrier();
147
148 try {
149 return theSpace.take(anEntry, aTxn, aWaitTime);
150 } catch (IOException anIOE) {
151 theLogger.log(Level.SEVERE, "SpaceImpl has disk problems", anIOE);
152 throw new RemoteException("Space has disk problems", anIOE);
153 }
154 }
155
156 public MangledEntry read(MangledEntry anEntry, Transaction aTxn,
157 long aWaitTime)
158 throws RemoteException, TransactionException {
159
160 stopBarrier();
161
162 try {
163 return theSpace.read(anEntry, aTxn, aWaitTime);
164 } catch (IOException anIOE) {
165 theLogger.log(Level.SEVERE, "SpaceImpl has disk problems", anIOE);
166 throw new RemoteException("Space has disk problems", anIOE);
167 }
168 }
169
170 public MangledEntry takeIfExists(MangledEntry anEntry, Transaction aTxn,
171 long aWaitTime)
172 throws RemoteException, TransactionException {
173
174 stopBarrier();
175
176 try {
177 return theSpace.takeIfExists(anEntry, aTxn, aWaitTime);
178 } catch (IOException anIOE) {
179 theLogger.log(Level.SEVERE, "SpaceImpl has disk problems", anIOE);
180 throw new RemoteException("Space has disk problems", anIOE);
181 }
182 }
183
184 public MangledEntry readIfExists(MangledEntry anEntry, Transaction aTxn,
185 long aWaitTime)
186 throws RemoteException, TransactionException {
187
188 stopBarrier();
189
190 try {
191 return theSpace.readIfExists(anEntry, aTxn, aWaitTime);
192 } catch (IOException anIOE) {
193 theLogger.log(Level.SEVERE, "SpaceImpl has disk problems", anIOE);
194 throw new RemoteException("Space has disk problems", anIOE);
195 }
196 }
197
198 public EventRegistration notify(MangledEntry anEntry, Transaction aTxn,
199 RemoteEventListener aListener,
200 long aLeaseTime,
201 MarshalledObject aHandback)
202 throws RemoteException, TransactionException {
203
204 stopBarrier();
205
206 try {
207 RegTicket myTicket =
208 theSpace.notify(anEntry, aTxn, aListener, aLeaseTime,
209 aHandback);
210
211 LeaseImpl myLease =
212 ProxyFactory.newLeaseImpl(this, theUuid,
213 myTicket.getUID(),
214 myTicket.getExpirationTime());
215
216 return new EventRegistration(myTicket.getSourceId(), theSpaceProxy,
217 myLease, myTicket.getSeqNum());
218 } catch (IOException anIOE) {
219 theLogger.log(Level.SEVERE, "SpaceImpl has disk problems", anIOE);
220 throw new RemoteException("Space has disk problems", anIOE);
221 }
222 }
223
224 public int prepare(TransactionManager mgr, long id)
225 throws UnknownTransactionException, RemoteException {
226
227 stopBarrier();
228
229 return theSpace.getTxnControl().prepare(mgr, id);
230 }
231
232 public void commit(TransactionManager mgr, long id)
233 throws UnknownTransactionException, RemoteException {
234
235 stopBarrier();
236
237 theSpace.getTxnControl().commit(mgr, id);
238 }
239
240 public void abort(TransactionManager mgr, long id)
241 throws UnknownTransactionException, RemoteException {
242
243 stopBarrier();
244
245 theSpace.getTxnControl().abort(mgr, id);
246 }
247
248 public int prepareAndCommit(TransactionManager mgr, long id)
249 throws UnknownTransactionException, RemoteException {
250
251 stopBarrier();
252
253 return theSpace.getTxnControl().prepareAndCommit(mgr, id);
254 }
255
256 /* *********************************************************************
257 * Landlord
258 ******************************************************************** */
259 public long renew(SpaceUID aUID, long aDuration)
260 throws UnknownLeaseException, LeaseDeniedException, RemoteException {
261
262 // System.out.println("Renew: " + aUID + ", " + aDuration);
263
264 stopBarrier();
265
266 try {
267 long myResult = theSpace.getLeaseControl().renew(aUID, aDuration);
268
269 // System.out.println("Renew: " + myResult);
270
271 return myResult;
272 } catch (IOException anIOE) {
273 theLogger.log(Level.SEVERE, "Space has disk problems", anIOE);
274 throw new RemoteException("Space has disk problems", anIOE);
275 }
276 }
277
278 public void cancel(SpaceUID aUID)
279 throws UnknownLeaseException, RemoteException {
280
281 stopBarrier();
282
283 try {
284 theSpace.getLeaseControl().cancel(aUID);
285 } catch (IOException anIOE) {
286 theLogger.log(Level.SEVERE, "Space has disk problems", anIOE);
287 throw new RemoteException("Space has disk problems", anIOE);
288 }
289 }
290
291 public LeaseResults renew(SpaceUID[] aLeases, long[] aDurations)
292 throws RemoteException {
293
294 stopBarrier();
295
296 long[] myNewDurations = new long[aLeases.length];
297 Exception[] myFails = null;
298
299 for (int i = 0; i < aLeases.length; i++) {
300 try {
301 myNewDurations[i] =
302 theSpace.getLeaseControl().renew(aLeases[i],
303 aDurations[i]);
304 } catch (LeaseDeniedException anLDE) {
305 if (myFails == null)
306 myFails = initFails(aLeases.length, i);
307
308 myNewDurations[i] = -1;
309 myFails[i] = anLDE;
310 } catch (UnknownLeaseException anULE) {
311 if (myFails == null)
312 myFails = initFails(aLeases.length, i);
313
314 myNewDurations[i] = -1;
315 myFails[i] = anULE;
316 } catch (IOException anIOE) {
317 theLogger.log(Level.SEVERE, "Space has disk problems", anIOE);
318 throw new RemoteException("Space has disk problems", anIOE);
319 }
320 }
321
322 return new LeaseResults(myNewDurations, myFails);
323 }
324
325 public LeaseResults cancel(SpaceUID[] aLeases)
326 throws RemoteException {
327
328 stopBarrier();
329
330 Exception[] myFails = null;
331
332 for (int i = 0; i < aLeases.length; i++) {
333 try {
334 theSpace.getLeaseControl().cancel(aLeases[i]);
335 } catch (UnknownLeaseException aULE) {
336 if (myFails == null)
337 myFails = initFails(aLeases.length, i);
338
339 myFails[i] = aULE;
340 } catch (IOException anIOE) {
341 theLogger.log(Level.SEVERE, "Space has disk problems", anIOE);
342 throw new RemoteException("Space has disk problems", anIOE);
343 }
344 }
345
346 if (myFails != null)
347 return new LeaseResults(null, myFails);
348 else
349 return null;
350 }
351
352 private Exception[] initFails(int aLength, int anOffset) {
353 return new Exception[aLength];
354 }
355
356 /* *********************************************************************
357 * Administrable::getAdmin support
358 ******************************************************************** */
359
360 public Object getAdmin() throws RemoteException {
361 stopBarrier();
362
363 return theAdminProxy;
364 }
365
366 /* *********************************************************************
367 * JoinAdmin
368 ******************************************************************** */
369 /**
370 * Get the current attribute sets for the service.
371 *
372 * @return the current attribute sets for the service
373 * @throws java.rmi.RemoteException
374 */
375 public Entry[] getLookupAttributes() throws RemoteException {
376 stopBarrier();
377
378 throw new UnsupportedOperationException();
379 }
380
381 /**
382 * Add attribute sets for the service. The resulting set will be used
383 * for all future joins. The attribute sets are also added to all
384 * currently-joined lookup services.
385 *
386 * @param attrSets the attribute sets to add
387 * @throws java.rmi.RemoteException
388 */
389 public void addLookupAttributes(Entry[] attrSets) throws RemoteException {
390 stopBarrier();
391
392 throw new UnsupportedOperationException();
393 }
394
395 /**
396 * Modify the current attribute sets, using the same semantics as
397 * ServiceRegistration.modifyAttributes. The resulting set will be used
398 * for all future joins. The same modifications are also made to all
399 * currently-joined lookup services.
400 *
401 * @param attrSetTemplates the templates for matching attribute sets
402 * @param attrSets the modifications to make to matching sets
403 * @throws java.rmi.RemoteException
404 *
405 * @see net.jini.core.lookup.ServiceRegistration#modifyAttributes
406 */
407 public void modifyLookupAttributes(Entry[] attrSetTemplates,
408 Entry[] attrSets)
409 throws RemoteException {
410 stopBarrier();
411
412 throw new UnsupportedOperationException();
413 }
414
415 /**
416 * Get the list of groups to join. An empty array means the service
417 * joins no groups (as opposed to "all" groups).
418 *
419 * @return an array of groups to join. An empty array means the service
420 * joins no groups (as opposed to "all" groups).
421 * @throws java.rmi.RemoteException
422 * @see #setLookupGroups
423 */
424 public String[] getLookupGroups() throws RemoteException {
425 stopBarrier();
426
427 throw new UnsupportedOperationException();
428 }
429
430 /**
431 * Add new groups to the set to join. Lookup services in the new
432 * groups will be discovered and joined.
433 *
434 * @param groups groups to join
435 * @throws java.rmi.RemoteException
436 * @see #removeLookupGroups
437 */
438 public void addLookupGroups(String[] groups) throws RemoteException {
439 stopBarrier();
440
441 throw new UnsupportedOperationException();
442 }
443
444 /**
445 * Remove groups from the set to join. Leases are cancelled at lookup
446 * services that are not members of any of the remaining groups.
447 *
448 * @param groups groups to leave
449 * @throws java.rmi.RemoteException
450 * @see #addLookupGroups
451 */
452 public void removeLookupGroups(String[] groups) throws RemoteException {
453 stopBarrier();
454
455 throw new UnsupportedOperationException();
456 }
457
458 /**
459 * Replace the list of groups to join with a new list. Leases are
460 * cancelled at lookup services that are not members of any of the
461 * new groups. Lookup services in the new groups will be discovered
462 * and joined.
463 *
464 * @param groups groups to join
465 * @throws java.rmi.RemoteException
466 * @see #getLookupGroups
467 */
468 public void setLookupGroups(String[] groups) throws RemoteException {
469 stopBarrier();
470
471 throw new UnsupportedOperationException();
472 }
473
474 private DiscoveryLocatorManagement getDLM() {
475 throw new UnsupportedOperationException();
476 }
477
478 /**
479 *Get the list of locators of specific lookup services to join.
480 *
481 * @return the list of locators of specific lookup services to join
482 * @throws java.rmi.RemoteException
483 * @see #setLookupLocators
484 */
485 public LookupLocator[] getLookupLocators() throws RemoteException {
486 stopBarrier();
487
488 throw new UnsupportedOperationException();
489 }
490
491 /**
492 * Add locators for specific new lookup services to join. The new
493 * lookup services will be discovered and joined.
494 *
495 * @param locators locators of specific lookup services to join
496 * @throws java.rmi.RemoteException
497 * @see #removeLookupLocators
498 */
499 public void addLookupLocators(LookupLocator[] locators)
500 throws RemoteException {
501 stopBarrier();
502
503 throw new UnsupportedOperationException();
504 }
505
506 /**
507 * Remove locators for specific lookup services from the set to join.
508 * Any leases held at the lookup services are cancelled.
509 *
510 * @param locators locators of specific lookup services to leave
511 * @throws java.rmi.RemoteException
512 * @see #addLookupLocators
513 */
514 public void removeLookupLocators(LookupLocator[] locators)
515 throws RemoteException {
516 stopBarrier();
517
518 throw new UnsupportedOperationException();
519 }
520
521 /**
522 * Replace the list of locators of specific lookup services to join
523 * with a new list. Leases are cancelled at lookup services that were
524 * in the old list but are not in the new list. Any new lookup services
525 * will be discovered and joined.
526 *
527 * @param locators locators of specific lookup services to join
528 * @throws java.rmi.RemoteException
529 * @see #getLookupLocators
530 */
531 public void setLookupLocators(LookupLocator[] locators)
532 throws RemoteException {
533 stopBarrier();
534
535 throw new UnsupportedOperationException();
536 }
537
538 public void destroy() throws RemoteException {
539 stopBarrier();
540
541 blockCalls();
542
543 try {
544 theSpace.stop();
545 } catch (Exception anE) {
546 throw new RemoteException("Failed to destroy", anE);
547 }
548 }
549
550 private void blockCalls() {
551 synchronized(this) {
552 isStopped = true;
553 }
554 }
555
556 private void unblockCalls() {
557 synchronized(this) {
558 isStopped = false;
559 }
560 }
561
562 /**
563 Used to check whether calls are blocked and, if they are, throws
564 a RemoteException back to the client.
565 */
566 private void stopBarrier() throws RemoteException {
567 synchronized(this) {
568 if (isStopped)
569 throw new RemoteException("Remote calls not permitted");
570 }
571 }
572
573 public TxnControl getTxnControl() {
574 return theSpace.getTxnControl();
575 }
576
577 public void stop() throws RemoteException {
578 destroy();
579 }
580
581 /* *********************************************************************
582 * StatsAdmin
583 ******************************************************************** */
584
585 public Stat[] getStats() throws RemoteException {
586 stopBarrier();
587
588 return StatsBoard.get().getStats();
589 }
590
591 public void setSwitches(Switch[] aListOfSwitches) throws RemoteException {
592 stopBarrier();
593
594 SwitchSettings.get().update(aListOfSwitches);
595 }
596
597 /* *********************************************************************
598 * EntryViewAdmin
599 ******************************************************************** */
600 public JavaSpace getJavaSpaceProxy() throws RemoteException {
601 return theSpaceProxy;
602 }
603
604 public ViewResult newView(MangledEntry[] aTemplates, Transaction aTxn,
605 long aLeaseDuration, boolean isJavaSpace05,
606 long aLimit, int anInitialChunk)
607 throws RemoteException, TransactionException {
608
609 stopBarrier();
610
611 try {
612 long myDuration = aLeaseDuration;
613
614 /*
615 Bound the lease if we're instructed to do so - we may not
616 be required to if this is an emulation of the old
617 JavaSpaceAdmin::contents call
618 */
619 if (isJavaSpace05)
620 myDuration = LeaseBounds.boundView(aLeaseDuration);
621
622 /*
623 * JavaSpace05 holds locks only for a non-null transaction.
624 * JavaSpaceAdmin never holds locks but uses the transaction to
625 * test visibility
626 */
627 boolean holdLocks =
628 (isJavaSpace05) ? (aTxn != null) : false;
629
630 /*
631 If we're being asked to do JavaSpace05, we're performing the new contents
632 operation which means we should pass true for holdlocks, false otherwise
633 */
634 ViewRegistration myReg =
635 EntryViewFactory.get().newView(aTemplates, aTxn, holdLocks,
636 myDuration, aLimit, theSpace);
637
638 /*
639 Okay, got a view, now we need an initial batch
640 */
641 EntryChit[] myInitialBatch = getNext(myReg.getUID(), anInitialChunk);
642
643 return new ViewResult(
644 ProxyFactory.newLeaseImpl(this, theUuid,
645 myReg.getUID(),
646 myReg.getExpiry()),
647 myInitialBatch);
648 } catch (IOException anIOE) {
649 throw new RemoteException("Failed to create view", anIOE);
650 }
651 }
652
653 public EntryChit[] getNext(EntryViewUID aUid, int aChunkSize)
654 throws RemoteException {
655
656 stopBarrier();
657
658 ArrayList myNext = new ArrayList();
659
660 EntryView myView = EntryViewFactory.get().getView(aUid);
661
662 /*
663 View could have expired or been otherwise lost
664 */
665 if (myView == null)
666 throw new NoSuchObjectException("View has been lost");
667
668 try {
669 for (int i = 0; i < aChunkSize; i++) {
670 EntryChit myChit = myView.next();
671
672 if (myChit == null)
673 break;
674 else
675 myNext.add(myChit);
676 }
677 } catch (TransactionException aTE) {
678 throw new RemoteException("View was prematurely destroyed - was a transaction ended?", aTE);
679 } catch (IOException anIOE) {
680 throw new RemoteException("Couldn't recover an Entry", anIOE);
681 }
682
683 if (myNext.size() == 0)
684 return null;
685
686 EntryChit[] myChits = new EntryChit[myNext.size()];
687 myChits = (EntryChit[]) myNext.toArray(myChits);
688
689 return myChits;
690 }
691
692 /**
693 Deletes a specific entity returned from an
694 <code>EntryView</code> via an <code>EntryChit</code>
695 */
696 public void delete(Object aCookie) throws RemoteException {
697 stopBarrier();
698
699 try {
700 theSpace.getLeaseControl().cancel((SpaceUID) aCookie);
701 } catch (IOException anIOE) {
702 theLogger.log(Level.SEVERE, "Space has disk problems", anIOE);
703 throw new RemoteException("Space has disk problems", anIOE);
704 } catch (UnknownLeaseException aULE) {
705 // It's gone already, fail silently
706 }
707 }
708
709 public void close(EntryViewUID aUid) throws RemoteException {
710 stopBarrier();
711
712 EntryViewFactory.get().delete(aUid);
713 }
714
715 /* *********************************************************************
716 * JavaSpace05
717 ******************************************************************** */
718
719 public List write(List aMangledEntries, Transaction aTxn, List aLeaseTimes)
720 throws RemoteException, TransactionException {
721
722 stopBarrier();
723
724 try {
725 List myTickets = theSpace.write(aMangledEntries, aTxn, aLeaseTimes);
726
727 for (int i = 0; i < myTickets.size(); i++) {
728 WriteTicket myTicket = (WriteTicket) myTickets.get(i);
729
730 Lease myLease =
731 ProxyFactory.newEntryLeaseImpl(this, theUuid,
732 myTicket.getUID(),
733 myTicket.getExpirationTime());
734
735 myTickets.set(i, myLease);
736 }
737
738 return myTickets;
739 } catch (IOException anIOE) {
740 theLogger.log(Level.SEVERE, "SpaceImpl has disk problems", anIOE);
741 throw new RemoteException("Space has disk problems", anIOE);
742 }
743 }
744
745 public List take(MangledEntry[] aTemplates, Transaction aTxn,
746 long aWaitTime, long aLimit)
747 throws RemoteException, TransactionException {
748
749 stopBarrier();
750
751 try {
752 return theSpace.take(aTemplates, aTxn, aWaitTime, aLimit);
753 } catch (IOException anIOE) {
754 theLogger.log(Level.SEVERE, "SpaceImpl has disk problems", anIOE);
755 throw new RemoteException("Space has disk problems", anIOE);
756 }
757 }
758
759 public EventRegistration
760 registerForVisibility(MangledEntry[] aTemplates, Transaction aTxn,
761 RemoteEventListener aListener, long aLeaseTime,
762 MarshalledObject aHandback,
763 boolean visibilityOnly)
764 throws RemoteException, TransactionException {
765
766 stopBarrier();
767
768 try {
769 RegTicket myTicket =
770 theSpace.visibility(aTemplates, aTxn, aListener, aLeaseTime,
771 aHandback, visibilityOnly);
772
773 LeaseImpl myLease =
774 ProxyFactory.newLeaseImpl(this, theUuid,
775 myTicket.getUID(),
776 myTicket.getExpirationTime());
777
778 return new EventRegistration(myTicket.getSourceId(), theSpaceProxy,
779 myLease, myTicket.getSeqNum());
780 } catch (IOException anIOE) {
781 theLogger.log(Level.SEVERE, "SpaceImpl has disk problems", anIOE);
782 throw new RemoteException("Space has disk problems", anIOE);
783 }
784 }
785
786 /* *********************************************************************
787 * BlitzAdmin
788 ******************************************************************** */
789 public void requestSnapshot() throws RemoteException,
790 TransactionException, IOException {
791 stopBarrier();
792 theSpace.getTxnControl().requestSnapshot();
793 }
794
795 public void shutdown() throws RemoteException {
796 // stopBarrier is done in destroyImpl
797 destroy();
798 }
799
800 public void backup(String aDir) throws RemoteException, IOException {
801 stopBarrier();
802 theSpace.getTxnControl().backup(aDir);
803 }
804
805 public void clean() throws RemoteException, IOException {
806 stopBarrier();
807
808 blockCalls();
809
810 theSpace.empty();
811
812 unblockCalls();
813 }
814
815 public void reap() throws RemoteException {
816 theSpace.reap();
817 }
818
819 /* *********************************************************************
820 * ServiceProxyAccessor
821 ******************************************************************** */
822
823 public Object getServiceProxy() throws RemoteException {
824 stopBarrier();
825
826 return theSpaceProxy;
827 }
828 }