Examples of GBeanData


Examples of org.apache.geronimo.gbean.GBeanData

        Repository repository = null;

        AbstractName moduleName = module.getModuleName();
        EARContext earContext = createEARContext(outputPath, defaultEnvironment, repository, configStore, moduleName);
        AbstractName jaccBeanName = kernel.getNaming().createChildName(moduleName, "foo", NameFactory.JACC_MANAGER);
        GBeanData jaccBeanData = new GBeanData(jaccBeanName, ApplicationPolicyConfigurationManager.GBEAN_INFO);
        PermissionCollection excludedPermissions= new Permissions();
        PermissionCollection uncheckedPermissions= new Permissions();
        ComponentPermissions componentPermissions = new ComponentPermissions(excludedPermissions, uncheckedPermissions, new HashMap());
        Map contextIDToPermissionsMap = new HashMap();
        contextIDToPermissionsMap.put("test_J2EEApplication=null_J2EEServer=bar_j2eeType=WebModule_name=geronimo/test/1.0/war", componentPermissions);
        jaccBeanData.setAttribute("contextIdToPermissionsMap", contextIDToPermissionsMap);
//        jaccBeanData.setAttribute("principalRoleMap", new HashMap());
        jaccBeanData.setAttribute("roleDesignates", new HashMap());
        earContext.addGBean(jaccBeanData);
        earContext.setJaccManagerName(jaccBeanName);
        module.setEarContext(earContext);
        module.setRootEarContext(earContext);
        builder.initContext(earContext, module, cl);
View Full Code Here

Examples of org.apache.geronimo.gbean.GBeanData

        kernel = KernelFactory.newInstance().createKernel("test");
        kernel.boot();

        ConfigurationData bootstrap = new ConfigurationData(baseId, naming);

        GBeanData serverInfo = bootstrap.addGBean("ServerInfo", BasicServerInfo.GBEAN_INFO);
        serverInfo.setAttribute("baseDirectory", ".");

        AbstractName configStoreName = bootstrap.addGBean("MockConfigurationStore", MockConfigStore.GBEAN_INFO).getAbstractName();

        GBeanData artifactManagerData = bootstrap.addGBean("ArtifactManager", DefaultArtifactManager.GBEAN_INFO);

        GBeanData artifactResolverData = bootstrap.addGBean("ArtifactResolver", DefaultArtifactResolver.GBEAN_INFO);
        artifactResolverData.setReferencePattern("ArtifactManager", artifactManagerData.getAbstractName());

        GBeanData configurationManagerData = bootstrap.addGBean("ConfigurationManager", EditableKernelConfigurationManager.GBEAN_INFO);
        configurationManagerData.setReferencePattern("ArtifactManager", artifactManagerData.getAbstractName());
        configurationManagerData.setReferencePattern("ArtifactResolver", artifactResolverData.getAbstractName());
        configurationManagerData.setReferencePattern("Stores", configStoreName);
        bootstrap.addGBean(configurationManagerData);

        GBeanData serverData = new GBeanData(serverName, J2EEServerImpl.GBEAN_INFO);
        bootstrap.addGBean(serverData);

        GBeanData securityService = bootstrap.addGBean("SecurityService", SecurityServiceImpl.GBEAN_INFO);
        securityService.setAttribute("policyConfigurationFactory", GeronimoPolicyConfigurationFactory.class.getName());
        securityService.setAttribute("policyProvider", GeronimoPolicy.class.getName());
        securityService.setReferencePattern("ServerInfo", serverInfo.getAbstractName());

        // Default Realm
        Map initParams = new HashMap();

        initParams.put("userClassNames",
                "org.apache.geronimo.security.realm.providers.GeronimoUserPrincipal");
        initParams.put("roleClassNames",
                "org.apache.geronimo.security.realm.providers.GeronimoGroupPrincipal");
        GBeanData realm = bootstrap.addGBean("tomcatRealm", RealmGBean.GBEAN_INFO);
        realm.setAttribute("className",
                "org.apache.geronimo.tomcat.realm.TomcatJAASRealm");
        realm.setAttribute("initParams", initParams);

        // Default Host
        initParams = new HashMap();
        initParams.put("workDir", "work");
        initParams.put("name", "localhost");
        initParams.put("appBase", "");
        GBeanData host = bootstrap.addGBean("tomcatHost", HostGBean.GBEAN_INFO);
        host.setAttribute("className", "org.apache.catalina.core.StandardHost");
        host.setAttribute("initParams", initParams);

        // Default Engine
        initParams = new HashMap();
        initParams.put("name", "Geronimo");
        GBeanData engine = bootstrap.addGBean("tomcatEngine", EngineGBean.GBEAN_INFO);
        engine.setAttribute("className", "org.apache.geronimo.tomcat.TomcatEngine");
        engine.setAttribute("initParams", initParams);
        engine.setReferencePattern("DefaultHost", host.getAbstractName());
        engine.setReferencePattern("RealmGBean", realm.getAbstractName());
        engine.setReferencePattern("Hosts", host.getAbstractName());

        WebServiceBuilder webServiceBuilder = new MockWebServiceBuilder();

        GBeanData containerData = bootstrap.addGBean("TomcatContainer", TomcatContainer.GBEAN_INFO);
        containerData.setAttribute("catalinaHome", new File(BASEDIR, "target/var/catalina").toString());
        containerData.setReferencePattern("EngineGBean", engine.getAbstractName());
        containerData.setReferencePattern("ServerInfo", serverInfo.getAbstractName());
        AbstractName containerName = containerData.getAbstractName();

        GBeanData connector = bootstrap.addGBean("TomcatConnector", Http11ConnectorGBean.GBEAN_INFO);
        connector.setAttribute("name", "HTTP");
        connector.setAttribute("port", new Integer(8181));
        connector.setReferencePattern("TomcatContainer", containerName);
        connector.setReferencePattern("ServerInfo", serverInfo.getAbstractName());

        GBeanData tm = bootstrap.addGBean("TransactionManager", GeronimoTransactionManagerGBean.GBEAN_INFO);
        tmName = tm.getAbstractName();
        tm.setAttribute("defaultTransactionTimeoutSeconds", new Integer(10));

        GBeanData ctc = bootstrap.addGBean("ConnectionTrackingCoordinator", ConnectionTrackingCoordinatorGBean.GBEAN_INFO);
        ctcName = ctc.getAbstractName();
        ctc.setReferencePattern("TransactionManager", tmName);

        GBeanData cs = bootstrap.addGBean("CredentialStore", DirectConfigurationCredentialStoreImpl.GBEAN_INFO);
        Map<String, Map<String, Map<String, String>>> csd = new HashMap<String, Map<String, Map<String, String>>>();
        Map<String, Map<String, String>> r = new HashMap<String, Map<String, String>>();
        csd.put("foo", r);
        Map<String, String> creds = new HashMap<String, String>();
        r.put("metro", creds);
        creds.put(GeronimoUserPrincipal.class.getName(), "metro");
        cs.setAttribute("credentialStore", csd);

        ConfigurationUtil.loadBootstrapConfiguration(kernel, bootstrap, getClass().getClassLoader());

        configurationManager = ConfigurationUtil.getEditableConfigurationManager(kernel);
        configStore = (ConfigurationStore) kernel.getGBean(configStoreName);
