Package org.apache.geronimo.xbeans.j2ee

Examples of org.apache.geronimo.xbeans.j2ee.EjbRefType


            String name = (String) it.next();
            newMap.put(name.trim(), ejbRefMap.get(name));
        }
        ejbRefMap = newMap;
        for (int i = 0; i < ejbRefs.length; i++) {
            EjbRefType ejbRef = ejbRefs[i];

            String ejbRefName = getStringValue(ejbRef.getEjbRefName());
            GerEjbRefType remoteRef = (GerEjbRefType) ejbRefMap.get(ejbRefName);

            Reference ejbReference = addEJBRef(earContext, ejbContext, refContext, moduleURI, ejbRef, remoteRef, cl);
            builder.bind(ejbRefName, ejbReference);
        }
View Full Code Here


    }

    static void addEJBRefs(NamingContext earContext, NamingContext ejbContext, RefContext refContext, URI moduleURI, EjbRefType[] ejbRefs, Map ejbRefMap, ClassLoader cl, ComponentContextBuilder builder) throws DeploymentException {
        J2eeContext j2eeContext = ejbContext.getJ2eeContext();
        for (int i = 0; i < ejbRefs.length; i++) {
            EjbRefType ejbRef = ejbRefs[i];

            String ejbRefName = getStringValue(ejbRef.getEjbRefName());

            String remote = getStringValue(ejbRef.getRemote());
            assureEJBObjectInterface(remote, cl);

            String home = getStringValue(ejbRef.getHome());
            assureEJBHomeInterface(home, cl);

            Reference ejbReference;
            boolean isSession = "Session".equals(getStringValue(ejbRef.getEjbRefType()));

            if (isSession && remote.equals("javax.management.j2ee.Management") && home.equals("javax.management.j2ee.ManagementHome")) {
                String mejbName = refContext.getMEJBName();
                ejbReference = refContext.getEJBRemoteRef(mejbName, isSession, home, remote);
            } else {

                String ejbLink = null;
                GerEjbRefType remoteRef = (GerEjbRefType) ejbRefMap.get(ejbRefName);
                if (remoteRef != null && remoteRef.isSetNsCorbaloc()) {
                    try {
                        ObjectName cssBean;
                        if (remoteRef.isSetCssName()) {
                            cssBean = ObjectName.getInstance(getStringValue(remoteRef.getCssName()));
                        } else if (remoteRef.isSetCssLink()) {
                            String cssLink = remoteRef.getCssLink().trim();
                            //TODO is this correct?
                            String moduleType = null;
                            cssBean = refContext.locateComponentName(cssLink, moduleURI, moduleType, NameFactory.CORBA_CSS, earContext.getJ2eeContext(), earContext, "css gbean");
                        } else {
                            GerCssType css = remoteRef.getCss();
                            cssBean = NameFactory.getComponentName(getStringValue(css.getDomain()),
                                    getStringValue(css.getServer()),
                                    getStringValue(css.getApplication()),
                                    getStringValue(css.getModule()),
                                    getStringValue(css.getName()),
                                    getStringValue(NameFactory.CORBA_CSS),
                                    earContext.getJ2eeContext());
                        }
                        ejbReference = refContext.getCORBARemoteRef(new URI(getStringValue(remoteRef.getNsCorbaloc())),
                                getStringValue(remoteRef.getName()),
                                ObjectName.getInstance(cssBean),
                                home);
                    } catch (URISyntaxException e) {
                        throw new DeploymentException("Could not construct CORBA NameServer URI: " + remoteRef.getNsCorbaloc(), e);
                    } catch (MalformedObjectNameException e) {
                        throw new DeploymentException("Could not construct CSS container name: " + remoteRef.getCssName(), e);
                    }
                } else {
                    if (remoteRef != null && remoteRef.isSetEjbLink()) {
                        ejbLink = remoteRef.getEjbLink();
                    } else if (ejbRef.isSetEjbLink()) {
                        ejbLink = getStringValue(ejbRef.getEjbLink());
                    }

                    if (ejbLink != null) {
                        ejbReference = refContext.getEJBRemoteRef(moduleURI, ejbLink, isSession, home, remote, ejbContext);
                    } else if (remoteRef != null) {
View Full Code Here

            String name = (String) it.next();
            newMap.put(name.trim(), ejbRefMap.get(name));
        }
        ejbRefMap = newMap;
        for (int i = 0; i < ejbRefs.length; i++) {
            EjbRefType ejbRef = ejbRefs[i];

            String ejbRefName = getStringValue(ejbRef.getEjbRefName());
            GerEjbRefType remoteRef = (GerEjbRefType) ejbRefMap.get(ejbRefName);

            Reference ejbReference = addEJBRef(earContext, ejbContext, refContext, moduleURI, ejbRef, remoteRef, cl);
            builder.bind(ejbRefName, ejbReference);
        }
View Full Code Here

    public static void addEJBRefs(EARContext earContext, URI uri, EjbRefType[] ejbRefs, Map ejbRefMap, ClassLoader cl, ComponentContextBuilder builder) throws DeploymentException {
        RefContext refContext = earContext.getRefContext();
        J2eeContext j2eeContext = earContext.getJ2eeContext();
        for (int i = 0; i < ejbRefs.length; i++) {
            EjbRefType ejbRef = ejbRefs[i];

            String ejbRefName = ejbRef.getEjbRefName().getStringValue();

            String remote = ejbRef.getRemote().getStringValue();
            assureEJBObjectInterface(remote, cl);

            String home = ejbRef.getHome().getStringValue();
            assureEJBHomeInterface(home, cl);

            boolean isSession = "Session".equals(ejbRef.getEjbRefType().getStringValue());

            String ejbLink = null;
            GerEjbRefType remoteRef = (GerEjbRefType) ejbRefMap.get(ejbRefName);
            if (remoteRef != null && remoteRef.isSetEjbLink()) {
                ejbLink = remoteRef.getEjbLink();
            } else if (ejbRef.isSetEjbLink()) {
                ejbLink = getJ2eeStringValue(ejbRef.getEjbLink());
            }

            Reference ejbReference;
            if (ejbLink != null) {
                ejbReference = refContext.getEJBRemoteRef(uri, ejbLink, isSession, home, remote);
View Full Code Here

    }

    static void addEJBRefs(NamingContext earContext, NamingContext ejbContext, RefContext refContext, URI moduleURI, EjbRefType[] ejbRefs, Map ejbRefMap, ClassLoader cl, ComponentContextBuilder builder) throws DeploymentException {
        J2eeContext j2eeContext = ejbContext.getJ2eeContext();
        for (int i = 0; i < ejbRefs.length; i++) {
            EjbRefType ejbRef = ejbRefs[i];

            String ejbRefName = getStringValue(ejbRef.getEjbRefName());

            String remote = getStringValue(ejbRef.getRemote());
            try {
                assureEJBObjectInterface(remote, cl);
            } catch (DeploymentException e) {
                throw new DeploymentException("Error processing 'remote' element for EJB Reference '"+ejbRefName+"' for module '"+moduleURI+"': "+e.getMessage());
            }

            String home = getStringValue(ejbRef.getHome());
            try {
                assureEJBHomeInterface(home, cl);
            } catch (DeploymentException e) {
                throw new DeploymentException("Error processing 'home' element for EJB Reference '"+ejbRefName+"' for module '"+moduleURI+"': "+e.getMessage());
            }

            Reference ejbReference;
            boolean isSession = "Session".equals(getStringValue(ejbRef.getEjbRefType()));

            if (isSession && remote.equals("javax.management.j2ee.Management") && home.equals("javax.management.j2ee.ManagementHome")) {
                String mejbName = refContext.getMEJBName();
                ejbReference = refContext.getEJBRemoteRef(mejbName, isSession, home, remote);
            } else {

                String ejbLink = null;
                GerEjbRefType remoteRef = (GerEjbRefType) ejbRefMap.get(ejbRefName);
                if (remoteRef != null && remoteRef.isSetNsCorbaloc()) {
                    try {
                        ObjectName cssBean;
                        if (remoteRef.isSetCssName()) {
                            cssBean = ObjectName.getInstance(getStringValue(remoteRef.getCssName()));
                        } else if (remoteRef.isSetCssLink()) {
                            String cssLink = remoteRef.getCssLink().trim();
                            //TODO is this correct?
                            String moduleType = null;
                            cssBean = refContext.locateComponentName(cssLink, moduleURI, moduleType, NameFactory.CORBA_CSS, earContext.getJ2eeContext(), earContext, "css gbean");
                        } else {
                            GerCssType css = remoteRef.getCss();
                            cssBean = NameFactory.getComponentName(getStringValue(css.getDomain()),
                                    getStringValue(css.getServer()),
                                    getStringValue(css.getApplication()),
                                    getStringValue(css.getModule()),
                                    getStringValue(css.getName()),
                                    getStringValue(NameFactory.CORBA_CSS),
                                    earContext.getJ2eeContext());
                        }
                        ejbReference = refContext.getCORBARemoteRef(new URI(getStringValue(remoteRef.getNsCorbaloc())),
                                getStringValue(remoteRef.getName()),
                                ObjectName.getInstance(cssBean),
                                home);
                    } catch (URISyntaxException e) {
                        throw new DeploymentException("Could not construct CORBA NameServer URI: " + remoteRef.getNsCorbaloc(), e);
                    } catch (MalformedObjectNameException e) {
                        throw new DeploymentException("Could not construct CSS container name: " + remoteRef.getCssName(), e);
                    }
                } else {
                    if (remoteRef != null && remoteRef.isSetEjbLink()) {
                        ejbLink = remoteRef.getEjbLink();
                    } else if (ejbRef.isSetEjbLink()) {
                        ejbLink = getStringValue(ejbRef.getEjbLink());
                    }

                    if (ejbLink != null) {
                        ejbReference = refContext.getEJBRemoteRef(moduleURI, ejbLink, isSession, home, remote, ejbContext);
                    } else if (remoteRef != null) {
View Full Code Here

    public static void addEJBRefs(EARContext earContext, URI uri, EjbRefType[] ejbRefs, Map ejbRefMap, ClassLoader cl, ComponentContextBuilder builder) throws DeploymentException {
        RefContext refContext = earContext.getRefContext();
        J2eeContext j2eeContext = earContext.getJ2eeContext();
        for (int i = 0; i < ejbRefs.length; i++) {
            EjbRefType ejbRef = ejbRefs[i];

            String ejbRefName = getStringValue(ejbRef.getEjbRefName());

            String remote = getStringValue(ejbRef.getRemote());
            assureEJBObjectInterface(remote, cl);

            String home = getStringValue(ejbRef.getHome());
            assureEJBHomeInterface(home, cl);

            Reference ejbReference;
            boolean isSession = "Session".equals(getStringValue(ejbRef.getEjbRefType()));

            if (isSession && remote.equals("javax.management.j2ee.Management") && home.equals("javax.management.j2ee.ManagementHome")) {
                String mejbName = refContext.getMEJBName();
                ejbReference = refContext.getEJBRemoteRef(mejbName, isSession, home, remote);
            } else {

                String ejbLink = null;
                GerEjbRefType remoteRef = (GerEjbRefType) ejbRefMap.get(ejbRefName);
                if (remoteRef != null && remoteRef.isSetEjbLink()) {
                    ejbLink = remoteRef.getEjbLink();
                } else if (ejbRef.isSetEjbLink()) {
                    ejbLink = getStringValue(ejbRef.getEjbLink());
                }

                if (ejbLink != null) {
                    ejbReference = refContext.getEJBRemoteRef(uri, ejbLink, isSession, home, remote);
                } else if (remoteRef != null) {
View Full Code Here

TOP

Related Classes of org.apache.geronimo.xbeans.j2ee.EjbRefType

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.