Delete an instance of a resource. This involves removing it from the stack of instantiations maintained by this resource type's resource data. Deletion does not guarantee that the resource will become a candidate for garbage collection, just that the GATE framework is no longer holding references to
(Resource resource)
| 461 | * @param resource the resource to be deleted. |
| 462 | */ |
| 463 | public static void deleteResource(Resource resource) { |
| 464 | ResourceData rd = |
| 465 | Gate.getCreoleRegister().get(resource.getClass().getName()); |
| 466 | if(rd != null && rd.removeInstantiation(resource)) { |
| 467 | creoleProxy.fireResourceUnloaded(new CreoleEvent(resource, |
| 468 | CreoleEvent.RESOURCE_UNLOADED)); |
| 469 | resource.cleanup(); |
| 470 | } |
| 471 | } // deleteResource |
| 472 | |
| 473 | /** Create a new transient Corpus. */ |
| 474 | public static Corpus newCorpus(String name) |