Package org.talend.esb.job.controller

Examples of org.talend.esb.job.controller.GenericOperation


    public void esbJobRemoved(TalendESBJob esbJob, String name) {
        LOG.info("Removing ESB job " + name + ".");
        if (isConsumerOnly(esbJob)) {
            stopJob(esbJob, name);
        } else {
            GenericOperation task = operations.remove(name);
            if (task != null) {
                task.stop();
            }
        }
    }
View Full Code Here


    }

    @Override
    public void esbJobFactoryRemoved(TalendESBJobFactory esbJobFactory, String name) {
        LOG.info("Removing ESB job factory for job " + name + ".");
        GenericOperation task = operations.remove(name);
        if (task != null) {
            task.stop();
        }
    }
View Full Code Here

        }
    }

    @Override
    public synchronized GenericOperation retrieveOperation(String jobName, String[] args) {
        GenericOperation task = operations.get(jobName);
        if (task == null) {
            throw new IllegalArgumentException("Talend ESB job with name "
                    + jobName + "' not found");

        }
        task.start(args);
        return task;
    }
View Full Code Here

        jobLauncher.esbJobAdded(job, JOB_NAME_1);
    }
   
    @Test
    public void retrieveNewOperation() throws Exception {
        GenericOperation operation = jobLauncher.retrieveOperation(JOB_NAME_1, new String[0]);
       
        assertNotNull(operation);
    }
View Full Code Here

    }

    @Test
    @Ignore
    public void retrieveSecondTimeOperationReturnsSame() throws Exception {       
        GenericOperation operation1 = jobLauncher.retrieveOperation(JOB_NAME_1, EMPTY_STRING_ARR);
        GenericOperation operation2 = jobLauncher.retrieveOperation(JOB_NAME_1, EMPTY_STRING_ARR);
       
        assertSame(operation1, operation2);
    }
View Full Code Here

    // @javax.jws.WebMethod(exclude=true)
    public final Source invoke(Source request) {
        QName operationQName = (QName) context.getMessageContext().get(
                MessageContext.WSDL_OPERATION);
        LOG.info("Invoke operation '" + operationQName + "'");
        GenericOperation esbProviderCallback =
             getESBProviderCallback(operationQName.getLocalPart());
       
        if (esbProviderCallback == null) {
            throw new RuntimeException("Handler for operation "
                    + operationQName + " cannot be found");
        }
        try {
            ByteArrayOutputStream os = new java.io.ByteArrayOutputStream();
            StaxUtils.copy(request, os);
            org.dom4j.Document requestDoc = new SAXReader()
                    .read(new ByteArrayInputStream(os.toByteArray()));

            Object payload;
            if (extractHeaders) {
                Map<String, Object> esbRequest = new HashMap<String, Object>();
                esbRequest.put(ESBProviderCallback.HEADERS_SOAP, context.getMessageContext().get(Header.HEADER_LIST));
                esbRequest.put(ESBProviderCallback.HEADERS_HTTP, context.getMessageContext().get(MessageContext.HTTP_REQUEST_HEADERS));
                esbRequest.put(ESBProviderCallback.REQUEST, requestDoc);
                esbRequest.put(CorrelationIDFeature.MESSAGE_CORRELATION_ID, context.getMessageContext().get(CorrelationIDFeature.MESSAGE_CORRELATION_ID));
                payload = esbRequest;
            } else {
                payload = requestDoc;
            }
            Object result = esbProviderCallback.invoke(payload,
                    isOperationRequestResponse(operationQName.getLocalPart()));

            // oneway
            if (result == null) {
                return null;
View Full Code Here

TOP

Related Classes of org.talend.esb.job.controller.GenericOperation

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.