Package org.apache.geronimo.jee.naming

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


        gbean.setClazz("service-gbean-class");
        gbean.setName("service-gbean-name");
        applicationClient.getService().add(deploymentFactory.createGbean(gbean));

        // add the service ref
        ServiceRef serviceRef = namingFactory.createServiceRef();
        serviceRef.setServiceRefName("serviceref-refname");
        ServiceCompletion serviceCompletion = namingFactory.createServiceCompletion();
        serviceCompletion.setServiceName("serviceref-servicecompletion-servicename");
        PortCompletion portCompletion = namingFactory.createPortCompletion();
        portCompletion.setBindingName("serviceref-servicecompletion-portcompletion-bindingname");
        Port port = namingFactory.createPort();
        port.setCredentialsName("serviceref-servicecompletion-portcompletion-port-credentialsname");
        port.setHost("serviceref-servicecompletion-portcompletion-port-host");
        port.setPort(new Integer(0));
        port.setPortName("serviceref-servicecompletion-portcompletion-port-portname");
        port.setProtocol("serviceref-servicecompletion-portcompletion-port-protocol");
        port.setUri("serviceref-servicecompletion-portcompletion-port-uri");
        portCompletion.setPort(port);
        serviceCompletion.getPortCompletion().add(portCompletion);
        serviceRef.setServiceCompletion(serviceCompletion);
        port = namingFactory.createPort();
        port.setCredentialsName("serviceref-port-credentialsname");
        port.setHost("serviceref-port-host");
        port.setPort(new Integer(0));
        port.setPortName("serviceref-port-portname");
        port.setProtocol("serviceref-port-protocol");
        port.setUri("serviceref-port-uri");
        serviceRef.getPort().add(port);
        applicationClient.getServiceRef().add(serviceRef);
       
        JAXBElement<ApplicationClient> jaxbElement = applicationClientFactory.createApplicationClient(applicationClient);
       
        //
View Full Code Here


        namingPattern.setModule("messagedrivenbean-resourcref-pattern-module");
        namingPattern.setName("messagedrivenbean-resourceref-pattern-name");
        namingPattern.setVersion("messagedrivenbean-resourceref-pattern-version");
        resourceRef.setPattern(namingPattern);
        messageDrivenBean.getResourceRef().add(resourceRef);
        ServiceRef serviceRef = namingFactory.createServiceRef();
        serviceRef.setServiceRefName("messagedrivenbean-serviceref-refname");
        ServiceCompletion serviceCompletion = namingFactory.createServiceCompletion();
        serviceCompletion.setServiceName("messagedrivenbean-serviceref-servicecompletion-servicename");
        PortCompletion portCompletion = namingFactory.createPortCompletion();
        portCompletion.setBindingName("messagedrivenbean-serviceref-servicecompletion-portcompletion-bindingname");
        Port port = namingFactory.createPort();
        port.setCredentialsName("messagedrivenbean-serviceref-servicecompletion-portcompletion-port-credentialsname");
        port.setHost("messagedrivenbean-serviceref-servicecompletion-portcompletion-port-host");
        port.setPort(new Integer(0));
        port.setPortName("messagedrivenbean-serviceref-servicecompletion-portcompletion-port-portname");
        port.setProtocol("messagedrivenbean-serviceref-servicecompletion-portcompletion-port-protocol");
        port.setUri("messagedrivenbean-serviceref-servicecompletion-portcompletion-port-uri");
        portCompletion.setPort(port);
        serviceCompletion.getPortCompletion().add(portCompletion);
        serviceRef.setServiceCompletion(serviceCompletion);
        port = namingFactory.createPort();
        port.setCredentialsName("messagedrivenbean-serviceref-port-credentialsname");
        port.setHost("messagedrivenbean-serviceref-port-host");
        port.setPort(new Integer(0));
        port.setPortName("messagedrivenbean-serviceref-port-portname");
        port.setProtocol("messagedrivenbean-serviceref-port-protocol");
        port.setUri("messagedrivenbean-serviceref-port-uri");
        serviceRef.getPort().add(port);
        messageDrivenBean.getServiceRef().add(serviceRef);
        enterpriseBeans.getSessionOrEntityOrMessageDriven().add(messageDrivenBean);
        openEjbJar.setEnterpriseBeans(enterpriseBeans);

        // set the Relationships
