Package org.apache.geronimo.xbeans.geronimo.naming

Examples of org.apache.geronimo.xbeans.geronimo.naming.GerMessageDestinationType


                iface = cl.loadClass(type);
            } catch (ClassNotFoundException e) {
                throw new DeploymentException("could not load class " + type, e);
            }
            String moduleURI = null;
            GerMessageDestinationType destination = getMessageDestination(linkName, messageDestinations);
            if (destination != null) {
                if (destination.isSetAdminObjectLink()) {
                    if (destination.isSetAdminObjectModule()) {
                        moduleURI = destination.getAdminObjectModule().trim();
                    }
                    linkName = destination.getAdminObjectLink().trim();
                }
            } else {
                //well, we know for sure an admin object is not going to be defined in a modules that can have a message-destination
                int pos = linkName.indexOf('#');
                if (pos > -1) {
View Full Code Here


        }

    }

    public static GerMessageDestinationType getMessageDestination(String messageDestinationLink, Map<String, Map<String, GerMessageDestinationType>> messageDestinations) throws DeploymentException {
        GerMessageDestinationType destination = null;
        int pos = messageDestinationLink.indexOf('#');
        if (pos > -1) {
            String targetModule = messageDestinationLink.substring(0, pos);
            Map<String, GerMessageDestinationType> destinations = messageDestinations.get(targetModule);
            // Hmmm...if we don't find the module then something is wrong in the deployment.
            if (destinations == null) {
                StringBuffer sb = new StringBuffer();
                for (Object o : messageDestinations.keySet()) {
                    sb.append(o).append("\n");
                }
                throw new DeploymentException("Unknown module " + targetModule + " when processing message destination " + messageDestinationLink +
                        "\nKnown modules in deployable unit are:\n" + sb.toString());
            }
            messageDestinationLink = messageDestinationLink.substring(pos + 1);
            destination = destinations.get(messageDestinationLink);
        } else {
            for (Map<String, GerMessageDestinationType> destinations : messageDestinations.values()) {
                GerMessageDestinationType destinationTest = destinations.get(messageDestinationLink);
                if (destinationTest != null) {
                    if (destination != null) {
                        throw new DeploymentException("Duplicate message destination " + messageDestinationLink + " accessed from a message-destination-link without a module");
                    }
                    destination = destinationTest;
View Full Code Here

                    return true;
                }
            }

            //if it maps to a message-destination in the geronimo plan, it's a message-destination.
            GerMessageDestinationType gerMessageDestinationType = null;
            if (messageDestinations != null) {
                gerMessageDestinationType = getMessageDestination(resourceName, messageDestinations);
            }
            if (gerMessageDestinationType != null) {
                addMethodDestinationRef(annotatedApp, resourceName, resourceType, method, field, annotation);
View Full Code Here

            //}
        }
        // Handle removed or new messageDestinations
        for (Iterator it = before.iterator(); it.hasNext();) {
            MessageDestination adapter = (MessageDestination) it.next();
            GerMessageDestinationType all[] = getWebApp().getMessageDestinationArray();
            for (int i = 0; i < all.length; i++) {
                if(all[i] == adapter) {
                    getWebApp().removeMessageDestination(i);
                    break;
                }
View Full Code Here

    private static final String JAXR_CONNECTION_FACTORY_CLASS = "javax.xml.registry.ConnectionFactory";

    public static void registerMessageDestinations(RefContext refContext, String moduleName, MessageDestinationType[] specDestinations, GerMessageDestinationType[] destinations) throws DeploymentException {
        Map nameMap = new HashMap();
        for (int i = 0; i < destinations.length; i++) {
            GerMessageDestinationType destination = destinations[i];
            String name = destination.getMessageDestinationName().trim();
            nameMap.put(name, destination);
            boolean found = false;
            for (int j = 0; j < specDestinations.length; j++) {
                MessageDestinationType specDestination = specDestinations[j];
                if (specDestination.getMessageDestinationName().getStringValue().trim().equals(name)) {
View Full Code Here

                iface = cl.loadClass(type);
            } catch (ClassNotFoundException e) {
                throw new DeploymentException("could not load class " + type, e);
            }
            URI moduleURI = URI.create("");
            GerMessageDestinationType destination = (GerMessageDestinationType) refContext.getMessageDestination(linkName);
            if (destination != null) {
                if (destination.isSetAdminObjectLink()) {
                    if (destination.isSetAdminObjectModule()) {
                        String module = destination.getAdminObjectModule().trim();
                        try {
                            moduleURI = new URI(module);
                        } catch (URISyntaxException e) {
                            throw new DeploymentException("Could not construct module URI", e);
                        }
                    }
                    linkName = destination.getAdminObjectLink().trim();
                }
            } else {
                //well, we know for sure an admin object is not going to be defined in a modules that can have a message-destination
                int pos = linkName.indexOf('#');
                if (pos > -1) {
View Full Code Here

        d1.addNewMessageDestinationName().setStringValue(name);
        return d1;
    }

    private GerMessageDestinationType makeGerMD(String name, String link) {
        GerMessageDestinationType d1 = GerMessageDestinationType.Factory.newInstance();
        d1.setMessageDestinationName(name);
        d1.setAdminObjectLink(link);
        return d1;
    }
View Full Code Here

        d1.setAdminObjectLink(link);
        return d1;
    }

    private GerMessageDestinationType makeGerMD(String name, String module, String link) {
        GerMessageDestinationType d1 = makeGerMD(name, link);
        d1.setAdminObjectModule(module);
        return d1;
    }
View Full Code Here

        if (annotatedWebAppDD instanceof AnnotatedWebApp) {
            WebAppType webAppDD = ((AnnotatedWebApp) annotatedWebAppDD).getWebApp();
            MessageDestinationType[] messageDestinations = webAppDD.getMessageDestinationArray();
            for (int i = 0; i < messageDestinations.length; i++) {
                String messageDestinationName = messageDestinations[i].getMessageDestinationName().getStringValue();
                GerMessageDestinationType messageDestination = webApp.addNewMessageDestination();
                messageDestination.setMessageDestinationName(messageDestinationName);
                // messageDestination.setAdminObjectLink(messageDestinationName);
            }
        }
    }
View Full Code Here

    public String getAdminObjectLink() {
        return getMessageDestination().getAdminObjectLink();
    }

    public void setAdminObjectLink(String link) {
        GerMessageDestinationType ref = getMessageDestination();
        if(link != null && ref.isSetPattern()) {
            clearPatternFromChoice();
        }
        String old = getAdminObjectLink();
        ref.setAdminObjectLink(link);
        pcs.firePropertyChange("adminObjectLink", old, link);
    }
View Full Code Here

TOP

Related Classes of org.apache.geronimo.xbeans.geronimo.naming.GerMessageDestinationType

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.