Riferimenti per la classe org.jaebi.server.service.ServiceMediatorImpl

Diagramma delle classi per org.jaebi.server.service.ServiceMediatorImpl

Inheritance graph
[legenda]
Diagramma di collaborazione per org.jaebi.server.service.ServiceMediatorImpl:

Collaboration graph
[legenda]
Lista di tutti i membri.

Descrizione Dettagliata

Autore:
detro
Implementazione dell'Interfaccia Service Mediator. Abbiamo aggiunto un paio di overloading del metodo "executeService" per comodita'.

Questa Interfaccia e una "proposta" al programmatore Client: puo' anche essere ignorata, utilizzando le Classi del Package Service autonomamente.

Definizione alla linea 38 del file ServiceMediatorImpl.java.

Membri pubblici

 ServiceMediatorImpl (String backEndPropertiesFilePath) throws ServiceMediatorInitException
 Creates a new instance of ServiceMediatorImpl.
 ServiceMediatorImpl () throws ServiceMediatorInitException
 Creates a new instance of ServiceMediatorImpl.
Object executeService (User user, Object request) throws ServiceMediatorExecException
 Esegui il Servizio.
String executeServiceToString (User user, Object request) throws ServiceMediatorExecException
 Esegui il Servizio.

Attributi privati

final BackEndHandler backEndHandler
final CommandValidator validator

Attributi privati statici

static JAXBMarshallerWrapper xrequestMarshWrap
static JAXBMarshallerWrapper xresponseMarshWrap
static XRequestCommandFactory commFactory
static JAXBXResponseFactory xresponseFactory
static final String exceptionPrefix


Documentazione dei costruttori e dei distruttori

org.jaebi.server.service.ServiceMediatorImpl.ServiceMediatorImpl String  backEndPropertiesFilePath  )  throws ServiceMediatorInitException
 

Creates a new instance of ServiceMediatorImpl.

Istanzia tutte le Classi necessarie per fornire il Service.

Parametri:
backEndPropertiesFilePath File Path al file di configurazione del BackEndHandler
Eccezioni:
ServiceMediatorInitException Errore durante l'inizializzazione

Definizione alla linea 57 del file ServiceMediatorImpl.java.

Riferimenti org.jaebi.server.service.ServiceMediatorImpl.backEndHandler, org.jaebi.server.service.ServiceMediatorImpl.commFactory, org.jaebi.server.service.ServiceMediatorImpl.exceptionPrefix, org.jaebi.server.service.ServiceMediatorImpl.validator, org.jaebi.server.service.ServiceMediatorImpl.xrequestMarshWrap, org.jaebi.server.service.ServiceMediatorImpl.xresponseFactory, e org.jaebi.server.service.ServiceMediatorImpl.xresponseMarshWrap.

00058                                             {
00059         
00060                 validator = new XRequestCommandValidator();
00061                 
00062                 try {
00063                         backEndHandler = new BackEndHandlerImpl(backEndPropertiesFilePath);
00064                         xrequestMarshWrap = new JAXBMarshallerWrapperImpl(
00065                                         "org.jaebi.server.service.xml.xrequest");
00066                         xresponseMarshWrap = new JAXBMarshallerWrapperImpl(
00067                                         "org.jaebi.server.service.xml.xresponse");
00068                         commFactory = new XRequestCommandFactory(backEndHandler);
00069                         xresponseFactory = new JAXBXResponseFactory();
00070                 } catch ( BackEndHandlerInitException behie ) {
00071                     throw new ServiceMediatorInitException( exceptionPrefix 
00072                             + behie );
00073                 } catch ( JAXBMarshallerWrapperInitException jmarinite) {
00074                     throw new ServiceMediatorInitException( exceptionPrefix 
00075                             + jmarinite );
00076                 } catch ( XRequestCommandFactoryInitException xreqinite) {
00077                     throw new ServiceMediatorInitException( exceptionPrefix 
00078                             + xreqinite );
00079                 }
00080     }

org.jaebi.server.service.ServiceMediatorImpl.ServiceMediatorImpl  )  throws ServiceMediatorInitException
 

Creates a new instance of ServiceMediatorImpl.

Istanzia tutte le Classi necessarie per fornire il Service.

