submarine.connectors.jdbc
Class JDBCPooler

java.lang.Object
  |
  +--submarine.connectors.jdbc.JDBCPooler
All Implemented Interfaces:
PoolingFunction, PoolingFunctionWithContext, SubmiterAware, XMLConfigurable

public class JDBCPooler
extends java.lang.Object
implements PoolingFunctionWithContext, SubmiterAware


Field Summary
private  org.w3c.dom.Element afterSubmit
           
private  JDBCBatch current
           
private  org.w3c.dom.Document current_doc
           
private  java.util.List current_nodes
           
private  int current_pos
           
private  long frequency
           
private  org.w3c.dom.Element request
           
private  JDBCRessource ressource
           
private  RouteInfos route
           
private  int submitCount
           
private  Submiter submiter
           
private  java.lang.String submitPath
           
 
Constructor Summary
JDBCPooler()
          Constructor for JDBCPooler.
 
Method Summary
 long getFrequency()
          Fournit La durée pendant laquelle l'EAIsystem doit attendre avant de renouveller les appels.
 java.lang.Object getNextDocument()
          Retourne le document suivant de la liste initialisé lors de l'appel à hasNewDocument().
L'implémentation de cette méthode ne doit pas être bloquante.
 java.lang.Object getNextDocument(Message.MsgContext context)
          Same logic than getNextDocument() but receive as parameter a MsgContext that can be changed.
 RouteInfos getRouteInfos()
          Fournit les informations de routage pour le dernier document lu par getNextDocument.
 boolean hasNewDocument()
          La PoolingFunction a-elle de nouveaux documents à soumettre au Systeme EAI ?
 void init(org.w3c.dom.Element xml)
           
 void notifyResponse(java.lang.Object doc, java.lang.Object response, boolean ok)
          Notifie la PoolingFunction que la soumission de l'objet doc a eu lieu et que la réponse est response.
 void setSubmiter(Submiter s)
           
 
Methods inherited from class java.lang.Object
, clone, equals, finalize, getClass, hashCode, notify, notifyAll, registerNatives, toString, wait, wait, wait
 

Field Detail

ressource

private JDBCRessource ressource

request

private org.w3c.dom.Element request

afterSubmit

private org.w3c.dom.Element afterSubmit

frequency

private long frequency

route

private RouteInfos route

submitPath

private java.lang.String submitPath

submitCount

private int submitCount

current_doc

private org.w3c.dom.Document current_doc

current

private JDBCBatch current

current_nodes

private java.util.List current_nodes

current_pos

private int current_pos

submiter

private Submiter submiter
Constructor Detail

JDBCPooler

public JDBCPooler()
Constructor for JDBCPooler.
Method Detail

setSubmiter

public void setSubmiter(Submiter s)
Specified by:
setSubmiter in interface SubmiterAware
Following copied from interface: submarine.core.SubmiterAware
Parameters:
s -  

hasNewDocument

public boolean hasNewDocument()
Description copied from interface: PoolingFunction
La PoolingFunction a-elle de nouveaux documents à soumettre au Systeme EAI ?
Appelée après chaque réveil de la PoolingFunction, l'implémentation de cette méthode doit permettre de vérifier auprès du tiers si des documents sont disponibles.
Specified by:
hasNewDocument in interface PoolingFunction
Following copied from interface: submarine.core.PoolingFunction
Returns:
boolean Retourne Vrai si et seulement si au moins un appel à getNextDocument() ne retournera pas null.

getNextDocument

public java.lang.Object getNextDocument()
                                 throws java.lang.Exception
Description copied from interface: PoolingFunction
Retourne le document suivant de la liste initialisé lors de l'appel à hasNewDocument().
L'implémentation de cette méthode ne doit pas être bloquante.
Specified by:
getNextDocument in interface PoolingFunction
Following copied from interface: submarine.core.PoolingFunction
Returns:
java.lang.Object Retourne le nouvel objet java représentant le message. Retourne null si le dernier message a déjà été lu.
Throws:
java.lang.Exception - Si une exception est levée lors de l'exécution de cette méthode, le processus d'interrogation s'interrompt.

getNextDocument

public java.lang.Object getNextDocument(Message.MsgContext context)
                                 throws java.lang.Exception
Description copied from interface: PoolingFunctionWithContext
Same logic than PoolingFunction.getNextDocument() but receive as parameter a MsgContext that can be changed.
Specified by:
getNextDocument in interface PoolingFunctionWithContext

notifyResponse

public void notifyResponse(java.lang.Object doc,
                           java.lang.Object response,
                           boolean ok)
Description copied from interface: PoolingFunction
Notifie la PoolingFunction que la soumission de l'objet doc a eu lieu et que la réponse est response.
Le paramètre ok, indique si une erreur s'est produite lors le la soumission du message.
Specified by:
notifyResponse in interface PoolingFunction
Following copied from interface: submarine.core.PoolingFunction
Parameters:
doc - L'objet Java ayant été retourné par le précedent appel à getNextDocument.
response - La réponse de la soumission du message au Systeme EAI. Voir EAISystem.submit(java.lang.Object, submarine.core.RouteInfos, submarine.core.Message.MsgContext).
ok - Vrai si la soumission s'est passée sans erreur, et faut si une exception s'est produite. Si la soumission était asynchrone, ok n'indique pas si le traitement du message s'est bien passé mais seulement qu'il a bien été inséré dans la file d'attente.

getFrequency

public long getFrequency()
Description copied from interface: PoolingFunction
Fournit La durée pendant laquelle l'EAIsystem doit attendre avant de renouveller les appels.
Cette fréquence peut être fixe ou bien variable selon le besoin du connecteur.
Specified by:
getFrequency in interface PoolingFunction
Following copied from interface: submarine.core.PoolingFunction
Returns:
long La durée pendant laquelle l'EAISystem va attendre en millisecondes.

getRouteInfos

public RouteInfos getRouteInfos()
Description copied from interface: PoolingFunction
Fournit les informations de routage pour le dernier document lu par getNextDocument.
Ces informations peuvent être systématiquement identique, dans ce cas, la même instance de RouteInfos peut être utilisée. Si ces informations dépendent du message (routage en fonction du contenu), une instance spécifique devra être fournie.
Specified by:
getRouteInfos in interface PoolingFunction
Following copied from interface: submarine.core.PoolingFunction
Returns:
submarine.core.RouteInfos Les informations de routage.

init

public void init(org.w3c.dom.Element xml)
          throws java.lang.Exception
Specified by:
init in interface XMLConfigurable
See Also:
MyRessource update Données set statut='X' where statut is null select * from Données where statut ='X' insert into LOG (dt, texte) values (SYSDATE,'maj de la ligne ') update Données set statut='T' where statut='X' update Données set statut='T' where id=

Submarine project. free distribution of this software must include the opensource licence.
Guénolé de Cadoudal.