private void configureScope(ServiceProfile<?> profile) throws IOException { assert profile != null; String scopeSymbol = profile.getConfiguration(KEY_SCOPE, false, true); if (scopeSymbol == null) { scope = ExecutionLock.Scope.getDefault(); LOG.debug("Lock scope is not defined, use default: {}", scope.getSymbol()); } else { scope = ExecutionLock.Scope.findFromSymbol(scopeSymbol); if (scope == null) { throw new IOException(MessageFormat.format( "Unknown lock scope in \"{0}.{1}\": {2}", profile.getPrefix(), KEY_SCOPE, scopeSymbol)); } } }
/** * Returns the symbol of this scope. * @return the symbol of this scope */ @Override public String getSymbol() { return name().toLowerCase(); }
@Override public String toString() { return getSymbol(); }