Revision: 16717
http://sourceforge.net/p/gate/code/16717
Author: markagreenwood
Date: 2013-07-02 11:22:03 +0000 (Tue, 02 Jul 2013)
Log Message:
-----------
added a warning message when PRs are removed because you unloaded a pipleine,
so that Adam is less likely to mess up his apps in the future :)
Modified Paths:
--------------
gate/trunk/src/gate/creole/CreoleRegisterImpl.java
Modified: gate/trunk/src/gate/creole/CreoleRegisterImpl.java
===================================================================
--- gate/trunk/src/gate/creole/CreoleRegisterImpl.java 2013-07-01 15:49:17 UTC
(rev 16716)
+++ gate/trunk/src/gate/creole/CreoleRegisterImpl.java 2013-07-02 11:22:03 UTC
(rev 16717)
@@ -504,9 +504,12 @@
* @param directory
*/
public void removeDirectory(URL directory) {
+ int prCount = 0;
+
if(directories.remove(directory)) {
DirectoryInfo dInfo = Gate.getDirectoryInfo(directory);
if(dInfo != null) {
+
for(ResourceInfo rInfo : dInfo.getResourceInfoList()) {
ResourceData rData = get(rInfo.getResourceClassName());
if (rData != null && rData.getReferenceCount() == 1) {
@@ -515,6 +518,7 @@
try {
List<Resource> loaded =
getAllInstances(rInfo.getResourceClassName(),true);
+ prCount += loaded.size();
for(Resource r : loaded) {
//System.out.println(r);
Factory.deleteResource(r);
@@ -536,6 +540,8 @@
}
log.info("CREOLE plugin unloaded: " + directory);
+ if (prCount > 0)
+ log.warn(prCount+" resources were deleted as they relied on the " +
dInfo.getName() +" plugin");
}
}
This was sent by the SourceForge.net collaborative development platform, the
world's largest Open Source development site.
------------------------------------------------------------------------------
This SF.net email is sponsored by Windows:
Build for Windows Store.
http://p.sf.net/sfu/windows-dev2dev
_______________________________________________
GATE-cvs mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/gate-cvs