Package org.apache.openejb.jee.oejb2

Examples of org.apache.openejb.jee.oejb2.PatternType


        case DEPENDENCY:
            if (isEmpty(textList.get(0).getText()) || isEmpty(textList.get(1).getText())) {
                return false;
            }
            PatternType dependency = (PatternType)eObject;
            if (dependency == null) {
                dependency = (PatternType)getEFactory().create(PatternType.class);
                gbean = (GbeanType)section.getSelectedObject();

                // add the JAXBElement of a Dependency, not the Dependency
                ObjectFactory objectFactory = new ObjectFactory();
                gbean.getAttributeOrXmlAttributeOrReference().add(objectFactory.createGbeanTypeDependency(dependency));
            }
            dependency.setGroupId(textList.get(0).getText());
            dependency.setArtifactId(textList.get(1).getText());
            dependency.setVersion(textList.get(2).getText());
            dependency.setModule(textList.get(3).getText());
            dependency.setType(textList.get(4).getText());
            dependency.setCustomFoo(textList.get(5).getText());
            break;

        case REFERENCE:
            if (isEmpty(textList.get(0).getText()) || isEmpty(textList.get(1).getText()) ||
                    isEmpty(textList.get(2).getText())) {
View Full Code Here


                }
                else if (String.class.isInstance(element)) {
                    return "Gbean type: name = \"" + (String)element + "\"";
                }
                else if (PatternType.class.isInstance(element)) {
                  PatternType pattern = (PatternType)element;
                    return "Pattern: name = \"" + pattern.getCustomFoo() +
                            "\", group = \"" + pattern.getGroupId() +
                            "\", artifact = \"" + pattern.getArtifactId() +
                            "\", version = \"" + pattern.getVersion() +
                            "\", module = \"" + pattern.getModule() + "\"";
                }

                return null;
            }
View Full Code Here

                        return "Attribute: name = \"" + attribute.getName() +
                                "\", type = \"" + attribute.getType() +
                                "\", value = \"" + attribute.getValue() + "\"";
                    }
                    else if (PatternType.class.isInstance(object)) {
                      PatternType dependency = (PatternType)object;
                        return "Dependency: group = \"" + dependency.getGroupId() +
                                "\", artifact = \"" + dependency.getArtifactId() +
                                "\", version = \"" + dependency.getVersion() +
                                "\", module = \"" + dependency.getModule() +
                                "\", type = \"" + dependency.getType() +
                                "\", custom name = \"" + dependency.getCustomFoo() + "\"";
                    }
                    else if (ReferenceType.class.isInstance(object)) {
                      ReferenceType reference = (ReferenceType)object;
                        return "Reference: name = \"" + reference.getName() +
                                "\", group = \"" + reference.getGroupId() +
View Full Code Here

                        if (value instanceof String[]) {
                            List<String> interfaces = Arrays
                                    .asList((String[]) value);
                            for (int j = 0; j < acceptedValues.length; j++) {
                                if (interfaces.contains(acceptedValues[j])) {
                                  PatternType pattern = new PatternType();
                                    Artifact artifact = abstractName
                                            .getArtifact();
                                    pattern.setArtifactId(artifact
                                            .getArtifactId());
                                    pattern.setGroupId(artifact.getGroupId());
                                    pattern.setVersion(artifact.getVersion()
                                            .toString());
                                    pattern.setName((String) abstractName
                                            .getName().get("name"));
                                    if (!result.contains(pattern)) {
                                        result.add(pattern);
                                    }
                                    break;
                                }
                            }
                        }
                        if (value instanceof String) {
                            String interfaces = (String) value;
                            for (int j = 0; j < acceptedValues.length; j++) {
                                if (interfaces.contains(acceptedValues[j])) {
                                  PatternType pattern = new PatternType();
                                    Artifact artifact = abstractName
                                            .getArtifact();
                                    pattern.setArtifactId(artifact
                                            .getArtifactId());
                                    pattern.setGroupId(artifact.getGroupId());
                                    pattern.setVersion(artifact.getVersion()
                                            .toString());
                                    pattern.setName((String) abstractName
                                            .getName().get("name"));
                                    if (!result.contains(pattern)) {
                                        result.add(pattern);
                                    }
                                    break;
View Full Code Here

                Collections.EMPTY_SET);
        for (int i = 0; i < kernels.size(); i++) {
            Set beans = kernels.get(i).listGBeans(query);
            for (Iterator it = beans.iterator(); it.hasNext();) {
                AbstractName abstractName = (AbstractName) it.next();
                PatternType pattern = new PatternType();
                Artifact artifact = abstractName.getArtifact();
                pattern.setArtifactId(artifact.getArtifactId());
                pattern.setGroupId(artifact.getGroupId());
                pattern.setVersion(artifact.getVersion().toString());
                pattern.setName((String) abstractName.getName().get("name"));
                if (!result.contains(pattern)) {
                    result.add(pattern);
                }
            }
        }
View Full Code Here

        return result;
    }

    protected void printNamingPatternList(List<PatternType> patternList) {
        for (int i = 0; i < patternList.size(); i++) {
          PatternType pattern = patternList.get(i);
            System.out.println("ArtifactID:" + pattern.getArtifactId()
                    + " GroupID:" + pattern.getGroupId() + " Module:"
                    + pattern.getModule() + " Version:" + pattern.getVersion()
                    + " Name:" + pattern.getName());
        }
    }
View Full Code Here

        }
        else if (element.getText().equals(elementTypes[PATTERN])) {
            if (isEmpty(textList.get(0).getText())) {
                return false;
            }
            PatternType pattern = (PatternType)eObject;
            if (pattern == null) {
                pattern = (PatternType)getEFactory().create(PatternType.class);
                gbeanRef = (GbeanRefType)section.getSelectedObject();
                gbeanRef.getPattern().add(pattern);
            }
            pattern.setName(textList.get(0).getText());
            pattern.setGroupId(textList.get(1).getText());
            pattern.setArtifactId(textList.get(2).getText());
            pattern.setVersion(textList.get(3).getText());
            pattern.setModule(textList.get(4).getText());
        }
        return true;
    }
View Full Code Here

        }
    }
   
    public boolean performFinish() {
        AbstractTableWizardPage page = (AbstractTableWizardPage) getPages()[0];
        PatternType msgPattern;
        MessageDestinationType messageDest;

        if (eObject == null) {
            eObject = getEFactory().create(MessageDestinationType.class);
            JAXBElement plan = section.getPlan();
View Full Code Here

                data.widthHint = 100;
                text.setLayoutData(data);
                if (eObject != null) {
                    if (i > 2) {
                        // get the pattern value
                        PatternType pattern = ((MessageDestinationType) eObject).getPattern();
                        String value = null;
            try {
              value = (String) JAXBUtils.getValue(pattern,getTableColumnEAttributes()[i]);
            } catch (Exception e) {
              MessageDialog.openError(Display.getCurrent().getActiveShell(),"Error", e.getMessage());
View Full Code Here

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

TOP

Related Classes of org.apache.openejb.jee.oejb2.PatternType

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.