You are viewing a plain text version of this content. The canonical link for it is here.
Posted to cvs@avalon.apache.org by ha...@apache.org on 2004/06/27 17:57:26 UTC

svn commit: rev 22202 - avalon/trunk/central/site/src/xdocs/central/laboratory/castle/managedextensions

Author: hammett
Date: Sun Jun 27 08:57:25 2004
New Revision: 22202

Added:
   avalon/trunk/central/site/src/xdocs/central/laboratory/castle/managedextensions/invokers.xml   (contents, props changed)
   avalon/trunk/central/site/src/xdocs/central/laboratory/castle/managedextensions/lifecycle.xml   (contents, props changed)
   avalon/trunk/central/site/src/xdocs/central/laboratory/castle/managedextensions/remoting.xml   (contents, props changed)
Modified:
   avalon/trunk/central/site/src/xdocs/central/laboratory/castle/managedextensions/index.xml
   avalon/trunk/central/site/src/xdocs/central/laboratory/castle/managedextensions/navigation.xml
Log:
ManagementExtensions documentation


Modified: avalon/trunk/central/site/src/xdocs/central/laboratory/castle/managedextensions/index.xml
==============================================================================
--- avalon/trunk/central/site/src/xdocs/central/laboratory/castle/managedextensions/index.xml	(original)
+++ avalon/trunk/central/site/src/xdocs/central/laboratory/castle/managedextensions/index.xml	Sun Jun 27 08:57:25 2004
@@ -27,26 +27,61 @@
 
   <section name="The project">
     <p>
-    ManagedExtensions is an attempt to give application's management capabilities. 
+    ManagedExtensions is an attempt to give management capabilities to applications. 
     Its relation to Castle Container is yet to be developed.
     </p>
     <p>
-    
+    Basically you have to approaches to choose: the server approach and the passive 
+    approach.
     </p>
   </section>
 
-  <section name="Source code">
+  <section name="Building a server">
     <p>
-    The lastest version of source can be obtained from 
-    <a href="https://svn.apache.org/repos/asf/avalon/trunk/central/laboratory/avalon-net/Castle/CastleManagementExtensions">Avalon Subversion repository</a> 
-    (Test cases can be found <a href="https://svn.apache.org/repos/asf/avalon/trunk/central/laboratory/avalon-net/Castle/CastleManagementExtensionsTest">here</a>).
+    If your application will be used to host others components, then you 
+    may build it as a server application. Just create a MServer concrete instance
+    and register your managed components on it (or use it to create your components 
+    instances)
     </p>
+<source>
+using Apache.Avalon.Castle.ManagementExtensions;
+
+
+bool createNewAppDomain = false;
+MServer server = MServerFactory.CreateServer("logicaldomainname", createNewAppDomain);
+
+</source>
+
+  <p>
+  After setting up a MServer instance you can use it to register component instances, 
+  or create instances from it:
+  </p>
+<source>
+/// <summary>
+/// Registers the specified managed object instance.
+/// </summary>
+/// <exception cref="InvalidDomainException">If domain name is not found.</exception>
+ManagedInstance RegisterManagedObject(Object instance, ManagedObjectName name);
+
+/// <summary>
+/// Instantiates the specified type using the server domain.
+/// </summary>
+Object Instantiate(String assemblyName, String typeName);
+</source>
   </section>
 
-  <section name="Usage">
-    <p>
-    
-    </p>
+  <section name="Managed Components">
+  <p>
+  To expose your components as managed components you have two choices:
+  <ul>
+    <li>
+    Use the ManagedComponent attribute
+    </li>
+    <li>
+    Implement the MDynamicSupport interface
+    </li>
+  </ul>
+  </p>
 <source>
 using Apache.Avalon.Castle.ManagementExtensions;
 
@@ -59,7 +94,7 @@
 	{
 	}
 
-	[ManagedAttribute]
+	<b>[ManagedAttribute]</b>
 	public bool Started
 	{
 		get
@@ -72,78 +107,45 @@
 		}
 	}
 
-	[ManagedOperation]
+	<b>[ManagedOperation]</b>
 	public void Start()
 	{
 		Started = true;
 	}
 
-	[ManagedOperation]
+	<b>[ManagedOperation]</b>
 	public void StartAt(int time)
 	{
 	}
 
-	[ManagedOperation]
+	<b>[ManagedOperation]</b>
 	public void Stop()
 	{
 		Started = false;
 	}
 }
