• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

Java MuleException类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Java中org.mule.api.MuleException的典型用法代码示例。如果您正苦于以下问题:Java MuleException类的具体用法?Java MuleException怎么用?Java MuleException使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



MuleException类属于org.mule.api包,在下文中一共展示了MuleException类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: startMuleContext

import org.mule.api.MuleException; //导入依赖的package包/类
private void startMuleContext(ApplicationContext parent) {
	if (muleContext == null) {
		DefaultMuleContextFactory muleContextFactory = new DefaultMuleContextFactory();

		try {
			SpringXmlConfigurationBuilder configBuilder = new SpringXmlConfigurationBuilder(config);
			StaticApplicationContext staticApplicationContext = new StaticApplicationContext(parent);
			staticApplicationContext.refresh();
			configBuilder.setParentContext(staticApplicationContext);
			muleContext = muleContextFactory.createMuleContext(configBuilder);
			muleContext.start();
		} catch (MuleException e) {
			throw new RuntimeException(e);
		}			
	}
}
 
开发者ID:denschu,项目名称:mule-spring-boot-starter,代码行数:17,代码来源:MuleContextInitializer.java


示例2: getMessageStream

import org.mule.api.MuleException; //导入依赖的package包/类
/**
 * Gets the stream representation of the current message.
 * 
 * @param context the event context
 * @return The inputstream for the current message
 * @throws MuleException
 */
protected InputStream getMessageStream(MuleEventContext context) throws MuleException
{
    InputStream is;
    Object eventMsgPayload = context.transformMessage();

    if (eventMsgPayload instanceof InputStream)
    {
        is = (InputStream) eventMsgPayload;
    }
    else
    {
        is = (InputStream) context.transformMessage(InputStream.class);
    }
    return is;
}
 
开发者ID:mprins,项目名称:muleebmsadapter,代码行数:23,代码来源:CxfServiceComponent.java


示例3: dispatch

import org.mule.api.MuleException; //导入依赖的package包/类
@SuppressWarnings("rawtypes")
@Override
public synchronized void dispatch(final MoverMessage inMessage,
    final String inEndpointURI) throws TransportException {
    try {
        @SuppressWarnings("unchecked")
        final MoverMessage<MuleMessage> theMuleMoverMessage = inMessage;
        mMuleClient.dispatch(inEndpointURI, theMuleMoverMessage
            .getMessage());

        LOGGER.debug("Sent message: {}", inMessage);
    } catch (MuleException theException) {
        throw new TransportException("Error occurred sending message",
            theException);
    }
}
 
开发者ID:krizsan,项目名称:message-cowboy,代码行数:17,代码来源:MuleTransportService.java


示例4: receive

import org.mule.api.MuleException; //导入依赖的package包/类
@Override
public synchronized MoverMessage<MuleMessage> receive(
    final String inEndpointURI, final long inTimeout)
    throws TransportException {
    MuleMessage theReceivedMsg = null;
    MoverMessage<MuleMessage> theMoverMessage = null;
    try {
        theReceivedMsg = mMuleClient.request(inEndpointURI, inTimeout);

        LOGGER.debug("Received message: {}", theReceivedMsg);
    } catch (MuleException theException) {
        throw new TransportException("Error occurred receiving message",
            theException);
    }

    if (theReceivedMsg != null) {
        theMoverMessage = new MuleMoverMessage(theReceivedMsg);
    }
    return theMoverMessage;
}
 
开发者ID:krizsan,项目名称:message-cowboy,代码行数:21,代码来源:MuleTransportService.java


示例5: testMarkPaymentProcessed

