org.jboss.arquillian.container.spi.client.container.LifecycleException类的使用及代码示例

x33g5p2x  于2022-01-24 转载在 其他  
字(7.2k)|赞(0)|评价(0)|浏览(107)

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

LifecycleException介绍

[英]LifecycleException
[中]生命周期异常

代码示例

代码示例来源:origin: org.wildfly/wildfly-arquillian-container-managed

private void failDueToRunning() throws LifecycleException {
  throw new LifecycleException(
      "The server is already running! " +
          "Managed containers do not support connecting to running server instances due to the " +
          "possible harmful effect of connecting to the wrong server. Please stop server before running or " +
          "change to another type of container.\n" +
          "To disable this check and allow Arquillian to connect to a running server, " +
          "set allowConnectingToRunningServer to true in the container configuration"
  );
}

代码示例来源:origin: wildfly/wildfly-arquillian

private void failDueToRunning() throws LifecycleException {
  throw new LifecycleException("The server is already running! "
      + "Managed containers do not support connecting to running server instances due to the "
      + "possible harmful effect of connecting to the wrong server. Please stop server before running or "
      + "change to another type of container.\n"
      + "To disable this check and allow Arquillian to connect to a running server, "
      + "set allowConnectingToRunningServer to true in the container configuration");
}

代码示例来源:origin: org.jboss.arquillian.container/arquillian-wls-common

/**
 * Closes the connection to the Domain Runtime MBean Server.
 * 
 * @throws LifecycleException
 */
private void closeConnection() throws LifecycleException {
  try {
    if (connector != null) {
      connector.close();
    }
  } catch (IOException ioEx) {
    throw new LifecycleException("Failed to close the connection to the MBean Server.", ioEx);
  }
}

代码示例来源:origin: org.jboss.arquillian.container/arquillian-jetty-embedded-9

public void stop() throws LifecycleException
{
  try
  {
    log.info("Stopping Jetty Embedded Server [id:" + server.hashCode() + "]");
    server.stop();
  }
  catch (Exception e)
  {
    throw new LifecycleException("Could not stop container",e);
  }
}

代码示例来源:origin: org.jboss.arquillian.container/arquillian-jetty-embedded-7

@Override
public void stop() throws LifecycleException
{
  try
  {
    log.info("Stopping Jetty Embedded Server [id:" + server.hashCode() + "]");
    server.stop();
  }
  catch (Exception e)
  {
    throw new LifecycleException("Could not stop container",e);
  }
}

代码示例来源:origin: org.infinispan.arquillian.container/infinispan-arquillian-container-managed

@Override
public void stop() throws LifecycleException
{
 try
 {
   if (process != null)
   {
    process.destroy();
    process.waitFor();
    process = null;
   }
 }
 catch (Exception e)
 {
   throw new LifecycleException("Could not stop container", e);
 }
}

代码示例来源:origin: org.arquillian.container/arquillian-container-chameleon

private <T> T lifecycle(Callable<T> callable) throws LifecycleException {
  ClassLoader current = Thread.currentThread().getContextClassLoader();
  try {
    Thread.currentThread().setContextClassLoader(classloader);
    return callable.call();
  } catch (LifecycleException e) {
    throw e;
  } catch (Exception e) {
    throw new LifecycleException("Could not proxy call", e);
  } finally {
    Thread.currentThread().setContextClassLoader(current);
  }
}

代码示例来源:origin: arquillian/arquillian-container-chameleon

private <T> T lifecycle(Callable<T> callable) throws LifecycleException {
  ClassLoader current = Thread.currentThread().getContextClassLoader();
  try {
    Thread.currentThread().setContextClassLoader(classloader);
    return callable.call();
  } catch (LifecycleException e) {
    throw e;
  } catch (Exception e) {
    throw new LifecycleException("Could not proxy call", e);
  } finally {
    Thread.currentThread().setContextClassLoader(current);
  }
}

代码示例来源:origin: org.jboss.arquillian.container/arquillian-tomcat-managed-common

