[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

microsoft.public.dotnet.framework.remoting

Detecting remote object instantiation/activation at the server

caughtfire

10/26/2004 3:37:00 AM

Hi All,

I'm currently running a remoting server via IIS. I'd like to be able
to tell (via an event, preferably) when a remote object is called from
a client. Is this possible? I would think it would be built-in
somwhere, but I haven't found anything on it.

I'd like to be able to get the object's Assembly object prior to the
object being instantiated, if possible.

-Andy
1 Answer

Ken Kolda

10/26/2004 3:39:00 PM

0

Do you need to know every method call or simply when the object is
instantiated? If it's the former, then you'll want to write a channel sink.
If it's the latter, you have a few choices depending on your requirements.

Obviously, the easiest thing to do is to add code to the class's
constructor, but this may be too late based on what you've said below.
Another alternative is to use a factory approach to remoting. The client
gets a reference to a singleton and then invokes its methods to create other
remoted objects. You could then put whatever code you want before you return
the newly created object to the client, e.g.

public class FactoryClass : MarshalByRefObject
{
public RemoteObject CreateRemoteObject()
{
// Do some stuff before creating object
return new RemoteObject();
}
}

Hope that helps -
Ken


"Andy Franks" <caughtfire@juno.com> wrote in message
news:5f7b7cad.0410251937.4c9b59af@posting.google.com...
> Hi All,
>
> I'm currently running a remoting server via IIS. I'd like to be able
> to tell (via an event, preferably) when a remote object is called from
> a client. Is this possible? I would think it would be built-in
> somwhere, but I haven't found anything on it.
>
> I'd like to be able to get the object's Assembly object prior to the
> object being instantiated, if possible.
>
> -Andy