Re: Connecting Out of Process Servers via COM+

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance




"Lance Wynn" <lance_wynn@xxxxxxxxxxxxxxxxxxxxxxx> schrieb im Newsbeitrag
news:eW0UczijFHA.2152@xxxxxxxxxxxxxxxxxxxxxxx

> Is there a setting where I can have COM+ instantiate only one instance
> of the object (In this case, my connection wrapper) and allow client
> applications to "share" this one instance of the COM+ object?
I wouldn't try to find a setting for COM+ itself, to restrict the PoolSize
of a specific COM+-object to 1.
I would allow your clients, to access a "normal" configured COM+ Object
(name it ComPlusRMIWrap).
This ComPlusRMIWrap-Object (if requested) then accesses the
RunningObjectsTable (ROT) on the serverside per GetObject(,
"COMRMI.cServerDispatcher"), to get a (marshaled) Reference to your own
ServerApplication (running as a sessionwide Singleton-Object on the
COM+-Host).
If you want to implement such a "Singleton-Server" in VB, you can use a
Standard-Exe, that loads your RMI-DLL-Instance once, makes the connect to
the Java-Environment and registers this Object in the ROT.
Another (better, but more complicated) approach is, not to use a
VB-Standard-Exe, but an ActiveX-Exe instead.
With an ActiveX-Exe you can write a Server-Application, that can create more
than one instance of your RMI-Connection-Wrapper on different threads. If
the AX-Exe starts, it would create a Dispatcher-Object first and registers
that in the ROT (cServerDispatcher). This Dispatcher-Object is the
Singleton-Object, that the COM+Objects can reference per GetObject. Inside
the Dispatcher is a Thread-Pool-Collection (created at Startup) of (for
example 10) RMIWrapper-Objects (cRMIWrapper). Those Wrappers are the
(threaded) COM-Objects, wich create and hold a separate RMI-Connection (from
your Dll) inside.

> If this is possible, how would I instantiate the teh object at the client?
> GetObject? CreateObject? When one client sent a command, it would
> have to wait until the command had finished completely before
> allowing the next client's command through.

If two Clients at the same time are requesting the COM+-Server, the requests
are processed in parallel up to the point, where the Interface of the
ROT-Singleton (the Proxy) is used. Interface-Calls of a marshaled ROT-Object
are queued automatically (the call, wich is a moment later will be blocked
until the first request against the interface of the ROT-Singleton is
finished).
This means, altough COM+ would allow parallel requests, the calls would be
serialized regarding the internal ROT-Object-Requests.
In case of the VB-Standard-Exe, wich could place your RMIWrapper-Object
directly in the ROT, your Clients would block each other during parallel
RMI-Calls against the same ROT-Instance (I don't write a Code-Example for
the COM+WrapperClasses - that case would be easy)

In Case of the VB-AxtiveX-Exe, the ROT-Object is not the RMIWrapper itself,
it's a Dispatcher-Object, wich allows 'ThreadpoolCollection.Count' parallel
and async requests.
Your COM+ Objects would then have some Code like this (Aircode, no
error+timeout handling):

Private RMIDispatcher as COMRMI.cServerDispatcher

Public Function DoRMIRequest(Params)
Set RMIDispatcher = GetObject(, "COMRMI.cServerDispatcher")

'The Dispatcher takes the Params, chooses a free RMI-Pool-Object
internally
'and creates an EventObject, calls the PoolObject async and returns
immediately
hEvt = RMIDispatcher.GetFreePoolObjectAndCallAsyncWith(Params)

'The Dispatcher will raise a SystemWide-Event, if the threaded RMI-Pool
'-Object has finished the request and informed the ROT-Dispatcher
WaitForSingleObject hEvt, TimeOut
DoRMIRequest = RMIDispatcher.GetResult(hEvt)
End Function

Olaf


.



Relevant Pages

  • Re: Connecting Out of Process Servers via COM+
    ... it would create a Dispatcher-Object first and registers ... wich create and hold a separate RMI-Connection (from ... how would I instantiate the teh object at the client? ... If two Clients at the same time are requesting the COM+-Server, the requests ...
    (microsoft.public.vb.com)
  • Re: Connecting Out of Process Servers via COM+
    ... >> of the object and allow client ... > RunningObjectsTable (ROT) on the serverside per GetObject(, ... it would create a Dispatcher-Object first and registers ... > This means, altough COM+ would allow parallel requests, the calls would be ...
    (microsoft.public.vb.com)
  • COM Interop + Threading + Scalability
    ... The Client completely denies ... The Rules Processor is implemented in VB 6 and the ASP.NET ... multiple concurrent requests for the Rules Processor. ... creates and initializes an apartment when calling a COM ...
    (microsoft.public.dotnet.framework.interop)
  • Re: [CFT][PATCH] new scheduler policy
    ... "The X server uses selectto detect clients with pending input. ... executing requests from the client with the smallest file descriptor. ... Each client has a buffer which is used to read some data from the ...
    (Linux-Kernel)
  • RE: Citrix/ISA
    ... Microsoft CSS Online Newsgroup Support ... |> server" will not affect your Web proxy functionality. ... |> requests from firewall client and SecureNAT client will not be able to ... |> HTTP redirector filter is used to grab the HTTP/HTTPS/FTP requests from ...
    (microsoft.public.windows.server.sbs)