Package org.oasisopen.sca

Examples of org.oasisopen.sca.ServiceRuntimeException


                } catch (InvocationTargetException e) {
                    Throwable t = e.getTargetException();
                    // FIXME need to throw really a business exception.
                    // ServiceBusinessException?
                    // Tuscany core doesn't have ServiceBusinessException
                    throw new ServiceRuntimeException(t);
                }
            }

            return response;
        } catch (Exception e) {
            // FIXME this be business exception? Tuscany core doesn't have
            // ServiceBusinessException
            throw new ServiceRuntimeException(e);

        } catch (Throwable e) {
            throw new ServiceRuntimeException(e);
        }
    }
View Full Code Here


            for (int i = 0; i < exceptionTypes.length; i++) {
                Class exceptionType =
                    methodInfo.getMethod() != null ? methodInfo.getMethod().getExceptionTypes()[i]
                        : loadClass(exceptionTypes[i]);
                if (exceptionType.isAssignableFrom(exCopy.getClass()))
                    throw new ServiceRuntimeException(exCopy); // FIXME should
                // be business
                // exception?
            }
            throw Util.wrapException(exCopy);
        } catch (Throwable e) {
            // Other exceptions thrown from "invoke"
            throw new ServiceRuntimeException(e);
        } finally {
            stub._servant_postinvoke(so);
        }
    }
View Full Code Here

        try {
            String operation = getOperation(methodName);

            MethodInfo methodInfo = interfaceInfo.getMethod(methodName);
            if (methodInfo == null) {
                throw new ServiceRuntimeException("Invalid Method " + methodName);
            }
            Class[] parameterTypes = null;
            Class returnType = null;
            if (methodInfo.getMethod() != null) {
                parameterTypes = methodInfo.getMethod().getParameterTypes();
                returnType = methodInfo.getMethod().getReturnType();
            } else {
                String[] types = methodInfo.getParameterTypes();
                if (args != null) {
                    if (types.length != args.length)
                        throw new ServiceRuntimeException(
                                                          "The argument list doesn't match the method signature of " + methodName);
                }

                parameterTypes = new Class[types.length];
                for (int i = 0; i < types.length; i++) {
View Full Code Here

            PropertyDescriptor propertyDescriptor = new PropertyDescriptor(propertyName, bean.getClass());
            Method writeMethod = propertyDescriptor.getWriteMethod();
            writeMethod.invoke(bean, new Object[] {value});
            return true;
        } catch (InvocationTargetException e) {
            throw new ServiceRuntimeException(e.getTargetException());
        } catch (Exception e) {
            return false;
        }
    }
View Full Code Here

                    if (provider.supportsFeedEntries())
                        msg.setFaultBody(new NotFoundException());
                    else
                        msg.setFaultBody(new org.apache.tuscany.sca.data.collection.NotFoundException());
                } else {
                    msg.setFaultBody(new ServiceRuntimeException("HTTP status code: " + status));
                }

            } catch (Exception e) {
                msg.setFaultBody(new ServiceRuntimeException(e));
            } finally {

                // Release the connection unless the Abdera parser is
                // parsing the response, in this case it will release it
                release(getMethod, response);
View Full Code Here

        if(sourceContract != null && targetContract != null) {
            RuntimeComponentReference reference = (RuntimeComponentReference)getReference();
            for (Operation operation : sourceContract.getInterface().getOperations()) {
                Operation targetOperation = interfaceContractMapper.map(targetContract.getInterface(), operation);
                if (targetOperation == null) {
                    throw new ServiceRuntimeException("No matching operation for " + operation.getName()
                        + " is found in reference "
                        + getComponent().getURI()
                        + "#"
                        + reference.getName());
                }
View Full Code Here

                                                              Compatibility.SUBSET,
                                                              !bindingHasCallback, // ignore callbacks if binding doesn't have one
                                                              false);                  
              
           } catch (Exception ex){
               throw new ServiceRuntimeException("Component " +
                                                 this.getComponent().getName() +
                                                 " Reference " +
                                                 getReference().getName() +
                                                 " interface is incompatible with the interface of the reference binding " +
                                                 getBinding().getName() +
View Full Code Here

        }
        if (bindingProvider == null) {
            BindingProviderFactory factory =
                (BindingProviderFactory)providerFactories.getProviderFactory(getBinding().getClass());
            if (factory == null) {
                throw new ServiceRuntimeException("No provider factory is registered for binding " + getBinding()
                    .getType());
            }
            this.bindingProvider = factory.createReferenceBindingProvider(this);
        }
        return bindingProvider;
View Full Code Here

    public InterfaceContract getGeneratedWSDLContract(InterfaceContract interfaceContract) {

        if ( interfaceContract.getNormalizedWSDLContract() == null){
            if (getComponentReferenceInterfaceContract() instanceof JavaInterfaceContract){
                if (contractBuilder == null){
                    throw new ServiceRuntimeException("Contract builder not found while calculating WSDL contract for " + this.toString());
                }
                contractBuilder.build(interfaceContract, null);
            }
        }
       
View Full Code Here

                    if (provider.supportsFeedEntries())
                        msg.setFaultBody(new NotFoundException());
                    else
                        msg.setFaultBody(new org.apache.tuscany.sca.data.collection.NotFoundException());
                } else {
                    msg.setFaultBody(new ServiceRuntimeException("HTTP status code: " + status));
                }

            } catch (Exception e) {
                msg.setFaultBody(new ServiceRuntimeException(e));
            } finally {

                // Release the connection unless the Abdera parser is
                // parsing the response, in this case it will release it
                release(postMethod, response);
View Full Code Here

TOP

Related Classes of org.oasisopen.sca.ServiceRuntimeException

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.