import org.mule.api.MuleException; //导入依赖的package包/类
@Test
   public void testMarkPaymentProcessed() throws MuleException {
FakeShopserviceImplementation fakeShop = muleContext.getRegistry().lookupObject("fakeShop");
       fakeShop.markOrderAsPaid("first");
       fakeShop.markOrderAsPaid("second");
GetUnprocessedPaymentsResponse response = (GetUnprocessedPaymentsResponse) call("getUnprocessedPayments", null);
       List<String> list = response.getPayments();
assertEquals(2, list.size());
assertEquals("first", list.get(0));
assertEquals("second", list.get(1));
call("markPaymentProcessed", "first");
response = (GetUnprocessedPaymentsResponse) call("getUnprocessedPayments", null);
       list = response.getPayments();
assertEquals(1, list.size());
assertEquals("second", list.get(0));
   }
 
开发者ID:berndruecker,项目名称:mule-camunda-24,代码行数:17,代码来源:FakeServiceCallTest.java


示例6: processBlocking

import org.mule.api.MuleException; //导入依赖的package包/类
@Override
protected MuleEvent processBlocking(MuleEvent event) throws MuleException {
    MessagingException exception = null;

    final String origin = event.getMessage().getInboundProperty(HttpHeaders.Names.ORIGIN);
    final String method = event.getMessage().getInboundProperty(HttpConstants.RequestProperties.HTTP_METHOD_PROPERTY);
    final String requestMethod = event.getMessage().getInboundProperty(HttpHeaders.Names.ACCESS_CONTROL_REQUEST_METHOD);
    final String requestHeaders = event.getMessage().getInboundProperty(HttpHeaders.Names.ACCESS_CONTROL_REQUEST_HEADERS);

    try {
        return processResponse(origin, method, requestMethod, requestHeaders, processNext(processRequest(event)));
    } catch (MessagingException e) {
        exception = e;
        throw e;
    } finally {
        processFinally(event, exception, origin, method, requestMethod, requestHeaders);
    }
}
 
开发者ID:mulesoft,项目名称:mule-module-cors,代码行数:19,代码来源:ValidateMessageProcessor.java


示例7: listener

import org.mule.api.MuleException; //导入依赖的package包/类
/**
 * Subscribe for Mule events under the specified topic name
 * <p/>
 * {@sample.xml ../../../doc/pubsub-module.xml.sample pubsub:listener}
 *
 * @param topic    Name of the topic
 * @param callback flow to process
 */
@Source(exchangePattern = MessageExchangePattern.ONE_WAY)
public void listener(String topic, final SourceCallback callback) {
    ITopic hazelcastTopic = HazelcastManager.getInstance().getHazelcastInstance().getTopic(topic);
    hazelcastTopic.addMessageListener(new MessageListener() {
        @Override
        public void onMessage(Message message) {
            Thread.currentThread().setContextClassLoader(muleContext.getExecutionClassLoader());

            MuleEvent newEvent = createMuleEvent(message);

            // process it
            try {
                callback.processEvent(newEvent);
            } catch (MuleException e) {
                LOGGER.error(e.getMessage(), e);
            }
        }
    });
}
 
开发者ID:mulesoft,项目名称:mule-module-publish-subscribe,代码行数:28,代码来源:PubSubModule.java


示例8: main

import org.mule.api.MuleException; //导入依赖的package包/类
public static void main(String[] args) throws MuleException
{
	setProperty("ebms.mode",new String[]{"normal","oracle"},"normal");
	setProperty("ebms.protocol",new String[]{"http","https"},"http");
	setProperty("ebms.database",new String[]{"hsqldb","mysql","postgresql","mssql","oracle"},"hsqldb");
	DefaultMuleContextFactory muleContextFactory = new DefaultMuleContextFactory();
	SpringXmlConfigurationBuilder configBuilder = new SpringXmlConfigurationBuilder(args.length == 0 ? "main.xml" : args[0]);
	MuleContext muleContext = muleContextFactory.createMuleContext(configBuilder);
	muleContext.start();
}
 
开发者ID:mprins,项目名称:muleebmsadapter,代码行数:11,代码来源:Start.java


示例9: aggregate

