Package org.apache.geronimo.xml.ns.naming_1

Examples of org.apache.geronimo.xml.ns.naming_1.GbeanLocatorType


    /**
     * @return
     */
    private ResourceLocatorType getResourceLocator() {
      ResourceLocatorType locator = plan.getCmpConnectionFactory();
        if (locator == null) {
            locator = namingFactory.createResourceLocatorType();
            plan.setCmpConnectionFactory(locator);
        }
        return locator;
View Full Code Here


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

    public ITableLabelProvider getLabelProvider() {
        return new LabelProvider() {
            @Override
            public String getColumnText(Object element, int columnIndex) {
                if (ResourceRefType.class.isInstance(element)) {
                  ResourceRefType resourceRef = (ResourceRefType) element;
                    switch (columnIndex) {
                    case 0:
                        return resourceRef.getRefName();
                    case 1:
                        return resourceRef.getResourceLink();
                    }
                }
                return null;
            }
        };
View Full Code Here

            serviceRef.setServiceRefName(textList.get(0).getText());
            if (isEmpty(textList.get(1).getText())) {
                serviceRef.setServiceCompletion(null);
            }
            else {
                ServiceCompletionType serviceComp = serviceRef.getServiceCompletion();
                if (serviceComp == null) {
                    serviceComp = (ServiceCompletionType)getEFactory().create(ServiceCompletionType.class);
                    serviceRef.setServiceCompletion(serviceComp);
                }
                serviceRef.getServiceCompletion().setServiceName(textList.get(1).getText());
View Full Code Here

        addPage(new ServiceRefWizardPage("Page0"));
    }

    @Override
    public boolean performFinish() {
        ServiceRefType serviceRef;
        if (element.getText().equals(elementTypes[SERVICE_REF])) {
            if (isEmpty(textList.get(0).getText())) {
                return false;
            }
            serviceRef = (ServiceRefType)eObject;
            if (serviceRef == null) {
                serviceRef = (ServiceRefType)getEFactory().create(ServiceRefType.class);
                JAXBElement plan = section.getPlan();
                JAXBModelUtils.getServiceRefs(plan).add(serviceRef);
            }
            serviceRef.setServiceRefName(textList.get(0).getText());
            if (isEmpty(textList.get(1).getText())) {
                serviceRef.setServiceCompletion(null);
            }
            else {
                ServiceCompletionType serviceComp = serviceRef.getServiceCompletion();
                if (serviceComp == null) {
                    serviceComp = (ServiceCompletionType)getEFactory().create(ServiceCompletionType.class);
                    serviceRef.setServiceCompletion(serviceComp);
                }
                serviceRef.getServiceCompletion().setServiceName(textList.get(1).getText());
            }
        }
        else if (element.getText().equals(elementTypes[PORT])) {
            if (isEmpty(textList.get(0).getText()) || isEmpty(textList.get(4).getText())) {
                return false;
            }
            PortType port = (PortType)eObject;
            if (port == null) {
                port = (PortType)getEFactory().create(PortType.class);
                serviceRef = (ServiceRefType)section.getSelectedObject();
                serviceRef.getPort().add(port);
            }
            port.setPortName(textList.get(0).getText());
            port.setProtocol(textList.get(1).getText());
            port.setHost(textList.get(2).getText());
            port.setPort(Integer.valueOf(textList.get(3).getText()));
            port.setUri(textList.get(4).getText());
            port.setCredentialsName(textList.get(5).getText());
        }
        else if (element.getText().equals(elementTypes[PORT_COMPLETION])) {
            if (isEmpty(textList.get(0).getText()) || isEmpty(textList.get(4).getText()) ||
                isEmpty(textList.get(6).getText())) {
                return false;
            }
            PortCompletionType portComp = (PortCompletionType)eObject;
            if (portComp == null) {
                portComp = (PortCompletionType)getEFactory().create(PortCompletionType.class);
                serviceRef = (ServiceRefType)section.getSelectedObject();
                serviceRef.getServiceCompletion().getPortCompletion().add(portComp);
                PortType port = (PortType)getEFactory().create(PortType.class);
                portComp.setPort (port);
            }
            portComp.getPort().setPortName(textList.get(0).getText());
            portComp.getPort().setProtocol(textList.get(1).getText());
View Full Code Here

        }

        protected void initControl () {
            if (eObject == null) {
                element.select(SERVICE_REF);
                ServiceRefType serviceRef = (ServiceRefType)section.getSelectedObject();
                // use of ports and port completions are mutually exclusive
                if (serviceRef == null) {
                    element.setEnabled(false);
                } else if (serviceRef.getServiceCompletion() == null) {
                    element.remove(PORT_COMPLETION);
                } else {
                    element.remove(PORT);
                }
            }
View Full Code Here

    public void removeItem(Object anItem) {
        if (ServiceRefType.class.isInstance(anItem)) {
            getObjectContainer().remove(anItem);
        }
        else if (PortType.class.isInstance(anItem)) {
          ServiceRefType serviceRef = (ServiceRefType)tree.getSelection()[0].getParentItem().getData();
            serviceRef.getPort().remove(anItem);
        }
        else if (PortCompletionType.class.isInstance(anItem)) {
          ServiceRefType serviceRef = (ServiceRefType)tree.getSelection()[0].getParentItem().getData();
            serviceRef.getServiceCompletion().getPortCompletion().remove(anItem);
        }
    }
View Full Code Here

            public Object[] getChildren(Object parentElement) {
                if (List.class.isInstance(parentElement)) {
                    return ((List)parentElement).toArray();
                }
                if (ServiceRefType.class.isInstance(parentElement)) {
                    ServiceRefType serviceRef = (ServiceRefType)parentElement;
                    Object[] portList = serviceRef.getPort().toArray();
                    Object[] compList = new Object[0];
                    if (serviceRef.getServiceCompletion() != null) {
                        compList = serviceRef.getServiceCompletion().getPortCompletion().toArray();
                    }
                    Object[] fullList = new Object[portList.length + compList.length];
                    System.arraycopy(portList, 0, fullList, 0, portList.length);
                    System.arraycopy(compList, 0, fullList, portList.length, compList.length);
                    return fullList;
View Full Code Here

    public ILabelProvider getLabelProvider() {
        return new LabelProvider() {
            @Override
            public String getText(Object element) {
                if (ServiceRefType.class.isInstance(element)) {
                  ServiceRefType serviceRef = (ServiceRefType)element;
                        String retString = "Service Ref: name = \"" + serviceRef.getServiceRefName() + "\"";
                        if (serviceRef.getServiceCompletion() != null) {
                            retString += ", service completion name = \"" + serviceRef.getServiceCompletion().getServiceName() + "\"";
                        }
                        return retString;
                }
                else if (PortType.class.isInstance(element)) {
                  PortType port = (PortType)element;
View Full Code Here

TOP

Related Classes of org.apache.geronimo.xml.ns.naming_1.GbeanLocatorType

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.