@Override
	public synchronized void closeArchive(DataTypeManager dtm) {
		if (dtm instanceof BuiltInDataTypeManager) {
			Msg.info(this, "Cannot close the built-in Data Type Manager");
			return;
		}

		if (dtm instanceof ProgramDataTypeManager) {
			Msg.info(this, "Cannot close the Program's Data Type Manager");
			return;
		}

		DataTypeManagerInfo dtmInfo = openDTMs.get(dtm.getUniversalID());
		if (dtmInfo == null) {
			Msg.info(this, "Unable close archive; archive not open: '%s'".formatted(dtm.getName()));
			return;
		}

		beforeCloseDataTypeManager(dtmInfo);
		openDTMs.remove(dtm.getUniversalID());

		if (dtmInfo.domainObject != null) {
			dtmInfo.domainObject.release(this);
		}
		dtmInfo.dtm.close();

		afterCloseDataTypeManager(dtmInfo);
	}
Simple, non-ui implementation of the {@link DataTypeArchiveService} interface.
Ghidra/Features/Base/src/main/java/ghidra/app/plugin/core/datamgr/archive/DefaultDataTypeArchiveService.java