Package org.apache.geronimo.kernel

Examples of org.apache.geronimo.kernel.Naming


            } else {
                LOGGER.info("Deploying WAB {} at {}", new Object[] {bundle, contextPath});

                ModuleIDBuilder idBuilder = new ModuleIDBuilder();
                Kernel kernel = extender.getKernel();
                Naming naming = kernel.getNaming();
                ModuleBuilder webModuleBuilder = extender.getWebModuleBuilder();
                if (webModuleBuilder == null) {
                    throw new DeploymentException("Unable to deploy " + bundle + " WAB. No web module builders found.");
                }
                WebModule webModule = (WebModule) webModuleBuilder.createModule(bundle, naming, idBuilder);

                BundleDeploymentContext deploymentContext =
                    new BundleDeploymentContext(
                        webModule.getEnvironment(),
                        webModule.getType(),
                        naming,
                        configurationManager,
                        bundle.getBundleContext(),
                        extender.getServerName(),
                        webModule.getModuleName(),
                        extender.getTransactionManagerObjectName(),
                        extender.getConnectionTrackerObjectName(),
                        extender.getCorbaGBeanObjectName(),
                        new HashMap(),
                        bundle);
                webModule.setEarContext(deploymentContext);
                webModule.setRootEarContext(deploymentContext);
               
                deploymentContext.flush();
                deploymentContext.initializeConfiguration();

                Map<JndiKey, Map<String, Object>> contexts = NamingBuilder.JNDI_KEY.get(deploymentContext.getGeneralData());
                Map<String, Object> app = new HashMap<String, Object>();
                app.put("app/AppName", webModule.getName());
                contexts.put(JndiScope.app, app);
               
                webModuleBuilder.initContext(deploymentContext, webModule, bundle);

                AbstractName appJndiName = naming.createChildName(deploymentContext.getModuleName(), "ApplicationJndi", "ApplicationJndi");
                deploymentContext.getGeneralData().put(EARContext.APPLICATION_JNDI_NAME_KEY, appJndiName);

                webModuleBuilder.addGBeans(deploymentContext, webModule, bundle, extender.getRepositories());

                GBeanData appContexts = new GBeanData(appJndiName, ApplicationJndi.class);
View Full Code Here


            AbstractNameQuery roleMapperDataName = ROLE_MAPPER_DATA_NAME.get(earContext.getGeneralData());
            if (roleMapperDataName == null) {
                roleMapperDataName = defaultRoleMappingName;
                EnvironmentBuilder.mergeEnvironments(earContext.getConfiguration().getEnvironment(), defaultEnvironment);
            }
            Naming naming = earContext.getNaming();
            GBeanData jaccBeanData = configureApplicationPolicyManager(naming, earContext.getModuleName(), earContext.getContextIDToPermissionsMap());
            jaccBeanData.setReferencePattern("PrincipalRoleMapper", roleMapperDataName);
            try {
                earContext.addGBean(jaccBeanData);
                earContext.getGeneralData().put(EARContext.JACC_MANAGER_NAME_KEY, jaccBeanData.getAbstractName());
View Full Code Here

            PatternType credentialStoreType = securityType.getCredentialStoreRef();
            credentialStoreName = SingleGBeanBuilder.buildAbstractNameQuery(credentialStoreType, GBeanInfoBuilder.DEFAULT_J2EE_TYPE, Collections.singleton(CredentialStore.class.getName()));
        } else {
            credentialStoreName = this.defaultCredentialStoreName;
        }
        Naming naming = deploymentContext.getNaming();
        String name = securityType.isSetName() ? securityType.getName() : "RoleMapper";
        AbstractName roleMapperName = naming.createChildName(deploymentContext.getModuleName(), "RoleMapper", name);
        GBeanData roleMapperData = new GBeanData(roleMapperName, ApplicationPrincipalRoleConfigurationManager.GBEAN_INFO);
        roleMapperData.setAttribute("principalRoleMap", principalRoleMap);
        roleMapperData.setAttribute("roleDesignates", roleDesignates);
        roleMapperData.setAttribute("defaultSubjectInfo", defaultSubjectInfo);
        if ((roleDesignates != null && !roleDesignates.isEmpty()) || defaultSubjectInfo != null) {
View Full Code Here

    private AbstractName bootDeployerSystem() throws Exception {
        getLog().debug("Booting deployer system...");

        org.apache.geronimo.kernel.repository.Artifact baseId =
                new org.apache.geronimo.kernel.repository.Artifact("geronimo", "packaging", "fixed", "car");
        Naming naming = kernel.getNaming();
        ConfigurationData bootstrap = new ConfigurationData(baseId, naming);
        ClassLoader cl = getClass().getClassLoader();
        Set<AbstractName> repoNames = new HashSet<AbstractName>();

        //
View Full Code Here

        // Get hold of configuration containing caKeystore GBean
        AbstractName caKeystoreName = PortletManager.getNameFor(request, caKeystore);
        Artifact configurationId =  PortletManager.getConfigurationFor(request, caKeystoreName);
        ServerInfo serverInfo = PortletManager.getCurrentServer(request).getServerInfo();
        AbstractName serverInfoName = PortletManager.getNameFor(request, serverInfo);
        Naming naming = PortletManager.getManagementHelper(request).getNaming();
       
        // Add a CertificateStore GBean
        AbstractName certStoreName = naming.createSiblingName(caKeystoreName, "geronimo-ca-cert-store", SecurityNames.CERTIFICATE_STORE);
        GBeanData certStore = new GBeanData(certStoreName, FileCertificateStore.GBEAN_INFO);
        certStore.setAttribute("directoryPath", URI.create(certStorePath));
        certStore.setReferencePattern("ServerInfo", serverInfoName);
        PortletManager.addGBeanToConfiguration(request, configurationId, certStore, true);
       
        // Add a CertificateRequestStore GBean
        AbstractName certReqStoreName = naming.createSiblingName(caKeystoreName, "geronimo-ca-cert-req-store", SecurityNames.CERTIFICATE_REQUEST_STORE);
        GBeanData certReqStore = new GBeanData(certReqStoreName, FileCertificateRequestStore.GBEAN_INFO);
        certReqStore.setAttribute("directoryPath", URI.create(certReqStorePath));
        certReqStore.setReferencePattern("ServerInfo", serverInfoName);
        PortletManager.addGBeanToConfiguration(request, configurationId, certReqStore, true);
       
        // Add a CertificationAuthority GBean
        AbstractName caName = naming.createSiblingName(caKeystoreName, "geronimo-ca", SecurityNames.CERTIFICATION_AUTHORITY);
        GBeanData ca = new GBeanData(caName, GeronimoCertificationAuthority.GBEAN_INFO);
        ca.setReferencePattern("ServerInfo", serverInfoName);
        ca.setReferencePattern("KeystoreInstance", caKeystoreName);
        ca.setReferencePattern("CertificateStore", certStoreName);
        ca.setReferencePattern("CertificateRequestStore", certReqStoreName);
View Full Code Here

        gbeanDatas = localAttributeManager.applyOverrides(configurationName, gbeanDatas, bundle);
        assertEquals(referencePatterns, gbeanData.getReferencePatterns(referenceInfo.getName()));
    }

    public void testSetReferences() throws Exception {
        Naming naming = new Jsr77Naming();

        AbstractName referencePattern1 = naming.createRootName(gbeanName.getArtifact(), "name", "referencePattern1");
        AbstractName referencePattern2 = naming.createRootName(gbeanName.getArtifact(), "name", "referencePattern2");
        ReferencePatterns referencePatterns = new ReferencePatterns(new LinkedHashSet(Arrays.asList(new AbstractName[]{referencePattern1, referencePattern2})));
        localAttributeManager.setReferencePatterns(configurationName, gbeanName, referenceInfo, referencePatterns);
        Collection<GBeanData> gbeanDatas = new ArrayList<GBeanData>();
        GBeanData gbeanData = new GBeanData(gbeanName, GBEAN_INFO);
        gbeanDatas.add(gbeanData);
View Full Code Here

            SecurityConfiguration securityConfiguration = buildSecurityConfiguration(security, classLoader);
            earContext.setSecurityConfiguration(securityConfiguration);
        }
        //add the JACC gbean if there is a principal-role mapping and we are on the correct module
        if (earContext.getSecurityConfiguration() != null && applicationContext == moduleContext) {
            Naming naming = earContext.getNaming();
            GBeanData roleMapperData = configureRoleMapper(naming, earContext.getModuleName(), earContext.getSecurityConfiguration());
            try {
                earContext.addGBean(roleMapperData);
            } catch (GBeanAlreadyExistsException e) {
                throw new DeploymentException("Role mapper gbean already present", e);
View Full Code Here

        gbeanDatas = localAttributeManager.applyOverrides(configurationName, gbeanDatas, getClass().getClassLoader());
        assertEquals(referencePatterns, gbeanData.getReferencePatterns(referenceInfo.getName()));
    }

    public void testSetReferences() throws Exception {
        Naming naming = new Jsr77Naming();

        AbstractName referencePattern1 = naming.createRootName(gbeanName.getArtifact(), "name", "referencePattern1");
        AbstractName referencePattern2 = naming.createRootName(gbeanName.getArtifact(), "name", "referencePattern2");
        ReferencePatterns referencePatterns = new ReferencePatterns(new LinkedHashSet(Arrays.asList(new AbstractName[]{referencePattern1, referencePattern2})));
        localAttributeManager.setReferencePatterns(configurationName, gbeanName, referenceInfo, referencePatterns);
        Collection gbeanDatas = new ArrayList();
        GBeanData gbeanData = new GBeanData(gbeanName, GBEAN_INFO);
        gbeanDatas.add(gbeanData);
View Full Code Here

    private void bootDeployerSystem() throws Exception {
        log.debug("Booting deployer system...");

        org.apache.geronimo.kernel.repository.Artifact baseId =
                new org.apache.geronimo.kernel.repository.Artifact("geronimo", "packaging", "fixed", "car");
        Naming naming = kernel.getNaming();
        ConfigurationData bootstrap = new ConfigurationData(baseId, naming);
        ClassLoader cl = getClass().getClassLoader();
        Set repoNames = new HashSet();

        //
View Full Code Here

        gbeanDatas = localAttributeManager.applyOverrides(configurationName, gbeanDatas, getClass().getClassLoader());
        assertEquals(referencePatterns, gbeanData.getReferencePatterns(referenceInfo.getName()));
    }

    public void testSetReferences() throws Exception {
        Naming naming = new Jsr77Naming();

        AbstractName referencePattern1 = naming.createRootName(gbeanName.getArtifact(), "name", "referencePattern1");
        AbstractName referencePattern2 = naming.createRootName(gbeanName.getArtifact(), "name", "referencePattern2");
        ReferencePatterns referencePatterns = new ReferencePatterns(new LinkedHashSet(Arrays.asList(new AbstractName[]{referencePattern1, referencePattern2})));
        localAttributeManager.setReferencePatterns(configurationName, gbeanName, referenceInfo, referencePatterns);
        Collection gbeanDatas = new ArrayList();
        GBeanData gbeanData = new GBeanData(gbeanName, GBEAN_INFO);
        gbeanDatas.add(gbeanData);
View Full Code Here

TOP

Related Classes of org.apache.geronimo.kernel.Naming

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.