Revision: 17132
          http://sourceforge.net/p/gate/code/17132
Author:   markagreenwood
Date:     2013-11-27 13:16:56 +0000 (Wed, 27 Nov 2013)
Log Message:
-----------
added a check, to stop Adam shooting himself in the foot, that makes sure 
Gate.init() has been called before you try and reload things via the 
PersistenceManager. I would have liked to add the same to 
Factory.createResource but this is actually called from within Gate.init making 
it tricky to check the status accurately

Modified Paths:
--------------
    gate/trunk/src/main/gate/util/persistence/PersistenceManager.java

Modified: gate/trunk/src/main/gate/util/persistence/PersistenceManager.java
===================================================================
--- gate/trunk/src/main/gate/util/persistence/PersistenceManager.java   
2013-11-27 02:22:33 UTC (rev 17131)
+++ gate/trunk/src/main/gate/util/persistence/PersistenceManager.java   
2013-11-27 13:16:56 UTC (rev 17132)
@@ -826,6 +826,11 @@
 
   public static Object loadObjectFromUrl(URL url) throws PersistenceException,
           IOException, ResourceInstantiationException {
+    
+    if(!Gate.isInitialised())
+      throw new ResourceInstantiationException(
+              "You must call Gate.init() before you can restore resources");
+    
     ProgressListener pListener = (ProgressListener)Gate.getListeners()
             .get("gate.event.ProgressListener");
     StatusListener sListener = (gate.event.StatusListener)Gate

This was sent by the SourceForge.net collaborative development platform, the 
world's largest Open Source development site.


------------------------------------------------------------------------------
Rapidly troubleshoot problems before they affect your business. Most IT 
organizations don't have a clear picture of how application performance 
affects their revenue. With AppDynamics, you get 100% visibility into your 
Java,.NET, & PHP application. Start your 15-day FREE TRIAL of AppDynamics Pro!
http://pubads.g.doubleclick.net/gampad/clk?id=84349351&iu=/4140/ostg.clktrk
_______________________________________________
GATE-cvs mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/gate-cvs

Reply via email to