Package org.apache.geronimo.jee.naming

Examples of org.apache.geronimo.jee.naming.GbeanLocator


            if (security.getRoleMappings() != null && security.getRoleMappings().getRole().size() == 0) {
                security.setRoleMappings(null);
            }
        } else if (source instanceof WebApp) {
            WebApp webapp = (WebApp)source;
            GbeanLocator gbeanlocator = webapp.getWebContainer();
            if (gbeanlocator != null && isEmpty(gbeanlocator.getGbeanLink()) && isEmpty(gbeanlocator.getPattern())) {
                webapp.setWebContainer(null);
            }
        } else if (source instanceof OpenejbJar) {
            OpenejbJar openejb = (OpenejbJar)source;
            ResourceLocator locator = openejb.getCmpConnectionFactory();
View Full Code Here


        // set the Resource Adapter
        Resourceadapter resourceadapter = connectorFactory.createResourceadapter();
        ResourceadapterInstance resourceadapterInstance = connectorFactory.createResourceadapterInstance();
        resourceadapterInstance.setResourceadapterName("resourceadapter-name");
        GbeanLocator gbeanLocator = namingFactory.createGbeanLocator();
        gbeanLocator.setGbeanLink("connector-resourceadapter-workmanager-gbeanlink");
        Pattern namingPattern = namingFactory.createPattern();
        namingPattern.setArtifactId("connector-resourceadapter-workmanager-pattern-artifactid");
        namingPattern.setGroupId("connector-resourceadapter-workmanager-pattern-groupid");
        namingPattern.setModule("connector-resourceadapter-workmanager-pattern-module");
        namingPattern.setName("connector-resourceadapter-workmanager-pattern-name");
        namingPattern.setVersion("connector-resourceadapter-workmanager-pattern-version");
        gbeanLocator.setPattern(namingPattern);
        resourceadapterInstance.setWorkmanager(gbeanLocator);
        configPropertySetting = connectorFactory.createConfigPropertySetting();
        configPropertySetting.setName("resourceadapter-instance-name");
        configPropertySetting.setValue("resourceadapter-instance-value");       
        resourceadapterInstance.getConfigPropertySetting().add(configPropertySetting);
View Full Code Here

        environment.setDependencies(dependencies);
        connector.setEnvironment(environment);
        Resourceadapter resourceadapter = connectorFactory.createResourceadapter();
        ResourceadapterInstance resourceadapterInstance = connectorFactory.createResourceadapterInstance();
        resourceadapterInstance.setResourceadapterName("resource-connector-resourceadapter-name");
        GbeanLocator gbeanLocator = namingFactory.createGbeanLocator();
        gbeanLocator.setGbeanLink("connector-resourceadapter-workmanager-gbeanlink");
        namingPattern = namingFactory.createPattern();
        namingPattern.setArtifactId("connector-resourceadapter-workmanager-pattern-artifactid");
        namingPattern.setGroupId("connector-resourceadapter-workmanager-pattern-groupid");
        namingPattern.setModule("connector-resourceadapter-workmanager-pattern-module");
        namingPattern.setName("connector-resourceadapter-workmanager-pattern-name");
        namingPattern.setVersion("connector-resourceadapter-workmanager-pattern-version");
        gbeanLocator.setPattern(namingPattern);
        resourceadapterInstance.setWorkmanager(gbeanLocator);
        configPropertySetting = connectorFactory.createConfigPropertySetting();
        configPropertySetting.setName("resource-connector-resourceadapter-instance-name");
        configPropertySetting.setValue("resource-connector-resourceadapter-instance-value");       
        resourceadapterInstance.getConfigPropertySetting().add(configPropertySetting);
View Full Code Here

        //ContainerConfig containerConfig = webFactory.createContainerConfig();
        //containerConfig.getAny().add("containerconfig-any");
        //webApp.setContainerConfig(containerConfig);

        // set the GBean Locator
        GbeanLocator gbeanLocator = namingFactory.createGbeanLocator();
        gbeanLocator.setGbeanLink("gbeanlocator-gbeanlink");
        org.apache.geronimo.jee.naming.Pattern namingPattern = namingFactory.createPattern();
        namingPattern.setArtifactId("gbeanlocator-pattern-artifactid");
        namingPattern.setGroupId("gbeanlocator-pattern-groupid");
        namingPattern.setModule("gbeanlocator-pattern-module");
        namingPattern.setName("gbeanlocator-pattern-name");
        namingPattern.setVersion("gbeanlocator-pattern-version");
        gbeanLocator.setPattern(namingPattern);
        webApp.setWebContainer(gbeanLocator);

        // set the Abstract Naming Entry
        PersistenceUnitRef persistenceUnitRef = namingFactory.createPersistenceUnitRef();
        persistenceUnitRef.setPersistenceUnitName("persistenceunitref-unitname");
View Full Code Here

        specifyAsLink = toolkit.createButton(composite, CommonMessages.useGBeanLink, SWT.RADIO);
        GridData data = new GridData();
        data.horizontalSpan = 2;
        specifyAsLink.setLayoutData(data);

        GbeanLocator wc = plan.getWebContainer();

        toolkit.createLabel(composite, CommonMessages.gBeanLink);
        String value = wc != null ? wc.getGbeanLink() : null;
        gBeanLink = toolkit.createText(composite, value, SWT.BORDER);
        gBeanLink.setLayoutData(createTextFieldGridData());
        gBeanLink.addModifyListener(new ModifyListener() {
            public void modifyText(ModifyEvent e) {
                getGBeanLocator().setGbeanLink(gBeanLink.getText());
                markDirty();
            }
        });

        specifyAsPattern = toolkit.createButton(composite, CommonMessages.useGBeanPattern, SWT.RADIO);
        specifyAsPattern.setLayoutData(data);

        toolkit.createLabel(composite, CommonMessages.groupId);
        value = wc != null && wc.getPattern() != null ? wc.getPattern().getGroupId()
                : null;
        group = toolkit.createText(composite, value, SWT.BORDER);
        group.setLayoutData(createTextFieldGridData());
        group.addModifyListener(new ModifyListener() {
            public void modifyText(ModifyEvent e) {
                getPattern().setGroupId(group.getText());
                markDirty();
            }
        });

        toolkit.createLabel(composite, CommonMessages.artifactId);
        value = wc != null && wc.getPattern() != null ? wc.getPattern().getArtifactId()
                : null;
        artifact = toolkit.createText(composite, value, SWT.BORDER);
        artifact.setLayoutData(createTextFieldGridData());
        artifact.addModifyListener(new ModifyListener() {
            public void modifyText(ModifyEvent e) {
                getPattern().setArtifactId(artifact.getText());
                markDirty();
            }
        });

        toolkit.createLabel(composite, CommonMessages.moduleId);
        value = wc != null && wc.getPattern() != null ? wc.getPattern().getModule()
                : null;
        module = toolkit.createText(composite, value, SWT.BORDER);
        module.setLayoutData(createTextFieldGridData());
        module.addModifyListener(new ModifyListener() {
            public void modifyText(ModifyEvent e) {
                getPattern().setModule(module.getText());
                markDirty();
            }
        });

        toolkit.createLabel(composite, CommonMessages.name);
        value = wc != null && wc.getPattern() != null ? wc.getPattern().getName()
                : null;
        name = toolkit.createText(composite, value, SWT.BORDER);
        name.setLayoutData(createTextFieldGridData());
        name.addModifyListener(new ModifyListener() {
            public void modifyText(ModifyEvent e) {
                getPattern().setName(name.getText());
                markDirty();
            }
        });

        toolkit.createLabel(composite, CommonMessages.version);
        value = wc != null && wc.getPattern() != null ? wc.getPattern().getVersion()
                : null;
        version = toolkit.createText(composite, value, SWT.BORDER);
        version.setLayoutData(createTextFieldGridData());
        version.addModifyListener(new ModifyListener() {
            public void modifyText(ModifyEvent e) {
                getPattern().setVersion(version.getText());
                markDirty();
            }
        });

        specifyAsLink.addSelectionListener(new SelectionAdapter() {
            public void widgetSelected(SelectionEvent e) {
                if (specifyAsLink.getSelection()) {
                    getGBeanLocator().setPattern(null);
                    if (gBeanLink.getText().length() > 0) {
                        plan.getWebContainer().setGbeanLink(gBeanLink.getText());
                    }
                    markDirty();
                    toggle();
                }
            }
        });
        specifyAsPattern.addSelectionListener(new SelectionAdapter() {
            public void widgetSelected(SelectionEvent e) {
                if (specifyAsPattern.getSelection()) {
                  if (plan.getWebContainer() != null) {
                      plan.getWebContainer().setGbeanLink (null);
                  }
                    if (group.getText().length() > 0) {
                        getPattern().setGroupId(group.getText());
                    }
                    if (artifact.getText().length() > 0) {
                        getPattern().setArtifactId(artifact.getText());
                    }
                    if (module.getText().length() > 0) {
                        getPattern().setModule(module.getText());
                    }
                    if (name.getText().length() > 0) {
                        getPattern().setName(name.getText());
                    }
                    if (version.getText().length() > 0) {
                        getPattern().setVersion(version.getText());
                    }
                    markDirty();
                    toggle();
                }
            }
        });

        if (wc != null) {
            if (wc.getGbeanLink() != null) {
                specifyAsLink.setSelection(true);
            } else if (wc.getPattern() != null) {
                specifyAsPattern.setSelection(true);
            }
        }

        toggle();
View Full Code Here

    /**
     * @return
     */
    private GbeanLocator getGBeanLocator() {
        GbeanLocator wc = plan.getWebContainer();
        if (wc == null) {
            wc = namingFactory.createGbeanLocator();
            plan.setWebContainer(wc);
        }
        return wc;
View Full Code Here

    /**
     * @return
     */
    private Pattern getPattern() {
        GbeanLocator locator = getGBeanLocator();
        Pattern pattern = locator.getPattern();
        if (pattern == null) {
            pattern = namingFactory.createPattern();
            locator.setPattern(pattern);
        }
        return pattern;
    }
View Full Code Here

TOP

Related Classes of org.apache.geronimo.jee.naming.GbeanLocator

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.