public Set getApplicationManagedSecurityResources() { return (Set) gbean.getAttribute("applicationManagedSecurityResources"); }
public Set getUnshareableResources() { return (Set) gbean.getAttribute("unshareableResources"); }
protected Integer getSessionTimeout(GBeanData webModuleData) throws AssertionError { //TODO this will no longer work, use WebAppInfo Integer sessionTimeout = (Integer) webModuleData.getAttribute(WebAppContextWrapper.GBEAN_ATTR_SESSION_TIMEOUT); if (null == sessionTimeout) { throw new AssertionError(); } return sessionTimeout; }
private void respectExcludeUnlistedClasses(GBeanData gbeanData) { boolean excludeUnlistedClasses = (Boolean) gbeanData.getAttribute("excludeUnlistedClasses"); if (excludeUnlistedClasses) { gbeanData.clearAttribute("jarFileUrls"); } }
private void setWebModuleDetails(ModuleDetails details, GBeanData gbean) { details.getContextPaths().add((String)gbean.getAttribute("contextPath")); details.setDisplayName(((WebAppInfo)gbean.getAttribute("webAppInfo")).displayName); String virtualServer = (String)gbean.getAttribute("virtualServer"); if (virtualServer != null && virtualServer.length() > 0) { details.setVirtualServer(virtualServer); } }
protected GBeanData getQueueGBeanData() throws GBeanNotFoundException { GBeanData moduleData = getResourceAdapterModuleData(); Map adminObjects = (Map) moduleData.getAttribute("adminObjectInfoMap"); GBeanData queueData = (GBeanData) adminObjects.get(Queue.class.getName()); return new GBeanData(queueData); }
private GBeanData locateAdminObjectInfo(GBeanData resourceAdapterModuleData, String adminObjectInterfaceName) throws DeploymentException { Map adminObjectInfos = (Map) resourceAdapterModuleData.getAttribute("adminObjectInfoMap"); if (adminObjectInfos == null) { throw new DeploymentException("No admin object infos found for resource adapter module: " + resourceAdapterModuleData.getAbstractName()); } return (GBeanData) adminObjectInfos.get(adminObjectInterfaceName); }
protected GBeanData getTopicGBeanData() throws GBeanNotFoundException { GBeanData moduleData = getResourceAdapterModuleData(); Map adminObjects = (Map) moduleData.getAttribute("adminObjectInfoMap"); GBeanData queueData = (GBeanData) adminObjects.get(Topic.class.getName()); return new GBeanData(queueData); }
private GBeanData locateConnectionFactoryInfo(GBeanData resourceAdapterModuleData, String connectionFactoryInterfaceName) throws DeploymentException { Map managedConnectionFactoryInfos = (Map) resourceAdapterModuleData.getAttribute("managedConnectionFactoryInfoMap"); if (managedConnectionFactoryInfos == null) { throw new DeploymentException("No managed connection factory infos found for resource adapter module: " + resourceAdapterModuleData.getAbstractName()); } return (GBeanData) managedConnectionFactoryInfos.get(connectionFactoryInterfaceName); }
private GBeanData locateConnectionFactoryInfo(GBeanData resourceAdapterModuleData, String connectionFactoryInterfaceName) throws DeploymentException { Map managedConnectionFactoryInfos = (Map) resourceAdapterModuleData.getAttribute("managedConnectionFactoryInfoMap"); if (managedConnectionFactoryInfos == null) { throw new DeploymentException("No managed connection factory infos found for resource adapter module: " + resourceAdapterModuleData.getAbstractName()); } return (GBeanData) managedConnectionFactoryInfos.get(connectionFactoryInterfaceName); }
private GBeanData locateAdminObjectInfo(GBeanData resourceAdapterModuleData, String adminObjectInterfaceName) throws DeploymentException { Map adminObjectInfos = (Map) resourceAdapterModuleData.getAttribute("adminObjectInfoMap"); if (adminObjectInfos == null) { throw new DeploymentException("No admin object infos found for resource adapter module: " + resourceAdapterModuleData.getAbstractName()); } return (GBeanData) adminObjectInfos.get(adminObjectInterfaceName); }
private GBeanData locateResourceAdapterGBeanData(GBeanData resourceAdapterModuleData) throws DeploymentException { GBeanData data = (GBeanData) resourceAdapterModuleData.getAttribute("resourceAdapterGBeanData"); if (data == null) { throw new DeploymentException("No resource adapter info found for resource adapter module: " + resourceAdapterModuleData.getAbstractName()); } return data; }
private GBeanData locateResourceAdapterGBeanData(GBeanData resourceAdapterModuleData) throws DeploymentException { GBeanData data = (GBeanData) resourceAdapterModuleData.getAttribute("resourceAdapterGBeanData"); if (data == null) { throw new DeploymentException("No resource adapter info found for resource adapter module: " + resourceAdapterModuleData.getAbstractName()); } return data; }
private GBeanData configureDefaultServlet(Object defaultServlet, EARContext earContext, AbstractName moduleName, Set knownServletMappings, EARContext moduleContext) throws GBeanNotFoundException, GBeanAlreadyExistsException { GBeanData servletGBeanData = getGBeanData(kernel, defaultServlet); AbstractName defaultServletObjectName = earContext.getNaming().createChildName(moduleName, (String) servletGBeanData.getAttribute("servletName"), NameFactory.SERVLET); servletGBeanData.setAbstractName(defaultServletObjectName); servletGBeanData.setReferencePattern("JettyServletRegistration", moduleName); Set<String> defaultServletMappings = new HashSet<String>((Collection<String>) servletGBeanData.getAttribute("servletMappings")); defaultServletMappings.removeAll(knownServletMappings); servletGBeanData.setAttribute("servletMappings", defaultServletMappings); moduleContext.addGBean(servletGBeanData); return servletGBeanData; }
/** * Removes a connector. This shuts it down if necessary, and removes it from the server environment. It must be a * connector that uses this network technology. * @param connectorName */ public void removeConnector(AbstractName connectorAbstractName) { try { kernel.invoke(connectorAbstractName, "doStop"); String connectorName=(String)kernel.getGBeanData(connectorAbstractName).getAttribute("name"); tomcatServerConfigManager.removeConnector(connectorName); kernel.unloadGBean(connectorAbstractName); } catch (Exception e) { log.error("error when removing connector:"+connectorAbstractName,e); } }
protected void setConfigInfo(GerClusteringWadiType clustering, GBeanData webModuleData, GBeanData beanData) { int sweepInterval = getSweepInterval(clustering); int numPartitions = getNumberOfPartitions(clustering); Integer sessionTimeout = getSessionTimeout(webModuleData); boolean disableReplication = isDisableReplication(clustering); boolean deltaReplication = isDeltaReplication(clustering); String contextPath = (String) webModuleData.getAttribute("contextPath"); URI serviceSpaceName; try { serviceSpaceName = new URI(contextPath); } catch (URISyntaxException e) { throw (AssertionError) new AssertionError("contextPath [" + contextPath + "] cannot be parsed as an URI.").initCause(e); } WADISessionManagerConfigInfo configInfo = new WADISessionManagerConfigInfo(serviceSpaceName, sweepInterval, numPartitions, sessionTimeout.intValue(), disableReplication, deltaReplication); beanData.setAttribute(BasicWADISessionManager.GBEAN_ATTR_WADI_CONFIG_INFO, configInfo); }
for (GBeanData resourceAdapterWrapperData : resourceAdapterWrappers) { String resourceAdapterId = getResourceAdapterId(resourceAdapterWrapperData.getAbstractName()); Map<String, String> messageListenerToActivationSpecMap = (Map<String, String>) resourceAdapterWrapperData.getAttribute("messageListenerToActivationSpecMap"); if (messageListenerToActivationSpecMap == null) { continue;
private void setConfigInfo(GerClusteringWadiType clustering, GBeanData webModuleData, GBeanData beanData) { int sweepInterval = defaultSweepInterval; if (clustering.isSetSweepInterval()) { sweepInterval = clustering.getSweepInterval().intValue(); } int numPartitions = defaultNumPartitions; if (clustering.isSetNumPartitions()) { numPartitions = clustering.getNumPartitions().intValue(); } Integer sessionTimeout = (Integer) webModuleData.getAttribute(JettyWebAppContext.GBEAN_ATTR_SESSION_TIMEOUT); if (null == sessionTimeout) { throw new AssertionError(); } WADISessionManagerConfigInfo configInfo = new WADISessionManagerConfigInfo( beanData.getAbstractName().toURI(), sweepInterval, numPartitions, sessionTimeout.intValue()); beanData.setAttribute(BasicWADISessionManager.GBEAN_ATTR_WADI_CONFIG_INFO, configInfo); }
private void addAdminObjectGBeans(List<GBeanData> raBeans, Naming naming, AbstractName jcaResourceName, GBeanData resourceAdapterModuleData, Bundle bundle, AbstractName resourceAdapterAbstractName, GerAdminobjectType[] adminObjects) throws DeploymentException { for (GerAdminobjectType gerAdminObject : adminObjects) { String adminObjectInterface = gerAdminObject.getAdminobjectInterface().trim(); GBeanData adminObjectGBeanData = locateAdminObjectInfo(resourceAdapterModuleData, adminObjectInterface); if (adminObjectGBeanData == null) { throw new DeploymentException("No admin object declared for interface: " + adminObjectInterface); } for (GerAdminobjectInstanceType gerAdminObjectInstance : gerAdminObject.getAdminobjectInstanceArray()) { GBeanData adminObjectInstanceGBeanData = new GBeanData(adminObjectGBeanData); setDynamicGBeanDataAttributes(adminObjectInstanceGBeanData, gerAdminObjectInstance.getConfigPropertySettingArray(), bundle); // add it AbstractName adminObjectAbstractName = naming.createChildName(jcaResourceName, gerAdminObjectInstance.getMessageDestinationName().trim(), NameFactory.JCA_ADMIN_OBJECT); adminObjectInstanceGBeanData.setAbstractName(adminObjectAbstractName); if (resourceAdapterAbstractName != null) { adminObjectInstanceGBeanData.setReferencePattern("ResourceAdapterWrapper", resourceAdapterAbstractName); } Set<String> implementedInterfaces = new HashSet<String>(); implementedInterfaces.add(checkClass(bundle, (String) adminObjectInstanceGBeanData.getAttribute("adminObjectInterface"))); implementedInterfaces.add(checkClass(bundle, (String) adminObjectInstanceGBeanData.getAttribute("adminObjectClass"))); adminObjectInstanceGBeanData.setServiceInterfaces(implementedInterfaces.toArray(new String[implementedInterfaces.size()])); String jndiName = naming.toOsgiJndiName(adminObjectAbstractName); //TODO allow specifying osig jndi name directly, like for connection factories adminObjectInstanceGBeanData.getServiceProperties().put(OSGI_JNDI_SERVICE_NAME, jndiName); raBeans.add(adminObjectInstanceGBeanData); } } }
private AbstractName addDefaultFiltersGBeans(EARContext earContext, EARContext moduleContext, AbstractName moduleName, AbstractName previous) throws GBeanNotFoundException, GBeanAlreadyExistsException { for (Object defaultFilter : defaultFilters) { GBeanData filterGBeanData = getGBeanData(kernel, defaultFilter); String filterName = (String) filterGBeanData.getAttribute("filterName"); AbstractName defaultFilterAbstractName = earContext.getNaming().createChildName(moduleName, filterName, NameFactory.WEB_FILTER); filterGBeanData.setAbstractName(defaultFilterAbstractName); filterGBeanData.setReferencePattern("JettyServletRegistration", moduleName); moduleContext.addGBean(filterGBeanData); //add a mapping to /* GBeanData filterMappingGBeanData = new GBeanData(JettyFilterMapping.GBEAN_INFO); if (previous != null) { filterMappingGBeanData.addDependency(previous); } filterMappingGBeanData.setReferencePattern("JettyServletRegistration", moduleName); String urlPattern = "/*"; filterMappingGBeanData.setAttribute("urlPattern", urlPattern); AbstractName filterMappingName = earContext.getNaming().createChildName(defaultFilterAbstractName, urlPattern, NameFactory.URL_WEB_FILTER_MAPPING); filterMappingGBeanData.setAbstractName(filterMappingName); previous = filterMappingName; filterMappingGBeanData.setAttribute("requestDispatch", TRUE); filterMappingGBeanData.setAttribute("forwardDispatch", TRUE); filterMappingGBeanData.setAttribute("includeDispatch", TRUE); filterMappingGBeanData.setAttribute("errorDispatch", FALSE); filterMappingGBeanData.setReferencePattern("Filter", defaultFilterAbstractName); moduleContext.addGBean(filterMappingGBeanData); } return previous; }