Get an instance of a DataGridStateFactory given a {@link JspContext}.

@param jspContext the current {@link JspContext}
@return an instance of the factory
187794
public static final DataGridStateFactory getInstance(JspContext jspContext) {
        assert jspContext instanceof PageContext;
        return getInstance(((PageContext)jspContext).getRequest());
    }
151237
public static synchronized JspFactory getDefaultFactory() {
        if (deflt == null) {
            try {
                Class factory = Class.forName("org.apache.jasper.runtime.JspFactoryImpl");
                if (factory != null) {
                    deflt = (JspFactory) factory.newInstance();
                }
            } catch (Exception ex) {
            }
        }
	return deflt;
    }
703920
public ConnectionFactory<?> getConnectionFactory(String providerId) {
		ConnectionFactory<?> connectionFactory = connectionFactories.get(providerId);
		if (connectionFactory == null) {
			throw new IllegalArgumentException("No connection factory for service provider '" + providerId + "' is registered");
		}
		return connectionFactory;
	}
278595
private CmsJspStandardContextBean getStandardContext(CmsObject cms, HttpServletRequest req) throws CmsException {

        CmsJspStandardContextBean standardContext = CmsJspStandardContextBean.getInstance(req);
        standardContext.initPage();
        return standardContext;
    }
839618
protected Context createContext() throws NamingException
   {
      Properties properties = new Properties();
      properties.setProperty("java.naming.factory.initial", "org.jnp.interfaces.LocalOnlyContextFactory");
      properties.setProperty("java.naming.factory.url.pkgs", "org.jboss.naming:org.jnp.interfaces");
      properties.setProperty(Context.PROVIDER_URL, jndiProtocol + "://" + jndiHost + ":" + jndiPort);
      return new InitialContext(properties);
   }
1127435
public static ScriptFactory getScriptFactory() {
    ProcessEngineConfigurationImpl processEngineConfiguration = Context.getProcessEngineConfiguration();
    if (processEngineConfiguration != null) {
      return processEngineConfiguration.getScriptFactory();
    }
    else {
      return new ScriptFactory();
    }
  }
315196
public JspConfiguration createClonedJspConfiguration() {
        return new JspConfiguration(configManager, this.getServletVersion(), this.jspVersion, this.isXml, this.isXmlSpecified, this.elIgnored, this.scriptingInvalid(), this.isTrimDirectiveWhitespaces(), this.isDeferredSyntaxAllowedAsLiteral(), this.getTrimDirectiveWhitespaces(), this.getDeferredSyntaxAllowedAsLiteral(), this.elIgnoredSetTrueInPropGrp(), this.elIgnoredSetTrueInPage(), this.getDefaultContentType(), this.getBuffer(), this.isErrorOnUndeclaredNamespace());
    }
1255631
protected ConnectionFactory retrieveConnectionFactory(String name) throws JMSException {
        if (name == null && defaultConnectionFactory != null) {
            return defaultConnectionFactory; // injected
        }
        else {
            try {
                // autowiring did not occur
                return (ConnectionFactory)SpringAppContext.getInstance().getBean(name);
            }
            catch (Exception ex) {
                logger.severeException(ex.getMessage(), ex);
                throw new JMSException("JMS ConnectionFactory not found: " + name);
            }
        }
    }
682699
public static DataGridTagModel getDataGridTagModel(JspContext jspContext) {
        Object model = jspContext.getAttribute(KEY_GRID_MODEL);
        assert model != null ? model instanceof DataGridTagModel : true;
        return (DataGridTagModel)model;
    }
714360
final protected ServletBeanContext getServletBeanContext()
    {
        if (_beanContext == null)
        {
            ControlContainerContext ccc = ControlThreadContext.getContext();
            if (! (ccc instanceof ServletBeanContext))
                throw new IllegalStateException("No ServletBeanContext available");

            _beanContext = (ServletBeanContext)ccc;
        }
        return _beanContext;
    }
451201
public BindingFactory getBindingFactory() {
		if (bindingFactory == null) {
			bindingFactory = getApplicationConfig().bindingFactoryProvider().getBindingFactory(formModel);
		}
		return bindingFactory;
	}
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);
	}
