View Javadoc
1   /*
2    * Copyright (c) MuleSoft, Inc.  All rights reserved.  http://www.mulesoft.com
3    * The software in this package is published under the terms of the CPAL v1.0
4    * license, a copy of which has been included with this distribution in the
5    * LICENSE.txt file.
6    */
7   package org.mule.transport.rmi;
8   
9   import org.mule.api.MuleContext;
10  import org.mule.api.transport.MessageTypeNotSupportedException;
11  import org.mule.transport.AbstractMuleMessageFactory;
12  
13  public class RmiMuleMessageFactory extends AbstractMuleMessageFactory
14  {
15  
16      public RmiMuleMessageFactory(MuleContext context)
17      {
18          super(context);
19      }
20  
21      @Override
22      protected Object extractPayload(Object transportMessage, String encoding) throws Exception
23      {
24          if (transportMessage == null)
25          {
26              throw new MessageTypeNotSupportedException(null, getClass());
27          }
28          else
29          {
30              return transportMessage;
31          }
32      }
33  
34      @Override
35      protected Class<?>[] getSupportedTransportMessageTypes()
36      {
37          return new Class[]{Object.class};
38      }
39  
40  }