View Full Code Here

        persistenceUnit.getMappingFile().add("persistence-mappingfile");
        persistence.getPersistenceUnit().add(persistenceUnit);
        webApp.getServiceOrPersistence().add(persistence);

        // set the Service Ref
        ServiceRef serviceRef = namingFactory.createServiceRef();
        serviceRef.setServiceRefName("serviceref-refname");
        ServiceCompletion serviceCompletion = namingFactory.createServiceCompletion();
        serviceCompletion.setServiceName("serviceref-servicecompletion-servicename");
        PortCompletion portCompletion = namingFactory.createPortCompletion();
        portCompletion.setBindingName("serviceref-servicecompletion-portcompletion-bindingname");
        Port port = namingFactory.createPort();
        port.setCredentialsName("serviceref-servicecompletion-portcompletion-port-credentialsname");
        port.setHost("serviceref-servicecompletion-portcompletion-port-host");
        port.setPort(new Integer(0));
        port.setPortName("serviceref-servicecompletion-portcompletion-port-portname");
        port.setProtocol("serviceref-servicecompletion-portcompletion-port-protocol");
        port.setUri("serviceref-servicecompletion-portcompletion-port-uri");
        portCompletion.setPort(port);
        serviceCompletion.getPortCompletion().add(portCompletion);
        serviceRef.setServiceCompletion(serviceCompletion);
        port = namingFactory.createPort();
        port.setCredentialsName("serviceref-port-credentialsname");
        port.setHost("serviceref-port-host");
        port.setPort(new Integer(0));
        port.setPortName("serviceref-port-portname");
        port.setProtocol("serviceref-port-protocol");
        port.setUri("serviceref-port-uri");
        serviceRef.getPort().add(port);
        webApp.getServiceRef().add(serviceRef);

        // set the Security
        Security security = securityFactory.createSecurity();
        security.setDefaultRole ("security-role");
View Full Code Here

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

    @Override
    public boolean performFinish() {
        ServiceRef serviceRef;
        if (element.getText().equals(elementTypes[SERVICE_REF])) {
            if (isEmpty(textList.get(0).getText())) {
                return false;
            }
            serviceRef = (ServiceRef)eObject;
            if (serviceRef == null) {
                serviceRef = (ServiceRef)getEFactory().create(ServiceRef.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 {
                ServiceCompletion serviceComp = serviceRef.getServiceCompletion();
                if (serviceComp == null) {
                    serviceComp = (ServiceCompletion)getEFactory().create(ServiceCompletion.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;
            }
            Port port = (Port)eObject;
            if (port == null) {
                port = (Port)getEFactory().create(Port.class);
                serviceRef = (ServiceRef)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;
            }
            PortCompletion portComp = (PortCompletion)eObject;
            if (portComp == null) {
                portComp = (PortCompletion)getEFactory().create(PortCompletion.class);
                serviceRef = (ServiceRef)section.getSelectedObject();
                serviceRef.getServiceCompletion().getPortCompletion().add(portComp);
                Port port = (Port)getEFactory().create(Port.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);
                ServiceRef serviceRef = (ServiceRef)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 (ServiceRef.class.isInstance(anItem)) {
            getObjectContainer().remove(anItem);
        }
        else if (Port.class.isInstance(anItem)) {
            ServiceRef serviceRef = (ServiceRef)tree.getSelection()[0].getParentItem().getData();
            serviceRef.getPort().remove(anItem);
        }
        else if (PortCompletion.class.isInstance(anItem)) {
            ServiceRef serviceRef = (ServiceRef)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 (ServiceRef.class.isInstance(parentElement)) {
                    ServiceRef serviceRef = (ServiceRef)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 (ServiceRef.class.isInstance(element)) {
                    ServiceRef serviceRef = (ServiceRef)element;
                        String retString = "Service Ref: name = \"" + serviceRef.getServiceRefName() + "\"";
                        if (serviceRef.getServiceCompletion() != null) {
                            retString += ", service completion name = \"" + serviceRef.getServiceCompletion().getServiceName() + "\"";
                        }
                        return retString;
                }
                else if (Port.class.isInstance(element)) {
                    Port port = (Port)element;
View Full Code Here

TOP

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

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.