Package org.apache.wsif

Examples of org.apache.wsif.WSIFException


        Trc.entry(this, operationName, inputName, outputName);

        WSIFOperation_Java op =
            getDynamicWSIFOperation(operationName, inputName, outputName);
        if (op == null) {
            throw new WSIFException(
                "Could not create operation: "
                    + operationName
                    + ":"
                    + inputName
                    + ":"
View Full Code Here


            try {
                ExtensibilityElement portExtension =
                    (ExtensibilityElement) fieldPortModel.getExtensibilityElements().get(0);

                if (portExtension == null) {
                    throw new WSIFException("missing port extension");
                }

                address = (JavaAddress) portExtension;

                fieldObjectReference =
                    Class
                        .forName(
                            address.getClassName(),
                            true,
                            Thread.currentThread().getContextClassLoader())
                        .newInstance();
            } catch (Exception ex) {
              Trc.exception(ex);
                throw new WSIFException(
                    "Could not create object of class '" + address.getClassName() + "'",
                    ex);
            }
        }
        Trc.exit(fieldObjectReference);
View Full Code Here

            }
        }

        if (typeMapping == null) {
            QName bindingName = fieldPortModel.getBinding().getQName();
            throw new WSIFException(
                "Binding "
                    + (bindingName == null ? "<null>" : bindingName.toString())
                    + " does not contain a typeMap with encoding=Java and style=Java");
        }

        // Build the hashmap
        bindingIterator = typeMapping.getMaps().iterator();
        while (bindingIterator.hasNext()) {
            TypeMap typeMap = (TypeMap) bindingIterator.next();
            ///////////////////////////////////
            QName typeName = typeMap.getTypeName();
            if (typeName == null) typeName = typeMap.getElementName();
            String type = typeMap.getFormatType();
            if (typeName != null && type != null) {
                if (fieldTypeMaps.containsKey(typeName)) {
                  Vector v = null;
                  Object obj = fieldTypeMaps.get(typeName);                 
                  if (obj instanceof Vector) {
                    v = (Vector) obj;
                  } else {
                    v = new Vector();
                      v.addElement(obj);
                  }                                     
                    v.addElement(type);
                    this.fieldTypeMaps.put(typeName, v);
                } else {
                    this.fieldTypeMaps.put(typeName, type);
                }
            } else {
                throw new WSIFException("Error in binding TypeMap. Key or Value is null");
            }
        }
        Trc.exit();
    }