42105
@FFDCIgnore(Exception.class)
    public DataSource getDataSource() throws Exception {
        if (tc.isEntryEnabled())
            Tr.entry(tc, "getDataSource");

        // Retrieve the data source factory from the CustomLogProperties. This Factory should be set in the JTMConfigurationProvider
        // by the jdbc component using DeclarativeServices. TxRecoveryAgentImpl gets the factory from the ConfigurationProvider and
        // then sets it into CustomLogProperties.
        ResourceFactory dataSourceFactory = _customLogProperties.resourceFactory();

        if (dataSourceFactory != null) {
            if (tc.isDebugEnabled())
                Tr.debug(tc, "Using DataSourceFactory " + dataSourceFactory);
        } else {
            if (tc.isEntryEnabled())
                Tr.exit(tc, "getDataSource", "Null ResourceFactory InternalLogException");
            throw new InternalLogException("Failed to locate DataSource, null Resourcefactory", null);
        }

        try {
            nonTranDataSource = (DataSource) dataSourceFactory.createResource(null);
        } catch (Exception e) {
            //e.printStackTrace();
            if (tc.isEntryEnabled())
                Tr.exit(tc, "getDataSource", "Caught exception " + e + "throw InternalLogException");
            throw new InternalLogException("Failed to locate DataSource, caught exception ", null);
        }

/*
 * TEMPORARY This is waiting on fixes to DeclarativeServices which impact the jdbc component. At present it is
 * possible that the DataSource will have been set but that its associated jdbc driver service will still be initialising
 */
//        boolean refSet = false;
//        while (!refSet)
//        {
//            if (tc.isDebugEnabled())
//                Tr.debug(tc, "getDataSource after sleep");
//            try {
//
//                nonTranDataSource = (DataSource) dataSourceFactory.createResource(null);
//                if (tc.isDebugEnabled())
//                    Tr.debug(tc, "Non Tran dataSource is " + nonTranDataSource);
//                Connection conn = nonTranDataSource.getConnection();
//                if (tc.isDebugEnabled())
//                    Tr.debug(tc, "Established connection " + conn);
//
//                DatabaseMetaData mdata = conn.getMetaData();
//
//                String dbName = mdata.getDatabaseProductName();
//                if (tc.isDebugEnabled())
//                    Tr.debug(tc, "Database name " + dbName);
//
//                String dbVersion = mdata.getDatabaseProductVersion();
//                if (tc.isDebugEnabled())
//                    Tr.debug(tc, "Database version " + dbVersion);
//                refSet = true;
//            } catch (Exception e) {
//                // We will catch an exception if the DataSource is not yet fully formed
//                if (tc.isDebugEnabled())
//                    Tr.debug(tc, "Caught exception: " + e);
//            }
//
//            if (!refSet)
//                Thread.sleep(200);
//        }
// eof TEMPORARY

        if (tc.isEntryEnabled())
            Tr.exit(tc, "getDataSource", nonTranDataSource);
        return nonTranDataSource;
    }
428011
private static <T> ServiceBindingBuilder<T> newFactoryBinder(final Factory<T> factory) {
        return BindingBuilderFactory.newFactoryBinder(factory);
    }
90413
public DataAccessFactory getDataAccessFactory(ConfigurableListableBeanFactory beanFactory) {
        if (this.dataAccessFactory == null) {
            dataAccessFactory = new DataAccessFactoryAdapter(//
                    new SpringDataSourceFactoryDelegate(beanFactory));
        }
        return dataAccessFactory;
    }
959067
public synchronized static ServiceFactory getInstance(Class<?> aClass, String configurationPath)
      {
         if(configurationPath == null)
         {
            configurationPath = "";   
         } 
         
         if (instances.get(configurationPath) == null)
         {
            instances.put(configurationPath, createServiceFactory(aClass,configurationPath));
         }         
         
         return (ServiceFactory)instances.get(configurationPath);
      }
777508
private ContextModel getOrCreateContext(final HttpContext httpContext) {
		// org.osgi.service.http.HttpContext -> org.ops4j.pax.web.service.WebContainerContext
		final WebContainerContext context;
		if (httpContext == null) {
			context = createDefaultHttpContext();
		} else if (!(httpContext instanceof WebContainerContext)) {
			context = new WebContainerContextWrapper(serviceBundle, httpContext);
		} else {
			context = (WebContainerContext) httpContext;
		}

		// sanity check - non shared context should be associated to single bundle
		serverModel.associateHttpContext(context, serviceBundle, httpContext instanceof SharedWebContainerContext);

		ContextModel contextModel = serviceModel.getContextModel(context);
		if (contextModel == null) {
			contextModel = new ContextModel(context, serviceBundle,
					bundleClassLoader);
			contextModel.setVirtualHosts(serverController.getConfiguration()
					.getVirtualHosts());
		}
		return contextModel;
	}