View Full Code Here

Examples of org.apache.geronimo.gbean.GBeanData

    public void build(XmlObject container, DeploymentContext applicationContext, DeploymentContext moduleContext)
            throws DeploymentException {
        GerTomcatClusteringWadiType clusteringWadiType = getWadiClusterConfig(container);
        if (clusteringWadiType != null) {
            GBeanData webModuleData = extractWebModule(moduleContext);
            try {
                AbstractName sessionManagerName = addSessionManager(clusteringWadiType, webModuleData, moduleContext);
                addClusteredManagerRetriever(moduleContext, webModuleData, sessionManagerName);
                addClusteredValveRetriever(moduleContext, webModuleData, sessionManagerName);
            } catch (GBeanAlreadyExistsException e) {
View Full Code Here

Examples of org.apache.geronimo.gbean.GBeanData

    protected AbstractName addSessionManager(GerTomcatClusteringWadiType clustering,
            GBeanData webModuleData,
            DeploymentContext moduleContext) throws GBeanAlreadyExistsException {
        AbstractName name = newGBeanName(moduleContext, "WADISessionManager");

        GBeanData beanData = new GBeanData(name, BasicWADISessionManager.GBEAN_INFO);

        setConfigInfo(clustering, webModuleData, beanData);
        setCluster(clustering, beanData);
        setBackingStrategyFactory(clustering, beanData);
View Full Code Here

Examples of org.apache.geronimo.gbean.GBeanData

    protected AbstractName addClusteredValveRetriever(DeploymentContext moduleContext,
            GBeanData webModuleData,
            AbstractName sessionManagerName) throws GBeanAlreadyExistsException {
        AbstractName name = newGBeanName(moduleContext, "WADIClusteredValveRetriever");

        GBeanData beanData = new GBeanData(name, WADIClusteredValveRetriever.GBEAN_INFO);
        beanData.setReferencePattern(WADIClusteredValveRetriever.GBEAN_REF_WADI_SESSION_MANAGER, sessionManagerName);

        webModuleData.setReferencePattern(TomcatWebAppContext.GBEAN_REF_CLUSTERED_VALVE_RETRIEVER, name);

        addGBean(moduleContext, beanData);
View Full Code Here

Examples of org.apache.geronimo.gbean.GBeanData

    protected AbstractName addClusteredManagerRetriever(DeploymentContext moduleContext,
            GBeanData webModuleData,
            AbstractName sessionManagerName) throws GBeanAlreadyExistsException {
        AbstractName name = newGBeanName(moduleContext, "ClusteredManagerRetriever");

        GBeanData beanData = new GBeanData(name, ClusteredManagerRetriever.GBEAN_INFO);
        beanData.setReferencePattern(ClusteredManagerRetriever.GBEAN_REF_SESSION_MANAGER, sessionManagerName);

        webModuleData.setReferencePattern(TomcatWebAppContext.GBEAN_REF_MANAGER_RETRIEVER, name);

        addGBean(moduleContext, beanData);
View Full Code Here

Examples of org.apache.geronimo.gbean.GBeanData

            List results = new ArrayList();
            AbstractNameQuery query = new AbstractNameQuery(ActiveMQConnector.class.getName());
            Set set = kernel.listGBeans(query); // all Jetty connectors
            for (Iterator it = set.iterator(); it.hasNext();) {
                AbstractName name = (AbstractName) it.next(); // a single Jetty connector
                GBeanData data = kernel.getGBeanData(name);
                ReferencePatterns refs = data.getReferencePatterns("brokerService");
                if (containerName.equals(refs.getAbstractName())) {
                    results.add(mgr.createProxy(name, ActiveMQConnector.class.getClassLoader()));
                }
            }
            return (ActiveMQConnector[]) results.toArray(new ActiveMQConnector[results.size()]);
View Full Code Here

Examples of org.apache.geronimo.gbean.GBeanData

            List results = new ArrayList();
            AbstractNameQuery query = new AbstractNameQuery(ActiveMQConnector.class.getName());
            Set set = kernel.listGBeans(query); // all Jetty connectors
            for (Iterator it = set.iterator(); it.hasNext();) {
                AbstractName name = (AbstractName) it.next(); // a single Jetty connector
                GBeanData data = kernel.getGBeanData(name);
                ReferencePatterns refs = data.getReferencePatterns("brokerService");
                if(containerName.equals(refs.getAbstractName())) {
                    try {
                        String testProtocol = (String) kernel.getAttribute(name, "protocol");
                        if(testProtocol != null && testProtocol.equals(protocol)) {
                            results.add(mgr.createProxy(name, ActiveMQConnector.class.getClassLoader()));
View Full Code Here

Examples of org.apache.geronimo.gbean.GBeanData

     * functional (e.g. SSL settings for a secure connector).
     */
    public JMSConnector addConnector(JMSBroker broker, String uniqueName, String protocol, String host, int port) {
        AbstractName brokerAbstractName = kernel.getAbstractNameFor(broker);
        AbstractName name = kernel.getNaming().createChildName(brokerAbstractName, uniqueName, NameFactory.GERONIMO_SERVICE);
        GBeanData connector = new GBeanData(name, TransportConnectorGBeanImpl.GBEAN_INFO);
        //todo: if SSL is supported, need to add more properties or use a different GBean?
        connector.setAttribute("protocol", protocol);
        connector.setAttribute("host", host);
        connector.setAttribute("port", new Integer(port));
        connector.setReferencePattern("brokerService", brokerAbstractName);
        EditableConfigurationManager mgr = ConfigurationUtil.getEditableConfigurationManager(kernel);
        if(mgr != null) {
            try {
                mgr.addGBeanToConfiguration(brokerAbstractName.getArtifact(), connector, false);
                return (JMSConnector) kernel.getProxyManager().createProxy(name, ActiveMQConnector.class.getClassLoader());
View Full Code Here

Examples of org.apache.geronimo.gbean.GBeanData

    }

    public GBeanData addGBean(String name, GBeanInfo gbeanInfo) throws GBeanAlreadyExistsException {
        if (name == null) throw new NullPointerException("name is null");
        if (gbeanInfo == null) throw new NullPointerException("gbean is null");
        GBeanData gbean = new GBeanData(gbeanInfo);
        configuration.addGBean(name, gbean);
        return gbean;
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.