{
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)
{
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);