3
0
Fork 0

[svn r385] updates

This commit is contained in:
willemc 2009-08-11 20:35:06 +02:00
parent 2ed987361c
commit c540c7e531
16 changed files with 118 additions and 40 deletions

View file

@ -4,5 +4,6 @@
- (80% DONE) make J2EE compaitle - (80% DONE) make J2EE compaitle
- Add annotations for ports - Add annotations for ports
- Make asysc piping faster - Make asysc piping faster
- Auto immiate useage on bench of time of functions against piping
- Start implementing JMS interfaces - Start implementing JMS interfaces

View file

@ -0,0 +1,71 @@
/*
* Copyright 2004-2006 IDCA. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without modification, are permitted provided that the
* following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright notice, this list of conditions and
* the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions
* and the following disclaimer in the documentation and/or other materials provided with the
* distribution.
*
* THIS SOFTWARE IS PROVIDED BY IDCA AND CONTRIBUTORS ``AS IS'' AND ANY EXPRESS OR IMPLIED
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
* FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL IDCA OR
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
* OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*
* The views and conclusions contained in the software and documentation are those of the authors and
* should not be interpreted as representing official policies, either expressed or implied, of IDCA.
*/
package com.idcanet.foei.core;
/**
* Binding exception
*
* @author Willem Cazander
* @version 1.0 Jan 24, 2006
*/
public class FoeiBindingException extends Exception {
/** v1.0 */
static final long serialVersionUID = 10l;
/**
* Constructs an FoeiContextBuildingException without a detail message.
*/
public FoeiBindingException() {
super();
}
/**
* Constructs an FoeiContextBuildingException with a detail message.
* @param message The message of this Exception
*/
public FoeiBindingException(String message) {
super(message);
}
/**
* Creates an FoeiContextBuildingException from a parent exception and a message
* @param e The parent exception.
* @param message An detail message.
*/
public FoeiBindingException(String message,Exception e) {
super(message,e);
}
/**
* Creates an FoeiContextBuildingException from a parent exception.
* @param e The parant exception
*/
public FoeiBindingException(Exception e) {
super(e);
}
}

View file

