org.beigesoft.ajetty.FactoryAppBeansStd Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of a-jetty-base Show documentation
Show all versions of a-jetty-base Show documentation
A-Jetty Base can run on Android Java as well as on standard Java 7+ and it can run precompiled JSP/JSTL.
package org.beigesoft.ajetty;
/*
* Beigesoft ™
*
* Licensed under the Apache License, Version 2.0
*
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*/
import org.beigesoft.afactory.IFactoryAppBeans;
/**
* Factory app-beans for standart Java.
*
* @author Yury Demidenko
*/
public class FactoryAppBeansStd implements IFactoryAppBeans {
/**
* Factory WebAppClassLoaderStd.
**/
private FactoryWebAppClassLoaderStd factoryWebAppClassLoaderStd;
/**
* Get bean in lazy mode (if bean is null then initialize it).
* @param pBeanName - bean name
* @return Object - requested bean
* @throws Exception - an exception
*/
@Override
public final synchronized Object lazyGet(
final String pBeanName) throws Exception {
if ("IFactoryParam"
.equals(pBeanName)) {
return lazyGetFactoryWebAppClassLoaderStd();
}
throw new Exception("There is no bean: " + pBeanName);
}
/**
* Getter for factoryWebAppClassLoaderStd.
* @return FactoryWebAppClassLoaderStd
**/
public final FactoryWebAppClassLoaderStd
lazyGetFactoryWebAppClassLoaderStd() {
if (this.factoryWebAppClassLoaderStd == null) {
this.factoryWebAppClassLoaderStd = new FactoryWebAppClassLoaderStd();
}
return this.factoryWebAppClassLoaderStd;
}
}