import org.mule.api.MuleException; //导入依赖的package包/类
@Override
public MuleEvent aggregate(AggregationContext context) throws MuleException {
	VerificaCreditoResponse resultado = new VerificaCreditoResponse();
	resultado.setCredito(new Credito());

	for (MuleEvent event : context.getEvents()) {
		CreditoMappingStrategyFactory.mapCredito(event.getMessage().getPayload(), resultado.getCredito());
	}

	boolean aprovado = resultado.getCredito().isCasasBahia() && resultado.getCredito().isSerasa() && resultado.getCredito().isSpc();
	resultado.getCredito().setAprovado(aprovado);

	MuleMessage response = new DefaultMuleMessage((Object) resultado, context.getOriginalEvent().getMuleContext());
	return new DefaultMuleEvent(response, context.getOriginalEvent(), context.getOriginalEvent().getSession());
}
 
开发者ID:soaexpert,项目名称:circuitbreaker,代码行数:16,代码来源:VerificacaoCreditoAggregationStrategy.java


示例10: contextInitialized

import org.mule.api.MuleException; //导入依赖的package包/类
@Override
public void contextInitialized(ServletContextEvent event) {
  DefaultMuleContextFactory muleContextFactory = new DefaultMuleContextFactory();
  try {
    logger.info("Starting Mule...");
    String[] flows = new String[] { "wundershop.xml", "fakeshopsystem.xml" };
    SpringXmlConfigurationBuilder configBuilder = new SpringXmlConfigurationBuilder(flows);
    muleContext = muleContextFactory.createMuleContext(configBuilder);
    muleContext.start();
    logger.info("Mule started");
  } catch (MuleException e) {
    throw new RuntimeException(e);
  }
}
 
开发者ID:berndruecker,项目名称:mule-camunda-24,代码行数:15,代码来源:MuleStarter.java


示例11: contextDestroyed

import org.mule.api.MuleException; //导入依赖的package包/类
@Override
public void contextDestroyed(ServletContextEvent event) {
  try {
    logger.info("Stopping Mule...");
    muleContext.stop();
    muleContext.getWorkManager().dispose();
    muleContext.dispose();
    logger.info("Mule stopped");
  } catch (MuleException e) {
    throw new RuntimeException(e);
  } finally {
    muleContext = null;
  }
}
 
开发者ID:berndruecker,项目名称:mule-camunda-24,代码行数:15,代码来源:MuleStarter.java


示例12: order

import org.mule.api.MuleException; //导入依赖的package包/类
@PUT
   @Produces(MediaType.TEXT_PLAIN)
   @Consumes(MediaType.TEXT_PLAIN)
   public String order(String json) throws MuleException {
MuleClient client = context.getClient();
client.send("vm://vm-order", json, null);

return "Order received, starting workflow...";
   }
 
开发者ID:berndruecker,项目名称:mule-camunda-24,代码行数:10,代码来源:RestOrder.java


示例13: callMule

import org.mule.api.MuleException; //导入依赖的package包/类
public void callMule(DelegateExecution execution, ProcessVariableAccessor variables) throws MuleException {
  if (status.getValue(execution)==null) {
    throw new RuntimeException("You have to configure the " + this.getClass().getName() + " with the status value in your BPMN process model on activity " + execution.getCurrentActivityName());
  }
  // Check that the enum value is correct
  ShopStatus shopStatus = ShopStatus.valueOf((String)status.getValue(execution));
  
  Object args[] = new Object[] { 
      variables.getBestellung().getId(), //
      shopStatus};
  
  callMuleFlowSync("set-status", args, null);
}
 
开发者ID:berndruecker,项目名称:mule-camunda-24,代码行数:14,代码来源:SetStatusAdapter.java


示例14: callMule

import org.mule.api.MuleException; //导入依赖的package包/类
public void callMule(DelegateExecution execution, ProcessVariableAccessor variables) throws MuleException {
  Object args[] = new Object[] { 
      variables.getBestellung().getId(), //
      ShopStatus.CONFIRMED };
  
  callMuleFlowSync("set-status", args, null);
}
 
开发者ID:berndruecker,项目名称:mule-camunda-24,代码行数:8,代码来源:SetStatusConfirmedAdapter.java


