MCPcopy Create free account
hub / github.com/GateNLP/gate-core / deleteResource

Method deleteResource

src/main/java/gate/Factory.java:463–471  ·  view source on GitHub ↗

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)

Source from the content-addressed store, hash-verified

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)

Callers 15

testAnnicIndexingMethod · 0.95
testExplicitMimeTypeMethod · 0.95
testDefaultValueMethod · 0.95
checkPersistenceMethod · 0.95
tearDownMethod · 0.95
populateMethod · 0.95
datastoreClosedMethod · 0.95
resourceDeletedMethod · 0.95
datastoreClosedMethod · 0.95
resourceDeletedMethod · 0.95
executeImplMethod · 0.95
cleanupMethod · 0.95

Calls 6

getCreoleRegisterMethod · 0.95
removeInstantiationMethod · 0.95
getMethod · 0.65
getNameMethod · 0.65
cleanupMethod · 0.65
fireResourceUnloadedMethod · 0.45

Tested by 5

testAnnicIndexingMethod · 0.76
testExplicitMimeTypeMethod · 0.76
testDefaultValueMethod · 0.76
checkPersistenceMethod · 0.76
tearDownMethod · 0.76