Package org.openengsb.core.services.internal

Examples of org.openengsb.core.services.internal.TransformationHandler


    @Override
    public Object doInvoke(Object proxy, Method method, Object[] args) throws Throwable {
        if (method.getDeclaringClass().equals(Connector.class)) {
            return this.getClass().getMethod(method.getName(), method.getParameterTypes()).invoke(this, args);
        }
        TransformationHandler transformationHandler = TransformationHandler
                .newTransformationHandler(transformationEngine, method, connectorInterface);
        transformationHandler.getTargetMethod();
        Method targetMethod = transformationHandler.getTargetMethod();
        Object[] targetArgs = transformationHandler.transformArguments(args);
        MethodCall methodCall = new MethodCall(targetMethod, targetArgs, metadata);

        if (!registration.isRegistered()) {
            if (targetMethod.getName().equals("getAliveState")) {
                return AliveState.OFFLINE;
            }
            throw new IllegalArgumentException("not registered");
        }

        MethodResult callResult =
                portUtil.sendMethodCallWithResult(registration.getPortId(), registration.getDestination(), methodCall);
        switch (callResult.getType()) {
            case Object:
                Object result = callResult.getArg();
                return transformationHandler.transformResult(result);
            case Void:
                return null;
            case Exception:
                throw new RuntimeException(callResult.getArg().toString());
            default:
View Full Code Here

TOP

Related Classes of org.openengsb.core.services.internal.TransformationHandler

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.