use of gate.event.CreoleEvent in project gate-core by GateNLP.
the class CreoleProxy method createDataStore.
// openDataStore()
/**
* Create a new DataStore and open it. <B>NOTE:</B> for some data
* stores creation is an system administrator task; in such cases this
* method will throw an UnsupportedOperationException.
*/
public static DataStore createDataStore(String dataStoreClassName, String storageUrl) throws PersistenceException, UnsupportedOperationException {
DataStore ds = instantiateDataStore(dataStoreClassName, storageUrl);
ds.create();
ds.open();
if (Gate.getDataStoreRegister().add(ds))
creoleProxy.fireDatastoreCreated(new CreoleEvent(ds, CreoleEvent.DATASTORE_CREATED));
return ds;
}
use of gate.event.CreoleEvent in project gate-core by GateNLP.
the class CreoleProxy method deleteResource.
// create(resourceClassName, parameterValues, features, listeners)
/**
* 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 the resource.
*
* @param resource the resource to be deleted.
*/
public static void deleteResource(Resource resource) {
ResourceData rd = Gate.getCreoleRegister().get(resource.getClass().getName());
if (rd != null && rd.removeInstantiation(resource)) {
creoleProxy.fireResourceUnloaded(new CreoleEvent(resource, CreoleEvent.RESOURCE_UNLOADED));
resource.cleanup();
}
}
Aggregations