Beispiel #1
0
        /// <include file='doc\ServicedComponent.uex' path='docs/doc[@for="ServicedComponent.ServicedComponent"]/*' />
        public ServicedComponent()
        {
            ServicedComponentProxy pxy = RemotingServices.GetRealProxy(this) as ServicedComponentProxy;

            DBG.Assert(pxy != null, "RealProxy() is null during constructor!");
            pxy.SuppressFinalizeServer();

            Type thisType = this.GetType();

            _denyRemoteDispatch = ServicedComponentInfo.AreMethodsSecure(thisType);

            // Get the methodinfo for finalize...
            // REVIEW:  Do we have to do anything special to make sure we
            // get the one furthest down the chain?

            bool bFoundInCache = false;

            _finalize = _finalizeCache.Get(thisType, out bFoundInCache) as MethodInfo;

            if (bFoundInCache == false)
            {
                _finalize = GetDeclaredFinalizer(thisType);
                _finalizeCache.Put(thisType, _finalize);
            }

            _calledDispose = false;
        }
Beispiel #2
0
        public void ConfigureSubCollections(ICatalogCollection coll)
        {
            if ((_installFlags & InstallationFlags.ConfigureComponentsOnly) == 0)
            {
                foreach (Type t in _spec.ConfigurableTypes)
                {
                    ICatalogObject     obj     = (ICatalogObject)FindObject(coll, t);
                    ICatalogCollection ifcColl = (ICatalogCollection)(coll.GetCollection(CollectionName.Interfaces, obj.Key()));

                    // Poke the cache so it's up to date...
                    _cache["Component"]     = obj;
                    _cache["ComponentType"] = t;

                    InterfaceConfigCallback cb = new InterfaceConfigCallback(ifcColl, t, _cache, _driver);
                    _driver.ConfigureCollection(ifcColl, cb);

                    if (_cache["SecurityOnMethods"] != null || ServicedComponentInfo.AreMethodsSecure(t))
                    {
                        DBG.Info(DBG.Registration, "Found security on methods for: " + t);
                        FixupMethodSecurity(ifcColl);
                        _cache["SecurityOnMethods"] = null;
                    }
                }
            }
        }
Beispiel #3
0
        public ServicedComponent()
        {
            (RemotingServices.GetRealProxy(this) as ServicedComponentProxy).SuppressFinalizeServer();
            Type t = base.GetType();

            this._denyRemoteDispatch = ServicedComponentInfo.AreMethodsSecure(t);
            bool bFound = false;

            this._finalize = _finalizeCache.Get(t, out bFound) as MethodInfo;
            if (!bFound)
            {
                this._finalize = GetDeclaredFinalizer(t);
                _finalizeCache.Put(t, this._finalize);
            }
            this._calledDispose = false;
        }
Beispiel #4
0
        internal RemoteServicedComponentProxy(Type serverType, IntPtr pUnk, bool fAttachServer)
            : base(serverType)
        {
            DBG.Info(DBG.SC, "RSCP: type = " + serverType);
            DBG.Assert(serverType != null, "server type is null");

            _fUseIntfDispatch = (ServicedComponentInfo.IsTypeEventSource(serverType) ||
                                 ServicedComponentInfo.AreMethodsSecure(serverType));
            DBG.Info(DBG.SC, "RSCP: using interface dispatch = " + _fUseIntfDispatch);
            if (pUnk != IntPtr.Zero)
            {
                _pUnk   = pUnk;
                _server = EnterpriseServicesHelper.WrapIUnknownWithComObject(pUnk);
                if (fAttachServer)
                {
                    AttachServer((MarshalByRefObject)_server);
                    _fAttachedServer = true;
                }
            }
        }
 public void ConfigureSubCollections(ICatalogCollection coll)
 {
     if ((this._installFlags & InstallationFlags.ConfigureComponentsOnly) == InstallationFlags.Default)
     {
         foreach (Type type in this._spec.ConfigurableTypes)
         {
             ICatalogObject     obj2       = (ICatalogObject)this.FindObject(coll, type);
             ICatalogCollection collection = (ICatalogCollection)coll.GetCollection(CollectionName.Interfaces, obj2.Key());
             this._cache["Component"]     = obj2;
             this._cache["ComponentType"] = type;
             InterfaceConfigCallback cb = new InterfaceConfigCallback(collection, type, this._cache, this._driver);
             this._driver.ConfigureCollection(collection, cb);
             if ((this._cache["SecurityOnMethods"] != null) || ServicedComponentInfo.AreMethodsSecure(type))
             {
                 this.FixupMethodSecurity(collection);
                 this._cache["SecurityOnMethods"] = null;
             }
         }
     }
 }
 internal RemoteServicedComponentProxy(Type serverType, IntPtr pUnk, bool fAttachServer) : base(serverType)
 {
     this._fUseIntfDispatch = ServicedComponentInfo.IsTypeEventSource(serverType) || ServicedComponentInfo.AreMethodsSecure(serverType);
     if (pUnk != IntPtr.Zero)
     {
         this._pUnk   = pUnk;
         this._server = EnterpriseServicesHelper.WrapIUnknownWithComObject(pUnk);
         if (fAttachServer)
         {
             base.AttachServer((MarshalByRefObject)this._server);
             this._fAttachedServer = true;
         }
     }
 }