code: public OSGiInjectionScopeData getInjectionScopeData(ComponentMetaData cmd, NamingConstants.JavaColonNamespace namespace) {
          if (cmd == null) {
              return null;
          }
  
          if (namespace == NamingConstants.JavaColonNamespace.GLOBAL) {
              return globalScopeData;
          }
  
          if (namespace == NamingConstants.JavaColonNamespace.COMP || namespace == NamingConstants.JavaColonNamespace.COMP_ENV) {
              OSGiInjectionScopeData isd = (OSGiInjectionScopeData) cmd.getMetaData(componentMetaDataSlot);
  
              if (isd == null) {
                  ModuleMetaData mmd = cmd.getModuleMetaData();
                  if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {
                      Tr.debug(tc, "trying module " + mmd);
                  }
  
                  // WAR java:comp is shared across all components, so the
                  // bindings are stored in the module metadata.
                  isd = (OSGiInjectionScopeData) cmd.getModuleMetaData().getMetaData(moduleMetaDataSlot);
                  if (isd == null || !isd.isCompAllowed()) {
                      return null;
                  }
              }
  
              return isd;
          }
  
          ModuleMetaData mmd = cmd.getModuleMetaData();
          if (namespace == NamingConstants.JavaColonNamespace.MODULE) {
              if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {
                  Tr.debug(tc, "trying " + mmd);
              }
              return (OSGiInjectionScopeData) mmd.getMetaData(moduleMetaDataSlot);
          }
  
          if (namespace == NamingConstants.JavaColonNamespace.APP) {
              ApplicationMetaData amd = mmd.getApplicationMetaData();
              if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {
                  Tr.debug(tc, "trying " + amd);
              }
              return (OSGiInjectionScopeData) amd.getMetaData(applicationMetaDataSlot);
          }
  
          return null;
      }
docs: Gets the injection scope data for a namespace.
  
  @param cmd the component metadata, or null if null should be returned
  @param namespace the namespace
  @return the scope data, or null if unavailable