Gets the java:comp scope data for a configuration, or null if the
configuration represents application.xml data or a managed bean.
344075
private OSGiInjectionScopeData getCompInjectionScopeData(ComponentNameSpaceConfiguration compNSConfig) {
        if (isManagedBean(compNSConfig)) {
            return null;
        }

        ComponentMetaData cmd = compNSConfig.getComponentMetaData();
        if (cmd == null) {
            ModuleMetaData mmd = compNSConfig.getModuleMetaData();
            if (mmd == null) {
                return null;
            }
            return getInjectionScopeData(mmd);
        }

        return getInjectionScopeData(cmd);
    }
805364
private static ICollaboratorHelper getCurrentInstance()
  {
      ComponentMetaData cmd = ComponentMetaDataAccessorImpl.getComponentMetaDataAccessor().getComponentMetaData();
      if (cmd != null)
      {
          WebModuleMetaData wmmd = (WebModuleMetaData)cmd.getModuleMetaData();
          return ((WebAppConfiguration)wmmd.getConfiguration()).getWebApp().getCollaboratorHelper();
      }
      else
      {
          return null;
      }        
  }
231458
private void lookupBeanScopeAndName(HttpServletRequest request, ServletContext servletContext)
            throws JspException
    {
        // Look up the application module configuration information we need
        _appConfig = (ModuleConfig) request.getAttribute(Globals.MODULE_KEY);
        if (_appConfig == null) { // Backwards compatibility hack
            _appConfig = (ModuleConfig) servletContext.getAttribute(Globals.MODULE_KEY);
        }
        if (_appConfig == null) {
            registerTagError(Bundle.getString("Tags_FormNoApplicationConfig"), null);
            return;
        }
        _servlet = (ActionServlet) servletContext.getAttribute(Globals.ACTION_SERVLET_KEY);
        _flowController = PageFlowUtils.getCurrentPageFlow(request, pageContext.getServletContext());

        // check to see if this is a bad action
        
        PageFlowTagUtils.MappingAndController mac = PageFlowTagUtils.getActionMapping(request, _flowController, _state.action);
        if (mac == null) {
            FlowController globalApp = PageFlowUtils.getSharedFlow(InternalConstants.GLOBALAPP_CLASSNAME, request);
            mac = PageFlowTagUtils.getActionMapping(request, globalApp, _state.action);
        }
        if (mac == null) {
            registerTagError(Bundle.getString("Tags_BadAction", _state.action), null);
            return;
        }

        _flowController = mac.controller;
        _mapping = mac.mapping;
        assert (_mapping != null) : "Mapping not found for controller";
        _appConfig = _mapping.getModuleConfig();

        // Were the required values already specified?
        if (_beanName != null) {
            if (!_explicitBeanType) {
                registerTagError(Bundle.getString("Tags_FormNameNoType"), null);
                return;
            }
            if (_beanScope == null)
                _beanScope = "session";
            return;
        }

        // Look up the form bean definition
        FormBeanConfig formBeanConfig = _appConfig.findFormBeanConfig(_mapping.getName());
        if (formBeanConfig == null) {
            // clear any _beanType
            _beanType = null;
        }
        else {
            // Calculate the required values
            _beanName = _mapping.getAttribute();
            _beanScope = _mapping.getScope();
            _beanType = formBeanConfig.getType();
        }
    }
905743
@Override
    public BeansXml getBeansXml() {
        if (this.beansXml == null) {
            Resource beansXmlResource = archive.getBeansXml();
            if (beansXmlResource != null) {
                URL beansXmlUrl = beansXmlResource.getURL();
                Bootstrap bootstrap = getCDIDeployment().getBootstrap();
                final ClassLoader origTCCL = getContextClassLoader();
                try {
                    // Must use this class's loader as the context classloader to ensure
                    // that we load Liberty's XML parser rather than any parser defined
                    // in the application.
                    setContextClassLoader(BeanDeploymentArchiveImpl.class.getClassLoader());
                    beansXml = bootstrap.parse(beansXmlUrl);
                } finally {
                    setContextClassLoader(origTCCL);
                }
            }
        }
        return this.beansXml;
    }
