[Csmail-patches] CVS: csmail/src/CSMail ChangeLog,1.24,1.25 Session.cs,1.14,1.15
Status: Pre-Alpha
Brought to you by:
mastergaurav
From: Gaurav V. <mas...@us...> - 2002-09-03 12:49:52
|
Update of /cvsroot/csmail/csmail/src/CSMail In directory usw-pr-cvs1:/tmp/cvs-serv29235 Modified Files: ChangeLog Session.cs Log Message: 2002-09-03 * Session.cs : GetStore, GetTransport - Completed : GetServiceInstance(...) - Stubbed Index: ChangeLog =================================================================== RCS file: /cvsroot/csmail/csmail/src/CSMail/ChangeLog,v retrieving revision 1.24 retrieving revision 1.25 diff -u -r1.24 -r1.25 --- ChangeLog 3 Sep 2002 12:38:45 -0000 1.24 +++ ChangeLog 3 Sep 2002 12:49:49 -0000 1.25 @@ -1,6 +1,11 @@ 2002-09-03 Gaurav Vaish <mastergaurav AT users DOT sf DOT net> + * Session.cs : GetStore, GetTransport - Completed + : GetServiceInstance(...) - Stubbed + +2002-09-03 Gaurav Vaish <mastergaurav AT users DOT sf DOT net> + * Service.cs : Connect(...) - Implemented : Connect / Close - Marked "virtual" : GetHostAndProto(...) Index: Session.cs =================================================================== RCS file: /cvsroot/csmail/csmail/src/CSMail/Session.cs,v retrieving revision 1.14 retrieving revision 1.15 diff -u -r1.14 -r1.15 --- Session.cs 3 Sep 2002 12:38:45 -0000 1.14 +++ Session.cs 3 Sep 2002 12:49:49 -0000 1.15 @@ -72,14 +72,13 @@ return GetStore(null, provider); } - [MailTODO] private Store GetStore(URLName url, Provider provider) { if(provider == null || provider.ProviderType != ProviderType.Store) { throw new NoSuchProviderException("Invalid provider"); } - throw new NotImplementedException(); + return (Store)GetServiceInstance(url, provider); } public Transport GetTransport() @@ -103,14 +102,27 @@ return GetTransport(null, provider); } - [MailTODO] private Transport GetTransport(URLName url, Provider provider) { if(provider == null || provider.ProviderType != ProviderType.Transport) { throw new NoSuchProviderException("Invalid provider"); } + return (Transport)GetServiceInstance(url, provider); + } + + [MailTODO] + private object GetServiceInstance(URLName url, Provider provider) + { throw new NotImplementedException(); + /** + * First, try to load using "Assembly.Load", + * and if you are unable to do so (during testing) + * then use only and only "Assembly.LoadFrom", + * create instance of the object with canonical name + * as that of value of "Provider.ClassName" + * If even that fails, then throw an exception + */ } private Session(Properties properties, Authenticator authenticator) |