Package org.osoa.sca

Examples of org.osoa.sca.ServiceRuntimeException


            pos.close();

            return pos.toByteArray();

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


            XMLDocument document = xmlHelper.load(new ByteArrayInputStream(xmlBytes));

            return document.getRootObject();

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

            for (SourceWireFactory proxyFactory : sourceProxyFactories) {
                context.put(proxyFactory.getConfiguration().getReferenceName(), proxyFactory.createProxy());
            }
            return context;
        } catch (ProxyCreationException e) {
            throw new ServiceRuntimeException(e);
        }
    }
View Full Code Here

                }
               
            });
        } catch (WorkException e) {
            //FIXME Which exception should we throw here?
            throw new ServiceRuntimeException(e);
        }
       
        // No return on a OneWay invocation.
        return messageFactory.createMessage();
    }
View Full Code Here

        if (wire != null) {
            try {
                // Clone the wire so that reference parameters can be changed
                this.wire = (RuntimeWire)wire.clone();
            } catch (CloneNotSupportedException e) {
                throw new ServiceRuntimeException(e);
            }
        }
        InterfaceContract contract = wire.getSource().getInterfaceContract();
        this.conversational = contract.getInterface().isConversational();
    }
View Full Code Here

    public Object invoke(Object proxy, Method method, Object[] args) throws Throwable {
        if (Object.class == method.getDeclaringClass()) {
            return invokeObjectMethod(method, args);
        }
        if (wire == null) {
            throw new ServiceRuntimeException("No runtime wire is available");
        }
        InvocationChain chain = getInvocationChain(method, wire);
        if (chain == null) {
            throw new IllegalArgumentException("No matching operation is found: " + method);
        }
View Full Code Here

            RuntimeComponentReference reference = (RuntimeComponentReference)wireSource.getContract();
            Binding refBinding = wireSource.getBinding();
            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 "
                        + wireSource.getComponent().getURI()
                        + "#"
                        + reference.getName());
                }
                InvocationChain chain = new InvocationChainImpl(operation, targetOperation);
                if (operation.isNonBlocking()) {
                    addNonBlockingInterceptor(reference, refBinding, chain);
                }
                addBindingInterceptor(reference, refBinding, chain, operation);
                chains.add(chain);
            }
        } else {
            // It's the service wire
            RuntimeComponentService service = (RuntimeComponentService)wireTarget.getContract();
            RuntimeComponent serviceComponent = wireTarget.getComponent();
            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 service "
                        + serviceComponent.getURI()
                        + "#"
                        + service.getName());
                }
View Full Code Here

            }
            return body;
        } catch (InvocationTargetException e) {
            throw e;
        } catch (Throwable e) {
            throw new ServiceRuntimeException(e);
        } finally {
            try {
                conversationPostInvoke(msg);
            } catch (TargetDestructionException e) {
                throw new ServiceRuntimeException(e);
            } finally {
                ThreadMessageContext.setMessageContext(msgContext);
            }
        }
    }
View Full Code Here

        for (RuntimeWire wire : wires) {
            if (callbackEPR.getURI().equals(wire.getTarget().getURI())) {
                try {
                    return (RuntimeWire)wire.clone();
                } catch (CloneNotSupportedException e) {
                    throw new ServiceRuntimeException(e);
                }
            }
        }

        // no exact match, so find callback binding with same name as service binding
View Full Code Here

        // wire not pre-selected, so select a wire now to be used for the callback
        Message msgContext = ThreadMessageContext.getMessageContext();
        RuntimeWire wire = ((CallbackReferenceImpl)callableReference).selectCallbackWire(msgContext);
        if (wire == null) {
            //FIXME: need better exception
            throw new ServiceRuntimeException("No callback wire found for " + msgContext.getFrom().getURI());
        }

        // set the conversational state based on the interface that
        // is specified for the reference that this wire belongs to
        init(wire);
View Full Code Here

TOP

Related Classes of org.osoa.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.