1087720
private Object getFieldValue(Object bean)
            throws IllegalAccessException, InvocationTargetException, NoSuchMethodException {
        return PropertyUtils.getProperty(bean, field.getName());
    }
1026394
public static PmiModuleConfig getConfig(String moduleID) {
        if (moduleID == null)
            return null;

        PmiModuleConfig config = (PmiModuleConfig) moduleConfigs.get(moduleID);

        if (config == null) {
            // beanModule and com.ibm.websphere.pmi.xml.beanModule will work
            // if moduleID doesn't have a '.' then use pre-defined modulePrefix
            int hasDot = moduleID.indexOf('.');
            if (hasDot == -1) {
                // not found in moduleConfigs; try as a pre-defined module
                // prepend com.ibm.websphere.pmi.xml. to moduleID
                String preDefinedMod = DEFAULT_MODULE_PREFIX + moduleID;
                config = getConfigFromXMLFile(getXmlFileName(preDefinedMod), true, false);
            }
        }

        if (config == null) {
            // input moduleID has '.' in it. use as it is            
            // do validation since its NOT pre-defined module
            config = getConfigFromXMLFile(getXmlFileName(moduleID), true, true);
        }

        return config;
    }
513536
public static Configuration getConfiguration() {
	    if(configuration == null){
            try {
                configuration = (Configuration) getContext().getBean("configuration");
            } catch (BeansException e) {
                LOGGER.error("Can't load config. Error: {}",e ,e);
            }
        }
	    return configuration;
	}
1339509
private static String getReferenceName(Page configPage,
      Map<String, ConfigurationMetadata> configurationMetadatas, Set<String> configurationBuckets) {
    List<String> pathParts = Arrays.asList(StringUtils.split(configPage.getPath(), "/"));
    return pathParts.stream()
        .filter(name -> !configurationBuckets.contains(name))
        .map(name -> {
          ConfigurationMetadata configMetadata = configurationMetadatas.get(name);
          if (configMetadata != null && configMetadata.getLabel() != null) {
            return configMetadata.getLabel();
          }
          else {
            return name;
          }
        })
        .collect(Collectors.joining(" / "));
  }
977986
@Override
  public ICCASessionData getAppSessionData(Class<? extends AppSession> clazz, String sessionId) {
    if (clazz.equals(ClientCCASession.class)) {
      ClientCCASessionDataLocalImpl data = new ClientCCASessionDataLocalImpl();
      data.setSessionId(sessionId);
      return data;
    }
    else if (clazz.equals(ServerCCASession.class)) {
      ServerCCASessionDataLocalImpl data = new ServerCCASessionDataLocalImpl();
      data.setSessionId(sessionId);
      return data;
    }
    throw new IllegalArgumentException(clazz.toString());
  }
765680
private Configuration getConfFromContext() {
    Configuration conf = (Configuration)getServletContext().getAttribute(
        HttpServer.CONF_CONTEXT_ATTRIBUTE);
    assert conf != null;
    return conf;
  }
1088829
private Attribute getAttribute(MappedField configuredField, Class<?> configuredClass){
		// If configuredClass exists in XML configuration file
		for (Class<?> clazz : getAllsuperClasses(configuredClass))
			if (isMapped(clazz))
				// loads all configured attributes
				for (Attribute attribute : loadAttributes().get(clazz.getName())) {

					// verifies that exists the attribute written in XML in
					// the configured Class
					if (isNull(fieldName(clazz, attribute.getName())))
						Error.attributeAbsent(clazz, attribute);

					// if the field given in input isn't equal to xmlField
					// continue with the cycle
					if (attribute.getName().equals(configuredField.getValue().getName()))
						return attribute;
				}
		return null;
	}
878565
private Object getComponent(JspContext context) throws JspTagException
	{
		int scope = context.getAttributesScope(name);

		if (scope == 0)
		{
			throw new JspTagException("Cannot find component: " + name);
		}
		
		return context.getAttribute(name, scope);
	}
