Package org.oasisopen.sca

Examples of org.oasisopen.sca.ServiceRuntimeException


    public InterfaceContract getGeneratedWSDLContract(InterfaceContract interfaceContract) {

        if ( interfaceContract.getNormalizedWSDLContract() == null){
            if (getComponentServiceInterfaceContract() 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


   
    public void invokeAsyncRequest(Message msg) {
        if (msg.getOperation().getName().equals("upper")){
          // Retrieve the async callback information
          AsyncResponseInvoker respInvoker = (AsyncResponseInvoker)msg.getHeaders().get("ASYNC_RESPONSE_INVOKER");
          if( respInvoker == null ) throw new ServiceRuntimeException("Async Implementation invoked with no response invoker");
         
            Message responseMsg = processRequest(msg);
           
            // in this sample programming model we make the async
            // response from the implementation provider. The
            // component implementation itself doesn't get a chance to
            // do async responses.
       
            // At this point we could serialize the AsyncResponseInvoker and pick it up again
            // later to send the async response
           
            try {
                FileOutputStream fos = new FileOutputStream("ari.dat");
                ObjectOutputStream oos = new ObjectOutputStream(fos);
                oos.writeObject(respInvoker);
                oos.close();
                respInvoker.invokeAsyncResponse(responseMsg);
            } catch (Exception ex) {
                ex.printStackTrace();
            }

        } else if (msg.getOperation().getName().equals("upper2")){
            Message responseMsg = processRequest(msg);
           
            // read the async response invoker back in and call it
            FileInputStream fis = null;
            ObjectInputStream ois = null;
            try {
                fis = new FileInputStream("ari.dat");
                ois = new ObjectInputStream(fis);
                AsyncResponseInvoker respInvoker = (AsyncResponseInvoker) ois.readObject();
                ois.close();
                respInvoker.invokeAsyncResponse(responseMsg);
            } catch (Exception ex) {
                ex.printStackTrace();
            }
        } else {
            // Retrieve the async callback information
            AsyncResponseInvoker respInvoker = (AsyncResponseInvoker)msg.getHeaders().get("ASYNC_RESPONSE_INVOKER");
            if( respInvoker == null ) throw new ServiceRuntimeException("Async Implementation invoked with no response invoker");
           
            Message responseMsg = processRequest(msg);
           
            if (responseMsg.getBody() != null){
                respInvoker.invokeAsyncResponse(responseMsg);
View Full Code Here

                    throw (RuntimeException)cause;
                }
                if (cause instanceof Error) {
                    throw (Error)cause;
                } else {
                    throw new ServiceRuntimeException(cause.getMessage(), cause);
                }
            }           
               
        } catch (ObjectCreationException e) {
            throw new ServiceRuntimeException(e.getMessage(), e);
        } catch (Exception e) {
            msg.setFaultBody(e);          
        } finally {
            // set the tccl
            Thread.currentThread().setContextClassLoader(tccl);
View Full Code Here

           
            Object[] args = list.toArray();
            msg.setBody(args);
           
        } else if (wsBinding.isRpcEncoded()){
            throw new ServiceRuntimeException("rpc/encoded WSDL style not supported for endpoint " + endpoint);
        } else if (wsBinding.isDocEncoded()){
            throw new ServiceRuntimeException("doc/encoded WSDL style not supported for endpoint " + endpoint);
        //} else if (wsBinding.isDocLiteralUnwrapped()){
           // throw new ServiceRuntimeException("doc/literal/unwrapped WSDL style not supported for endpoint " + endpoint);
        } else if (wsBinding.isDocLiteralWrapped() ||
                   wsBinding.isDocLiteralUnwrapped()){
            Object[] args = new Object[] {requestOM};
            msg.setBody(args);
        } else {
            throw new ServiceRuntimeException("Unrecognized WSDL style for endpoint " + endpoint);
        }       

        SOAPHeader header = inMC.getEnvelope().getHeader();
        if (header != null) {
          // Retrieve callback-related headers
View Full Code Here

        try {
            Class<?> factoryClass = getFactoryImplClass();
            nodeFactory = (NodeFactory)factoryClass.newInstance();

        } catch (Exception e) {
            throw new ServiceRuntimeException(e);
        }
        factories.add(nodeFactory);
        return nodeFactory;
    }
View Full Code Here

        try {
            Class<?> factoryClass = getFactoryImplClass();
            nodeFactory = (NodeFactory)factoryClass.newInstance();
            nodeFactory.configure(attributes);
        } catch (Exception e) {
            throw new ServiceRuntimeException(e);
        }
        factories.add(nodeFactory);
        return nodeFactory;
    }
View Full Code Here

            Class<?> factoryClass = getFactoryImplClass();
            nodeFactory = (NodeFactory)factoryClass.newInstance();
            nodeFactory.properties = configProperties;
            nodeFactory.configure(new HashMap<String, Map<String,String>>());
        } catch (Exception e) {
            throw new ServiceRuntimeException(e);
        }
        factories.add(nodeFactory);
        return nodeFactory;
    }
View Full Code Here

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

            return newInstance();
        } else if (configURI.startsWith("properties:")) {
            try {
                properties = loadProperties(configURI.substring("properties:".length()));
            } catch (IOException e) {
                throw new ServiceRuntimeException(e);
            }
        } else if (configURI.startsWith("uri:")) {
            properties = parseConfigURI(configURI.substring("uri:".length()));
        } else {
            properties = new Properties();
View Full Code Here

            for (Problem problem : monitor.getProblems()) {
                if ((problem.getSeverity() == Severity.ERROR)) {
                    if (problem.getCause() != null) {
                        throw problem.getCause();
                    } else {
                        throw new ServiceRuntimeException(problem.toString());
                    }
                }
            }
        } finally {
            // FIXME: Clear problems so that the monitor is clean again
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.