Eccezioni:
ServiceMediatorInitException Errore durante l'inizializzazione

Definizione alla linea 89 del file ServiceMediatorImpl.java.

00090                                                     {
00091                 
00092                 this("BackEndHandlerImpl.properties");
00093         }


Documentazione delle funzioni membro

Object org.jaebi.server.service.ServiceMediatorImpl.executeService User  user,
Object  request
throws ServiceMediatorExecException
 

Esegui il Servizio.

Parametri:
user User che richiede l'uso del Service
request Definisce una richiesta
Restituisce:
Risultato prodotto dal Service
Eccezioni:
ServiceMediatorExecException Errore durante l'esecuzione

Implementa org.jaebi.server.service.ServiceMediator.

Definizione alla linea 95 del file ServiceMediatorImpl.java.

Riferimenti org.jaebi.server.service.xml.JAXBXResponseFactory.buildXresponse(), org.jaebi.server.service.ServiceMediatorImpl.commFactory, org.jaebi.server.service.XRequestCommandFactory.createCommand(), org.jaebi.server.service.ServiceMediatorImpl.exceptionPrefix, org.jaebi.server.service.XRequestCommand.execute(), org.jaebi.server.service.xml.JAXBMarshallerWrapper.unmarshall(), org.jaebi.server.service.CommandValidator.validate(), org.jaebi.server.service.ServiceMediatorImpl.validator, org.jaebi.server.service.ServiceMediatorImpl.xrequestMarshWrap, e org.jaebi.server.service.ServiceMediatorImpl.xresponseFactory.

Referenziato da org.jaebi.server.service.ServiceMediatorImpl.executeServiceToString(), e org.jaebi.test.server.service.MainTestServiceMediatorImpl.main().

00096                                             {
00097         
00098         Xrequest newReq = null;
00099         XRequestCommand newCommand = null;
00100         Xresponse newRes = null;
00101         
00102         /* Controlla il tipo in INPUT e, se si tratta di String, 
00103          * esegue l'unmarshalling in un Oggetto di tipo Xrequest */
00104         if ( request instanceof String ) {
00105             try {
00106                 newReq = (Xrequest)xrequestMarshWrap.unmarshall(
00107                         (String)request);
00108             } catch ( JAXBMarshallerWrapperUnmarshallException unmarshe ) {
00109                 throw new ServiceMediatorExecException( exceptionPrefix 
00110                         + unmarshe );
00111             }
00112         } else {
00113             newReq = (Xrequest)request;
00114         }
00115         
00116         /* Creazione nuovo XRequestCommand */
00117         try {
00118             newCommand = commFactory.createCommand(newReq);
00119         } catch ( CommandCreationException cce) { 
00120             throw new ServiceMediatorExecException( exceptionPrefix + cce );
00121         }
00122                 
00123                 /* Validazione Command */
00124                 if ( validator.validate(user, newCommand) ) {
00125                         /* Esecuzione dell'XRequestCommand */
00126                         try {
00127                             newRes = (Xresponse)newCommand.execute();
00128                         } catch ( CommandExecException cee ) {
00129                             throw new ServiceMediatorExecException( exceptionPrefix + cee );
00130                         }
00131                 } else {
00132                         /* Creazione Xresponse di errore per mancata Validazione */
00133                         String errMessage = "This is not a Valid Request for this User.";
00134                         try {
00135                                 newRes = (Xresponse)xresponseFactory.buildXresponse(false, errMessage );
00136                         } catch (JAXBXResponseFactoryBuildingException e) {
00137                                 throw new ServiceMediatorExecException( exceptionPrefix + e );
00138                         }
00139                 }
00140                 
00141                 return newRes;
00142     }

Questo è il grafo delle chiamate per questa funzione:

String org.jaebi.server.service.ServiceMediatorImpl.executeServiceToString User  user,
Object  request
throws ServiceMediatorExecException
 

Esegui il Servizio.

Questo metodo e' identico a "executeService", con l'unica differenza che serializza il risultato dell'esecuzione in una stringa.

Parametri:
user User che richiede l'uso del Service
request Definisce una richiesta
Restituisce:
Risultato prodotto dal Service
Eccezioni:
ServiceMediatorExecException Errore durante l'esecuzione