1217677
public final UtilXml lazyGetUtilXml() throws Exception {
    String beanName = getUtilXmlName();
    UtilXml utilXml = (UtilXml) this.beansMap.get(beanName);
    if (utilXml == null) {
      utilXml = new UtilXml();
      this.beansMap.put(beanName, utilXml);
      lazyGetLogger().info(null, AFactoryAppBeans.class, beanName
        + " has been created.");
    }
    return utilXml;
  }
832837
protected Object resolveProviderConfig(String exp, Map<String, ? extends Object> contextMap, LaContainer container,
            Class<?> resultType) {
        if (exp.startsWith(PROVIDER_GET) && exp.endsWith(METHOD_MARK) && exp.contains(".") && !exp.contains("\"")) {
            final String[] tokens = exp.split("\\.");
            if (tokens.length > 1) {
                Object component = null;
                BeanDesc beanDesc = null;
                for (String prop : tokens) {
                    if (prop.endsWith(METHOD_MARK)) { // method
                        if (component == null) { // e.g. getJdbcUrl() only
                            break;
                        }
                        final String methodName = prop.substring(0, prop.length() - METHOD_MARK.length());
                        component = beanDesc.invoke(component, methodName, (Object[]) null);
                        beanDesc = BeanDescFactory.getBeanDesc(component.getClass());
                    } else { // component or property
                        if (beanDesc == null) { // first element
                            if (container.hasComponentDef(prop)) { // component
                                component = container.getComponent(prop);
                                beanDesc = BeanDescFactory.getBeanDesc(component.getClass());
                            } else {
                                break;
                            }
                        } else { // next elements, property
                            final PropertyDesc propertyDesc = beanDesc.getPropertyDesc(prop);
                            if (propertyDesc != null) {
                                component = propertyDesc.getValue(component);
                                beanDesc = BeanDescFactory.getBeanDesc(component.getClass());
                            } else {
                                break;
                            }
                        }
                    }
                }
                if (component != null) {
                    return component;
                }
            }
        }
        return null;
    }
336478
String getConfigString() throws XPathExpressionException {
		ganglia = getXmlNode("/jmxetric-config/ganglia", inputSource);
		String hostname = getHostName();
		int port = getPort();
		UDPAddressingMode addressingMode = getAddressingMode();
		boolean v31x = getV31();
		String spoof = getSpoof();

		StringBuilder buf = new StringBuilder();
		buf.append("GMetric host=").append(hostname);
		buf.append(" port=").append(port);
		buf.append(" mode=").append(addressingMode);
		buf.append(" v31x=").append(v31x);
		buf.append(" spoof=").append(spoof);
		return buf.toString();
	}
97048
public ConfigurationResult getConfiguration ()
        throws ServiceException
    {
        requireAdminUser();

        final ServletWaiter<ConfigurationResult> waiter =
            new ServletWaiter<ConfigurationResult>("getConfiguration");

        _omgr.postRunnable(new Runnable() {
            public void run () {
                Map<String, ConfigurationRecord> tabs = Maps.newHashMap();
                for (String key : _confReg.getKeys()) {
                    ConfigurationRecord record = buildRecord(key);
                    if (record == null) {
                        waiter.requestFailed(
                            new ServiceException(InvocationCodes.E_INTERNAL_ERROR));
                        return;
                    }
                    tabs.put(key, record);
                }

                ConfigurationResult result = new ConfigurationResult();
                result.records = tabs;
                waiter.requestCompleted(result);
            }
        });

        return waiter.waitForResult();
    }
1202436
private String getSchema() {
        if (Utils.isEmpty(m_config.schema)) {
            m_config.schema = m_config.root + m_config.app + ".xml";
        }
        File schemaFile = new File(m_config.schema);
        if (!schemaFile.exists()) {
            logErrorThrow("Schema file not found: {}", m_config.schema);
        }
        StringBuilder schemaBuffer = new StringBuilder();
        char[] charBuffer = new char[65536];
        try (FileReader reader = new FileReader(schemaFile)) {
            for (int bytesRead = reader.read(charBuffer); bytesRead > 0; bytesRead = reader.read(charBuffer)) {
                schemaBuffer.append(charBuffer, 0, bytesRead);
            }
        } catch (Exception e) {
            logErrorThrow("Cannot read schema file '{}': {}", m_config.schema, e);
        }
        return schemaBuffer.toString();
    }