Package org.apache.geronimo.xbeans.connector

Examples of org.apache.geronimo.xbeans.connector.GerAdminobjectType


                   adminobjects[i].getAdminObjectInterface().equals(aoInterface)) {
                    return adminobjects[i];
                }
            }
            // Haven't seen it; create a new DConfigBean
            GerAdminobjectType ao = getConnector().addNewAdminobject();
            AdminObjectDCB dcb = new AdminObjectDCB(bean, ao);
            AdminObjectDCB[] list = new AdminObjectDCB[adminobjects.length+1];
            System.arraycopy(adminobjects, 0, list, 0, adminobjects.length);
            list[adminobjects.length] = dcb;
            return dcb;
View Full Code Here


        if(admins == null) {
            adminobjects = new AdminObjectDCB[0];
        } else {
            // Match up each Geronimo adminobject with a ra.xml adminobject and create DConfigBeans accordingly
            for (int i = 0; i < admins.length; i++) {
                GerAdminobjectType admin = admins[i];
                String aoClass = admin.getAdminobjectClass();
                String aoIface = admin.getAdminobjectInterface();
                AdminObjectDCB dcb = (AdminObjectDCB) dcbs.get("class "+aoClass+" iface "+aoIface);
                if(dcb != null) {
                    // this is a second Geronimo adminobject block of the same type; there will not be a matching DDBean any more
                    // merge the adminobject-instance entries instead!!!
                    if(admin.getAdminobjectInstanceArray().length > 0) {
                        GerAdminobjectType old = dcb.getAdminObject();
                        GerAdminobjectInstanceType[] array = admin.getAdminobjectInstanceArray();
                        int oldCount = dcb.getAdminObjectInstance().length;
                        for (int j = 0; j < array.length; j++) {
                            GerAdminobjectInstanceType instance = array[j];
                            XmlCursor source = instance.newCursor();
                            XmlCursor dest = old.newCursor();
                            dest.toEndToken();
                            if(!source.moveXml(dest)) {
                                throw new RuntimeException("Unable to move admin object instance");
                            }
                            source.dispose();
                            dest.dispose();
                            dcb.addAdminObjectInstance(old.getAdminobjectInstanceArray(oldCount+j));
                        }
                    }
                    continue;
                }
                DDBean target = null;
                for (int j = 0; j < ddBeans.size(); j++) {
                    DDBean ddBean = (DDBean) ddBeans.get(j);
                    String ddClass = ddBean.getText("adminobject-class")[0];
                    String ddIface = ddBean.getText("adminobject-interface")[0];
                    if(ddClass.equals(aoClass) && ddIface.equals(aoIface)) {
                        target = ddBean;
                        ddBeans.remove(j);
                        break;
                    }
                }
                if(target == null) {
                    System.out.println("Geronimo connector deployment plan has admin object with interface '"+aoIface+"' and class '"+aoClass+"' but the ra.xml does not have a matching adminobject declared.  Deleting this adminobject from the Geronimo plan.");
                    continue;
                }
                dcb = new AdminObjectDCB(target, admin);
                dcbs.put("class "+aoClass+" iface "+aoIface, dcb);
            }
        }
        // There are some admin object types in ra.xml with no matching instances; create DConfigBeans for those
        for (int i = 0; i < ddBeans.size(); i++) {
            DDBean ddBean = (DDBean) ddBeans.get(i);
            String ddClass = ddBean.getText("adminobject-class")[0];
            String ddIface = ddBean.getText("adminobject-interface")[0];
            GerAdminobjectType admin = connector.addNewAdminobject();
            dcbs.put("class "+ddClass+" iface "+ddIface, new AdminObjectDCB(ddBean, admin));
        }
        List adminResults = new ArrayList();
        for (Iterator it = dcbs.keySet().iterator(); it.hasNext();) {
            String key = (String) it.next();
View Full Code Here

                   adminobjects[i].getAdminObjectInterface().equals(aoInterface)) {
                    return adminobjects[i];
                }
            }
            // Haven't seen it; create a new DConfigBean
            GerAdminobjectType ao = getConnector().addNewAdminobject();
            AdminObjectDCB dcb = new AdminObjectDCB(bean, ao);
            AdminObjectDCB[] list = new AdminObjectDCB[adminobjects.length+1];
            System.arraycopy(adminobjects, 0, list, 0, adminobjects.length);
            list[adminobjects.length] = dcb;
            return dcb;
View Full Code Here

        if(admins == null) {
            adminobjects = new AdminObjectDCB[0];
        } else {
            // Match up each Geronimo adminobject with a ra.xml adminobject and create DConfigBeans accordingly
            for (int i = 0; i < admins.length; i++) {
                GerAdminobjectType admin = admins[i];
                String aoClass = admin.getAdminobjectClass();
                String aoIface = admin.getAdminobjectInterface();
                AdminObjectDCB dcb = (AdminObjectDCB) dcbs.get("class "+aoClass+" iface "+aoIface);
                if(dcb != null) {
                    // this is a second Geronimo adminobject block of the same type; there will not be a matching DDBean any more
                    // merge the adminobject-instance entries instead!!!
                    if(admin.getAdminobjectInstanceArray().length > 0) {
                        GerAdminobjectType old = dcb.getAdminObject();
                        GerAdminobjectInstanceType[] array = admin.getAdminobjectInstanceArray();
                        int oldCount = dcb.getAdminObjectInstance().length;
                        for (int j = 0; j < array.length; j++) {
                            GerAdminobjectInstanceType instance = array[j];
                            XmlCursor source = instance.newCursor();
                            XmlCursor dest = old.newCursor();
                            dest.toEndToken();
                            if(!source.moveXml(dest)) {
                                throw new RuntimeException("Unable to move admin object instance");
                            }
                            source.dispose();
                            dest.dispose();
                            dcb.addAdminObjectInstance(old.getAdminobjectInstanceArray(oldCount+j));
                        }
                    }
                    continue;
                }
                DDBean target = null;
                for (int j = 0; j < ddBeans.size(); j++) {
                    DDBean ddBean = (DDBean) ddBeans.get(j);
                    String ddClass = ddBean.getText("adminobject-class")[0];
                    String ddIface = ddBean.getText("adminobject-interface")[0];
                    if(ddClass.equals(aoClass) && ddIface.equals(aoIface)) {
                        target = ddBean;
                        ddBeans.remove(j);
                        break;
                    }
                }
                if(target == null) {
                    System.out.println("Geronimo connector deployment plan has admin object with interface '"+aoIface+"' and class '"+aoClass+"' but the ra.xml does not have a matching adminobject declared.  Deleting this adminobject from the Geronimo plan.");
                    continue;
                }
                dcb = new AdminObjectDCB(target, admin);
                dcbs.put("class "+aoClass+" iface "+aoIface, dcb);
            }
        }
        // There are some admin object types in ra.xml with no matching instances; create DConfigBeans for those
        for (int i = 0; i < ddBeans.size(); i++) {
            DDBean ddBean = (DDBean) ddBeans.get(i);
            String ddClass = ddBean.getText("adminobject-class")[0];
            String ddIface = ddBean.getText("adminobject-interface")[0];
            GerAdminobjectType admin = connector.addNewAdminobject();
            dcbs.put("class "+ddClass+" iface "+ddIface, new AdminObjectDCB(ddBean, admin));
        }
        List adminResults = new ArrayList();
        for (Iterator it = dcbs.keySet().iterator(); it.hasNext();) {
            String key = (String) it.next();
View Full Code Here

TOP

Related Classes of org.apache.geronimo.xbeans.connector.GerAdminobjectType

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.