Changeset 4701
- Timestamp:
- 06/12/08 16:45:02 (6 months ago)
- Files:
-
- trunk/nuxleus/Source/Dependencies/Scope/Scope/HandlerBase.cs (modified) (5 diffs)
- trunk/nuxleus/Source/Nuxleus.Extension.Aws.Sdb/Sdb/GetAttributesResponse.cs (modified) (3 diffs)
- trunk/nuxleus/Source/Nuxleus.Extension.Aws/Nuxleus.Extension.Aws.csproj (modified) (1 diff)
- trunk/nuxleus/Source/Nuxleus.Extension.Aws/SimpleDB/SimpleDBService.cs (modified) (2 diffs)
- trunk/nuxleus/Source/Nuxleus.Messaging/LoadBalancer/LoadBalancer.cs (modified) (1 diff)
- trunk/nuxleus/Source/nuXleus.sln (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/nuxleus/Source/Dependencies/Scope/Scope/HandlerBase.cs
r4696 r4701 4 4 using System.Text; 5 5 6 namespace VVMF.SOA.Common 7 { 8 public sealed class ScopeExceptionEventArg : EventArgs 9 { 6 namespace VVMF.SOA.Common { 7 public sealed class ScopeExceptionEventArg : EventArgs { 10 8 public Exception Exception { get; internal set; } 11 9 … … 13 11 } 14 12 15 public abstract class HandlerBase 16 { 17 public HandlerBase() 18 { 13 public abstract class HandlerBase { 14 public HandlerBase() { 19 15 scope = new Scope(ScopeMethod); 20 16 Enabled = true; 21 17 } 22 18 23 19 Scope scope; 24 20 25 public Scope Scope 26 { 21 public Scope Scope { 27 22 get { return scope; } 28 23 } 29 24 30 public static implicit operator Scope(HandlerBase handler) 31 {32 if (handler == null)return new Scope();25 public static implicit operator Scope(HandlerBase handler) { 26 if (handler == null) 27 return new Scope(); 33 28 return handler.scope; 34 29 } … … 44 39 public event EventHandler<ScopeExceptionEventArg> ScopeException; 45 40 46 Scope.Chain ScopeMethod(Scope.Chain code) 47 {48 if (inFlag || !Enabled)return (p) => { code(null); return null; };41 Scope.Chain ScopeMethod(Scope.Chain code) { 42 if (inFlag || !Enabled) 43 return (p) => { code(null); return null; }; 49 44 50 return (p) => 51 { 45 return (p) => { 52 46 inFlag = true; 53 try 54 { 47 try { 55 48 OnEnterScope(EventArgs.Empty); 56 49 this.code = code; 57 50 Call(); 58 } 59 finally 60 { 51 } finally { 61 52 OnLeaveScope(EventArgs.Empty); 62 53 inFlag = false; 63 54 } 64 return null; 55 return null; 65 56 }; 66 57 } … … 68 59 Scope.Chain code; 69 60 70 protected virtual void Call() 71 { 72 if (code != null) 73 { 74 try 75 { 61 protected virtual void Call() { 62 if (code != null) { 63 try { 76 64 code(null); 77 } 78 catch (Exception ex) 79 { 65 } catch (Exception ex) { 80 66 ScopeExceptionEventArg e = new ScopeExceptionEventArg { Exception = ex }; 81 67 OnScopeException(e); 82 if (!e.Handled) throw ex; 83 } 84 finally 85 { 68 if (!e.Handled) 69 throw ex; 70 } finally { 86 71 code = null; 87 72 } … … 89 74 } 90 75 91 protected virtual void OnEnterScope(EventArgs e) 92 { 76 protected virtual void OnEnterScope(EventArgs e) { 93 77 EventHandler handler = EnterScope; 94 if (handler != null) handler(this, e); 78 if (handler != null) 79 handler(this, e); 95 80 } 96 81 97 protected virtual void OnLeaveScope(EventArgs e) 98 { 82 protected virtual void OnLeaveScope(EventArgs e) { 99 83 EventHandler handler = LeaveScope; 100 if (handler != null) handler(this, e); 84 if (handler != null) 85 handler(this, e); 101 86 } 102 87 103 protected virtual void OnScopeException(ScopeExceptionEventArg e) 104 { 88 protected virtual void OnScopeException(ScopeExceptionEventArg e) { 105 89 EventHandler<ScopeExceptionEventArg> handler = ScopeException; 106 if (handler != null) handler(this, e); 90 if (handler != null) 91 handler(this, e); 107 92 } 108 93 } trunk/nuxleus/Source/Nuxleus.Extension.Aws.Sdb/Sdb/GetAttributesResponse.cs
r4487 r4701 15 15 using System.Xml; 16 16 17 namespace Nuxleus.Extension.Aws.Sdb 18 { 19 public class GetAttributesResponse : Response 20 { 17 namespace Nuxleus.Extension.Aws.Sdb { 18 public class GetAttributesResponse : Response { 21 19 private ArrayList attributes = new ArrayList(); 22 20 private string responseName = "GetAttributesResponse"; 23 21 24 public GetAttributesResponse (string response) 25 { 22 public GetAttributesResponse(string response) { 26 23 XmlDocument doc = new XmlDocument(); 27 24 doc.LoadXml(response); … … 31 28 processResponse(responseName, doc); 32 29 33 foreach (XmlNode node in doc.ChildNodes) 34 { 35 if (node.Name.Equals(responseName)) 36 { 37 foreach (XmlNode attributesNode in node.ChildNodes) 38 { 39 if (attributesNode.Name.Equals("Attribute")) 40 { 30 foreach (XmlNode node in doc.ChildNodes) { 31 if (node.Name.Equals(responseName)) { 32 foreach (XmlNode attributesNode in node.ChildNodes) { 33 if (attributesNode.Name.Equals("Attribute")) { 41 34 string name = ""; 42 35 string value = ""; 43 36 44 37 foreach (XmlNode attributeNode in 45 attributesNode.ChildNodes) 46 { 47 if (attributeNode.Name.Equals("Name")) 48 { 38 attributesNode.ChildNodes) { 39 if (attributeNode.Name.Equals("Name")) { 49 40 name = attributeNode.InnerText; 50 41 } 51 if (attributeNode.Name.Equals("Value")) 52 { 42 if (attributeNode.Name.Equals("Value")) { 53 43 value = attributeNode.InnerText; 54 44 } … … 62 52 } 63 53 64 public ICollection Attributes () 65 { 54 public ICollection Attributes() { 66 55 return attributes; 67 56 } trunk/nuxleus/Source/Nuxleus.Extension.Aws/Nuxleus.Extension.Aws.csproj
r4695 r4701 67 67 <DependentUpon>Settings.settings</DependentUpon> 68 68 </Compile> 69 <Compile Include="SimpleDB\Model\Attribute.cs" /> 70 <Compile Include="SimpleDB\Model\CreateDomain.cs" /> 71 <Compile Include="SimpleDB\Model\CreateDomainResponse.cs" /> 72 <Compile Include="SimpleDB\Model\DeleteAttributes.cs" /> 73 <Compile Include="SimpleDB\Model\DeleteAttributesResponse.cs" /> 74 <Compile Include="SimpleDB\Model\DeleteDomain.cs" /> 75 <Compile Include="SimpleDB\Model\DeleteDomainResponse.cs" /> 76 <Compile Include="SimpleDB\Model\Error.cs" /> 77 <Compile Include="SimpleDB\Model\ErrorResponse.cs" /> 78 <Compile Include="SimpleDB\Model\GetAttributes.cs" /> 79 <Compile Include="SimpleDB\Model\GetAttributesResponse.cs" /> 80 <Compile Include="SimpleDB\Model\GetAttributesResult.cs" /> 81 <Compile Include="SimpleDB\Model\ListDomains.cs" /> 82 <Compile Include="SimpleDB\Model\ListDomainsResponse.cs" /> 83 <Compile Include="SimpleDB\Model\ListDomainsResult.cs" /> 84 <Compile Include="SimpleDB\Model\PutAttributes.cs" /> 85 <Compile Include="SimpleDB\Model\PutAttributesResponse.cs" /> 86 <Compile Include="SimpleDB\Model\Query.cs" /> 87 <Compile Include="SimpleDB\Model\QueryResponse.cs" /> 88 <Compile Include="SimpleDB\Model\QueryResult.cs" /> 89 <Compile Include="SimpleDB\Model\ReplaceableAttribute.cs" /> 90 <Compile Include="SimpleDB\Model\ResponseMetadata.cs" /> 69 91 <Compile Include="SimpleDB\SdbAction.cs" /> 70 92 <Compile Include="SimpleDB\SimpleDBService.cs" /> trunk/nuxleus/Source/Nuxleus.Extension.Aws/SimpleDB/SimpleDBService.cs
r4699 r4701 162 162 request.Pipelined = true; 163 163 164 Console.WriteLine(" [] starting on thread: {0}", Thread.CurrentThread.ManagedThreadId);164 Console.WriteLine("Start Request: Thread is background: {0}, Thread ID: {1}, Thread is managed: {2}", Thread.CurrentThread.IsBackground, Thread.CurrentThread.ManagedThreadId, Thread.CurrentThread.IsThreadPoolThread); 165 165 166 166 using (Stream newStream = request.GetRequestStream()) { … … 176 176 } 177 177 178 Console.WriteLine(" Current thread id: {0}", Thread.CurrentThread.ManagedThreadId);178 Console.WriteLine("End Request: Thread is background: {0}, Thread ID: {1}, Thread is managed: {2}", Thread.CurrentThread.IsBackground, Thread.CurrentThread.ManagedThreadId, Thread.CurrentThread.IsThreadPoolThread); 179 179 180 180 } trunk/nuxleus/Source/Nuxleus.Messaging/LoadBalancer/LoadBalancer.cs
r4684 r4701 1 1 using System; 2 2 using System.Collections; 3 using System.Threading; 3 4 4 5 namespace Nuxleus.Messaging { trunk/nuxleus/Source/nuXleus.sln
r4698 r4701 131 131 EndProject 132 132 Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ScopeTest", "Dependencies\Scope\ScopeTest\ScopeTest.csproj", "{A1C69CA6-2CBF-4B80-9FAC-78AFB6523B22}" 133 EndProject 134 Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Loadbalancer_Test", "Loadbalancer_Test\Loadbalancer_Test.csproj", "{8B0AB3D7-981B-46C7-AD7D-8C2FADA0625D}" 133 135 EndProject 134 136 Global … … 1060 1062 {A1C69CA6-2CBF-4B80-9FAC-78AFB6523B22}.Release|x64.ActiveCfg = Release|Any CPU 1061 1063 {A1C69CA6-2CBF-4B80-9FAC-78AFB6523B22}.Release|x86.ActiveCfg = Release|Any CPU 1064 {8B0AB3D7-981B-46C7-AD7D-8C2FADA0625D}.Debug|.NET.ActiveCfg = Debug|Any CPU 1065 {8B0AB3D7-981B-46C7-AD7D-8C2FADA0625D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 1066 {8B0AB3D7-981B-46C7-AD7D-8C2FADA0625D}.Debug|Any CPU.Build.0 = Debug|Any CPU 1067 {8B0AB3D7-981B-46C7-AD7D-8C2FADA0625D}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU 1068 {8B0AB3D7-981B-46C7-AD7D-8C2FADA0625D}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU 1069 {8B0AB3D7-981B-46C7-AD7D-8C2FADA0625D}.Debug|x64.ActiveCfg = Debug|Any CPU 1070 {8B0AB3D7-981B-46C7-AD7D-8C2FADA0625D}.Debug|x86.ActiveCfg = Debug|Any CPU 1071 {8B0AB3D7-981B-46C7-AD7D-8C2FADA0625D}.Release|.NET.ActiveCfg = Release|Any CPU 1072 {8B0AB3D7-981B-46C7-AD7D-8C2FADA0625D}.Release|Any CPU.ActiveCfg = Release|Any CPU 1073 {8B0AB3D7-981B-46C7-AD7D-8C2FADA0625D}.Release|Any CPU.Build.0 = Release|Any CPU 1074 {8B0AB3D7-981B-46C7-AD7D-8C2FADA0625D}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU 1075 {8B0AB3D7-981B-46C7-AD7D-8C2FADA0625D}.Release|Mixed Platforms.Build.0 = Release|Any CPU 1076 {8B0AB3D7-981B-46C7-AD7D-8C2FADA0625D}.Release|x64.ActiveCfg = Release|Any CPU 1077 {8B0AB3D7-981B-46C7-AD7D-8C2FADA0625D}.Release|x86.ActiveCfg = Release|Any CPU 1062 1078 EndGlobalSection 1063 1079 GlobalSection(SolutionProperties) = preSolution
