public boolean deployInternal(Iterable<Class<?>> classes, Iterable<URL> beansXmls)
{
try
{
final TCKMetaDataDiscoveryImpl discovery = (TCKMetaDataDiscoveryImpl) ServiceLoader.getService(ScannerService.class);
// Lifecycle container
this.lifeCycle = new StandaloneLifeCycle()
{
protected void afterInitApplication(Properties event)
{
this.scannerService = discovery;
}
@Override
public void beforeStartApplication(Object object)
{
super.beforeStartApplication(object);
try
{
PluginLoader.getInstance().startUp();
EjbPlugin plugin = (EjbPlugin) PluginLoader.getInstance().getEjbPlugin();
plugin.setUseInTest(true);
}
catch (Throwable e)
{
// Not worry
}
}
};
Iterator<Class<?>> it = classes.iterator();
while (it.hasNext())
{
discovery.addBeanClass(it.next());
}
Iterator<URL> itUrl = beansXmls.iterator();
while (itUrl.hasNext())
{
discovery.addBeanXml(itUrl.next());
}
this.lifeCycle.startApplication(null);
}
catch (Throwable e)