View Full Code Here

        // Swap the queues because we're a server not a client.   
        readQ = writeQ;
        writeQ = null;

        if (!allStarts.contains(startType))
            throw new WSIFException("StartType must either be warm or cold");

        if (COLDSTART.equals(startType)) {
            if (verbose)
                System.out.println("Wiping messages off the read queue");
            Message msg = null;
View Full Code Here

    public WSIFJMSProperties(String direction) throws WSIFException {
        super();
        Trc.entry(this, direction);

        if (!allDirections.contains(direction))
            throw new WSIFException("Invalid direction " + direction);
        this.direction = direction;
        Trc.exit(deep());
    }
View Full Code Here

     */
    public boolean set(MessageProducer producer, Message message)
        throws WSIFException {
        Trc.entry(this, producer, message);
        if (direction != IN)
            throw new WSIFException("Only input properties can be set on a MessageProducer");
   
        if (isEmpty()) {
            Trc.exit(false);
            return false;
        }
   
        for (Iterator it = keySet().iterator(); it.hasNext();)
            try {
                String prop = (String) (it.next());
                Object value = get(prop);
                Class type = value.getClass();
   
                if (predefinedProps.contains(prop))
                    try {
                        if (prop.equals(CORRELATIONID)) {
                            message.setJMSCorrelationID((String) value);
                        } else if (prop.equals(DELIVERYMODE)) {
                            message.setJMSDeliveryMode(
                                ((Integer) value).intValue());
                            producer.setDeliveryMode(((Integer) value).intValue());
                        } else if (prop.equals(DESTINATION)) {
                            message.setJMSDestination((Destination) value);
                        } else if (prop.equals(EXPIRATION)) {
                            message.setJMSExpiration(((Long) value).longValue());
                        } else if (prop.equals(PRIORITY)) {
                            message.setJMSPriority(((Integer) value).intValue());
                            producer.setPriority(((Integer) value).intValue());
                        } else if (prop.equals(REDELIVERED)) {
                            message.setJMSRedelivered(
                                ((Boolean) value).booleanValue());
                        } else if (prop.equals(REPLYTO)) {
                            message.setJMSReplyTo((Destination) value);
                        } else if (prop.equals(TIMESTAMP)) {
                            message.setJMSTimestamp(((Long) value).longValue());
                        } else if (prop.equals(TIMETOLIVE)) {
                            producer.setTimeToLive(((Long) value).longValue());
                        } else if(prop.equals(TYPE)) {
                            message.setJMSType((String)value);
                        }
                    } catch (ClassCastException ce) {
                Trc.exception(ce);
                        throw new WSIFException(
                            "Unexpected type "
                                + type
                                + " for JMS property "
                                + prop
                                + ".");
View Full Code Here

                || ja.getJndiDestName() != null
                || ja.getJmsProvDestName() != null;
        String implSpecURI = ja.getJmsImplSpecURI();

        if (jndiSpecified && implSpecURI != null)
            throw new WSIFException(
                "Cannot specify both JNDI attributes and "
                    + "jmsImplementationSpecificURL in the jms:address in port "
                    + portName);

        if (!jndiSpecified && implSpecURI == null)
            throw new WSIFException(
                "Must specify either JNDI attributes or "
                    + "jmsImplementationSpecificURL in the jms:address in port "
                    + portName);

        WSIFJMSFinder finder;
        if (jndiSpecified)
            finder =
                new WSIFJMSFinderForJndi(
                    ja.getJmsVendorURI(),
                    ja.getInitCxtFact(),
                    ja.getJndiProvURL(),
                    ja.getDestStyle(),
                    ja.getJndiConnFactName(),
                    ja.getJndiDestName(),
                    portName);
        else {
            if (implSpecURI.startsWith(MQ_URL_PREFIX))
                finder = new WSIFJMSFinderForMq(ja.getJmsVendorURI(), implSpecURI);
            else
                throw new WSIFException(
                    "No jms implementation found for jmsImplementationSpecificURI '"
                        + implSpecURI
                        + "' for port "
                        + portName);
        }
View Full Code Here

    private Destination initialDestination;
    private String style;

    WSIFJMSFinderForMq(String jmsVendorURL, String implSpecURL)
        throws WSIFException {
        throw new WSIFException("not yet implemented");

        /*    try {
              factory = new MQQueueConnectionFactory();
              factory.setQueueManager("");
       
View Full Code Here

            jndiConnectionFactory,
            jndiDestinationName,
            portName);

        if (!allStyles.contains(style))
            throw new WSIFException("Style must either be queue or topic");
        this.style = style;
        if (portName == null)
            portName = "<null>";
        this.portName = portName;

        if (((initialContextFactory == null) && (jndiProviderURL != null))
            || ((initialContextFactory != null) && (jndiProviderURL == null)))
            throw new WSIFException(
                "Either both initialContextFactory and jndiProviderURL "
                    + "must be specified or neither of them must be specified. Port="
                    + portName);

        /*
         * Go find the container's JNDI and the JNDI specified in the WSDL.
         */
        if (initialContextFactory != null && jndiProviderURL != null) {
            Hashtable environment = new Hashtable();
            environment.put(
                Context.INITIAL_CONTEXT_FACTORY,
                initialContextFactory);
            environment.put(Context.PROVIDER_URL, jndiProviderURL);

            try {
                namedJndiContext = new InitialDirContext(environment);
            } catch (NamingException ne) {
                Trc.exception(ne);
                throw new WSIFException(
                    "WSIFJMSFinderForJndi caught '"
                        + ne
                        + "'. InitialContextFactory was '"
                        + initialContextFactory
                        + "' ProviderUrl was '"
                        + jndiProviderURL
                        + "'. Port="
                        + portName);
            }
        }

        try {
            containersJndiContext = new InitialDirContext();
        } catch (NamingException ne) {
            Trc.exception(ne);
            if (initialContextFactory == null && jndiProviderURL == null)
                throw new WSIFException(
                    "WSIFJMSFinderForJndi caught '"
                        + ne
                        + "' using the default JNDI repository. Port="
                        + portName);
        }

        if (STYLE_TOPIC.equals(style))
            throw new WSIFException("Topics not implemented. Port=" + portName);
        else if (!STYLE_QUEUE.equals(style))
            throw new WSIFException(
                "jms:address must either be a queue or a topic not a '"
                    + (style == null ? "null" : style)
                    + "'. Port="
                    + portName);

        /*
         * Go find the queue connection factory.
         */
        if (jndiConnectionFactory == null)
            throw new WSIFException(
                "jndiConnectionFactory must be specified in port " + portName);
        try {
            factory = (QueueConnectionFactory) lookup(jndiConnectionFactory);
            if (factory == null)
                throw new WSIFException(
                    "WSIFJMSFinderForJndi was not able to lookup the ConnectionFactory "
                        + jndiConnectionFactory
                        + " in JNDI. Port="
                        + portName);
        } catch (ClassCastException cce) {
            Trc.exception(cce);
            throw new WSIFException(
                "WSIFJMSFinderForJndi caught ClassCastException. The ConnectionFactory "
                    + jndiConnectionFactory
                    + " in JNDI was not defined to be a connection factory. Port="
                    + portName
                    + " "
                    + cce);
        } catch (NamingException ne) {
            Trc.exception(ne);
            throw new WSIFException(
                "WSIFJMSFinderForJndi caught NamingException. The ConnectionFactory "
                    + jndiConnectionFactory
                    + " in JNDI was not defined to be a connection factory. Port="
                    + portName
                    + " "
                    + ne);
        }

        /*
         * Go find the initial destination.
         */
        if (jndiDestinationName != null)
            try {
                initialDestination = (Destination) lookup(jndiDestinationName);
                if (initialDestination == null)
                    throw new WSIFException(
                        "WSIFJMSFinderForJndi was not able to lookup the Destination "
                            + jndiDestinationName
                            + " in JNDI. Port="
                            + portName);
            } catch (ClassCastException cce) {
                Trc.exception(cce);
                throw new WSIFException(
                    "WSIFJMSFinderForJndi caught ClassCastException. The Destination "
                        + jndiDestinationName
                        + " in JNDI was not defined to be a destination. Port="
                        + portName
                        + " "
                        + cce);
            } catch (NamingException cce) {
                Trc.exception(cce);
                throw new WSIFException(
                    "WSIFJMSFinderForJndi caught NamingException. The Destination "
                        + jndiDestinationName
                        + " in JNDI was not defined to be a destination. Port="
                        + portName
                        + " "
View Full Code Here

        Trc.entry(this, name);
        Queue q = null;
        try {
            q = (Queue) lookup(name);
            if (q == null)
                throw new WSIFException(
                    "WSIFJMSFinderForJndi was not able to lookup the Destination "
                        + name
                        + " in JNDI.Port="
                        + portName);
        } catch (ClassCastException cce) {
            Trc.exception(cce);
            throw new WSIFException(
                "WSIFJMSFinderForJndi caught ClassCastException. The Queue "
                    + name
                    + " in JNDI was not defined to be a queue. Port="
                    + portName
                    + " "
                    + cce);
        } catch (NamingException ne) {
            Trc.exception(ne);
            throw new WSIFException(
                "WSIFJMSFinderForJndi caught NamingException. The Queue "
                    + name
                    + " in JNDI was not defined to be a queue. Port="
                    + portName
                    + " "
View Full Code Here

TOP

Related Classes of org.apache.wsif.WSIFException

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.