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/11/19 05:51:46 UTC
svn commit: r104063 - in avalon/trunk/central/site/src/xdocs/central/laboratory/castle: dynamicproxy managedextensions microkernel
Author: hammett
Date: Thu Nov 18 20:51:44 2004
New Revision: 104063
Modified:
avalon/trunk/central/site/src/xdocs/central/laboratory/castle/dynamicproxy/index.xml
avalon/trunk/central/site/src/xdocs/central/laboratory/castle/managedextensions/index.xml
avalon/trunk/central/site/src/xdocs/central/laboratory/castle/microkernel/index.xml
Log:
Modified: avalon/trunk/central/site/src/xdocs/central/laboratory/castle/dynamicproxy/index.xml
==============================================================================
--- avalon/trunk/central/site/src/xdocs/central/laboratory/castle/dynamicproxy/index.xml (original)
+++ avalon/trunk/central/site/src/xdocs/central/laboratory/castle/dynamicproxy/index.xml Thu Nov 18 20:51:44 2004
@@ -32,114 +32,8 @@
intrusive as it forces one to extend MarshalByRefObject or ContextBoundObject.
</p>
<p>
- You can use DynamicProxy to generate proxies on the fly for one or more interfaces
- (supporting concrete classes is on the plans as well)
+ The DynamicProxy has moved to <a href="http://www.castleproject.org/">http://www.castleproject.org</a>
</p>
- </section>
-
- <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/DynamicProxy">Avalon Subversion repository</a>.
- </p>
- </section>
-
- <section name="Usage">
- <p>
- The DynamicProxy relies on Reflection.Emit to generate new classes that implements
- the specified interfaces and delegates to your implementation of IInvocationHandler.
- The usage is very simple. You only need to invoke ProxyGenerator.CreateProxy
- specifying the interfaces that will be behind the proxy and your implementation of
- IInvocationHandler:
- </p>
-<source>
-using Apache.Avalon.DynamicProxy;
-
-public interface IMyInterface
-{
- String Name
- {
- get;
- set;
- }
-
- void DoSomething(int x, int y);
-}
-
-public class YourProxyInvocationHandler : IInvocationHandler
-{
- public object Invoke(object proxy, MethodInfo method, params object[] arguments)
- {
- // do something before
-
- object returnVal = method.Invoke( realInstance, arguments );
-
- // do something after...
-
- return returnVal;
- }
-}
-
-object proxy = ProxyGenerator.CreateProxy(
- typeof(IMyInterface),
- new YourProxyInvocationHandler( new MyInterfaceImpl() ) );
-
-// proxy can be safely casted to IMyInterface
-
-IMyInterface inter = proxy as IMyInterface;
-
-</source>
- <p>
- You can also overrides the implementation of StandardInvocationHandler.
- </p>
-<source>
-public class YourProxyInvocationHandler : StandardInvocationHandler
-{
- protected override void PreInvoke(object proxy,
- MethodInfo method, params object[] arguments)
- {
- }
-
- protected override void PostInvoke(object proxy,
- MethodInfo method, ref object returnValue, params object[] arguments)
- {
- }
-}
-</source>
-
- <subsection name="Useful links">
- <p>
- If you'd like to learn more about proxies in .Net and other similar solutions
- to generate proxies on the fly, please follow these links:
- </p>
- <ul>
- <li>
- <a href="http://opensource.atlassian.com/confluence/spring/display/NET/Dynamic+Proxy?showComments=true">Dynamic Proxies in .NET</a>:
- Discussions and explanation about the possibilities of proxies.
- </li>
- <li>
- <a href="http://jroller.com/comments/hammett?anchor=java_like_proxies_in_net">Java like proxies in .Net</a>:
- Explanation of the problems which leaded to development of Avalon DynamicProxy.
- </li>
- </ul>
- </subsection>
-
- <subsection name="Thanks to">
- <ul>
- <li>
- Stefan Zobel - for his suggestion of using ldtoken
- </li>
- <li>
- <a href="http://www.springframework.net/">SpringFramework.Net</a>
- guys - for their interest and willingness to help
- </li>
- <li>
- <a href="http://aspectsharp.sourceforge.net/">AspectSharp project</a>
- - for sticking with it
- </li>
- </ul>
- </subsection>
-
</section>
</body>
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 Thu Nov 18 20:51:44 2004
@@ -27,125 +27,12 @@
<section name="The project">
<p>
- ManagedExtensions is an attempt to give management capabilities to applications.
+ Management Extensions 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.
+ The Management Extensions has moved to <a href="http://www.castleproject.org/">http://www.castleproject.org</a>
</p>
- </section>
-
- <section name="Building a server">
- <p>
- 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="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;
-
-<b>[ManagedComponent]</b>
-public class DummyHttpServer
-{
- protected bool started = false;
-
- public DummyHttpServer()
- {
- }
-
- <b>[ManagedAttribute]</b>
- public bool Started
- {
- get
- {
- return started;
- }
- set
- {
- started = value;
- }
- }
-
- <b>[ManagedOperation]</b>
- public void Start()
- {
- Started = true;
- }
-
- <b>[ManagedOperation]</b>
- public void StartAt(int time)
- {
- }
-
- <b>[ManagedOperation]</b>
- public void Stop()
- {
- Started = false;
- }
-}
-</source>
- </section>
-
- <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>
Modified: avalon/trunk/central/site/src/xdocs/central/laboratory/castle/microkernel/index.xml
==============================================================================
--- avalon/trunk/central/site/src/xdocs/central/laboratory/castle/microkernel/index.xml (original)
+++ avalon/trunk/central/site/src/xdocs/central/laboratory/castle/microkernel/index.xml Thu Nov 18 20:51:44 2004
@@ -31,31 +31,9 @@
a port of Avalon, it benefits from several features offered by the
CLR.</p>
- <p>Other important difference of Castle container is its simplicity.
- Based on Microkernel pattern, the user can easily modify, extend or
- adapt it to match his requirements. No hard contracts, no obligations.
- Just good and old Inversion of Control and stills Avalon.</p>
- </section>
-
- <section name="More references">
<p>
- There are plenty of documents, articles and blog entries about .Net and proxies,
- its benefits, its cons and its differences when compared to java implementation.
+ Castle has moved to <a href="http://www.castleproject.org/">http://www.castleproject.org</a>
</p>
- <subsection name="Useful links">
- <ul>
- <li>
- <a href="../../cop/index.html">Developing With Avalon</a>:
- An excellent white paper on the Avalon framework.
- Recommended reading!
- </li>
- <li>
- <a href="../../cop/index.html">An Introduction to COP</a>:
- An introduction to Component Oriented Programming and the
- core Avalon Framework.
- </li>
- </ul>
- </subsection>
</section>
</body>
---------------------------------------------------------------------
To unsubscribe, e-mail: cvs-unsubscribe@avalon.apache.org
For additional commands, e-mail: cvs-help@avalon.apache.org