public String getName() { return name.toString(); }
public String toString() { return abstractName.toString(); } }
public String toString() { return name.toString(); }
public String toString() { if (abstractName != null) { return abstractName.toString(); } else { return patterns.toString(); } }
/** * Notify OpenJPA that the ClassLoader will no longer be used. This allows OpenJPA to free up * HARD references that would otherwise prevent Geronimo ClassLoaders from being GCed. */ private void configurationStopped(AbstractName name) { ClassLoader classLoader = classLoaderMap.remove(name); if (classLoader == null) { log.debug("Could not locate ClassLoader for artifact: " + name.toString()); } PCRegistry.deRegister(classLoader); }
public WebAppData(Artifact parentConfigId, String childName, AbstractName moduleBeanName, boolean enabled, String dynamicPattern, boolean serveStaticContent) { this.parentConfigId = parentConfigId.toString(); this.enabled = enabled; this.dynamicPattern = dynamicPattern; this.serveStaticContent = serveStaticContent; this.moduleBeanName = moduleBeanName == null ? null : moduleBeanName.toString(); this.childName = childName; }
public ThreadPoolSummary(AbstractName abstractName, int maxSize) { this.abstractName = abstractName.toString(); name = (String) abstractName.getName().get(NameFactory.J2EE_NAME); this.maxSize = maxSize; }
/** * Cache the ClassLoader for a newly started Configuration. */ private void configurationRunning(AbstractName name) { try { Configuration config = (Configuration)kernel.getGBean(name); bundleMap.put(name, config.getBundle()); } catch (GBeanNotFoundException gnfe) { log.warn("Could not retrieve GBean for artifact: " + name.toString(), gnfe); } }
/** * Cache the ClassLoader for a newly started Configuration. */ private void configurationRunning(AbstractName name) { try { Configuration config = (Configuration)kernel.getGBean(name); classLoaderMap.put(name, config.getConfigurationClassLoader()); } catch (GBeanNotFoundException gnfe) { log.warn("Could not retrieve GBean for artifact: " + name.toString(), gnfe); } }
/** * List MBeans containing a substring in its object name */ @RemoteMethod public Collection<String[]> listBySubstring(String substring) { Collection<String[]> result = new ArrayList<String[]>(); if ((substring == null) || (substring.trim().length() == 0)) { return result; } Collection<AbstractName> abstractNames = getAbstractNames(substring); for (Iterator<AbstractName> it = abstractNames.iterator(); it.hasNext();) { AbstractName abstractName = it.next(); ObjectName objectName = abstractName.getObjectName(); String[] pair = { abstractName.toString(), objectName.toString() }; result.add(pair); } return result; }
/** * List MBeans using J2EE type */ @RemoteMethod public Collection<String[]> listByJ2EEType(String type) { Collection<String[]> result = new ArrayList<String[]>(); Map<String, String> m = null; if ((type == null) || (type.trim().length() == 0)) { return result; } else { if (ALL_MBEANS.equalsIgnoreCase(type)) { m = Collections.EMPTY_MAP; } else { m = Collections.singletonMap(NameFactory.J2EE_TYPE, type); } } AbstractNameQuery query = new AbstractNameQuery(null, m, Collections.EMPTY_SET); Set<AbstractName> beans = kernel.listGBeans(query); for (Iterator<AbstractName> it = beans.iterator(); it.hasNext();) { AbstractName abstractName = (AbstractName) it.next(); ObjectName objectName = abstractName.getObjectName(); String[] pair = { abstractName.toString(), objectName.toString() }; result.add(pair); } return result; }
public synchronized void addGBean(GBeanData gbean) throws GBeanAlreadyExistsException { if (gbeans.containsKey(gbean.getAbstractName())) { throw new GBeanAlreadyExistsException(gbean.getAbstractName().toString()); } gbeans.put(gbean.getAbstractName(), gbean); }
public void addGBean(GBeanData gbean) throws GBeanAlreadyExistsException { if (gbeans.containsKey(gbean.getAbstractName())) { throw new GBeanAlreadyExistsException(gbean.getAbstractName().toString()); } gbeans.put(gbean.getAbstractName(), gbean); }
/** * Notify OpenJPA that the ClassLoader will no longer be used. This allows OpenJPA to free up * HARD references that would otherwise prevent Geronimo ClassLoaders from being GCed. */ private void configurationStopped(AbstractName name) { Bundle bundle = bundleMap.remove(name); if (bundle == null) { log.debug("Could not locate Bundle for artifact: " + name.toString()); return; } // iterate over the registry types looking for one that is loaded from this bundle for (Class<?> clz : PCRegistry.getRegisteredTypes()) { ClassLoader loader = clz.getClassLoader(); // if we find a class that is loaded from this bundle, then deregister all classes associated // with that bundle. Unfortunately, PCRegistry doesn't have a deRegister() capability for a // single class, we have to do it by class loader. Once we get a hit, we can assume we're finished. if (loader != null && loader instanceof BundleReference && ((BundleReference)loader).getBundle() == bundle) { PCRegistry.deRegister(loader); return; } } }
public OpenWebBeansWebAppContext(@ParamAttribute(name = "holder") Holder holder, @ParamReference(name = "SharedOwbContext") SharedOwbContext sharedOwbContext, @ParamSpecial(type = SpecialAttributeType.abstractName) AbstractName abName) { this.holder = holder; this.sharedOwbContext = sharedOwbContext; webBeansContext = sharedOwbContext == null ? null : sharedOwbContext.getOWBContext(); if (webBeansContext == null) { if (logger.isDebugEnabled()) { if (sharedOwbContext == null) { logger.debug("SharedOwbContext is null, web application {} will create its own WebBeansContext", abName.toString()); } else { logger.debug("No WebBeansContext is configured in SharedOwbContext, web application {} will create its own WebBeansContext", abName.toString()); } } shareableWebBeansContext = false; webBeansContext = OpenWebBeansWebInitializer.newWebBeansContext(null); } else { shareableWebBeansContext = true; } this.abName = abName; }
/** * 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; }
public int compareTo(Object o) { ConfigurationData other = (ConfigurationData) o; int test = getParentName().toString().compareTo(other.getParentName().toString()); if(test == 0) { if(getChildName() != null && other.getChildName() != null) { return getChildName().compareTo(other.getChildName()); } else if(getChildName() == null && other.getChildName() == null) { return 0; } else return getChildName() == null ? 1 : -1; } else return test; } }
public synchronized AbstractName addGBean(String name, GBeanData gbean) throws GBeanAlreadyExistsException { AbstractName abstractName = gbean.getAbstractName(); if (abstractName != null) { throw new IllegalArgumentException("gbean already has an abstract name: " + abstractName); } String j2eeType = gbean.getGBeanInfo().getJ2eeType(); if (j2eeType == null) j2eeType = "GBean"; abstractName = naming.createRootName(id, name, j2eeType); gbean.setAbstractName(abstractName); if (gbeans.containsKey(abstractName)) { throw new GBeanAlreadyExistsException(gbean.getAbstractName().toString()); } gbeans.put(abstractName, gbean); return abstractName; }
public void setRenderParameters(ActionResponse actionResponse) { actionResponse.setRenderParameter("physicalName", physicalName); actionResponse.setRenderParameter("adminObjType", type.name()); actionResponse.setRenderParameter("resourceAdapterModuleName", resourceAdapterModuleAbName.toString()); } }
private void configureSecurityRealm(EARContext earContext, WebAppType webApp, JettyWebAppType jettyWebApp, GBeanData webModuleData) throws DeploymentException { AbstractName moduleName = webModuleData.getAbstractName(); if (earContext.getSecurityConfiguration() == null) { throw new DeploymentException("You have specified a <security-realm-name> for the webapp " + moduleName + " but no <security> configuration (role mapping) is supplied in the Geronimo plan for the web application (or the Geronimo plan for the EAR if the web app is in an EAR)"); } String securityRealmName = jettyWebApp.getSecurityRealmName().trim(); webModuleData.setReferencePattern("ConfigurationFactory", new AbstractNameQuery(null, Collections.singletonMap("name", securityRealmName), ConfigurationFactory.class.getName())); webModuleData.setReferencePattern("RunAsSource", (AbstractNameQuery)earContext.getGeneralData().get(ROLE_MAPPER_DATA_NAME)); /** * TODO - go back to commented version when possible. */ String policyContextID = moduleName.toString().replaceAll("[, :]", "_"); //String policyContextID = webModuleName.getCanonicalName(); webModuleData.setAttribute("policyContextID", policyContextID); ComponentPermissions componentPermissions = buildSpecSecurityConfig(webApp); earContext.addSecurityContext(policyContextID, componentPermissions); }