Package org.apache.synapse.processors.mediatortypes

Examples of org.apache.synapse.processors.mediatortypes.ClassMediatorProcessor


public class ClassMediatorProcessorTest extends TestCase {
    public void testClassMediatorProcessor() throws Exception {
        SynapseMessage sm = new Axis2SynapseMessage(
                Axis2EnvSetup.axis2Deployment("target/synapse-repository"));
        ClassMediatorProcessor pro = new ClassMediatorProcessor();
        pro.setClazz(Class.forName("org.apache.synapse.mediators.LoggerTestSample"));
        boolean result = pro.process(null,sm);
        assertTrue(result);
    }
View Full Code Here


*/
public class ClassMediatorProcessorConfigurator extends AbstractProcessorConfigurator {
  private static final QName CLM_Q = new QName(Constants.SYNAPSE_NAMESPACE,
      "classmediator");
  public Processor createProcessor(SynapseEnvironment se, OMElement el) {
    ClassMediatorProcessor cmp = new ClassMediatorProcessor();
    super.setNameOnProcessor(se, el, cmp);

    OMAttribute clsName = el.getAttribute(new QName("class"));
    if (clsName == null)
      throw new SynapseException("missing class attribute on element"
          + el.toString());
    try {
      Class clazz = se.getClassLoader().loadClass(clsName.getAttributeValue());
      cmp.setClazz(clazz);
    } catch (ClassNotFoundException e) {
      throw new SynapseException("class loading error", e);
    }
    return cmp;

View Full Code Here

TOP

Related Classes of org.apache.synapse.processors.mediatortypes.ClassMediatorProcessor

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.