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 |
|
Creates a new instance of ServiceMediatorImpl. Istanzia tutte le Classi necessarie per fornire il Service.
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 }
|
|
Creates a new instance of ServiceMediatorImpl. Istanzia tutte le Classi necessarie per fornire il Service.
Definizione alla linea 89 del file ServiceMediatorImpl.java.
|
|
Esegui il Servizio.
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: ![]() |
|
Esegui il Servizio. Questo metodo e' identico a "executeService", con l'unica differenza che serializza il risultato dell'esecuzione in una stringa.
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: ![]() |
|
Definizione alla linea 39 del file ServiceMediatorImpl.java. Referenziato da org.jaebi.server.service.ServiceMediatorImpl.ServiceMediatorImpl(). |
|
Definizione alla linea 42 del file ServiceMediatorImpl.java. Referenziato da org.jaebi.server.service.ServiceMediatorImpl.executeService(), e org.jaebi.server.service.ServiceMediatorImpl.ServiceMediatorImpl(). |
|
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(). |
|
Definizione alla linea 46 del file ServiceMediatorImpl.java. Referenziato da org.jaebi.server.service.ServiceMediatorImpl.executeService(), e org.jaebi.server.service.ServiceMediatorImpl.ServiceMediatorImpl(). |
|
Definizione alla linea 40 del file ServiceMediatorImpl.java. Referenziato da org.jaebi.server.service.ServiceMediatorImpl.executeService(), e org.jaebi.server.service.ServiceMediatorImpl.ServiceMediatorImpl(). |
|
Definizione alla linea 43 del file ServiceMediatorImpl.java. Referenziato da org.jaebi.server.service.ServiceMediatorImpl.executeService(), e org.jaebi.server.service.ServiceMediatorImpl.ServiceMediatorImpl(). |
|
Definizione alla linea 41 del file ServiceMediatorImpl.java. Referenziato da org.jaebi.server.service.ServiceMediatorImpl.executeServiceToString(), e org.jaebi.server.service.ServiceMediatorImpl.ServiceMediatorImpl(). |