@Override
public void stop() throws LifecycleException {
  if (shutdownThread != null) {
    Runtime.getRuntime().removeShutdownHook(shutdownThread);
    shutdownThread = null;
  }
  try {
    if (startupProcess != null) {
      startupProcess.destroy();
      startupProcess.waitFor();
      startupProcess = null;
    }
  } catch (final Exception e) {
    throw new LifecycleException("Could not stop container", e);
  }
}

代码示例来源:origin: org.jboss.arquillian.container/arquillian-tomcat-embedded-7

@Override
public void stop() throws LifecycleException {
  if (wasStarted) {
    try {
      stopTomcatEmbedded();
    } catch (final org.apache.catalina.LifecycleException e) {
      throw new LifecycleException("Failed to stop Tomcat", e);
    }
  }
}

代码示例来源:origin: org.wildfly/wildfly-arquillian-container-embedded

@Override
protected void startInternal() throws LifecycleException {
  try {
    server.start();
  } catch (Throwable e) {
    throw new LifecycleException("Could not invoke start on: " + server, e);
  }
}

代码示例来源:origin: org.jboss.arquillian.container/arquillian-tomcat-embedded-7

@Override
public void start() throws LifecycleException {
  try {
    startTomcatEmbedded();
  } catch (final Exception e) {
    throw new LifecycleException("Failed to start embedded Tomcat", e);
  }
}

代码示例来源:origin: org.wildfly/wildfly-arquillian-container-embedded

@Override
  protected void stopInternal() throws LifecycleException {
    try {
      server.stop();
    } catch (Throwable e) {
      throw new LifecycleException("Could not invoke stop on: " + server, e);
    }
  }
}

代码示例来源:origin: org.mobicents.arquillian.container/mss-tomcat-embedded-6

@Override
public void removeSipConnector(String ipAddress, int port, String transport) throws LifecycleException {
  try {
    (sipStandardService).removeSipConnector(ipAddress, port, transport);
  } catch (Exception e) {
    throw new LifecycleException("Couldn't remove the sip connector " + ipAddress+":"+port+"/"+transport, e);
  }
}

代码示例来源:origin: org.jboss.as/jboss-as-arquillian-container-embedded

@Override
  protected void stopInternal() throws LifecycleException {
    try {
      server.stop();
    } catch (Throwable e) {
      throw new LifecycleException("Could not invoke stop on: " + server, e);
    }
  }
}

代码示例来源:origin: org.jboss.arquillian.container/arquillian-jetty-common

public static void assertMinimumJettyVersion(String version, String minimum) throws LifecycleException
  {
    if (!VersionUtil.isGreaterThenOrEqual(version,minimum))
    {
      throw new LifecycleException("Incompatible Jetty container version on the classpath: [actual:" + version + "], [minimum:" + minimum + "]");
    }
  }
}

代码示例来源:origin: org.mobicents.arquillian.container/mss-tomcat-embedded-6

@Override
public void addSipConnector(SipConnector sipConnector) throws LifecycleException {
  try {
    (sipStandardService).addSipConnector(sipConnector);
  } catch (Exception e) {
    throw new LifecycleException("Couldn't create the sip connector " + sipConnector, e);
  }
}

代码示例来源:origin: org.jboss.arquillian.container/arquillian-jbossas-remote-6

@Override
public void stop() throws LifecycleException
{
 try 
 {
   removeFailedUnDeployments();
 } 
 catch (Exception e) 
 {
   throw new LifecycleException("Could not clean up", e);
 }
}

代码示例来源:origin: org.jboss.as/jboss-as-arquillian-container-embedded

@Override
protected void startInternal() throws LifecycleException {
  try {
    server.start();
  } catch (Throwable e) {
    throw new LifecycleException("Could not invoke start on: " + server, e);
  }
}

代码示例来源:origin: org.jboss.arquillian.container/arquillian-container-osgi

@Override
public void uninstallBundle(long bundleId) throws Exception {
  try {
    frameworkMBean.uninstallBundle(bundleId);
    logger.info("Bundle '" + bundleId + " was uninstalled");
  } catch (Exception ex) {
    throw new LifecycleException("Cannot uninstall " + bundleId, ex);
  }
}

相关文章

微信公众号

最新文章

更多

LifecycleException类方法