{
internal class ActivationServices
{
- static IActivator _constructionActivator = new ConstructionLevelActivator ();
+ static IActivator _constructionActivator;
+
+ static IActivator ConstructionActivator {
+ get {
+ if (_constructionActivator == null)
+ _constructionActivator = new ConstructionLevelActivator ();
+
+ return _constructionActivator;
+ }
+ }
public static IMessage Activate (RemotingProxy proxy, ConstructionCall ctorCall)
{
public static IMessage RemoteActivate (IConstructionCallMessage ctorCall)
{
- try \r
+ try
{
return ctorCall.Activator.Activate (ctorCall);
}
- catch (Exception ex) \r
+ catch (Exception ex)
{
return new ReturnMessage (ex, ctorCall);
- } \r
+ }
}
public static object CreateProxyFromAttributes (Type type, object[] activationAttributes)
if (!type.IsContextful)
{
// Must be a remote activated object
- ctorCall.Activator = new AppDomainLevelActivator (activationUrl, _constructionActivator);
+ ctorCall.Activator = new AppDomainLevelActivator (activationUrl, ConstructionActivator);
ctorCall.IsContextOk = false; // It'll be activated in a remote context
return ctorCall;
}
// It is a CBO. Need collect context properties and
// check if a new context is needed.
- IActivator activatorChain = _constructionActivator;
+ IActivator activatorChain = ConstructionActivator;
activatorChain = new ContextLevelActivator (activatorChain);
ArrayList attributes = new ArrayList ();
identity.AttachServerObject ((MarshalByRefObject) obj, Threading.Thread.CurrentContext);
ConstructionCall call = ctorCall as ConstructionCall;
+
if (ctorCall.ActivationType.IsContextful && call != null && call.SourceProxy != null)
{
call.SourceProxy.AttachIdentity (identity);
if (type.IsContextful)
return RemotingServices.CreateClientProxyForContextBound (type, null);
-
+#if !NET_2_1
+ if (type.IsCOMObject) {
+ return RemotingServices.CreateClientProxyForComInterop (type);
+ }
+#endif
return null;
}