3
0
Fork 0

[svn r378] updated x4o

This commit is contained in:
willemc 2009-04-13 19:17:55 +02:00
parent a773fc002e
commit 2ed987361c
5 changed files with 23 additions and 10 deletions

View file

@ -6,9 +6,9 @@ import com.idcanet.foei.event.EventInput;
import com.idcanet.foei.event.EventOutput; import com.idcanet.foei.event.EventOutput;
import com.idcanet.foei.event.EventStep; import com.idcanet.foei.event.EventStep;
import com.idcanet.foei.event.EventStepController; import com.idcanet.foei.event.EventStepController;
import com.idcanet.x4o.element.AbstractElementBindingHandler;
import com.idcanet.x4o.element.Element; import com.idcanet.x4o.element.Element;
import com.idcanet.x4o.element.ElementBindingException; import com.idcanet.x4o.element.ElementBindingException;
import com.idcanet.x4o.element.ElementBindingHandler;
/** /**
* *
@ -17,7 +17,7 @@ import com.idcanet.x4o.element.ElementBindingHandler;
* @author Willem Cazander * @author Willem Cazander
* @version 1.0 Feb 24, 2006 * @version 1.0 Feb 24, 2006
*/ */
public class FoeiEventBindingRuleHandler implements ElementBindingHandler { public class FoeiEventBindingRuleHandler extends AbstractElementBindingHandler {
/** /**
* *

View file

@ -29,7 +29,15 @@ package com.idcanet.foei.core.impl;
import com.idcanet.foei.core.FoeiProcess; import com.idcanet.foei.core.FoeiProcess;
import com.idcanet.foei.core.FoeiProcessFactory; import com.idcanet.foei.core.FoeiProcessFactory;
import com.idcanet.foei.core.X2OExecutor; import com.idcanet.foei.core.X2OExecutor;
import com.idcanet.x4o.core.AbstractX4OPhaseHandler;
import com.idcanet.x4o.core.X4OParser; import com.idcanet.x4o.core.X4OParser;
import com.idcanet.x4o.core.X4OPhaseException;
import com.idcanet.x4o.core.X4OPhaseHandler;
import com.idcanet.x4o.core.X4OPhaseHandlerFactory;
import com.idcanet.x4o.core.X4OPhase;
import com.idcanet.x4o.eld.EldX4OElementConfigurator;
import com.idcanet.x4o.element.Element;
import com.idcanet.x4o.element.ElementContext;
import java.io.InputStream; import java.io.InputStream;
import java.util.logging.Level; import java.util.logging.Level;
@ -67,8 +75,12 @@ public class X2OExecutorImpl implements X2OExecutor {
// config parser // config parser
FoeiProcess foeiProcess = FoeiProcessFactory.getFoeiProcess(); FoeiProcess foeiProcess = FoeiProcessFactory.getFoeiProcess();
X4OParser parser = new X4OParser("foei"); X4OParser parser = new X4OParser("foei");
parser.preStart();
parser.getElementContext().getProperties().putAll(foeiProcess.getFoeiContext().getStartProperties()); for (String key:foeiProcess.getFoeiContext().getStartProperties().keySet()) {
String value = foeiProcess.getFoeiContext().getStartProperties().get(key);
parser.setProperty(key, value);
}
logger.info("Executing X2O Parsing."); logger.info("Executing X2O Parsing.");

View file

@ -33,6 +33,7 @@ import com.idcanet.foei.event.EventOutput;
import com.idcanet.foei.event.EventPort; import com.idcanet.foei.event.EventPort;
import com.idcanet.x4o.element.AbstractElementParameterHandler; import com.idcanet.x4o.element.AbstractElementParameterHandler;
import com.idcanet.x4o.element.Element; import com.idcanet.x4o.element.Element;
import com.idcanet.x4o.element.ElementConfiguratorException;
import com.idcanet.x4o.element.ElementException; import com.idcanet.x4o.element.ElementException;
/** /**
@ -47,7 +48,7 @@ public class BindAttributeHandler extends AbstractElementParameterHandler {
* @see com.idca.foei.xml.x2o.eld.GlobalParameterHandler#doParameter(java.lang.Object, java.lang.String) * @see com.idca.foei.xml.x2o.eld.GlobalParameterHandler#doParameter(java.lang.Object, java.lang.String)
*/ */
@Override @Override
public void doParameterStartTag(Element element) throws ElementException { public void doConfigElement(Element element) throws ElementConfiguratorException {
String parameterValue = element.getAttributes().get(getParameterName()); String parameterValue = element.getAttributes().get(getParameterName());
String[] port = parameterValue.split(":"); String[] port = parameterValue.split(":");
if(port.length!=2) { if(port.length!=2) {
@ -77,7 +78,7 @@ public class BindAttributeHandler extends AbstractElementParameterHandler {
foei.addBinding(outputEventPort,inputEventPort); foei.addBinding(outputEventPort,inputEventPort);
} catch (Exception e) { } catch (Exception e) {
e.printStackTrace(); throw new ElementConfiguratorException(this,e.getMessage(),e);
} }
} }
} }

View file

@ -28,9 +28,9 @@ package com.idcanet.foei.core.x4o;
import com.idcanet.foei.event.EventStep; import com.idcanet.foei.event.EventStep;
import com.idcanet.foei.event.EventStepController; import com.idcanet.foei.event.EventStepController;
import com.idcanet.x4o.element.AbstractElementBindingHandler;
import com.idcanet.x4o.element.Element; import com.idcanet.x4o.element.Element;
import com.idcanet.x4o.element.ElementBindingException; import com.idcanet.x4o.element.ElementBindingException;
import com.idcanet.x4o.element.ElementBindingHandler;
/** /**
* *
@ -38,7 +38,7 @@ import com.idcanet.x4o.element.ElementBindingHandler;
* @author Willem Cazander * @author Willem Cazander
* @version 1.0 Apr 16, 2006 * @version 1.0 Apr 16, 2006
*/ */
public class EventStepBindRuleHandler implements ElementBindingHandler { public class EventStepBindRuleHandler extends AbstractElementBindingHandler {
/** /**
* @see com.idca.foei.xml.x2o.eld.BindingRuleHandler#canBind(java.lang.Object, java.lang.Object) * @see com.idca.foei.xml.x2o.eld.BindingRuleHandler#canBind(java.lang.Object, java.lang.Object)

View file

@ -30,7 +30,7 @@ import com.idcanet.foei.core.FoeiProcess;
import com.idcanet.foei.core.FoeiProcessFactory; import com.idcanet.foei.core.FoeiProcessFactory;
import com.idcanet.x4o.element.AbstractElementParameterHandler; import com.idcanet.x4o.element.AbstractElementParameterHandler;
import com.idcanet.x4o.element.Element; import com.idcanet.x4o.element.Element;
import com.idcanet.x4o.element.ElementException; import com.idcanet.x4o.element.ElementConfiguratorException;
/** /**
* Handles the id * Handles the id
@ -44,7 +44,7 @@ public class IdAttributeHandler extends AbstractElementParameterHandler {
* @see com.idca.foei.xml.x2o.eld.GlobalParameterHandler#doParameter(java.lang.Object, java.lang.String) * @see com.idca.foei.xml.x2o.eld.GlobalParameterHandler#doParameter(java.lang.Object, java.lang.String)
*/ */
@Override @Override
public void doParameterStartTag(Element element) throws ElementException { public void doConfigElement(Element element) throws ElementConfiguratorException {
// add to objext context // add to objext context
String parameterValue = element.getAttributes().get(getParameterName()); String parameterValue = element.getAttributes().get(getParameterName());
if(element.getElementObject()==null | "".equals(parameterValue)) { if(element.getElementObject()==null | "".equals(parameterValue)) {