示例15: testSetStatusFlow

import org.mule.api.MuleException; //导入依赖的package包/类
@Test
   public void testSetStatusFlow() throws MuleException {
FakeShopserviceImplementation fakeShop = muleContext.getRegistry().lookupObject("fakeShop");
MuleClient client = muleContext.getClient();
Object args[] = new Object[] { "id", ShopStatus.SHIPPED };
MuleMessage reply = client.send("vm://set-status", args, null);
assertNotNull(reply);
assertEquals(ShopStatus.SHIPPED, fakeShop.getStatus("id"));
   }
 
开发者ID:berndruecker,项目名称:mule-camunda-24,代码行数:10,代码来源:FakeServiceCallTest.java


示例16: call

import org.mule.api.MuleException; //导入依赖的package包/类
private Object call(String operation, Object argument) throws MuleException {
Map<String, Object> props = new HashMap<>();
props.put("operation", operation);
MuleClient client = muleContext.getClient();
MuleMessage reply = client.send("vm://fakeservicecaller", argument, props);
return reply.getPayload();
   }
 
开发者ID:berndruecker,项目名称:mule-camunda-24,代码行数:8,代码来源:FakeServiceCallTest.java


示例17: test

import org.mule.api.MuleException; //导入依赖的package包/类
@Test
   public void test() throws MuleException {
MuleClient client = muleContext.getClient();
BestellungFactory bf = new BestellungFactory();
Bestellung value = bf.createBestellungMitZweiPositionen();
MuleMessage reply = client.send("vm://jsoncreate", value, null, 5000);
assertNotNull(reply);
String json = (String) reply.getPayload();
assertNotNull(json);
System.out.println(json);
   }
 
开发者ID:berndruecker,项目名称:mule-camunda-24,代码行数:12,代码来源:JsonCreationTest.java


示例18: test

import org.mule.api.MuleException; //导入依赖的package包/类
@Test
   public void test() throws MuleException {
MuleClient client = muleContext.getClient();
Map<String, Object> properties = new HashMap<>();
properties.put("to", "[email protected]");
properties.put("from", "[email protected]");
properties.put("subject", "Ein sinnfreies subject");
MuleMessage reply = client.send("vm://send-mail", "Mail mit wenig Inhalt", properties);
assertNotNull(reply);
   }
 
开发者ID:berndruecker,项目名称:mule-camunda-24,代码行数:11,代码来源:SendMailTest.java


示例19: processNext

import org.mule.api.MuleException; //导入依赖的package包/类
@Override
protected MuleEvent processNext(MuleEvent event) throws MuleException
{
    if(event != null && !VoidMuleEvent.getInstance().equals(event)
            && Boolean.TRUE.equals(event.getMessage().getInvocationProperty(Constants.CORS_STOP_PROCESSING_FLAG))) {
        return event;
    }

    return super.processNext(event);
}
 
开发者ID:mulesoft,项目名称:mule-module-cors,代码行数:11,代码来源:ValidateMessageProcessor.java


示例20: processReplyTo

import org.mule.api.MuleException; //导入依赖的package包/类
@Override
public void processReplyTo(MuleEvent event, MuleMessage muleMessage, Object replyTo) throws MuleException {
    MuleEvent response = processResponse(origin, method, requestMethod, requestHeaders,
                                         new DefaultMuleEvent(event, originalReplyToHandler));
    // Update RequestContext ThreadLocal for backwards compatibility
    OptimizedRequestContext.unsafeSetEvent(response);
    if (!NonBlockingVoidMuleEvent.getInstance().equals(response))
    {
        originalReplyToHandler.processReplyTo(response, null, null);
    }
    processFinally(event, null);
}
 
开发者ID:mulesoft,项目名称:mule-module-cors,代码行数:13,代码来源:ValidateMessageProcessor.java



注:本文中的org.mule.api.MuleException类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java ConcurrentSet类代码示例发布时间:2022-05-21
下一篇:
Java DistributedCache类代码示例发布时间:2022-05-21
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap