@Override
	public Script create(ResourceDefinition definition)
			throws ResourceException {
		String compileAttr = definition.getAttribute("compile");
		boolean compile = (compileAttr != null && compileAttr.equals("false")) ? false : true;
		String file = definition.getValue();
		
		if (file.isEmpty()) {
			throw new ResourceException("Script resource with id='" + definition.getId() + "' does not define a file");
		}
		
		try {
			return factory.create(file, compile);
		} catch (ScriptException ex) {
			throw new ResourceException(ex);
		}
	}