Package org.apache.geronimo.jee.naming

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


        namingPattern.setVersion("ejbref-pattern-version");
        ejbRef.setPattern(namingPattern);
        applicationClient.getEjbRef().add(ejbRef);

        // set the GBean Ref
        GbeanRef gbeanRef = namingFactory.createGbeanRef();
        gbeanRef.setRefName("gbeanref-name");
        gbeanRef.getRefType().add("gbeanref-reftype");
        namingPattern = namingFactory.createPattern();
        namingPattern.setArtifactId("gbeanref-pattern-artifactid");
        namingPattern.setGroupId("gbeanref-pattern-groupid");
        namingPattern.setModule("gbeanref-pattern-module");
        namingPattern.setName("gbeanref-pattern-name");
        namingPattern.setVersion("gbeanref-pattern-version");
        gbeanRef.getPattern().add(namingPattern);
        applicationClient.getGbeanRef().add(gbeanRef);

        // set the Message Destination
        MessageDestination messageDestination = namingFactory.createMessageDestination();
        messageDestination.setAdminObjectLink("messagedestination-adminobjectlink");
View Full Code Here


                }
                if (JAXBElement.class.isInstance(parentElement)) {
                    parentElement = ((JAXBElement)parentElement).getValue();
                }
                if (GbeanRef.class.isInstance(parentElement)) {
                    GbeanRef gbeanRef = (GbeanRef)parentElement;
                    Object[] typeList = gbeanRef.getRefType().toArray();
                    Object[] patternList = gbeanRef.getPattern().toArray();
                    Object[] fullList = new Object[typeList.length + patternList.length];
                    System.arraycopy(typeList, 0, fullList, 0, typeList.length);
                    System.arraycopy(patternList, 0, fullList, typeList.length, patternList.length);
                    return fullList;
                }
View Full Code Here

            public String getText(Object element) {
                if (JAXBElement.class.isInstance(element)) {
                    element = ((JAXBElement)element).getValue();
                }
                if (GbeanRef.class.isInstance(element)) {
                    GbeanRef gbeanRef = (GbeanRef)element;
                    return "Gbean Ref: name = \"" + gbeanRef.getRefName() + "\"";
                }
                else if (String.class.isInstance(element)) {
                    return "Gbean type: name = \"" + (String)element + "\"";
                }
                else if (Pattern.class.isInstance(element)) {
View Full Code Here

        }
    }

    @Override
    public boolean performFinish() {
        GbeanRef gbeanRef;
        if (element.getText().equals(elementTypes[GBEAN_REF])) {
            if (isEmpty(textList.get(0).getText())) {
                return false;
            }
            gbeanRef = (GbeanRef)eObject;
            if (gbeanRef == null) {
                gbeanRef = (GbeanRef)getEFactory().create(GbeanRef.class);
                JAXBElement plan = section.getPlan();

                // if we have a WebApp, add the JAXBElement of the GBeanRef, not the GBeanRef
                if (WebApp.class.isInstance(plan.getValue())) {
                    ObjectFactory objectFactory = new ObjectFactory();
                    JAXBModelUtils.getGbeanRefs(plan).add(objectFactory.createGbeanRef(gbeanRef));
                    section.getObjectContainer().add(objectFactory.createGbeanRef(gbeanRef));
                }
                else {
                    JAXBModelUtils.getGbeanRefs(plan).add(gbeanRef);
                    section.getObjectContainer().add(gbeanRef);
                }
            }
            gbeanRef.setRefName(textList.get(0).getText());
        }
        else if (element.getText().equals(elementTypes[GBEAN_TYPE])) {
            if (isEmpty(textList.get(0).getText())) {
                return false;
            }
            String type = (String)eObject;
            gbeanRef = (GbeanRef)section.getSelectedObject();
            if (type == null) {
                gbeanRef.getRefType().add(textList.get(0).getText());
            }
            else {
                gbeanRef.getRefType().set(gbeanRef.getRefType().indexOf(type), textList.get(0).getText());
            }
        }
        else if (element.getText().equals(elementTypes[PATTERN])) {
            if (isEmpty(textList.get(0).getText())) {
                return false;
            }
            Pattern pattern = (Pattern)eObject;
            if (pattern == null) {
                pattern = (Pattern)getEFactory().create(Pattern.class);
                gbeanRef = (GbeanRef)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());
View Full Code Here

        }

        protected void initControl () {
            if (eObject == null) {
                element.select(GBEAN_REF);
                GbeanRef gbeanRef = (GbeanRef)section.getSelectedObject();
                if (gbeanRef == null) {
                    element.setEnabled(false);
                }
            }
            else {
View Full Code Here

TOP

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

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.