abstractName = (AbstractName) in.readObject(); } catch (IOException e) { throw (IOException) new IOException("Unable to deserialize AbstractName for GBeanData of type " + gbeanInfo.getClassName()).initCause(e);
/** * Return MBean basic info */ @RemoteMethod public Collection<String[]> getMBeanInfo(String abstractName) { Collection<String[]> info = new ArrayList<String[]>(); try { AbstractName aname = new AbstractName(URI.create(abstractName)); info.add(new String[] { "abstractName", aname.toString() }); ObjectName oname = aname.getObjectName(); info.add(new String[] { "objectName", oname.toString() }); GBeanInfo beanInfo = kernel.getGBeanInfo(aname); String className = beanInfo.getClassName(); info.add(new String[] { "className", className }); String domain = oname.getDomain(); info.add(new String[] { "domain", domain }); String j2eeType = beanInfo.getJ2eeType(); info.add(new String[] { "j2eeType", j2eeType }); // String sourceClass = beanInfo.getSourceClass(); // info.add(new String[] { "sourceClass", sourceClass }); } catch (Exception e) { // GBean not found, just ignore } return info; }
private void addContainerInfos(Configuration configuration, ContainerSystemInfo containerSystem, ConfigurationFactory configurationFactory) throws OpenEJBException { LinkedHashSet<GBeanData> containerDatas = configuration.findGBeanDatas(Collections.singleton(new AbstractNameQuery(EjbContainer.class.getName()))); for (GBeanData containerData : containerDatas) { String id = EjbContainer.getId(containerData.getAbstractName()); Class<? extends ContainerInfo> infoClass = EjbContainer.getInfoType(containerData.getGBeanInfo().getClassName()); Properties declaredProperties = new Properties(); String providerId = null; ContainerInfo containerInfo = configurationFactory.configureService(infoClass, id, declaredProperties, providerId, "Container"); containerSystem.containers.add(containerInfo); } }
type = classLoader.loadClass(gbeanInfo.getClassName()); } catch (ClassNotFoundException e) { throw new InvalidConfigurationException("Could not load GBeanInfo class from classloader: " + classLoader + " className=" + gbeanInfo.getClassName(), e);
interfaceTypes.add(gBeanData.getGBeanInfo().getClassName()); gBeanType = ClassLoading.loadClass(gBeanData.getGBeanInfo().getClassName(), bundle); } catch (ClassNotFoundException e) { throw new DeploymentException("Cannot load GBean class", e);
public static LinkedHashSet<String> getImports(List<GBeanData> gbeans) { LinkedHashSet<String> imports = new LinkedHashSet<String>(); for (GBeanData data: gbeans) { GBeanInfo info = data.getGBeanInfo(); addImport(imports, info.getClassName()); for (GAttributeInfo attInfo: info.getAttributes()) { addImport(imports, attInfo.getType()); } for (GReferenceInfo refInfo: info.getReferences()) { addImport(imports, refInfo.getReferenceType()); } for (GOperationInfo opInfo: info.getOperations()) { addImport(imports, opInfo.getReturnType()); for (String paramType : opInfo.getParameterList()) { addImport(imports, paramType); } } } return imports; }