-
-
-</source>
-     <p>
-     Lifecycle:
-     </p>
-<source>
-[ManagedComponent]
-public class DummyLifecycledService : MRegistrationListener
-{
-	public DummyLifecycledService()
-	{
-	}
-
-	[ManagedOperation]
-	public void Start()
-	{
-	}
-
-	[ManagedOperation]
-	public void Stop()
-	{
-	}
-
-	public void BeforeRegister(MServer server, ManagedObjectName name)
-	{
-	}
-
-	public void AfterDeregister()
-	{
-	}
-
-	public void AfterRegister()
-	{
-	}
-
-	public void BeforeDeregister()
-	{
-	}
-}
 </source>
+  </section>
 
-     <subsection name="Useful links">
-      <p>
-      If you'd like to learn more about Managed Extensions, please refer to:
-      </p>
-      <ul>
-        <li>
-        <a href="http://jroller.com/comments/hammett?anchor=management_extensions_for_net">
-          Management Extensions for .Net</a>:
-          Full explanation of what driven the development of Castle Managed Extensions.
-        </li>
-      </ul>
-     </subsection>
+  <section name="Source code">
+    <p>
+    The lastest version of source can be obtained from 
+    <a href="https://svn.apache.org/repos/asf/avalon/trunk/central/laboratory/avalon-net/Castle/CastleManagementExtensions">Avalon Subversion repository</a> 
+    (Test cases can be found <a href="https://svn.apache.org/repos/asf/avalon/trunk/central/laboratory/avalon-net/Castle/CastleManagementExtensionsTest">here</a>).
+    </p>
+  </section>
 
+  <section name="Useful links">
+    <p>
+    If you'd like to learn more about Managed Extensions, please refer to:
+    </p>
+    <ul>
+      <li>
+      <a href="http://jroller.com/comments/hammett?anchor=management_extensions_for_net">
+        Management Extensions for .Net</a>:
+        Full explanation of what driven the development of Castle Managed Extensions.
+      </li>
+    </ul>
   </section>
 
   </body>

Added: avalon/trunk/central/site/src/xdocs/central/laboratory/castle/managedextensions/invokers.xml
==============================================================================
--- (empty file)
+++ avalon/trunk/central/site/src/xdocs/central/laboratory/castle/managedextensions/invokers.xml	Sun Jun 27 08:57:25 2004
@@ -0,0 +1,51 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<!-- 
+ Copyright 2004 Apache Software Foundation
+ Licensed  under the  Apache License,  Version 2.0  (the "License");
+ you may not use  this file  except in  compliance with the License.
+ You may obtain a copy of the License at 
+ 
+   http://www.apache.org/licenses/LICENSE-2.0
+ 
+ Unless required by applicable law or agreed to in writing, software
+ distributed  under the  License is distributed on an "AS IS" BASIS,
+ WITHOUT  WARRANTIES OR CONDITIONS  OF ANY KIND, either  express  or
+ implied.
+ 
+ See the License for the specific language governing permissions and
+ limitations under the License.
+-->
+
+<document>
+  <properties>
+    <author email="dev@avalon.apache.org">Avalon Team</author>
+    <title>Avalon Castle - Managed Extensions</title>
+  </properties>
+
+  <body>
+
+  <section name="Invokers">
+    <p>
+    One of the biggest perfomance problems of some JMX implementations was 
+    exactly how components methods were invoked. On the ManagementExtensions
+    implementation that was a big concern as well, so the invocation of methods and
+    attributes goes through a invoker strategy. The reflection strategy is used by 
+    default, but you can enable the code generation one, or develop your own.
+    </p>
+<source>
+namespace Apache.Avalon.Castle.ManagementExtensions.Default
+{
+	using System;
+
+	public interface InvokerStrategy
+	{
+		MDynamicSupport Create(Object instance);
+	}
+}
+</source>
+
+  </section>
+
+  </body>
+</document>
\ No newline at end of file

