本文整理汇总了Java中org.apache.openejb.core.LocalInitialContext类的典型用法代码示例。如果您正苦于以下问题:Java LocalInitialContext类的具体用法?Java LocalInitialContext怎么用?Java LocalInitialContext使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
LocalInitialContext类属于org.apache.openejb.core包,在下文中一共展示了LocalInitialContext类的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: ServiceManagerProxy
import org.apache.openejb.core.LocalInitialContext; //导入依赖的package包/类
public ServiceManagerProxy(final boolean checkAlreadyStarted) throws AlreadyStartedException {
final ClassLoader classLoader = Thread.currentThread().getContextClassLoader();
try {
serviceManagerClass = classLoader.loadClass("org.apache.openejb.server.ServiceManager");
} catch (final ClassNotFoundException e) {
final String msg = "Enabling option '" + LocalInitialContext.OPENEJB_EMBEDDED_REMOTABLE + "' requires class 'org.apache.openejb.server.ServiceManager' to be available. Make sure you have the openejb-server-*.jar in your classpath and at least one protocol implementation such as openejb-ejbd-*.jar.";
throw new IllegalStateException(msg, e);
}
final Method get = getMethod("get");
final Method getManager = getMethod("getManager");
if (checkAlreadyStarted && invoke(get, null) != null) {
throw new AlreadyStartedException("Server services already started");
}
serviceManager = invoke(getManager, null);
logger.info("Initializing network services");
final Method init = getMethod("init");
invoke(init, serviceManager);
}
示例2: getInitialContext
import org.apache.openejb.core.LocalInitialContext; //导入依赖的package包/类
@Override
public Context getInitialContext(final Hashtable env) throws NamingException {
init(env);
return new LocalInitialContext(env, this);
}