org.apache.openejb.OpenEJB.isInitialized()方法的使用及代码示例

x33g5p2x  于2022-01-26 转载在 其他  
字(6.7k)|赞(0)|评价(0)|浏览(116)

本文整理了Java中org.apache.openejb.OpenEJB.isInitialized()方法的一些代码示例,展示了OpenEJB.isInitialized()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。OpenEJB.isInitialized()方法的具体详情如下:
包路径:org.apache.openejb.OpenEJB
类名称:OpenEJB
方法名:isInitialized

OpenEJB.isInitialized介绍

[英]1 usages
[中]1用法

代码示例

代码示例来源:origin: org.apache.openejb/tck-common

@Override
public boolean deploy(final InputStream archive, final String name) {
  if (!OpenEJB.isInitialized()) stuck = name;
  else System.out.println("STUCK " + stuck);

代码示例来源:origin: org.apache.tomee/tck-common

@Override
public boolean deploy(final InputStream archive, final String name) {
  if (!OpenEJB.isInitialized()) stuck = name;
  else System.out.println("STUCK " + stuck);

代码示例来源:origin: org.apache.geronimo.ext.openejb/openejb-core

public Context getInitialContext(Hashtable env) throws javax.naming.NamingException {
  if (!org.apache.openejb.OpenEJB.isInitialized()) {
    initializeOpenEJB(env);
  }
  String user = (String) env.get(Context.SECURITY_PRINCIPAL);
  String pass = (String) env.get(Context.SECURITY_CREDENTIALS);
  String realmName = (String) env.get("openejb.authentication.realmName");
  if (user != null && pass != null){
    try {
      SecurityService securityService = SystemInstance.get().getComponent(SecurityService.class);
      Object identity = null;
      if (realmName == null) {
        identity = securityService.login(user, pass);
      } else {
        identity = securityService.login(realmName, user, pass);
      }
      securityService.associate(identity);
    } catch (LoginException e) {
      throw (AuthenticationException) new AuthenticationException("User could not be authenticated: "+user).initCause(e);
    }
  }
  ContainerSystem containerSystem = SystemInstance.get().getComponent(ContainerSystem.class);
  Context context = containerSystem.getJNDIContext();
  context = (Context) context.lookup("openejb/local");
  return context;
}

代码示例来源:origin: org.apache.openejb/openejb-core

@SuppressWarnings("unchecked")
@Override
public Context getInitialContext(final Hashtable env) throws javax.naming.NamingException {
  if (!OpenEJB.isInitialized()) {
    initializeOpenEJB(env);
  }
  final String user = (String) env.get(Context.SECURITY_PRINCIPAL);
  final String pass = (String) env.get(Context.SECURITY_CREDENTIALS);
  final String realmName = (String) env.get("openejb.authentication.realmName");
  if (user != null && pass != null) {
    try {
      final SecurityService securityService = SystemInstance.get().getComponent(SecurityService.class);
      final Object identity;
      if (realmName == null) {
        identity = securityService.login(user, pass);
      } else {
        identity = securityService.login(realmName, user, pass);
      }
      securityService.associate(identity);
    } catch (final LoginException e) {
      throw (AuthenticationException) new AuthenticationException("User could not be authenticated: " + user).initCause(e);
    }
  }
  final ContainerSystem containerSystem = SystemInstance.get().getComponent(ContainerSystem.class);
  Context context = containerSystem.getJNDIContext();
  context = (Context) context.lookup("openejb/local");
  return context;
}

代码示例来源:origin: org.apache.tomee/openejb-core

@SuppressWarnings("unchecked")
@Override
public Context getInitialContext(final Hashtable env) throws javax.naming.NamingException {
  if (!OpenEJB.isInitialized()) {
    initializeOpenEJB(env);
  }
  final String user = (String) env.get(Context.SECURITY_PRINCIPAL);
  final String pass = (String) env.get(Context.SECURITY_CREDENTIALS);
  final String realmName = (String) env.get("openejb.authentication.realmName");
  if (user != null && pass != null) {
    try {
      final SecurityService securityService = SystemInstance.get().getComponent(SecurityService.class);
      final Object identity;
      if (realmName == null) {
        identity = securityService.login(user, pass);
      } else {
        identity = securityService.login(realmName, user, pass);
      }
      securityService.associate(identity);
    } catch (final LoginException e) {
      throw (AuthenticationException) new AuthenticationException("User could not be authenticated: " + user).initCause(e);
    }
  }
  final ContainerSystem containerSystem = SystemInstance.get().getComponent(ContainerSystem.class);
  Context context = containerSystem.getJNDIContext();
  context = (Context) context.lookup("openejb/local");
  return context;
}

代码示例来源:origin: org.apache.openejb/tomee-catalina

if (OpenEJB.isInitialized()) {
  ejbServer = SystemInstance.get().getComponent(EjbServer.class);
  return;

代码示例来源:origin: org.apache.openejb/openejb-tomcat-catalina

if (OpenEJB.isInitialized()) {
  ejbServer = SystemInstance.get().getComponent(EjbServer.class);
  return;

代码示例来源:origin: org.apache.geronimo.ext.openejb/openejb-core

/**
 * 2 usages
 */
public static void init(Properties initProps, ApplicationServer appServer) throws OpenEJBException {
  if (isInitialized()) {
    if (instance != null){
      String msg = messages.message("startup.alreadyInitialized");
      logger.error(msg, instance.initialized);
      throw new OpenEJBException(msg, instance.initialized);
    } else {
      String msg = messages.message("startup.alreadyInitialized");
      logger.error(msg);
      throw new OpenEJBException(msg);
    }
  } else {
    instance = appServer == null ? new Instance(initProps) : new Instance(initProps, appServer);
  }
}

代码示例来源:origin: org.apache.openejb/openejb-core

if (instance != null || OpenEJB.isInitialized()) {
  if (!isSingleClose()) {
    logger().info("EJBContainer already initialized.  Call ejbContainer.close() to allow reinitialization");
  if (instance == null && OpenEJB.isInitialized()) {
    try {
      OpenEJB.destroy();

代码示例来源:origin: org.apache.tomee/tomee-catalina

if (OpenEJB.isInitialized()) {
  ejbServer = SystemInstance.get().getComponent(EjbServer.class);
  return;

代码示例来源:origin: org.apache.openejb/openejb-core

/**
 * 2 usages
 */
public static synchronized void init(final Properties initProps, final ApplicationServer appServer) throws OpenEJBException {
  if (isInitialized()) {
    if (instance != null) {
      final String msg = messages.message("startup.alreadyInitialized");
      logger().error(msg, instance.initialized);
      throw new OpenEJBException(msg, instance.initialized);
    } else {
      final String msg = messages.message("startup.alreadyInitialized");
      logger().error(msg);
      throw new OpenEJBException(msg);
    }
  } else {
    instance = appServer == null ? new Instance(initProps) : new Instance(initProps, appServer);
  }
}

代码示例来源:origin: org.apache.tomee/openejb-core

if (instance != null || OpenEJB.isInitialized()) {
  if (!isSingleClose()) {
    logger().info("EJBContainer already initialized.  Call ejbContainer.close() to allow reinitialization");
  if (instance == null && OpenEJB.isInitialized()) {
    try {
      OpenEJB.destroy();

代码示例来源:origin: org.apache.tomee/openejb-core

/**
 * 2 usages
 */
public static void init(final Properties initProps, final ApplicationServer appServer) throws OpenEJBException {
  if (isInitialized()) {
    if (instance != null) {
      final String msg = messages().message("startup.alreadyInitialized");
      logger().error(msg, instance.initialized);
      throw new OpenEJBException(msg, instance.initialized);
    } else {
      final String msg = messages().message("startup.alreadyInitialized");
      logger().error(msg);
      throw new OpenEJBException(msg);
    }
  } else {
    instance = appServer == null ? new Instance(initProps) : new Instance(initProps, appServer);
  }
}

相关文章