@ -32,8 +32,8 @@ package com.idcanet.foei.core;
* @author Willem Cazander * @author Willem Cazander
* @version 1.0 Jan 24, 2006 * @version 1.0 Jan 24, 2006
*/ */
public class FoeiContextBuildingException extends Exception public class FoeiContextBuildingException extends Exception {
{
/** v1.0 */ /** v1.0 */
static final long serialVersionUID = 10l; static final long serialVersionUID = 10l;

View file

@ -39,13 +39,13 @@ public interface ObjectContextManager {
* Adds an EventObject to the Context * Adds an EventObject to the Context
* @param eventObject * @param eventObject
*/ */
public void addEventObject(Object eventObject,String id); public void addEventObject(Object eventObject,String id) throws FoeiBindingException;
/** /**
* removes an EventObject from the Context * removes an EventObject from the Context
* @param eventObject * @param eventObject
*/ */
public void removeEventObject(String id); public void removeEventObject(String id) throws FoeiBindingException;
/** /**
* Gets an EventObject by its id. * Gets an EventObject by its id.

View file

@ -114,7 +114,6 @@ public class EventExecutorImpl implements EventExecutor {
ready = true; ready = true;
FoeiProcessFactory.unbindFoeiProcess(); FoeiProcessFactory.unbindFoeiProcess();
foeiProcess.getExecutors().remove(this); foeiProcess.getExecutors().remove(this);
logger.info(Thread.currentThread().getName()+"--"+this.toString()+" executed: "+processed);
} }
} }
@ -122,13 +121,13 @@ public class EventExecutorImpl implements EventExecutor {
EventPort eventPort = msg.getEventPort(); EventPort eventPort = msg.getEventPort();
Object eventObject = msg.getEventObject(); Object eventObject = msg.getEventObject();
if(eventPort.getEventPortType()==EventPortType.input) { if (eventPort.getEventPortType()==EventPortType.input) {
EventInput eventInput = (EventInput)eventPort.getEventObject(); EventInput eventInput = (EventInput)eventPort.getEventObject();
eventPort.addEventsPassed(); // inc input port eventPort.addEventsPassed(); // inc input port
eventInput.doEvent(eventPort,eventObject); eventInput.doEvent(eventPort,eventObject);
return; return;
} }
if(eventPort.getEventPortType()==EventPortType.output) { if (eventPort.getEventPortType()==EventPortType.output) {
eventPort.addEventsPassed(); // inc output port eventPort.addEventsPassed(); // inc output port
List<EventPort> bindings = foeiProcess.getBindings(eventPort); List<EventPort> bindings = foeiProcess.getBindings(eventPort);

View file

@ -27,6 +27,7 @@
package com.idcanet.foei.core.impl; package com.idcanet.foei.core.impl;
import com.idcanet.foei.core.EventExecutor; import com.idcanet.foei.core.EventExecutor;
import com.idcanet.foei.core.FoeiBindingException;
import com.idcanet.foei.core.FoeiContext; import com.idcanet.foei.core.FoeiContext;
import com.idcanet.foei.core.FoeiPortMessage; import com.idcanet.foei.core.FoeiPortMessage;
import com.idcanet.foei.core.FoeiProcess; import com.idcanet.foei.core.FoeiProcess;
@ -138,13 +139,13 @@ public class FoeiProcessImpl implements FoeiProcess {
/** /**
* @see com.idcanet.foei.core.ObjectContextManager#addEventObject(com.idcanet.foei.event.EventObject) * @see com.idcanet.foei.core.ObjectContextManager#addEventObject(com.idcanet.foei.event.EventObject)
*/ */
public void addEventObject(Object eventObject,String id) { public void addEventObject(Object eventObject,String id) throws FoeiBindingException {
try { try {
getEventObjectContext().bind(id,eventObject); getEventObjectContext().bind(id,eventObject);
} catch (NameAlreadyBoundException nabe) { } catch (NameAlreadyBoundException nabe) {
logger.log(Level.WARNING,"NameAlreadyBoundException: "+nabe.getMessage(),nabe); throw new FoeiBindingException(nabe);
} catch (NamingException ne) { } catch (NamingException ne) {
logger.log(Level.WARNING,"NamingException: "+ne.getMessage(),ne); throw new FoeiBindingException(ne);
} }
} }
@ -155,21 +156,20 @@ public class FoeiProcessImpl implements FoeiProcess {
try { try {
return getEventObjectContext().lookup(id); return getEventObjectContext().lookup(id);
} catch (NamingException ne) { } catch (NamingException ne) {
logger.log(Level.WARNING,"NamingException: "+ne.getMessage(),ne); return null;
} }
return null;
} }
/** /**
* @see com.idcanet.foei.core.ObjectContextManager#removeEventObject(com.idcanet.foei.event.EventObject) * @see com.idcanet.foei.core.ObjectContextManager#removeEventObject(com.idcanet.foei.event.EventObject)
*/ */
public void removeEventObject(String id) { public void removeEventObject(String id) throws FoeiBindingException {
try { try {
getEventObjectContext().unbind(id); getEventObjectContext().unbind(id);
} catch (NameNotFoundException nnfe) { } catch (NameNotFoundException nnfe) {
logger.log(Level.WARNING,"NamingNotFoundException: "+nnfe.getMessage(),nnfe); throw new FoeiBindingException(nnfe);
} catch (NamingException ne) { } catch (NamingException ne) {
logger.log(Level.WARNING,"NamingException: "+ne.getMessage(),ne); throw new FoeiBindingException(ne);
} }
} }

View file

@ -29,15 +29,7 @@ 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;
@ -55,7 +47,7 @@ public class X2OExecutorImpl implements X2OExecutor {
private String parseFileName = null; private String parseFileName = null;
private InputStream parseInputStream = null; private InputStream parseInputStream = null;
private String parseXml = null; private String parseXml = null;
private boolean ready = false; volatile private boolean ready = false;
private Logger logger = null; private Logger logger = null;
/** /**

View file

@ -26,6 +26,7 @@
package com.idcanet.foei.core.x4o; package com.idcanet.foei.core.x4o;
import com.idcanet.foei.core.FoeiBindingException;
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.x4o.element.AbstractElementParameterHandler; import com.idcanet.x4o.element.AbstractElementParameterHandler;
@ -52,6 +53,10 @@ public class IdAttributeHandler extends AbstractElementParameterHandler {
//logger.finest("Generated auto id: "+parameterValue); //logger.finest("Generated auto id: "+parameterValue);
} }
FoeiProcess process = FoeiProcessFactory.getFoeiProcess(); FoeiProcess process = FoeiProcessFactory.getFoeiProcess();
process.addEventObject(element.getElementObject(),parameterValue); try {
process.addEventObject(element.getElementObject(),parameterValue);
} catch (FoeiBindingException e) {
throw new ElementConfiguratorException(this,e.getMessage(),e);
}
} }
} }

View file

@ -53,7 +53,7 @@ public class ObjectBindingElement extends AbstractElement {
* Do the element * Do the element
*/ */
@Override @Override
public void doElementStart() throws ElementException { public void doElementRun() throws ElementException {
Map<String,String> attributes = getAttributes(); Map<String,String> attributes = getAttributes();

View file

@ -28,6 +28,7 @@ package com.idcanet.foei.ee.jca.cci;
import javax.resource.spi.endpoint.MessageEndpointFactory; import javax.resource.spi.endpoint.MessageEndpointFactory;
import com.idcanet.foei.core.FoeiBindingException;
import com.idcanet.foei.core.FoeiProcess; import com.idcanet.foei.core.FoeiProcess;
import com.idcanet.foei.core.FoeiProcessListener; import com.idcanet.foei.core.FoeiProcessListener;
import com.idcanet.foei.ee.jca.spi.FoeiActivationSpec; import com.idcanet.foei.ee.jca.spi.FoeiActivationSpec;
@ -71,7 +72,12 @@ public class EJBFoeiProcessListener implements FoeiProcessListener {
FoeiEventWrapper wrapper = new FoeiEventWrapper(endpointFactory,process); FoeiEventWrapper wrapper = new FoeiEventWrapper(endpointFactory,process);
// inject bean // inject bean
process.addEventObject(wrapper, foeiActivationSpec.getFoeiBeanName()); try {
process.addEventObject(wrapper, foeiActivationSpec.getFoeiBeanName());
} catch (FoeiBindingException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
} }
} }
} }

View file

@ -24,6 +24,6 @@
The views and conclusions contained in the software and documentation are those of the authors and The views and conclusions contained in the software and documentation are those of the authors and
should not be interpreted as representing official policies, either expressed or implied, of IDCA. should not be interpreted as representing official policies, either expressed or implied, of IDCA.
--> -->
<eld xmlns:eld="http://x4o.idcanet.com/eld/eld-lang.eld"> <eld:root xmlns:eld="http://x4o.idcanet.com/eld/eld-lang.eld">
</eld> </eld:root>

View file

@ -24,11 +24,11 @@
The views and conclusions contained in the software and documentation are those of the authors and The views and conclusions contained in the software and documentation are those of the authors and
should not be interpreted as representing official policies, either expressed or implied, of IDCA. should not be interpreted as representing official policies, either expressed or implied, of IDCA.
--> -->
<eld xmlns:eld="http://x4o.idcanet.com/eld/eld-lang.eld"> <eld:root xmlns:eld="http://x4o.idcanet.com/eld/eld-lang.eld">
<eld:elementClass tag="filter" objectClassName="com.idcanet.foei.components.lang.Filter"/> <eld:elementClass tag="filter" objectClassName="com.idcanet.foei.components.lang.Filter"/>
<eld:elementClass tag="stringFilter" objectClassName="com.idcanet.foei.components.steps.filters.StringFilter"/> <eld:elementClass tag="stringFilter" objectClassName="com.idcanet.foei.components.steps.filters.StringFilter"/>
<eld:elementClass tag="classFilter" objectClassName="com.idcanet.foei.components.steps.filters.ClassFilter"/> <eld:elementClass tag="classFilter" objectClassName="com.idcanet.foei.components.steps.filters.ClassFilter"/>
<eld:elementClass tag="dateFilter" objectClassName="com.idcanet.foei.components.steps.filters.DateFilter"/> <eld:elementClass tag="dateFilter" objectClassName="com.idcanet.foei.components.steps.filters.DateFilter"/>
</eld> </eld:root>

View file

@ -24,10 +24,10 @@
The views and conclusions contained in the software and documentation are those of the authors and The views and conclusions contained in the software and documentation are those of the authors and
should not be interpreted as representing official policies, either expressed or implied, of IDCA. should not be interpreted as representing official policies, either expressed or implied, of IDCA.
--> -->
<eld xmlns:eld="http://x4o.idcanet.com/eld/eld-lang.eld"> <eld:root xmlns:eld="http://x4o.idcanet.com/eld/eld-lang.eld">
<eld:elementClass tag="standardOutput" objectClassName="com.idcanet.foei.components.io.StandardOutput"/> <eld:elementClass tag="standardOutput" objectClassName="com.idcanet.foei.components.io.StandardOutput"/>
<eld:elementClass tag="errorOutput" objectClassName="com.idcanet.foei.components.io.ErrorOutput"/> <eld:elementClass tag="errorOutput" objectClassName="com.idcanet.foei.components.io.ErrorOutput"/>
<eld:elementClass tag="fileOutput" objectClassName="com.idcanet.foei.components.io.FileOutput"/> <eld:elementClass tag="fileOutput" objectClassName="com.idcanet.foei.components.io.FileOutput"/>
</eld> </eld:root>

View file

@ -24,7 +24,11 @@
The views and conclusions contained in the software and documentation are those of the authors and The views and conclusions contained in the software and documentation are those of the authors and
should not be interpreted as representing official policies, either expressed or implied, of IDCA. should not be interpreted as representing official policies, either expressed or implied, of IDCA.
--> -->
<eld xmlns:eld="http://x4o.idcanet.com/eld/eld-lang.eld"> <eld:root xmlns:eld="http://x4o.idcanet.com/eld/eld-lang.eld">
<eld:elementClass tag="root" objectClassName="java.lang.Object">
<eld:elementDescription>Fake root tag</eld:elementDescription>
</eld:elementClass>
<eld:elementParameterHandler parameterName="bind" bean.class="com.idcanet.foei.core.x4o.BindAttributeHandler" /> <eld:elementParameterHandler parameterName="bind" bean.class="com.idcanet.foei.core.x4o.BindAttributeHandler" />
<eld:elementParameterHandler parameterName="foei.id" bean.class="com.idcanet.foei.core.x4o.IdAttributeHandler"/> <eld:elementParameterHandler parameterName="foei.id" bean.class="com.idcanet.foei.core.x4o.IdAttributeHandler"/>
@ -41,4 +45,4 @@
<eld:elementClass tag="mapValue" objectClassName="com.idcanet.foei.components.steps.lang.MapValue"/> <eld:elementClass tag="mapValue" objectClassName="com.idcanet.foei.components.steps.lang.MapValue"/>
<eld:elementClass tag="listValue" objectClassName="com.idcanet.foei.components.steps.lang.ListValue"/> <eld:elementClass tag="listValue" objectClassName="com.idcanet.foei.components.steps.lang.ListValue"/>
</eld> </eld:root>

View file

@ -24,6 +24,6 @@
The views and conclusions contained in the software and documentation are those of the authors and The views and conclusions contained in the software and documentation are those of the authors and
should not be interpreted as representing official policies, either expressed or implied, of IDCA. should not be interpreted as representing official policies, either expressed or implied, of IDCA.
--> -->
<eld xmlns:eld="http://x4o.idcanet.com/eld/eld-lang.eld"> <eld:root xmlns:eld="http://x4o.idcanet.com/eld/eld-lang.eld">
<eld:elementClass tag="loggerInput" objectClassName="com.idcanet.foei.components.logging.LoggerInput"/> <eld:elementClass tag="loggerInput" objectClassName="com.idcanet.foei.components.logging.LoggerInput"/>
</eld> </eld:root>

View file

@ -24,9 +24,9 @@
The views and conclusions contained in the software and documentation are those of the authors and The views and conclusions contained in the software and documentation are those of the authors and
should not be interpreted as representing official policies, either expressed or implied, of IDCA. should not be interpreted as representing official policies, either expressed or implied, of IDCA.
--> -->
<eld xmlns:eld="http://x4o.idcanet.com/eld/eld-lang.eld"> <eld:root xmlns:eld="http://x4o.idcanet.com/eld/eld-lang.eld">
<eld:elementClass tag="defaultPrinter" objectClassName="com.idcanet.foei.components.steps.printers.DefaultPrinter"/> <eld:elementClass tag="defaultPrinter" objectClassName="com.idcanet.foei.components.steps.printers.DefaultPrinter"/>
<eld:elementClass tag="datePrinter" objectClassName="com.idcanet.foei.components.steps.printers.DatePrinter"/> <eld:elementClass tag="datePrinter" objectClassName="com.idcanet.foei.components.steps.printers.DatePrinter"/>
</eld> </eld:root>