public void setApplicationManagedSecurityResources(Set applicationManagedSecurityResources) { gbean.setAttribute("applicationManagedSecurityResources", applicationManagedSecurityResources); } }
public void setUnshareableResources(Set unshareableResources) { gbean.setAttribute("unshareableResources", unshareableResources); }
protected GBeanData buildControllerGBean(Artifact configId, NodeInfo nodeInfo, Artifact slaveConfigId) { AbstractName controllerName = buildControllerName(configId, nodeInfo); GBeanData gbean = new GBeanData(controllerName, BasicClusterConfigurationController.class); gbean.setAttribute(BasicClusterConfigurationController.GBEAN_ATTR_ARTIFACT, slaveConfigId); gbean.setAttribute(BasicClusterConfigurationController.GBEAN_ATTR_IGNORE_START_CONF_FAIL_UPON_START, Boolean.TRUE); gbean.setAttribute(BasicClusterConfigurationController.GBEAN_ATTR_NODE_NAME, nodeInfo.getName()); gbean.setAttribute(BasicClusterConfigurationController.GBEAN_ATTR_START_CONF_UPON_START, Boolean.TRUE); gbean.setReferencePattern(BasicClusterConfigurationController.GBEAN_REF_CLUSTER_INFO, clusterInfoName); return gbean; }
protected GBeanData configureApplicationPolicyManager(AbstractName applicationPolicyManagerName, Map<String, ComponentPermissions> contextIDToPermissionsMap) { GBeanData jaccBeanData = new GBeanData(applicationPolicyManagerName, ApplicationPolicyConfigurationManager.GBEAN_INFO); jaccBeanData.setAttribute("contextIdToPermissionsMap", contextIDToPermissionsMap); return jaccBeanData; }
public void doStart() throws Exception { String threadName = (String)this.name.getName().get("name"); this.threadFactoryName = kernel.getNaming().createRootName(name.getArtifact(), threadName, ManagedConstants.MANAGED_THREAD_FACTORY); GBeanData threadFactoryData = new GBeanData(this.threadFactoryName, ManagedThreadFactoryGBean.getGBeanInfo()); threadFactoryData.setAttribute("contextHandlers", this.contextHandlerClasses); threadFactoryData.setAttribute("groupName", this.groupName); threadFactoryData.setAttribute("priority", this.threadPriority); threadFactoryData.setAttribute("daemon", this.daemonThread); threadFactoryData.setAttribute("hungTaskThreshold", this.hungTaskThreshold); threadFactoryData.setAttribute("hungTaskMonitorFrequency", this.hungTaskMonitorFrequency); addGBeanKernel(this.threadFactoryName, threadFactoryData); this.threadFactoryGBean = (ManagedThreadFactoryGBean)kernel.getGBean(this.threadFactoryName); this.threadFactoryGBean.verifyObjectName(); }
private void configureWelcomeFileLists(WebAppType webApp, GBeanData webModuleData) { WelcomeFileListType[] welcomeFileArray = webApp.getWelcomeFileListArray(); List<String> welcomeFiles; if (welcomeFileArray.length > 0) { welcomeFiles = new ArrayList<String>(); for (WelcomeFileListType aWelcomeFileArray : welcomeFileArray) { String[] welcomeFileListType = aWelcomeFileArray.getWelcomeFileArray(); for (String welcomeFile : welcomeFileListType) { welcomeFiles.add(welcomeFile.trim()); } } } else { welcomeFiles = new ArrayList<String>(defaultWelcomeFiles); } webModuleData.setAttribute("welcomeFiles", welcomeFiles.toArray(new String[welcomeFiles.size()])); }
private void configureListeners(WebAppType webApp, GBeanData webModuleData) { ListenerType[] listenerArray = webApp.getListenerArray(); Collection<String> listeners = new ArrayList<String>(); for (ListenerType listenerType : listenerArray) { listeners.add(listenerType.getListenerClass().getStringValue().trim()); } webModuleData.setAttribute("listenerClassNames", listeners); }
private void configureLocaleEncodingMappingLists(WebAppType webApp, GBeanData webModuleData) { LocaleEncodingMappingListType[] localeEncodingMappingListArray = webApp.getLocaleEncodingMappingListArray(); Map<String, String> localeEncodingMappingMap = new HashMap<String, String>(defaultLocaleEncodingMappings); for (LocaleEncodingMappingListType aLocaleEncodingMappingListArray : localeEncodingMappingListArray) { LocaleEncodingMappingType[] localeEncodingMappingArray = aLocaleEncodingMappingListArray.getLocaleEncodingMappingArray(); for (LocaleEncodingMappingType localeEncodingMapping : localeEncodingMappingArray) { localeEncodingMappingMap.put(localeEncodingMapping.getLocale().trim(), localeEncodingMapping.getEncoding().trim()); } } webModuleData.setAttribute("localeEncodingMapping", localeEncodingMappingMap); }
private Map getAdminObjectInfoMap(AdminobjectType[] adminobjectArray, ClassLoader cl) throws DeploymentException { Map<String, GBeanData> adminObjectInfos = new HashMap<String, GBeanData>(); for (AdminobjectType adminObject : adminobjectArray) { GBeanInfoBuilder adminObjectInfoBuilder = new GBeanInfoBuilder(AdminObjectWrapper.class, AdminObjectWrapperGBean.GBEAN_INFO); String adminObjectClassName = adminObject.getAdminobjectClass().getStringValue().trim(); GBeanData adminObjectGBeanData = setUpDynamicGBeanWithProperties(adminObjectClassName, adminObjectInfoBuilder, adminObject.getConfigPropertyArray(), cl, Collections.<String>emptySet()); // set the standard properties String adminObjectInterface = adminObject.getAdminobjectInterface().getStringValue().trim(); adminObjectGBeanData.setAttribute("adminObjectInterface", adminObjectInterface); adminObjectGBeanData.setAttribute("adminObjectClass", adminObjectClassName); adminObjectInfos.put(adminObjectInterface, adminObjectGBeanData); } return adminObjectInfos; }
private void configureMimeMappings(WebAppType webApp, GBeanData webModuleData) { MimeMappingType[] mimeMappingArray = webApp.getMimeMappingArray(); Map<String, String> mimeMappingMap = new HashMap<String, String>(defaultMimeTypeMappings); for (MimeMappingType mimeMappingType : mimeMappingArray) { mimeMappingMap.put(mimeMappingType.getExtension().getStringValue().trim(), mimeMappingType.getMimeType().getStringValue().trim()); } webModuleData.setAttribute("mimeMap", mimeMappingMap); }
private void configureContextParams(WebAppType webApp, GBeanData webModuleData) { ParamValueType[] contextParamArray = webApp.getContextParamArray(); Map<String, String> contextParams = new HashMap<String, String>(); for (ParamValueType contextParam : contextParamArray) { contextParams.put(contextParam.getParamName().getStringValue().trim(), contextParam.getParamValue().getStringValue().trim()); } webModuleData.setAttribute("contextParamMap", contextParams); }
private void configureErrorPages(WebAppType webApp, GBeanData webModuleData) { ErrorPageType[] errorPageArray = webApp.getErrorPageArray(); Map<String, String> errorPageMap = new HashMap<String, String>(); for (ErrorPageType errorPageType : errorPageArray) { if (errorPageType.isSetErrorCode()) { errorPageMap.put(errorPageType.getErrorCode().getStringValue().trim(), errorPageType.getLocation().getStringValue().trim()); } else { errorPageMap.put(errorPageType.getExceptionType().getStringValue().trim(), errorPageType.getLocation().getStringValue().trim()); } } webModuleData.setAttribute("errorPages", errorPageMap); }
private Map getAdminObjectInfoMap(AbstractName validatorName, List<AdminObject> adminObjects, Bundle bundle) throws DeploymentException { Map<String, GBeanData> adminObjectInfos = new HashMap<String, GBeanData>(); for (AdminObject adminObject : adminObjects) { GBeanInfoBuilder adminObjectInfoBuilder = new GBeanInfoBuilder(AdminObjectWrapperGBean.class, new AnnotationGBeanInfoBuilder(AdminObjectWrapperGBean.class).buildGBeanInfo()); String adminObjectClassName = adminObject.getAdminObjectClass(); GBeanData adminObjectGBeanData = setUpDynamicGBeanWithProperties(adminObjectClassName, adminObjectInfoBuilder, adminObject.getConfigProperty(), bundle, Collections.<String>emptySet()); // set the standard properties String adminObjectInterface = adminObject.getAdminObjectInterface(); adminObjectGBeanData.setAttribute("adminObjectInterface", adminObjectInterface); adminObjectGBeanData.setAttribute("adminObjectClass", adminObjectClassName); adminObjectGBeanData.setReferencePattern("ValidatorFactory", validatorName); adminObjectInfos.put(adminObjectInterface, adminObjectGBeanData); } return adminObjectInfos; }
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); }
private Map getActivationSpecInfoMap(MessagelistenerType[] messagelistenerArray, ClassLoader cl) throws DeploymentException { Map<String, GBeanData> activationSpecInfos = new HashMap<String, GBeanData>(); for (MessagelistenerType messagelistenerType : messagelistenerArray) { String messageListenerInterface = messagelistenerType.getMessagelistenerType().getStringValue().trim(); ActivationspecType activationspec = messagelistenerType.getActivationspec(); String activationSpecClassName = activationspec.getActivationspecClass().getStringValue().trim(); GBeanInfoBuilder infoBuilder = new GBeanInfoBuilder(ActivationSpecWrapperGBean.class, ActivationSpecWrapperGBean.GBEAN_INFO); Set<String> ignore = Collections.singleton("resourceAdapter"); setUpDynamicGBean(activationSpecClassName, infoBuilder, ignore, cl, true); GBeanInfo gbeanInfo = infoBuilder.getBeanInfo(); GBeanData activationSpecInfo = new GBeanData(gbeanInfo); activationSpecInfo.setAttribute("activationSpecClass", activationSpecClassName); activationSpecInfos.put(messageListenerInterface, activationSpecInfo); } return activationSpecInfos; }
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; }
public void doStart() throws Exception { String threadName = (String)this.name.getName().get("name"); this.executorServiceName = kernel.getNaming().createRootName(name.getArtifact(), threadName, ManagedConstants.MANAGED_EXECUTOR_SERVICE); GBeanData executorServiceData = new GBeanData(this.executorServiceName, ServerManagedScheduledExecutorServiceGBean.getGBeanInfo()); executorServiceData.setAttribute("contextHandlers", this.contextHandlerClasses); executorServiceData.setAttribute("corePoolSize", this.corePoolSize); GBeanData wrapperData = kernel.getGBeanData(this.name); executorServiceData.setReferencePatterns("threadFactory", wrapperData.getReferencePatterns("threadFactory")); addGBeanKernel(this.executorServiceName, executorServiceData); this.executorServiceGBean = (ServerManagedScheduledExecutorServiceGBean)kernel.getGBean(this.executorServiceName); this.executorServiceGBean.verifyObjectName(); }
public void setXmlAttribute(String name, XmlObject xmlObject, XmlObject enclosing) throws DeploymentException { String namespace = xmlObject.getDomNode().getNamespaceURI(); XmlAttributeBuilder builder = (XmlAttributeBuilder) xmlAttributeBuilderMap.get(namespace); if (builder == null) { throw new DeploymentException("No attribute builder deployed for namespace: " + namespace); } GAttributeInfo attribute = gbean.getGBeanInfo().getAttribute(name); if (attribute == null) { throw new DeploymentException("Unknown attribute " + name + " on " + gbean.getAbstractName()); } String type = attribute.getType(); Object value = builder.getValue(xmlObject, enclosing, type, bundle); gbean.setAttribute(name, value); }
private void configureTagLibs(Module module, WebAppType webApp, GBeanData webModuleData, Map<String, Set<String>> servletMappings, Set<String> knownServletMappings, String jspServletName) throws DeploymentException { JspConfigType[] jspConfigArray = webApp.getJspConfigArray(); if (jspConfigArray.length > 1) { throw new DeploymentException("Web app " + module.getName() + " cannot have more than one jsp-config element. Currently has " + jspConfigArray.length + " jsp-config elements."); } Map<String, String> tagLibMap = new HashMap<String, String>(); for (JspConfigType aJspConfigArray : jspConfigArray) { TaglibType[] tagLibArray = aJspConfigArray.getTaglibArray(); for (TaglibType taglib : tagLibArray) { tagLibMap.put(taglib.getTaglibUri().getStringValue().trim(), taglib.getTaglibLocation().getStringValue().trim()); } for (JspPropertyGroupType propertyGroup: aJspConfigArray.getJspPropertyGroupArray()) { UrlPatternType[] urlPatterns = propertyGroup.getUrlPatternArray(); addMappingsForServlet(jspServletName, urlPatterns, knownServletMappings, servletMappings); } } webModuleData.setAttribute("tagLibMap", tagLibMap); }
private Map<String, GBeanData> getActivationSpecInfoMap(AbstractName validatorName, List<MessageListener> messageListeners, Bundle bundle) throws DeploymentException { Map<String, GBeanData> activationSpecInfos = new HashMap<String, GBeanData>(); for (MessageListener messageListener : messageListeners) { String messageListenerInterface = messageListener.getMessageListenerType(); ActivationSpec activationSpec = messageListener.getActivationSpec(); String activationSpecClassName = activationSpec.getActivationSpecClass(); GBeanInfoBuilder infoBuilder = new GBeanInfoBuilder(ActivationSpecWrapperGBean.class, new AnnotationGBeanInfoBuilder(ActivationSpecWrapperGBean.class).buildGBeanInfo()); Set<String> ignore = Collections.singleton("resourceAdapter"); setUpDynamicGBean(activationSpecClassName, infoBuilder, ignore, bundle, true); GBeanInfo gbeanInfo = infoBuilder.getBeanInfo(); GBeanData activationSpecInfo = new GBeanData(gbeanInfo); activationSpecInfo.setAttribute("activationSpecClass", activationSpecClassName); activationSpecInfo.setReferencePattern("ValidatorFactory", validatorName); activationSpecInfos.put(messageListenerInterface, activationSpecInfo); } return activationSpecInfos; }