Implementa org.jaebi.server.service.ServiceMediator.

Definizione alla linea 144 del file ServiceMediatorImpl.java.

Riferimenti org.jaebi.server.service.ServiceMediatorImpl.exceptionPrefix, org.jaebi.server.service.ServiceMediatorImpl.executeService(), org.jaebi.server.service.xml.JAXBMarshallerWrapper.marshall(), e org.jaebi.server.service.ServiceMediatorImpl.xresponseMarshWrap.

00145                                             {
00146         
00147         Xresponse xresponseResult = null;
00148         String result = null;
00149         
00150         try {
00151             xresponseResult = (Xresponse)executeService(user, request);
00152             // xresponseMarshWrap.setFormattedMarshalling(true); //TODO Da problemi di parsing al client J2ME
00153             result = xresponseMarshWrap.marshall(xresponseResult);
00154         } catch ( ServiceMediatorExecException smee ) {
00155             throw new ServiceMediatorExecException( exceptionPrefix 
00156                         + smee );
00157         } catch ( JAXBMarshallerWrapperMarshallException marshe ) {
00158                 throw new ServiceMediatorExecException( exceptionPrefix 
00159                         + marshe );
00160         }
00161         
00162         return result;
00163     }

Questo è il grafo delle chiamate per questa funzione:


Documentazione dei dati membri

final BackEndHandler org.jaebi.server.service.ServiceMediatorImpl.backEndHandler [private]
 

Definizione alla linea 39 del file ServiceMediatorImpl.java.

Referenziato da org.jaebi.server.service.ServiceMediatorImpl.ServiceMediatorImpl().

XRequestCommandFactory org.jaebi.server.service.ServiceMediatorImpl.commFactory [static, private]
 

Definizione alla linea 42 del file ServiceMediatorImpl.java.

Referenziato da org.jaebi.server.service.ServiceMediatorImpl.executeService(), e org.jaebi.server.service.ServiceMediatorImpl.ServiceMediatorImpl().

final String org.jaebi.server.service.ServiceMediatorImpl.exceptionPrefix [static, private]
 

Valore iniziale:

 
                "[ServiceMediatorImpl Exception]: "

Definizione alla linea 44 del file ServiceMediatorImpl.java.

Referenziato da org.jaebi.server.service.ServiceMediatorImpl.executeService(), org.jaebi.server.service.ServiceMediatorImpl.executeServiceToString(), e org.jaebi.server.service.ServiceMediatorImpl.ServiceMediatorImpl().

final CommandValidator org.jaebi.server.service.ServiceMediatorImpl.validator [private]
 

Definizione alla linea 46 del file ServiceMediatorImpl.java.

Referenziato da org.jaebi.server.service.ServiceMediatorImpl.executeService(), e org.jaebi.server.service.ServiceMediatorImpl.ServiceMediatorImpl().

JAXBMarshallerWrapper org.jaebi.server.service.ServiceMediatorImpl.xrequestMarshWrap [static, private]
 

Definizione alla linea 40 del file ServiceMediatorImpl.java.

Referenziato da org.jaebi.server.service.ServiceMediatorImpl.executeService(), e org.jaebi.server.service.ServiceMediatorImpl.ServiceMediatorImpl().

JAXBXResponseFactory org.jaebi.server.service.ServiceMediatorImpl.xresponseFactory [static, private]
 

Definizione alla linea 43 del file ServiceMediatorImpl.java.

Referenziato da org.jaebi.server.service.ServiceMediatorImpl.executeService(), e org.jaebi.server.service.ServiceMediatorImpl.ServiceMediatorImpl().

JAXBMarshallerWrapper org.jaebi.server.service.ServiceMediatorImpl.xresponseMarshWrap [static, private]
 

Definizione alla linea 41 del file ServiceMediatorImpl.java.

Referenziato da org.jaebi.server.service.ServiceMediatorImpl.executeServiceToString(), e org.jaebi.server.service.ServiceMediatorImpl.ServiceMediatorImpl().


La documentazione per questa classe è stata generata a partire dal seguente file:
Generato il Mon Jun 27 22:50:45 2005 per JAEBI - JAva Enterprice BackEnd Interfacement da  doxygen 1.4.3