当前位置: 首页>>代码示例>>Java>>正文


Java LocalInitialContext类代码示例

本文整理汇总了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);
}
 
开发者ID:apache,项目名称:tomee,代码行数:26,代码来源:ServiceManagerProxy.java

示例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);
}
 
开发者ID:apache,项目名称:tomee,代码行数:6,代码来源:LocalInitialContextFactory.java


注:本文中的org.apache.openejb.core.LocalInitialContext类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。