Package org.milyn.container

Examples of org.milyn.container.ExecutionContext


        // get the input as an stream
        ByteArrayInputStream byteArrayInputStream = input.process(synCtx, synLog);

        // create the execution context for smooks. This is required for every message
        ExecutionContext executionContext = smooks.createExecutionContext();

        // create a output stream for store the result
        ByteArrayOutputStream outputStream = new ByteArrayOutputStream();
        StreamResult streamResult = new StreamResult(outputStream);
View Full Code Here


      String configFileName = dataLoader.config();

      log.fine("Loading smooks configuration file " + configFileName);
      Smooks smooks = new Smooks(getClass().getResourceAsStream(
          configFileName));
      ExecutionContext executionContext = smooks.createExecutionContext();
      executionContext.getBeanContext().addBean(OFY_HELPER,
          getOfyHelperBean());
      MapDaoRegister<Object> register = MapDaoRegister
          .newInstance(getDAOMap());

      PersistenceUtil.setDAORegister(executionContext, register);
View Full Code Here

      String configFileName = dataLoader.config();

      LOGGER.fine("Loading smooks configuration file " + configFileName);
      Smooks smooks = new Smooks(getClass().getResourceAsStream(
        configFileName));
      ExecutionContext executionContext = smooks.createExecutionContext();
      executionContext.getBeanContext().addBean(OFY_HELPER,
        getOfyHelperBean());
      MapDaoRegister<Object> register = MapDaoRegister
        .newInstance(getDAOMap());

      PersistenceUtil.setDAORegister(executionContext, register);
View Full Code Here

                        PipelineContext context) {
        this.smooks.setClassLoader( context.getClassLoader() );
        Object result = null;
        try {
            StringResult stringResult = new StringResult();
            ExecutionContext executionContext = this.smooks.createExecutionContext();

            this.smooks.filter( new JavaSource( object ),
                                stringResult,
                                executionContext );
View Full Code Here

                       PipelineContext context) {
        this.smooks.setClassLoader( context.getClassLoader() );
        Object result = null;
        try {
            JavaResult javaResult = new JavaResult();
            ExecutionContext executionContext = this.smooks.createExecutionContext();

            Source source = null;
            if ( object instanceof Source ) {
                source = ( Source ) object;
            } else if ( object instanceof InputStream ) {               
View Full Code Here

        assertResourceConfigOK(list);
    }

    private void assertProfilesOK(Smooks smooks) {
        ExecutionContext execContext;
        execContext = smooks.createExecutionContext("profileA");
        ProfileSet profileA = execContext.getTargetProfiles();
        assertTrue(profileA.isMember("profileA"));
        assertTrue(profileA.isMember("profile1"));
        assertTrue(profileA.isMember("profile2"));
        assertTrue(!profileA.isMember("profileB"));
        assertTrue(!profileA.isMember("profile3"));

        execContext = smooks.createExecutionContext("profileB");
        ProfileSet profileB = execContext.getTargetProfiles();
        assertTrue(profileB.isMember("profileB"));
        assertTrue(profileB.isMember("profile3"));
        assertTrue(profileB.isMember("profileA"));
        assertTrue(profileB.isMember("profile1"));
        assertTrue(profileB.isMember("profile2"));
View Full Code Here

    public void test() throws IOException, SAXException {
        Smooks smooks = new Smooks();

        smooks.addConfigurations("expansion-config.xml", getClass().getResourceAsStream("expansion-config.xml"));
        ExecutionContext context = smooks.createExecutionContext();

        DOMContentDeliveryConfig config = (DOMContentDeliveryConfig) context.getDeliveryConfig();
        ContentHandlerConfigMapTable<DOMVisitBefore> assemblyVisitBefores = config.getAssemblyVisitBefores();
        ContentHandlerConfigMapTable<DOMVisitAfter> assemblyVisitAfters = config.getAssemblyVisitAfters();
        ContentHandlerConfigMapTable<DOMVisitBefore> processingVisitBefores = config.getProcessingVisitBefores();
        ContentHandlerConfigMapTable<DOMVisitAfter> processingVisitAfters = config.getProcessingVisitAfters();
        ContentHandlerConfigMapTable<SerializationUnit> serializationUnits = config.getSerailizationVisitors();
View Full Code Here

        }
    }

    private void test(String config, List<Object> sourceObjects, String expected) throws IOException, SAXException {
        Smooks smooks = new Smooks(getClass().getResourceAsStream(config));
        ExecutionContext execContext = smooks.createExecutionContext();
        JavaSource source = new JavaSource(sourceObjects);
        StringWriter result = new StringWriter();

        smooks.filterSource(execContext, source, new StreamResult(result));
        assertEquals(expected, result.toString());
View Full Code Here

        assertNotNull(evaluator.condition);
    }

    public void test_DOM() throws IOException, SAXException {
        Smooks smooks;
        ExecutionContext execContext;

        SAXAndDOMVisitor.visited = false;
        smooks = new Smooks(getClass().getResourceAsStream("test-config-DOM-01.xml"));
        execContext = smooks.createExecutionContext();
        smooks.filterSource(execContext, new StreamSource(new StringReader("<a/>")), null);
View Full Code Here

        assertFalse(SAXAndDOMVisitor.visited);
    }

    public void test_SAX() throws IOException, SAXException {
        Smooks smooks;
        ExecutionContext execContext;

        SAXAndDOMVisitor.visited = false;
        smooks = new Smooks(getClass().getResourceAsStream("test-config-SAX-01.xml"));
        execContext = smooks.createExecutionContext();
        smooks.filterSource(execContext, new StreamSource(new StringReader("<a/>")), null);
View Full Code Here

TOP

Related Classes of org.milyn.container.ExecutionContext

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.