Added: avalon/trunk/central/site/src/xdocs/central/laboratory/castle/managedextensions/lifecycle.xml
==============================================================================
--- (empty file)
+++ avalon/trunk/central/site/src/xdocs/central/laboratory/castle/managedextensions/lifecycle.xml	Sun Jun 27 08:57:25 2004
@@ -0,0 +1,74 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<!-- 
+ Copyright 2004 Apache Software Foundation
+ Licensed  under the  Apache License,  Version 2.0  (the "License");
+ you may not use  this file  except in  compliance with the License.
+ You may obtain a copy of the License at 
+ 
+   http://www.apache.org/licenses/LICENSE-2.0
+ 
+ Unless required by applicable law or agreed to in writing, software
+ distributed  under the  License is distributed on an "AS IS" BASIS,
+ WITHOUT  WARRANTIES OR CONDITIONS  OF ANY KIND, either  express  or
+ implied.
+ 
+ See the License for the specific language governing permissions and
+ limitations under the License.
+-->
+
+<document>
+  <properties>
+    <author email="dev@avalon.apache.org">Avalon Team</author>
+    <title>Avalon Castle - Managed Extensions</title>
+  </properties>
+
+  <body>
+
+  <section name="Lifecycle">
+    <p>
+    Your component may optionally implements the MRegistrationListener
+    and receive lifecycle events during registration and de-registration.
+    If your component wants to interact with MServer, implementing 
+    MRegistrationListener is the best oportunity to receive a MServer instance.
+    </p>
+<source>
+[ManagedComponent]
+public class LifecycledService : MRegistrationListener
+{
+	public LifecycledService()
+	{
+	}
+
+	[ManagedOperation]
+	public void Start()
+	{
+	}
+
+	[ManagedOperation]
+	public void Stop()
+	{
+	}
+
+	public void BeforeRegister(MServer server, ManagedObjectName name)
+	{
+	}
+
+	public void AfterDeregister()
+	{
+	}
+
+	public void AfterRegister()
+	{
+	}
+
+	public void BeforeDeregister()
+	{
+	}
+}
+</source>
+
+  </section>
+
+  </body>
+</document>
\ No newline at end of file

Modified: avalon/trunk/central/site/src/xdocs/central/laboratory/castle/managedextensions/navigation.xml
==============================================================================
--- avalon/trunk/central/site/src/xdocs/central/laboratory/castle/managedextensions/navigation.xml	(original)
+++ avalon/trunk/central/site/src/xdocs/central/laboratory/castle/managedextensions/navigation.xml	Sun Jun 27 08:57:25 2004
@@ -23,6 +23,9 @@
 
  <body>
     <menu>
+      <item name="Lifecycle" href="lifecycle.html"/>
+      <item name="Remoting" href="remoting.html"/>
+      <item name="Invokers" href="invokers.html"/>
     </menu>
   </body>
 

Added: avalon/trunk/central/site/src/xdocs/central/laboratory/castle/managedextensions/remoting.xml
==============================================================================
--- (empty file)
+++ avalon/trunk/central/site/src/xdocs/central/laboratory/castle/managedextensions/remoting.xml	Sun Jun 27 08:57:25 2004
@@ -0,0 +1,69 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<!-- 
+ Copyright 2004 Apache Software Foundation
+ Licensed  under the  Apache License,  Version 2.0  (the "License");
+ you may not use  this file  except in  compliance with the License.
+ You may obtain a copy of the License at 
+ 
+   http://www.apache.org/licenses/LICENSE-2.0
+ 
+ Unless required by applicable law or agreed to in writing, software
+ distributed  under the  License is distributed on an "AS IS" BASIS,
+ WITHOUT  WARRANTIES OR CONDITIONS  OF ANY KIND, either  express  or
+ implied.
+ 
+ See the License for the specific language governing permissions and
+ limitations under the License.
+-->
+
+<document>
+  <properties>
+    <author email="dev@avalon.apache.org">Avalon Team</author>
+    <title>Avalon Castle - Managed Extensions</title>
+  </properties>
+
+  <body>
+
+  <section name="Exposing the server">
+    <p>
+    ManagementExtensions hides from developer all the complexity
+    dealing with .Net Remoting architecture. To expose your MServer
+    through TCP (or HTTP) you need to create a MConnectorServer instance.
+    By now the only formatter supported is the binary one.
+    </p>
+<source>
+MConnectorServer serverConn = 
+   MConnectorServerFactory.CreateServer( "provider:http:binary:test.rem", null, null );
+
+ManagedObjectName name = new ManagedObjectName("connector.http:formatter=binary");
+
+server.RegisterManagedObject( serverConn, name );
+</source>
+
+  </section>
+
+  <section name="Connecting to server">
+    <p>
+    The same strategy is used to connect from a client. Once you've connected, you 
+    can extract the component tree from MServer, invoke methods and change component 
+    attributes.
+    </p>
+<source>
+MConnector connector = 
+   MConnectorFactory.CreateConnector( "provider:http:binary:test.rem", null );
+  
+MServer server = (MServer) connector.ServerConnection;
+String[] domains = server.GetDomains();
+
+</source>
+    <p>
+    Obviously the connection string must match. You can use ASP.Net or Winforms 
+    to construct a client application for manage your application. Unfortunatelly, 
+    due to license issues, we can't provide a sample using either of these technologies.
+    But you can see the test cases to get a glimpse of how it can be accomplished.
+    </p>
+  </section>
+
+  </body>
+</document>
\ No newline at end of file

---------------------------------------------------------------------
To unsubscribe, e-mail: cvs-unsubscribe@avalon.apache.org
For additional commands, e-mail: cvs-help@avalon.apache.org