Mail Archive Home | fractal-commits List | May 2008 Index
| <-- Date Index --> | <-- Thread Index --> |
-Updated and well-formatted comments in cecilia-lib-event, echoserver, http_server folders.
Name: svn:ignore
+ .project
--- sandbox/cecilia-lib-event/README.txt 2008-05-28 14:58:07 UTC (rev 7808)
+++ sandbox/cecilia-lib-event/README.txt 2008-05-29 09:30:00 UTC (rev 7809)
@@ -6,7 +6,11 @@
This folder contains:
- -cecilia-lib-event : The event components (TO INSTALL FISRT)
+ -cecilia-lib-event : The event components (TO INSTALL FISRT!)
-echoserver : TCP Echo server using cecilia-lib-event
-http_server : Web server using cecilia-lib-event
- -pipeline_examples : simple example of how to use the cecilia-lib-event
\ No newline at end of file
+ -pipeline_examples : simple example of how to use the cecilia-lib-event
+
+
+
+Any comments are welcomed :)
\ No newline at end of file
--- sandbox/cecilia-lib-event/cecilia-lib-event/src/main/cecilia/event/BlockingFunc.idl 2008-05-28 14:58:07 UTC (rev 7808)
+++ sandbox/cecilia-lib-event/cecilia-lib-event/src/main/cecilia/event/BlockingFunc.idl 2008-05-29 09:30:00 UTC (rev 7809)
@@ -1,5 +1,9 @@
package event;
+/**
+ * Provides a synchronization barrier. Usefull for the main thread to
+ * block while the other threads are running.
+ */
public interface BlockingFunc
{
void block();
--- sandbox/cecilia-lib-event/cecilia-lib-event/src/main/cecilia/event/Executable.idl 2008-05-28 14:58:07 UTC (rev 7808)
+++ sandbox/cecilia-lib-event/cecilia-lib-event/src/main/cecilia/event/Executable.idl 2008-05-29 09:30:00 UTC (rev 7809)
@@ -1,5 +1,9 @@
package event;
+/**
+ * Interface for message massing.
+ * The is no type for the moment.
+ */
public interface Executable
{
void execute(any id);
--- sandbox/cecilia-lib-event/cecilia-lib-event/src/main/cecilia/event/Registration.idl 2008-05-28 14:58:07 UTC (rev 7808)
+++ sandbox/cecilia-lib-event/cecilia-lib-event/src/main/cecilia/event/Registration.idl 2008-05-29 09:30:00 UTC (rev 7809)
@@ -1,5 +1,8 @@
package event;
+/**
+ * Provides the possibility to register an event on a scheduler
+ */
public interface Registration
{
void register_reaction(Executable executable, any id);
--- sandbox/cecilia-lib-event/cecilia-lib-event/src/main/cecilia/event/Scheduler.idl 2008-05-28 14:58:07 UTC (rev 7808)
+++ sandbox/cecilia-lib-event/cecilia-lib-event/src/main/cecilia/event/Scheduler.idl 2008-05-29 09:30:00 UTC (rev 7809)
@@ -1,5 +1,8 @@
package event;
+/**
+ * The scheduler interface to start/cancel/block it.
+ */
public interface Scheduler {
// is blocking id != 0
void start(BlockingFunc blocking_func);
--- sandbox/cecilia-lib-event/cecilia-lib-event/src/main/cecilia/event/SchedulerAttributes.idl 2008-05-28 14:58:07 UTC (rev 7808)
+++ sandbox/cecilia-lib-event/cecilia-lib-event/src/main/cecilia/event/SchedulerAttributes.idl 2008-05-29 09:30:00 UTC (rev 7809)
@@ -1,5 +1,8 @@
package event;
+/**
+ * The attributes of a scheduler.
+ */
record SchedulerAttributes {
string name;
int thread_pool_size;
--- sandbox/cecilia-lib-event/cecilia-lib-event/src/main/cecilia/event/SchedulerType.fractal 2008-05-28 14:58:07 UTC (rev 7808)
+++ sandbox/cecilia-lib-event/cecilia-lib-event/src/main/cecilia/event/SchedulerType.fractal 2008-05-29 09:30:00 UTC (rev 7809)
@@ -2,6 +2,11 @@
<!DOCTYPE definition PUBLIC "-//objectweb.org//DTD Fractal ADL 2.0//EN"
"classpath://org/objectweb/fractal/cecilia/adl/parser/xml/cecilia.dtd">
+<!--=========================================================================-->
+<!-- event.SchedulerType : abstract Scheduler component -->
+<!-- -->
+<!--=========================================================================-->
+
<definition name="event.SchedulerType">
<interface name="registration" signature="event.Registration" role="server" />
<interface name="scheduler" signature="event.Scheduler" role="server" />
--- sandbox/cecilia-lib-event/cecilia-lib-event/src/main/cecilia/unix/event/SimpleScheduler.fractal 2008-05-28 14:58:07 UTC (rev 7808)
+++ sandbox/cecilia-lib-event/cecilia-lib-event/src/main/cecilia/unix/event/SimpleScheduler.fractal 2008-05-29 09:30:00 UTC (rev 7809)
@@ -4,6 +4,12 @@
<definition name="unix.event.SimpleScheduler" extends="event.SchedulerType" arguments="name,thread_pool_size">
+<!--=========================================================================-->
+<!-- unix.event.simpleScheduler : Linux-specific threaded(pthread) scheduler -->
+<!-- -->
+<!--=========================================================================-->
+
+ <!-- Implementation -->
<content class="unix.event.simpleScheduler" language="thinkMC">
<cflag value="-DTHREAD_POOL_SIZE=${thread_pool_size}" />
<cflag value="-Wall" />
--- sandbox/cecilia-lib-event/echoserver/src/main/cecilia/BootstrapEchoSrv.fractal 2008-05-28 14:58:07 UTC (rev 7808)
+++ sandbox/cecilia-lib-event/echoserver/src/main/cecilia/BootstrapEchoSrv.fractal 2008-05-29 09:30:00 UTC (rev 7809)
@@ -2,28 +2,37 @@
<!DOCTYPE definition PUBLIC "-//objectweb.org//DTD Fractal ADL 2.0//EN"
"classpath://org/objectweb/fractal/cecilia/adl/parser/xml/cecilia.dtd">
+<!--=========================================================================-->
+<!-- BootstrapEchoSrv : The bootstrap component of the httpServer -->
+<!-- -->
+<!-- It boots the two stages and the scheduler -->
+<!-- This component also parses program arguments passed in parameters -->
+<!--=========================================================================-->
-<!--
- * This bootstrap inits The TCP_stage and the 3 schedulers of the application.
- *
- *
- * Authors:
- * Fabien MOTTET
- * Nicolas ROCHE
--->
-
<definition name="BootstrapEchoSrv">
- <!-- Interfaces -->
+ <!--=====================================================================-->
+ <!-- boot interface to start the server -->
+ <!--=====================================================================-->
<interface name="boot" signature="boot.api.Main" role="server" />
+
+ <!--=====================================================================-->
+ <!-- runtcp interface to boot the TCP stage -->
+ <!--=====================================================================-->
<interface name="runtcp" signature="stages.Tcp.BootstrapTcp" role="client" />
+
+ <!--=====================================================================-->
+ <!-- startScheduler interface to start the global scheduler -->
+ <!--=====================================================================-->
<interface name="startGlobalScheduler" signature="event.Scheduler" role="client" />
-
- <!-- Useful interface to block main process and avoid unwanted termination -->
+ <!--=====================================================================-->
+ <!-- blocking_func interface used to synchronized the bootstrap and the -->
+ <!-- scheduler -->
+ <!--=====================================================================-->
<interface name="blocking_func" role="server" signature="event.BlockingFunc" />
- <!-- Content -->
+ <!-- Implementation of the BootstrapEchoSrv component -->
<content class="BootstrapEchoSrv" language="thinkMC" />
</definition>
\ No newline at end of file
--- sandbox/cecilia-lib-event/echoserver/src/main/cecilia/BufferManager/BufferMgr.fractal 2008-05-28 14:58:07 UTC (rev 7808)
+++ sandbox/cecilia-lib-event/echoserver/src/main/cecilia/BufferManager/BufferMgr.fractal 2008-05-29 09:30:00 UTC (rev 7809)
@@ -2,30 +2,45 @@
<!DOCTYPE definition PUBLIC "-//objectweb.org//DTD Fractal ADL 2.0//EN"
"classpath://org/objectweb/fractal/cecilia/adl/parser/xml/cecilia.dtd">
-<!--
- *
- * BufferManager
- *
--->
+<!--=========================================================================-->
+<!-- BufferManager.BufferMgr : -->
+<!-- -->
+<!--=========================================================================-->
-<definition name="BufferManager.BufferMgr" arguments="nbBufferTables,nbBuffersPerTable,bufferSize">
-
- <!-- Interfaces -->
- <interface name="bufferMgr" signature="BufferManager.BufferMgr" role="server"/>
- <interface name="lifecycle-controller" signature="fractal.api.LifeCycleController" role="server"/>
+<definition name="BufferManager.BufferMgr"
+ arguments="nbBufferTables,nbBuffersPerTable,bufferSize">
+
+ <!--=====================================================================-->
+ <!-- bufferMgr interface -->
+ <!--=====================================================================-->
+ <interface name="bufferMgr" signature="BufferManager.BufferMgr" role="server" />
+
+ <!--=====================================================================-->
+ <!-- allocator interface -->
+ <!--=====================================================================-->
<interface name="allocator" signature="memory.api.Allocator" role="client" />
- <interface name="mutexMgr" signature="MutexManager.MutexManagement" role="client" />
-
- <!-- Content -->
- <content class="BufferManager.BufferMgr" language="thinkMC">
- <cflag value="-DDEBUG_LEVEL=0" />
- <cflag value="-DDEBUG_INOUT_FUNC=0" />
- </content>
-
- <attributes signature="BufferManager.BufferMgrAttributes">
- <attribute name="nbBufferTables" value="${nbBufferTables}"/>
- <attribute name="nbBuffersPerTable" value="${nbBuffersPerTable}"/>
- <attribute name="bufferSize" value="${bufferSize}"/>
- </attributes>
-
+
+ <!--=====================================================================-->
+ <!-- mutexMgr interface -->
+ <!--=====================================================================-->
+ <interface name="mutexMgr" signature="MutexManager.MutexManagement" role="client" />
+
+ <!--=====================================================================-->
+ <!-- lifecycle-controller interface -->
+ <!--=====================================================================-->
+ <interface name="lifecycle-controller" signature="fractal.api.LifeCycleController"
+ role="server" />
+
+ <!-- Implementation -->
+ <content class="BufferManager.BufferMgr" language="thinkMC">
+ <cflag value="-DDEBUG_LEVEL=0" />
+ <cflag value="-DDEBUG_INOUT_FUNC=0" />
+ </content>
+
+ <attributes signature="BufferManager.BufferMgrAttributes">
+ <attribute name="nbBufferTables" value="${nbBufferTables}" />
+ <attribute name="nbBuffersPerTable" value="${nbBuffersPerTable}" />
+ <attribute name="bufferSize" value="${bufferSize}" />
+ </attributes>
+
</definition>
\ No newline at end of file
--- sandbox/cecilia-lib-event/echoserver/src/main/cecilia/EchoKernel.fractal 2008-05-28 14:58:07 UTC (rev 7808)
+++ sandbox/cecilia-lib-event/echoserver/src/main/cecilia/EchoKernel.fractal 2008-05-29 09:30:00 UTC (rev 7809)
@@ -2,11 +2,15 @@
<!DOCTYPE definition PUBLIC "-//objectweb.org//DTD Fractal ADL 2.0//EN"
"classpath://org/objectweb/fractal/cecilia/adl/parser/xml/cecilia.dtd">
+<!--=========================================================================-->
+<!-- EchoKernel : abstract stage-based webserver designed for high -->
+<!-- performance and scalability -->
+<!-- -->
+<!-- NOTE: This EchoKernel is an abstract component because it is NOT -->
+<!-- architecture specific (except schedulers for wiring reasons). -->
+<!-- See a linux full implementation in ./unix/HttpKernel.fractal. -->
+<!--=========================================================================-->
-<!--
-* This is the main composite component which contains the EchoServer and all components required for this EchoServer.
-* It is the point entry of the application.
--->
<definition name="EchoKernel">
<!-- Interface -->
--- sandbox/cecilia-lib-event/echoserver/src/main/cecilia/EchoServer.fractal 2008-05-28 14:58:07 UTC (rev 7808)
+++ sandbox/cecilia-lib-event/echoserver/src/main/cecilia/EchoServer.fractal 2008-05-29 09:30:00 UTC (rev 7809)
@@ -3,43 +3,75 @@
"classpath://org/objectweb/fractal/cecilia/adl/parser/xml/cecilia.dtd">
-<!--
- * This is the EchoServer with general components.
--->
+<!--=========================================================================-->
+<!-- EchoServer : The applicative part of the application -->
+<!-- -->
+<!-- -This components requires low level components to work. -->
+<!--=========================================================================-->
<definition name="EchoServer">
- <!-- Interfaces -->
+ <!--=====================================================================-->
+ <!-- boot interface to start the server -->
+ <!--=====================================================================-->
<interface name="boot" signature="boot.api.Main" role="server" />
+
+ <!--=====================================================================-->
+ <!-- allocator interface -->
+ <!--=====================================================================-->
<interface name="allocator" signature="memory.api.Allocator" role="client" />
+
+ <!--=====================================================================-->
+ <!-- networkWrapper interface to accept connections, read and write -->
+ <!-- on them -->
+ <!--=====================================================================-->
<interface name="networkWrapper" signature="NetworkWrapper.NetworkIO" role="client" />
+
+ <!--=====================================================================-->
+ <!-- mutexManager interface, mainly to protect the connection table -->
+ <!-- accesses -->
+ <!--=====================================================================-->
<interface name="mutexManager" signature="MutexManager.MutexManagement" role="client" />
- <!-- Components -->
+
+ <!--=======================================================================-->
+ <!-- The bootstrap sub-component: -->
+ <!--=======================================================================-->
<component name="bootstrap" definition="BootstrapEchoSrv" />
- <!-- params: nbBufferTables, nbBuffersPerTable ,bufferSize-->
+ <!--=======================================================================-->
+ <!-- The bufferManager sub-component: -->
+ <!-- params: nbBufferTables, nbBuffersPerTable ,bufferSize -->
+ <!--=======================================================================-->
<component name="bufferManager" definition="BufferManager.BufferMgr(1,512,512)" />
- <!-- Tcp stage listening on 0.0.0.0:8080 backlog:10000 nb_max_connections:1024-->
+ <!--=======================================================================-->
+ <!-- The tcpStage sub-component: -->
+ <!-- listening on 0.0.0.0:8080 backlog:10000 nb_max_connections:1024 -->
+ <!--=======================================================================-->
<component name="tcpStage" definition="stages.Tcp.TcpStage(1,0.0.0.0,8080,10000,1024)" />
- <!-- Echo stage -->
+ <!--=======================================================================-->
+ <!-- The Echo stage sub-component: -->
+ <!-- :) -->
+ <!--=======================================================================-->
<component name="echoStage" definition="stages.Echo.EchoStage(2)" />
-
- <!-- Scheduler declarations-->
+ <!--=======================================================================-->
+ <!-- The scheduler sub-component: -->
+ <!-- There is one scheduler for the whole application. -->
+ <!--=======================================================================-->
<component name="global_scheduler" definition="unix.event.SimpleScheduler(GlobalScheduler,5)" />
- <!-- Bindings -->
+ <!--=====================================================================-->
+ <!-- Bindings -->
+ <!--=====================================================================-->
+
<!-- bootstrap -->
<binding client="this.boot" server="bootstrap.boot" />
<binding client="bootstrap.runtcp" server="tcpStage.run" />
-
-
-
<!-- network -->
<binding client="tcpStage.networkIO" server="this.networkWrapper" />
@@ -57,18 +89,14 @@
<binding client="echoStage.appliOrder" server="tcpStage.appliOrder" />
<binding client="tcpStage.checkPushingData" server="echoStage.checkPushingData" />
-
<!-- allocator -->
<binding client="bufferManager.allocator" server="this.allocator" />
<!-- scheduler -->
<binding client="bootstrap.startGlobalScheduler" server="global_scheduler.scheduler" />
-
<binding client="tcpStage.registration_select" server="global_scheduler.registration" />
<binding client="tcpStage.registration_write" server="global_scheduler.registration" />
<binding client="echoStage.registration" server="global_scheduler.registration" />
-
-
</definition>
\ No newline at end of file
--- sandbox/cecilia-lib-event/echoserver/src/main/cecilia/MutexManager/MutexManager.fractal 2008-05-28 14:58:07 UTC (rev 7808)
+++ sandbox/cecilia-lib-event/echoserver/src/main/cecilia/MutexManager/MutexManager.fractal 2008-05-29 09:30:00 UTC (rev 7809)
@@ -2,17 +2,22 @@
<!DOCTYPE definition PUBLIC "-//objectweb.org//DTD Fractal ADL 2.0//EN"
"classpath://org/objectweb/fractal/cecilia/adl/parser/xml/cecilia.dtd">
-<!--
- *
- *
- *
--->
+<!--=========================================================================-->
+<!-- MutexManager.MutexManager : abstract mutex provider component -->
+<!-- -->
+<!--=========================================================================-->
<definition name="MutexManager.MutexManager">
- <!-- Interfaces -->
- <interface name="mutexMgr" signature="MutexManager.MutexManagement" role="server" />
- <interface name="lifecycle-controller" signature="fractal.api.LifeCycleController" role="server" />
+ <!--=====================================================================-->
+ <!-- mutexMgr interface -->
+ <!--=====================================================================-->
+ <interface name="mutexMgr" signature="MutexManager.MutexManagement" role="server" />
+ <!--=====================================================================-->
+ <!-- lifecycle-controller interface -->
+ <!--=====================================================================-->
+ <interface name="lifecycle-controller" signature="fractal.api.LifeCycleController"
+ role="server" />
</definition>
\ No newline at end of file
--- sandbox/cecilia-lib-event/echoserver/src/main/cecilia/NetworkWrapper/NetworkIO.fractal 2008-05-28 14:58:07 UTC (rev 7808)
+++ sandbox/cecilia-lib-event/echoserver/src/main/cecilia/NetworkWrapper/NetworkIO.fractal 2008-05-29 09:30:00 UTC (rev 7809)
@@ -2,15 +2,16 @@
<!DOCTYPE definition PUBLIC "-//objectweb.org//DTD Fractal ADL 2.0//EN"
"classpath://org/objectweb/fractal/cecilia/adl/parser/xml/cecilia.dtd">
-<!--
-*
-*
-*
--->
+<!--=========================================================================-->
+<!-- NetworkWrapper.NetworkIO : abstract network IO component -->
+<!-- -->
+<!--=========================================================================-->
<definition name="NetworkWrapper.NetworkIO">
-
- <!-- Interfaces -->
- <interface name="networkIO" signature="NetworkWrapper.NetworkIO" role="server"/>
-
+
+ <!--=====================================================================-->
+ <!-- networkIO interface -->
+ <!--=====================================================================-->
+ <interface name="networkIO" signature="NetworkWrapper.NetworkIO" role="server" />
+
</definition>
\ No newline at end of file
--- sandbox/cecilia-lib-event/echoserver/src/main/cecilia/stages/Echo/EchoRecv.fractal 2008-05-28 14:58:07 UTC (rev 7808)
+++ sandbox/cecilia-lib-event/echoserver/src/main/cecilia/stages/Echo/EchoRecv.fractal 2008-05-29 09:30:00 UTC (rev 7809)
@@ -1,11 +1,16 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE definition PUBLIC "-//objectweb.org//DTD Fractal ADL 2.0//EN"
- "classpath://org/objectweb/fractal/cecilia/adl/parser/xml/cecilia.dtd">
+ "classpath://org/objectweb/fractal/cecilia/adl/parser/xml/cecilia.dtd">
+
+<!--=========================================================================-->
+<!-- stages.Echo.EchoRecv : Echo receive component -->
+<!-- -->
+<!-- It reads the incoming data and send them back -->
+<!-- This component has an ASYNCHRONOUS server interface -->
+<!--=========================================================================-->
-
<definition name="stages.Echo.EchoRecv" arguments="stageNumber">
-
<!--asynch Interfaces -->
<interface name="incoming" signature="event.Executable" role="server" /> <!-- stages.Tcp.api.ApplicationInput -->
<interface name="registration" signature="event.Registration" role="client" />
--- sandbox/cecilia-lib-event/echoserver/src/main/cecilia/stages/Tcp/BootstrapTcp.c 2008-05-28 14:58:07 UTC (rev 7808)
+++ sandbox/cecilia-lib-event/echoserver/src/main/cecilia/stages/Tcp/BootstrapTcp.c 2008-05-29 09:30:00 UTC (rev 7809)
@@ -27,7 +27,7 @@
msg->run.argc = 0;
msg->run.argv = NULL;
- CALL(REQUIRED.outStart_two, execute, msg);
+ CALL(REQUIRED.selectStart, execute, msg);
}
--- sandbox/cecilia-lib-event/echoserver/src/main/cecilia/stages/Tcp/BootstrapTcp.fractal 2008-05-28 14:58:07 UTC (rev 7808)
+++ sandbox/cecilia-lib-event/echoserver/src/main/cecilia/stages/Tcp/BootstrapTcp.fractal 2008-05-29 09:30:00 UTC (rev 7809)
@@ -1,21 +1,31 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE definition PUBLIC "-//objectweb.org//DTD Fractal ADL 2.0//EN"
- "classpath://org/objectweb/fractal/cecilia/adl/parser/xml/cecilia.dtd">
+ "classpath://org/objectweb/fractal/cecilia/adl/parser/xml/cecilia.dtd">
-<!--
- *
- * Tcp bootstrap component.
- *
--->
+<!--=========================================================================-->
+<!-- stages.Tcp.BootstrapTcp : The tcp stage bootstrap component -->
+<!-- -->
+<!--=========================================================================-->
<definition name="stages.Tcp.BootstrapTcp">
+
+ <!--=====================================================================-->
+ <!-- boot interface to start tcp stage -->
+ <!--=====================================================================-->
+ <interface name="boot" signature="stages.Tcp.BootstrapTcp" role="server" />
+
+ <!--=====================================================================-->
+ <!-- initSelect interface -->
+ <!--=====================================================================-->
+ <interface name="initSelect" signature="stages.Tcp.BootstrapTcp" role="client" />
+
+ <!--=====================================================================-->
+ <!-- selectStart interface -->
+ <!--=====================================================================-->
+ <interface name="selectStart" signature="event.Executable" role="client" />
- <!-- Interfaces -->
- <interface name="boot" signature="stages.Tcp.BootstrapTcp" role="server" />
- <interface name="initSelect" signature="stages.Tcp.BootstrapTcp" role="client" />
- <interface name="outStart_two" signature="event.Executable" role="client" />
- <!-- Content -->
- <content class="stages.Tcp.BootstrapTcp" />
+ <!-- Implementation -->
+ <content class="stages.Tcp.BootstrapTcp" />
</definition>
\ No newline at end of file
--- sandbox/cecilia-lib-event/echoserver/src/main/cecilia/stages/Tcp/BootstrapTcp.idl 2008-05-28 14:58:07 UTC (rev 7808)
+++ sandbox/cecilia-lib-event/echoserver/src/main/cecilia/stages/Tcp/BootstrapTcp.idl 2008-05-29 09:30:00 UTC (rev 7809)
@@ -3,6 +3,14 @@
public interface BootstrapTcp {
+ /**
+ * @param listenItf listening interface
+ * @param port listen port
+ * @param backlog backlog
+ * @param nbMaxConnections nbMaxConnections accepted
+ * @param acceptLimit maximum number of connections to accept
+ * @return void
+ */
void boot(string listenItf, int port, int backlog, int nbMaxConnections, int acceptLimit);
}
\ No newline at end of file
--- sandbox/cecilia-lib-event/echoserver/src/main/cecilia/stages/Tcp/ConnectionTable.fractal 2008-05-28 14:58:07 UTC (rev 7808)
+++ sandbox/cecilia-lib-event/echoserver/src/main/cecilia/stages/Tcp/ConnectionTable.fractal 2008-05-29 09:30:00 UTC (rev 7809)
@@ -1,30 +1,43 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE definition PUBLIC "-//objectweb.org//DTD Fractal ADL 2.0//EN"
- "classpath://org/objectweb/fractal/cecilia/adl/parser/xml/cecilia.dtd">
+ "classpath://org/objectweb/fractal/cecilia/adl/parser/xml/cecilia.dtd">
-<!--
- *
- * The connection table that contains the connections of the TCP stage.
- *
--->
+<!--=========================================================================-->
+<!-- stages.Tcp.ConnectionTable : table that contains the connections of -->
+<!-- the TCP stage -->
+<!-- -->
+<!-- arguments: -->
+<!-- -nbMaxConnections : the number of connections that the table -->
+<!-- can register (note: value greater than 1024 are hazardous because -->
+<!-- of select limitation) -->
+<!--=========================================================================-->
<definition name="stages.Tcp.ConnectionTable" arguments="nbMaxConnections">
- <!-- Interfaces -->
- <interface name="incoming" signature="stages.Tcp.ConnectionTable" role="server" />
- <interface name="lifecycle-controller" signature="fractal.api.LifeCycleController" role="server" />
+
+ <!--=====================================================================-->
+ <!-- incoming synchronous interface -->
+ <!--=====================================================================-->
+ <interface name="incoming" signature="stages.Tcp.ConnectionTable" role="server" />
+
+ <!--=====================================================================-->
+ <!-- mutexMgr client interface -->
+ <!--=====================================================================-->
+ <interface name="mutexMgr" signature="MutexManager.MutexManagement" role="client" />
+
+ <!--=====================================================================-->
+ <!-- lifecycle-controller interface -->
+ <!--=====================================================================-->
+ <interface name="lifecycle-controller" signature="fractal.api.LifeCycleController" role="server" />
- <interface name="mutexMgr" signature="MutexManager.MutexManagement" role="client" />
- <!-- Content -->
- <content class="stages.Tcp.ConnectionTable">
- <cflag value="-DDEBUG_LEVEL=0" />
- <cflag value="-DDEBUG_INOUT_FUNC=0" />
- </content>
+ <!-- Implementation -->
+ <content class="stages.Tcp.ConnectionTable">
+ <cflag value="-DDEBUG_LEVEL=0" />
+ <cflag value="-DDEBUG_INOUT_FUNC=0" />
+ </content>
- <attributes signature="stages.Tcp.ListenAttributes">
- <attribute name="nbMaxConnections" value="${nbMaxConnections}" />
- </attributes>
+ <attributes signature="stages.Tcp.ListenAttributes">
+ <attribute name="nbMaxConnections" value="${nbMaxConnections}" />
+ </attributes>
-
-
</definition>
\ No newline at end of file
--- sandbox/cecilia-lib-event/echoserver/src/main/cecilia/stages/Tcp/Select.fractal 2008-05-28 14:58:07 UTC (rev 7808)
+++ sandbox/cecilia-lib-event/echoserver/src/main/cecilia/stages/Tcp/Select.fractal 2008-05-29 09:30:00 UTC (rev 7809)
@@ -1,36 +1,86 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE definition PUBLIC "-//objectweb.org//DTD Fractal ADL 2.0//EN"
- "classpath://org/objectweb/fractal/cecilia/adl/parser/xml/cecilia.dtd">
+ "classpath://org/objectweb/fractal/cecilia/adl/parser/xml/cecilia.dtd">
+<!--=========================================================================-->
+<!-- stages.Tcp.Select : Accepts and Reads on connections -->
+<!-- -->
+<!-- This component has an ASYNCHRONOUS server interface -->
+<!--=========================================================================-->
<definition name="stages.Tcp.Select" arguments="stageNumber">
- <!--asynch Interfaces
- * input is redirected on:
- * -run : stages.Tcp.ProcessManagement
- * -appliOrder : stages.Tcp.ReadCommands
- * -stages.Tcp.ConnectionNotification
- -->
- <interface name="input" signature="event.Executable" role="server" />
- <interface name="registration" signature="event.Registration" role="client" />
- <interface name="callback" signature="event.Executable" role="server" />
- <interface name="init" signature="stages.Tcp.BootstrapTcp" role="server" />
+ <!--Accepted messages type on input interface:
+ *
+ * ProcessManagementRun
+ * ReadCommandsReadNForConn
+ * ConnectionNotificationCloseConnection
+ *
+ * (see messages definition in ../messages.h)
+ -->
+
+ <!--=====================================================================-->
+ <!-- input asynchronous interface which accept messages -->
+ <!-- Here, the component will create a message corresponding to the call -->
+ <!-- and register it to the scheduler -->
+ <!--=====================================================================-->
+ <interface name="input" signature="event.Executable" role="server" />
+ <!--=====================================================================-->
+ <!-- registration interface linked to the scheduler where the component -->
+ <!-- register an incoming event -->
+ <!--=====================================================================-->
+ <interface name="registration" signature="event.Registration" role="client" />
- <!-- Client -->
- <interface name="applicationInput" signature="event.Executable" role="client" />
- <interface name="checkPushingData" signature="stages.Tcp.ApplicationCheckPushingData" role="client" />
- <interface name="networkInput" signature="NetworkWrapper.NetworkIO" role="client" />
- <interface name="connTable" signature="stages.Tcp.ConnectionTable" role="client" />
- <interface name="bufferMgr" signature="BufferManager.BufferMgr" role="client" />
+ <!--=====================================================================-->
+ <!-- callback interface: The scheduler will send a registered message -->
+ <!-- on this interface that will be analyzed and which will execute the -->
+ <!-- corresponding function -->
+ <!--=====================================================================-->
+ <interface name="callback" signature="event.Executable" role="server" />
- <interface name="lifecycle-controller" signature="fractal.api.LifeCycleController" role="server" />
+ <!--=====================================================================-->
+ <!-- init interface -->
+ <!--=====================================================================-->
+ <interface name="init" signature="stages.Tcp.BootstrapTcp" role="server" />
- <content class="stages.Tcp.Select" >
- <cflag value="-DDEBUG_LEVEL=0" />
- <cflag value="-DDEBUG_INOUT_FUNC=0" />
- </content>
-
-
+ <!--=====================================================================-->
+ <!-- applicationInput asynchronous client interface to the app stage -->
+ <!--=====================================================================-->
+ <interface name="applicationInput" signature="event.Executable" role="client" />
+
+ <!--=====================================================================-->
+ <!-- checkPushingData client interface -->
+ <!--=====================================================================-->
+ <interface name="checkPushingData" signature="stages.Tcp.ApplicationCheckPushingData"
+ role="client" />
+
+ <!--=====================================================================-->
+ <!-- networkInput client interface -->
+ <!--=====================================================================-->
+ <interface name="networkInput" signature="NetworkWrapper.NetworkIO" role="client" />
+
+ <!--=====================================================================-->
+ <!-- connTable client interface to interacte with this table -->
+ <!--=====================================================================-->
+ <interface name="connTable" signature="stages.Tcp.ConnectionTable" role="client" />
+
+ <!--=====================================================================-->
+ <!-- bufferMgr client interface -->
+ <!--=====================================================================-->
+ <interface name="bufferMgr" signature="BufferManager.BufferMgr" role="client" />
+
+ <!--=====================================================================-->
+ <!-- lifecycle-controller interface -->
+ <!--=====================================================================-->
+ <interface name="lifecycle-controller" signature="fractal.api.LifeCycleController"
+ role="server" />
+
+ <!-- Implementation -->
+ <content class="stages.Tcp.Select">
+ <cflag value="-DDEBUG_LEVEL=0" />
+ <cflag value="-DDEBUG_INOUT_FUNC=0" />
+ </content>
+
</definition>
\ No newline at end of file
--- sandbox/cecilia-lib-event/echoserver/src/main/cecilia/stages/Tcp/TcpStage.fractal 2008-05-28 14:58:07 UTC (rev 7808)
+++ sandbox/cecilia-lib-event/echoserver/src/main/cecilia/stages/Tcp/TcpStage.fractal 2008-05-29 09:30:00 UTC (rev 7809)
@@ -1,69 +1,128 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE definition PUBLIC "-//objectweb.org//DTD Fractal ADL 2.0//EN"
- "classpath://org/objectweb/fractal/cecilia/adl/parser/xml/cecilia.dtd">
+ "classpath://org/objectweb/fractal/cecilia/adl/parser/xml/cecilia.dtd">
-<!--
- *
- *
--->
+<!--=========================================================================-->
+<!-- stages.Tcp.TcpStage : The tcp stage composite component -->
+<!-- -->
+<!--=========================================================================-->
<definition name="stages.Tcp.TcpStage" arguments="stageNumber,backlog,nbMaxConnections">
- <!-- Interfaces -->
+ <!--=====================================================================-->
+ <!-- run interface start the tcp stage -->
+ <!--=====================================================================-->
+ <interface name="run" signature="stages.Tcp.BootstrapTcp" role="server" />
- <interface name="registration_select" signature="event.Registration" role="client"/>
- <interface name="registration_write" signature="event.Registration" role="client" />
+ <!--=====================================================================-->
+ <!-- registration_select interface register messages into the scheduler-->
+ <!--=====================================================================-->
+ <interface name="registration_select" signature="event.Registration" role="client" />
- <interface name="run" signature="stages.Tcp.BootstrapTcp" role="server" />
- <interface name="applicationOutput" signature="event.Executable" role="server" />
- <interface name="appliOrder" signature="event.Executable" role="server" />
+ <!--=====================================================================-->
+ <!-- registration_write interface register messages into the scheduler -->
+ <!--=====================================================================-->
+ <interface name="registration_write" signature="event.Registration" role="client" />
- <interface name="networkIO" signature="NetworkWrapper.NetworkIO" role="client" />
- <interface name="applicationInput" signature="event.Executable" role="client" />
- <interface name="bufferMgr" signature="BufferManager.BufferMgr" role="client" />
- <interface name="mutexManager" signature="MutexManager.MutexManagement" role="client" />
- <interface name="checkPushingData" signature="stages.Tcp.ApplicationCheckPushingData" role="client" />
+ <!--=====================================================================-->
+ <!--applicationOutput interface to receive messages from the applicative stage-->
+ <!--=====================================================================-->
+ <interface name="applicationOutput" signature="event.Executable" role="server" />
+ <!--=====================================================================-->
+ <!--appliOrder interface to receive order messages from the applicative stage-->
+ <!--=====================================================================-->
+ <interface name="appliOrder" signature="event.Executable" role="server" />
- <component name="bootstrapTcp" definition="stages.Tcp.BootstrapTcp" />
+ <!--=====================================================================-->
+ <!-- networkIO client interface -->
+ <!--=====================================================================-->
+ <interface name="networkIO" signature="NetworkWrapper.NetworkIO" role="client" />
- <component name="select" definition="stages.Tcp.Select(2)" />
+ <!--=====================================================================-->
+ <!--applicationInput asynchronous client interface to send messages to application-->
+ <!--=====================================================================-->
+ <interface name="applicationInput" signature="event.Executable" role="client" />
- <component name="write" definition="stages.Tcp.Write(3)" />
+ <!--=====================================================================-->
+ <!-- bufferMgr client interface -->
+ <!--=====================================================================-->
+ <interface name="bufferMgr" signature="BufferManager.BufferMgr" role="client" />
- <component name="connectionTable" definition="stages.Tcp.ConnectionTable(1024)" />
+ <!--=====================================================================-->
+ <!-- mutexMgr client interface -->
+ <!--=====================================================================-->
+ <interface name="mutexManager" signature="MutexManager.MutexManagement" role="client" />
+
+ <!--=====================================================================-->
+ <!--checkPushingData client interface to see if tcpstage can send incomming data to app_stage-->
+ <!--=====================================================================-->
+ <interface name="checkPushingData" signature="stages.Tcp.ApplicationCheckPushingData"
+ role="client" />
- <!-- Bindings -->
- <!-- bootstrap -->
- <binding client="this.run" server="bootstrapTcp.boot" />
- <binding client="bootstrapTcp.outStart_two" server="select.input" />
- <!-- buffer -->
- <binding client="select.bufferMgr" server="this.bufferMgr" />
- <binding client="write.bufferMgr" server="this.bufferMgr" />
- <!-- table -->
- <binding client="select.connTable" server="connectionTable.incoming" />
- <binding client="write.connTable" server="connectionTable.incoming" />
- <!-- network -->
- <binding client="select.networkInput" server="this.networkIO" />
- <binding client="write.networkOutput" server="this.networkIO" />
- <!-- application -->
- <binding client="select.applicationInput" server="this.applicationInput" />
- <binding client="this.applicationOutput" server="write.input" />
- <binding client="this.appliOrder" server="select.input" />
- <!-- connection notification -->
- <binding client="write.conNotification" server="select.input" />
- <!-- checkPushingData -->
- <binding client="select.checkPushingData" server="this.checkPushingData" />
+ <!--=======================================================================-->
+ <!-- The bootstrapTcp sub-component: -->
+ <!--=======================================================================-->
+ <component name="bootstrapTcp" definition="stages.Tcp.BootstrapTcp" />
- <!-- mutex manager-->
- <binding client="connectionTable.mutexMgr" server="this.mutexManager" />
+ <!--=======================================================================-->
+ <!-- The select sub-component: accepts and reads data on connections -->
+ <!--=======================================================================-->
+ <component name="select" definition="stages.Tcp.Select(2)" />
- <binding client="bootstrapTcp.initSelect" server="select.init" />
-
- <binding client="write.registration" server="this.registration_write" />
- <binding client="select.registration" server="this.registration_select" />
-
-
+ <!--=======================================================================-->
+ <!-- The write sub-component: writes data on connections -->
+ <!--=======================================================================-->
+ <component name="write" definition="stages.Tcp.Write(3)" />
+ <!--=======================================================================-->
+ <!-- The connectionTable sub-component: stores current connections -->
+ <!--=======================================================================-->
+ <component name="connectionTable" definition="stages.Tcp.ConnectionTable(1024)" />
+
+
+ <!--=====================================================================-->
+ <!-- Bindings -->
+ <!--=====================================================================-->
+
+ <!-- bootstrap -->
+ <binding client="this.run" server="bootstrapTcp.boot" />
+ <binding client="bootstrapTcp.selectStart" server="select.input" />
+
+ <!-- buffer -->
+ <binding client="select.bufferMgr" server="this.bufferMgr" />
+ <binding client="write.bufferMgr" server="this.bufferMgr" />
+
+ <!-- table -->
+ <binding client="select.connTable" server="connectionTable.incoming" />
+ <binding client="write.connTable" server="connectionTable.incoming" />
+
+ <!-- network -->
+ <binding client="select.networkInput" server="this.networkIO" />
+ <binding client="write.networkOutput" server="this.networkIO" />
+
+ <!-- application -->
+ <binding client="select.applicationInput" server="this.applicationInput" />
+ <binding client="this.applicationOutput" server="write.input" />
+ <binding client="this.appliOrder" server="select.input" />
+
+ <!-- connection notification -->
+ <binding client="write.conNotification" server="select.input" />
+
+ <!-- checkPushingData -->
+ <binding client="select.checkPushingData" server="this.checkPushingData" />
+
+ <!-- mutex manager-->
+ <binding client="connectionTable.mutexMgr" server="this.mutexManager" />
+
+ <!-- init select -->
+ <binding client="bootstrapTcp.initSelect" server="select.init" />
+
+ <!-- registration to scheduler -->
+ <binding client="write.registration" server="this.registration_write" />
+ <binding client="select.registration" server="this.registration_select" />
+
+
+
</definition>
\ No newline at end of file
--- sandbox/cecilia-lib-event/echoserver/src/main/cecilia/stages/Tcp/Write.fractal 2008-05-28 14:58:07 UTC (rev 7808)
+++ sandbox/cecilia-lib-event/echoserver/src/main/cecilia/stages/Tcp/Write.fractal 2008-05-29 09:30:00 UTC (rev 7809)
@@ -1,35 +1,69 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE definition PUBLIC "-//objectweb.org//DTD Fractal ADL 2.0//EN"
- "classpath://org/objectweb/fractal/cecilia/adl/parser/xml/cecilia.dtd">
+ "classpath://org/objectweb/fractal/cecilia/adl/parser/xml/cecilia.dtd">
-<!--
- *
- * Write
- *
--->
+<!--=========================================================================-->
+<!-- stages.Tcp.Write : writes on connections -->
+<!-- -->
+<!-- This component has an ASYNCHRONOUS server interface -->
+<!--=========================================================================-->
<definition name="stages.Tcp.Write" arguments="stageNumber">
+ <!--Accepted messages type on input interface:
+ *
+ * ApplicationOutputSend
+ * ApplicationOutputSendFromBuffer
+ * ApplicationOutputCloseConnection
+ *
+ * (see messages definition in ../messages.h)
+ -->
- <!--asynch Interfaces
- * input is redirected on:
- * -reactions : stages.Tcp.ApplicationOutput
- -->
- <interface name="input" signature="event.Executable" role="server" />
- <interface name="registration" signature="event.Registration" role="client" />
- <interface name="callback" signature="event.Executable" role="server" />
+ <!--=====================================================================-->
+ <!-- input asynchronous interface -->
+ <!--=====================================================================-->
+ <interface name="input" signature="event.Executable" role="server" />
- <interface name="networkOutput" signature="NetworkWrapper.NetworkIO" role="client" />
- <interface name="connTable" signature="stages.Tcp.ConnectionTable" role="client" />
- <interface name="conNotification" signature="event.Executable" role="client" />
- <interface name="bufferMgr" signature="BufferManager.BufferMgr" role="client" />
+ <!--=====================================================================-->
+ <!-- registration interface -->
+ <!--=====================================================================-->
+ <interface name="registration" signature="event.Registration" role="client" />
- <interface name="lifecycle-controller" signature="fractal.api.LifeCycleController" role="server" />
+ <!--=====================================================================-->
+ <!-- callback interface -->
+ <!--=====================================================================-->
+ <interface name="callback" signature="event.Executable" role="server" />
- <content class="stages.Tcp.Write">
- <cflag value="-DDEBUG_LEVEL=0" />
- <cflag value="-DDEBUG_INOUT_FUNC=0"/>
- </content>
-
+ <!--=====================================================================-->
+ <!-- networkOutput client interface -->
+ <!--=====================================================================-->
+ <interface name="networkOutput" signature="NetworkWrapper.NetworkIO" role="client" />
+ <!--=====================================================================-->
+ <!-- connTable client interface to interacte with this table -->
+ <!--=====================================================================-->
+ <interface name="connTable" signature="stages.Tcp.ConnectionTable" role="client" />
+
+ <!--=====================================================================-->
+ <!--conNotification client interface to send messages on connections event-->
+ <!--=====================================================================-->
+ <interface name="conNotification" signature="event.Executable" role="client" />
+
+ <!--=====================================================================-->
+ <!-- bufferMgr client interface -->
+ <!--=====================================================================-->
+ <interface name="bufferMgr" signature="BufferManager.BufferMgr" role="client" />
+
+ <!--=====================================================================-->
+ <!-- lifecycle-controller interface -->
+ <!--=====================================================================-->
+ <interface name="lifecycle-controller" signature="fractal.api.LifeCycleController"
+ role="server" />
+
+ <!-- Implementation -->
+ <content class="stages.Tcp.Write">
+ <cflag value="-DDEBUG_LEVEL=0" />
+ <cflag value="-DDEBUG_INOUT_FUNC=0" />
+ </content>
+
</definition>
\ No newline at end of file
--- sandbox/cecilia-lib-event/echoserver/src/main/cecilia/unix/EchoKernel.fractal 2008-05-28 14:58:07 UTC (rev 7808)
+++ sandbox/cecilia-lib-event/echoserver/src/main/cecilia/unix/EchoKernel.fractal 2008-05-29 09:30:00 UTC (rev 7809)
@@ -2,20 +2,27 @@
<!DOCTYPE definition PUBLIC "-//objectweb.org//DTD Fractal ADL 2.0//EN"
"classpath://org/objectweb/fractal/cecilia/adl/parser/xml/cecilia.dtd">
+<!--=========================================================================-->
+<!-- unix.EchoKernel : Linux implemented stage-based echo server -->
+<!-- -->
+<!-- All abstract components are overloaded by Linux-specific components -->
+<!--=========================================================================-->
-<!--
-*
-* Authors:
-* Fabien MOTTET
-* Nicolas ROCHE
--->
-
<definition name="unix.EchoKernel" extends="EchoKernel">
-
- <!-- components -->
+ <!--=====================================================================-->
+ <!-- The Linux-specific allocator sub-component -->
+ <!--=====================================================================-->
<component name="allocator" definition="unix.memory.Malloc" />
+
+ <!--=====================================================================-->
+ <!-- The Linux-specific networkWrapper sub-component -->
+ <!--=====================================================================-->
<component name="networkWrapper" definition="unix.NetworkWrapper.NetworkIO"/>
+
+ <!--=====================================================================-->
+ <!-- The Linux-specific mutexManager sub-component -->
+ <!--=====================================================================-->
<component name="mutexMgr" definition="unix.MutexManager.MutexManager(16)"/>
--- sandbox/cecilia-lib-event/echoserver/src/main/cecilia/unix/MutexManager/MutexManager.fractal 2008-05-28 14:58:07 UTC (rev 7808)
+++ sandbox/cecilia-lib-event/echoserver/src/main/cecilia/unix/MutexManager/MutexManager.fractal 2008-05-29 09:30:00 UTC (rev 7809)
@@ -2,21 +2,20 @@
<!DOCTYPE definition PUBLIC "-//objectweb.org//DTD Fractal ADL 2.0//EN"
"classpath://org/objectweb/fractal/cecilia/adl/parser/xml/cecilia.dtd">
-<!--
- *
- *
- *
--->
+<!--=========================================================================-->
+<!-- unix.MutexManager.MutexManager : Linux-specific mutex provider -->
+<!-- -->
+<!--=========================================================================-->
<definition name="unix.MutexManager.MutexManager" extends="MutexManager.MutexManager" arguments="nbTablesMax">
-
- <!-- Content -->
- <content class="unix.MutexManager.MutexManager" language="thinkMC">
- </content>
-
- <attributes signature="unix.MutexManager.MutexManagerAttributes">
- <attribute name="nbTablesMax" value="${nbTablesMax}" />
- </attributes>
-
-
+
+ <!-- Implementation -->
+ <content class="unix.MutexManager.MutexManager" language="thinkMC">
+ </content>
+
+ <attributes signature="unix.MutexManager.MutexManagerAttributes">
+ <attribute name="nbTablesMax" value="${nbTablesMax}" />
+ </attributes>
+
+
</definition>
\ No newline at end of file
--- sandbox/cecilia-lib-event/echoserver/src/main/cecilia/unix/NetworkWrapper/NetworkIO.fractal 2008-05-28 14:58:07 UTC (rev 7808)
+++ sandbox/cecilia-lib-event/echoserver/src/main/cecilia/unix/NetworkWrapper/NetworkIO.fractal 2008-05-29 09:30:00 UTC (rev 7809)
@@ -2,16 +2,15 @@
<!DOCTYPE definition PUBLIC "-//objectweb.org//DTD Fractal ADL 2.0//EN"
"classpath://org/objectweb/fractal/cecilia/adl/parser/xml/cecilia.dtd">
-<!--
-* HttpServer : a stage-based webserver designed for high performance
-* and scalability
-*
--->
+<!--=========================================================================-->
+<!-- unix.NetworkWrapper.NetworkIO : Linux-specific network IO component -->
+<!-- -->
+<!--=========================================================================-->
<definition name="unix.NetworkWrapper.NetworkIO" extends="NetworkWrapper.NetworkIO">
-
- <!-- Content -->
- <content class="unix.NetworkWrapper.NetworkIO" language="thinkMC">
- </content>
-
+
+ <!-- Implementation -->
+ <content class="unix.NetworkWrapper.NetworkIO" language="thinkMC">
+ </content>
+
</definition>
\ No newline at end of file
--- sandbox/cecilia-lib-event/http_server/src/main/cecilia/BootstrapHttpSrv.c 2008-05-28 14:58:07 UTC (rev 7808)
+++ sandbox/cecilia-lib-event/http_server/src/main/cecilia/BootstrapHttpSrv.c 2008-05-29 09:30:00 UTC (rev 7809)
@@ -55,7 +55,6 @@
int METHOD(boot , main)(void *_this, int argc, char *argv[]) {
printf("------------------------HTTP Server----------------------------------\n");
- //printf("Bootstrap--> launching TCP and HTTP stages...\n");
int opt;
@@ -67,8 +66,7 @@
jboolean bypassCache = DEFAULT_BYPASSCACHE;
int acceptLimit = DEFAULT_ACCEPT_LIMIT;
-
-
+ //Parsing arguments
while ((opt = getopt(argc, argv, "hp:d:f:b:n:c:a:")) != -1) {
switch (opt) {
case 'p':
@@ -111,48 +109,30 @@
}
}
-
// Initialising locks
pthread_mutex_init(&DATA.blocking_mutex, NULL);
pthread_cond_init(&DATA.blocking_cond, NULL);
-
+ //Set configuration for the tcp stage
CALL(REQUIRED.runtcp, boot, listenAddr, port, backlog, nbMaxConnections, acceptLimit);
-
+ //Set the current working directory for the http stage
CALL(REQUIRED.runhttp, boot, defDir, bypassCache);
-
- //Start Select scheduler
+ //Start global scheduler
CALL(REQUIRED.startScheduler,start,GET_MY_INTERFACE(blocking_func));
-
- //Start Write scheduler
- /*CALL(REQUIRED.startWriteScheduler,start,GET_MY_INTERFACE(blocking_func));
-
-
- CALL(REQUIRED.startHttpRecvScheduler,start,GET_MY_INTERFACE(blocking_func));
- CALL(REQUIRED.startHttpFileCacheScheduler,start,GET_MY_INTERFACE(blocking_func));
-
- CALL(REQUIRED.startHttpFileGetterScheduler,start,GET_MY_INTERFACE(blocking_func));
-
- CALL(REQUIRED.startHttpSendScheduler,start,GET_MY_INTERFACE(blocking_func));*/
-
-
printf("----------------------------------------------------------------\n");
printf("running...\n");
-
-
+ //Blocks here and lets the application do its job.
CALLMINE(blocking_func,block);
//unreachable code.
-
return fractal_api_ErrorConst_OK;
}
-
void METHOD(blocking_func, block) (void *_this){
pthread_mutex_lock(&DATA.blocking_mutex);
pthread_cond_wait(&DATA.blocking_cond, &DATA.blocking_mutex);
@@ -164,4 +144,3 @@
pthread_cond_signal(&DATA.blocking_cond);
pthread_mutex_unlock(&DATA.blocking_mutex);
}
-
--- sandbox/cecilia-lib-event/http_server/src/main/cecilia/BootstrapHttpSrv.fractal 2008-05-28 14:58:07 UTC (rev 7808)
+++ sandbox/cecilia-lib-event/http_server/src/main/cecilia/BootstrapHttpSrv.fractal 2008-05-29 09:30:00 UTC (rev 7809)
@@ -2,26 +2,43 @@
<!DOCTYPE definition PUBLIC "-//objectweb.org//DTD Fractal ADL 2.0//EN"
"classpath://org/objectweb/fractal/cecilia/adl/parser/xml/cecilia.dtd">
+<!--=========================================================================-->
+<!-- BootstrapHttpSrv : The bootstrap component of the httpServer -->
+<!-- -->
+<!-- It boots the two stages and the scheduler -->
+<!-- This component also parses program arguments passed in parameters -->
+<!--=========================================================================-->
-<!--
- *
- *
- *
--->
-
<definition name="BootstrapHttpSrv">
- <!-- Interfaces -->
+ <!--=====================================================================-->
+ <!-- boot interface to start the server -->
+ <!--=====================================================================-->
<interface name="boot" signature="boot.api.Main" role="server" />
+
+ <!--=====================================================================-->
+ <!-- runtcp interface to boot the TCP stage -->
+ <!--=====================================================================-->
<interface name="runtcp" signature="stages.Tcp.BootstrapTcp" role="client" />
+
+ <!--=====================================================================-->
+ <!-- runhttp interface to boot the HTTP stage -->
+ <!--=====================================================================-->
<interface name="runhttp" signature="stages.Http.BootstrapHttp" role="client" />
+ <!--=====================================================================-->
+ <!-- startScheduler interface to start the global scheduler -->
+ <!--=====================================================================-->
<interface name="startScheduler" signature="event.Scheduler" role="client" />
-
+
+ <!--=====================================================================-->
+ <!-- blocking_func interface used to synchronized the bootstrap and the -->
+ <!-- scheduler -->
+ <!--=====================================================================-->
<interface name="blocking_func" role="server" signature="event.BlockingFunc" />
- <!-- Content -->
+ <!-- Implementation of the BootstrapHttpSrv component -->
<content class="BootstrapHttpSrv" language="thinkMC" />
</definition>
\ No newline at end of file
--- sandbox/cecilia-lib-event/http_server/src/main/cecilia/BootstrapHttpSrvOneSchedulerPerStage.c 2008-05-28 14:58:07 UTC (rev 7808)
+++ sandbox/cecilia-lib-event/http_server/src/main/cecilia/BootstrapHttpSrvOneSchedulerPerStage.c 2008-05-29 09:30:00 UTC (rev 7809)
@@ -56,7 +56,6 @@
int METHOD(boot , main)(void *_this, int argc, char *argv[]) {
printf("------------------------HTTP Server----------------------------------\n");
- //printf("Bootstrap--> launching TCP and HTTP stages...\n");
int opt;
@@ -68,8 +67,7 @@
jboolean bypassCache = DEFAULT_BYPASSCACHE;
int acceptLimit = DEFAULT_ACCEPT_LIMIT;
-
-
+ //Parsing arguments
while ((opt = getopt(argc, argv, "hp:d:f:b:n:c:a:")) != -1) {
switch (opt) {
case 'p':
@@ -117,32 +115,27 @@
pthread_mutex_init(&DATA.blocking_mutex, NULL);
pthread_cond_init(&DATA.blocking_cond, NULL);
-
+ //Set configuration for the tcp stage
CALL(REQUIRED.runtcp, boot, listenAddr, port, backlog, nbMaxConnections, acceptLimit);
-
+ //Set the current working directory for the http stage
CALL(REQUIRED.runhttp, boot, defDir, bypassCache);
-
//Start TCP scheduler
CALL(REQUIRED.startTCPScheduler,start,GET_MY_INTERFACE(blocking_func));
//Start HTTP scheduler
CALL(REQUIRED.startHTTPScheduler,start,GET_MY_INTERFACE(blocking_func));
-
-
-
printf("----------------------------------------------------------------\n");
printf("running...\n");
-
+ //Blocks here and lets the application do its job.
CALLMINE(blocking_func,block);
//unreachable code.
-
return fractal_api_ErrorConst_OK;
}
--- sandbox/cecilia-lib-event/http_server/src/main/cecilia/BootstrapHttpSrvOneSchedulerPerStage.fractal 2008-05-28 14:58:07 UTC (rev 7808)
+++ sandbox/cecilia-lib-event/http_server/src/main/cecilia/BootstrapHttpSrvOneSchedulerPerStage.fractal 2008-05-29 09:30:00 UTC (rev 7809)
@@ -2,27 +2,49 @@
<!DOCTYPE definition PUBLIC "-//objectweb.org//DTD Fractal ADL 2.0//EN"
"classpath://org/objectweb/fractal/cecilia/adl/parser/xml/cecilia.dtd">
+<!--=========================================================================-->
+<!-- BootstrapHttpSrvOneSchedulerPerStage : The bootstrap component of -->
+<!-- the httpServer -->
+<!-- -->
+<!-- It boots the two stages and the two schedulers -->
+<!-- This component also parses program arguments passed in parameters -->
+<!--=========================================================================-->
-<!--
- *
- *
- *
--->
-
<definition name="BootstrapHttpSrvOneSchedulerPerStage">
- <!-- Interfaces -->
+ <!--=====================================================================-->
+ <!-- boot interface to start the server -->
+ <!--=====================================================================-->
<interface name="boot" signature="boot.api.Main" role="server" />
+
+ <!--=====================================================================-->
+ <!-- runtcp interface to boot the TCP stage -->
+ <!--=====================================================================-->
<interface name="runtcp" signature="stages.Tcp.BootstrapTcp" role="client" />
+
+ <!--=====================================================================-->
+ <!-- runhttp interface to boot the HTTP stage -->
+ <!--=====================================================================-->
<interface name="runhttp" signature="stages.Http.BootstrapHttp" role="client" />
+ <!--=====================================================================-->
+ <!-- startTCPScheduler interface to start the tcp scheduler -->
+ <!--=====================================================================-->
<interface name="startTCPScheduler" signature="event.Scheduler" role="client" />
+
+ <!--=====================================================================-->
+ <!-- startHTTPScheduler interface to start the http scheduler -->
+ <!--=====================================================================-->
<interface name="startHTTPScheduler" signature="event.Scheduler" role="client" />
+ <!--=====================================================================-->
+ <!-- blocking_func interface used to synchronized the bootstrap and the -->
+ <!-- scheduler -->
+ <!--=====================================================================-->
<interface name="blocking_func" role="server" signature="event.BlockingFunc" />
- <!-- Content -->
+ <!-- Implementation of the BootstrapHttpSrvOneSchedulerPerStage component -->
<content class="BootstrapHttpSrvOneSchedulerPerStage" language="thinkMC" />
</definition>
\ No newline at end of file
--- sandbox/cecilia-lib-event/http_server/src/main/cecilia/BufferManager/BufferMgr.fractal 2008-05-28 14:58:07 UTC (rev 7808)
+++ sandbox/cecilia-lib-event/http_server/src/main/cecilia/BufferManager/BufferMgr.fractal 2008-05-29 09:30:00 UTC (rev 7809)
@@ -2,30 +2,45 @@
<!DOCTYPE definition PUBLIC "-//objectweb.org//DTD Fractal ADL 2.0//EN"
"classpath://org/objectweb/fractal/cecilia/adl/parser/xml/cecilia.dtd">
-<!--
- *
- * BufferManager
- *
--->
+<!--=========================================================================-->
+<!-- BufferManager.BufferMgr : -->
+<!-- -->
+<!--=========================================================================-->
-<definition name="BufferManager.BufferMgr" arguments="nbBufferTables,nbBuffersPerTable,bufferSize">
-
- <!-- Interfaces -->
- <interface name="bufferMgr" signature="BufferManager.BufferMgr" role="server"/>
- <interface name="lifecycle-controller" signature="fractal.api.LifeCycleController" role="server"/>
- <interface name="allocator" signature="memory.api.Allocator" role="client" />
- <interface name="mutexMgr" signature="MutexManager.MutexManagement" role="client" />
-
- <!-- Content -->
+<definition name="BufferManager.BufferMgr"
+ arguments="nbBufferTables,nbBuffersPerTable,bufferSize">
+
+ <!--=====================================================================-->
+ <!-- bufferMgr interface -->
+ <!--=====================================================================-->
+ <interface name="bufferMgr" signature="BufferManager.BufferMgr" role="server" />
+
+ <!--=====================================================================-->
+ <!-- allocator interface -->
+ <!--=====================================================================-->
+ <interface name="allocator" signature="memory.api.Allocator" role="client" />
+
+ <!--=====================================================================-->
+ <!-- mutexMgr interface -->
+ <!--=====================================================================-->
+ <interface name="mutexMgr" signature="MutexManager.MutexManagement" role="client" />
+
+ <!--=====================================================================-->
+ <!-- lifecycle-controller interface -->
+ <!--=====================================================================-->
+ <interface name="lifecycle-controller" signature="fractal.api.LifeCycleController"
+ role="server" />
+
+ <!-- Implementation -->
<content class="BufferManager.BufferMgr" language="thinkMC">
<cflag value="-DDEBUG_LEVEL=0" />
<cflag value="-DDEBUG_INOUT_FUNC=0" />
</content>
-
+
<attributes signature="BufferManager.BufferMgrAttributes">
- <attribute name="nbBufferTables" value="${nbBufferTables}"/>
- <attribute name="nbBuffersPerTable" value="${nbBuffersPerTable}"/>
- <attribute name="bufferSize" value="${bufferSize}"/>
+ <attribute name="nbBufferTables" value="${nbBufferTables}" />
+ <attribute name="nbBuffersPerTable" value="${nbBuffersPerTable}" />
+ <attribute name="bufferSize" value="${bufferSize}" />
</attributes>
-
+
</definition>
\ No newline at end of file
--- sandbox/cecilia-lib-event/http_server/src/main/cecilia/BufferManager/SemiDynamicBufferMgr.fractal 2008-05-28 14:58:07 UTC (rev 7808)
+++ sandbox/cecilia-lib-event/http_server/src/main/cecilia/BufferManager/SemiDynamicBufferMgr.fractal 2008-05-29 09:30:00 UTC (rev 7809)
@@ -2,29 +2,44 @@
<!DOCTYPE definition PUBLIC "-//objectweb.org//DTD Fractal ADL 2.0//EN"
"classpath://org/objectweb/fractal/cecilia/adl/parser/xml/cecilia.dtd">
-<!--
- *
- * Semi Dynamic BufferManager
- *
--->
+<!--=========================================================================-->
+<!-- BufferManager.SemiDynamicBufferMgr : a buffer manager with a half of -->
+<!-- buffer preallocated and another half that will be allocated when needed-->
+<!-- -->
+<!--=========================================================================-->
<definition name="BufferManager.SemiDynamicBufferMgr" arguments="nbBuffers,bufferSize">
-
- <!-- Interfaces -->
- <interface name="bufferMgr" signature="BufferManager.BufferMgr" role="server"/>
- <interface name="lifecycle-controller" signature="fractal.api.LifeCycleController" role="server"/>
- <interface name="allocator" signature="memory.api.Allocator" role="client" />
- <interface name="mutexMgr" signature="MutexManager.MutexManagement" role="client" />
-
- <!-- Content -->
+
+ <!--=====================================================================-->
+ <!-- bufferMgr interface -->
+ <!--=====================================================================-->
+ <interface name="bufferMgr" signature="BufferManager.BufferMgr" role="server" />
+
+ <!--=====================================================================-->
+ <!-- allocator interface -->
+ <!--=====================================================================-->
+ <interface name="allocator" signature="memory.api.Allocator" role="client" />
+
+ <!--=====================================================================-->
+ <!-- mutexMgr interface -->
+ <!--=====================================================================-->
+ <interface name="mutexMgr" signature="MutexManager.MutexManagement" role="client" />
+
+ <!--=====================================================================-->
+ <!-- lifecycle-controller interface -->
+ <!--=====================================================================-->
+ <interface name="lifecycle-controller" signature="fractal.api.LifeCycleController"
+ role="server" />
+
+ <!-- Implementation -->
<content class="BufferManager.SemiDynamicBufferMgr" language="thinkMC">
<cflag value="-DDEBUG_LEVEL=0" />
<cflag value="-DDEBUG_INOUT_FUNC=0" />
</content>
-
+
<attributes signature="BufferManager.SemiDynamicBufferMgrAttributes">
- <attribute name="nbBuffers" value="${nbBuffers}"/>
- <attribute name="bufferSize" value="${bufferSize}"/>
+ <attribute name="nbBuffers" value="${nbBuffers}" />
+ <attribute name="bufferSize" value="${bufferSize}" />
</attributes>
-
+
</definition>
\ No newline at end of file
--- sandbox/cecilia-lib-event/http_server/src/main/cecilia/FileIOWrapper/FileIO.fractal 2008-05-28 14:58:07 UTC (rev 7808)
+++ sandbox/cecilia-lib-event/http_server/src/main/cecilia/FileIOWrapper/FileIO.fractal 2008-05-29 09:30:00 UTC (rev 7809)
@@ -2,9 +2,16 @@
<!DOCTYPE definition PUBLIC "-//objectweb.org//DTD Fractal ADL 2.0//EN"
"classpath://org/objectweb/fractal/cecilia/adl/parser/xml/cecilia.dtd">
+<!--=========================================================================-->
+<!-- unix.FileIOWrapper.FileIO : abstract File I/O component -->
+<!-- -->
+<!--=========================================================================-->
+
<definition name="FileIOWrapper.FileIO">
- <!-- Interfaces -->
+ <!--=====================================================================-->
+ <!-- fileIO interface -->
+ <!--=====================================================================-->
<interface name="fileIO" signature="FileIOWrapper.FileIO" role="server"/>
</definition>
\ No newline at end of file
--- sandbox/cecilia-lib-event/http_server/src/main/cecilia/HttpKernel.fractal 2008-05-28 14:58:07 UTC (rev 7808)
+++ sandbox/cecilia-lib-event/http_server/src/main/cecilia/HttpKernel.fractal 2008-05-29 09:30:00 UTC (rev 7809)
@@ -2,46 +2,81 @@
<!DOCTYPE definition PUBLIC "-//objectweb.org//DTD Fractal ADL 2.0//EN"
"classpath://org/objectweb/fractal/cecilia/adl/parser/xml/cecilia.dtd">
-<!--
-* HttpServer : a stage-based webserver designed for high performance
-* and scalability
--->
+<!--=========================================================================-->
+<!-- HttpKernel : abstract stage-based webserver designed for high -->
+<!-- performance and scalability -->
+<!-- -->
+<!-- NOTE: This HttpKernel is an abstract component because it is NOT -->
+<!-- architecture specific (except schedulers for wiring reasons). -->
+<!-- See a linux full implementation in ./unix/HttpKernel.fractal. -->
+<!-- -->
+<!-- This ADL defines a composite component 'HttpKernel' containing -->
+<!-- a httpServer component and low level components ( allocator, -->
+<!-- networkWrapper, mutexManager, fileIOWrapper) required by this -->
+<!-- httpServer. -->
+<!--=========================================================================-->
<definition name="HttpKernel">
-
- <!-- Interface -->
- <interface name="main" signature="boot.api.Main" role="server"/>
-
- <!-- components -->
+
+ <!--=====================================================================-->
+ <!-- 'main' interface. The entry point of the HttpServer application -->
+ <!--=====================================================================-->
+ <interface name="main" signature="boot.api.Main" role="server" />
+
+ <!--=====================================================================-->
+ <!-- The abstract allocator sub-component -->
+ <!--=====================================================================-->
<component name="allocator" definition="memory.AllocatorType" />
- <component name="networkWrapper" definition="NetworkWrapper.NetworkIO"/>
- <component name="mutexManager" definition="MutexManager.MutexManager"/>
- <component name="fileIOWrapper" definition="FileIOWrapper.FileIO"/>
+ <!--=====================================================================-->
+ <!-- The abstract networkWrapper sub-component -->
+ <!--=====================================================================-->
+ <component name="networkWrapper" definition="NetworkWrapper.NetworkIO" />
- <!-- UNCOMMENT THE CONFIGURATION YOU WANT :-->
-
+ <!--=====================================================================-->
+ <!-- The abstract mutexManager sub-component -->
+ <!--=====================================================================-->
+ <component name="mutexManager" definition="MutexManager.MutexManager" />
+
+ <!--=====================================================================-->
+ <!-- The abstract fileIOWrapper sub-component -->
+ <!--=====================================================================-->
+ <component name="fileIOWrapper" definition="FileIOWrapper.FileIO" />
+
+
+ <!--=====================================================================-->
+ <!-- The httpServer applicative sub-component : -->
+ <!-- -->
+ <!-- There are two versions of this component: -->
+ <!-- - one with a global scheduler with 3 threads for all stages -->
+ <!-- - one with a scheduler for the TCP stage and a scheduler -->
+ <!-- for the httpStage -->
+ <!-- -->
+ <!-- UNCOMMENT THE CONFIGURATION YOU WANT -->
+ <!--=====================================================================-->
<!-- HttpServer with a global scheduler for all stage. -->
- <component name="httpServer" definition="HttpServer(3)" />
-
+ <component name="httpServer" definition="HttpServer(3)" />
+
<!-- HttpServer with two schedulers, one for the TCP_stage, one for the HTTP_stage. -->
<!-- <component name="httpServer" definition="HttpServerOneSchedulerPer