use of org.apache.openejb.table.Lines in project tomee by apache.
the class CommandHelper method listEJBs.
public static Lines listEJBs(final String cr) throws Exception {
final ContainerSystem cs = SystemInstance.get().getComponent(ContainerSystem.class);
final Lines lines = new Lines(cr);
lines.add(new Line("Name", "Class", "Interface Type", "Bean Type"));
for (final BeanContext bc : cs.deployments()) {
if (bc.isHidden()) {
continue;
}
lines.add(new Line(bc.getEjbName(), bc.getBeanClass().getName(), getType(bc), componentType(bc.getComponentType())));
}
return lines;
}
use of org.apache.openejb.table.Lines in project tomee by apache.
the class ListEjbMojo method execute.
@Override
public void execute() throws MojoExecutionException, MojoFailureException {
final Deployer deployer = (Deployer) lookup("openejb/DeployerBusinessRemote");
final Collection<AppInfo> infos = deployer.getDeployedApps();
final Lines lines = new Lines();
lines.add(new Line("Name", "Class", "Interface Type", "Bean Type"));
for (final AppInfo info : infos) {
for (final EjbJarInfo ejbJar : info.ejbJars) {
for (final EnterpriseBeanInfo bean : ejbJar.enterpriseBeans) {
lines.add(new Line(bean.ejbDeploymentId, bean.ejbClass, getType(bean), componentType(bean)));
}
}
}
lines.print(new LogPrinterStream(getLog()));
}
Aggregations