/** * Returns this dependency state. */ @Override public int getState() { // Can be called from any threads, but our class attributes are volatile if (m_isStarted) { return (isAvailable() ? 1 : 0) + (isRequired() ? 2 : 0); } else { return isRequired() ? ComponentDependencyDeclaration.STATE_REQUIRED : ComponentDependencyDeclaration.STATE_OPTIONAL; } }