[lnkForumImage]
TotalShareware - Download Free Software

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


 

Forums >

microsoft.public.dotnet.framework.remoting

create local object after remoting is configured?

Jason

7/6/2004 12:32:00 PM

i have the opposite problem to everyone else. i want to still create a
local instance of an object after i have loaded the remoting configuration.

so i want

MyRemoteObject mro = new MyRemoteObject();

to be a remote object


but i want some thing like

Activator.CreateInstance("MyRemoteObject", "MyRemoteObject", ...");

where ... is the set of undocumented activation attributes which would
hopefully ignore the RemotingConfiguration and return me a local instance,
unless there is some other way of doing this?

cheers

Jason


23 Answers

Jason

7/8/2004 9:37:00 AM

0

guess it must be difficult then

"Jason" <microsoft@anywhere.com> wrote in message
news:#5wInV1YEHA.1656@TK2MSFTNGP09.phx.gbl...
> i have the opposite problem to everyone else. i want to still create a
> local instance of an object after i have loaded the remoting
configuration.
>
> so i want
>
> MyRemoteObject mro = new MyRemoteObject();
>
> to be a remote object
>
>
> but i want some thing like
>
> Activator.CreateInstance("MyRemoteObject", "MyRemoteObject", ...");
>
> where ... is the set of undocumented activation attributes which would
> hopefully ignore the RemotingConfiguration and return me a local instance,
> unless there is some other way of doing this?
>
> cheers
>
> Jason
>
>


Sunny

7/8/2004 2:17:00 PM

0

I do not think it is possible with config files. If I''d need that
functionality, I''ll go with a factory pattern for the remoted objects
and just plain "new" for local.

Sunny

In article <u9jtB9MZEHA.2844@TK2MSFTNGP12.phx.gbl>,
microsoft@anywhere.com says...
> guess it must be difficult then
>
> "Jason" <microsoft@anywhere.com> wrote in message
> news:#5wInV1YEHA.1656@TK2MSFTNGP09.phx.gbl...
> > i have the opposite problem to everyone else. i want to still create a
> > local instance of an object after i have loaded the remoting
> configuration.
> >
> > so i want
> >
> > MyRemoteObject mro = new MyRemoteObject();
> >
> > to be a remote object
> >
> >
> > but i want some thing like
> >
> > Activator.CreateInstance("MyRemoteObject", "MyRemoteObject", ...");
> >
> > where ... is the set of undocumented activation attributes which would
> > hopefully ignore the RemotingConfiguration and return me a local instance,
> > unless there is some other way of doing this?
> >
> > cheers
> >
> > Jason
> >
> >
>
>
>

Jason

7/9/2004 11:34:00 AM

0

true - but it is not so much a workaround i am looking for - it''s an answer
to the problem. i use the factory pattern you describe all the time - but i
am in charge of configuring those apps. i want to use the state pattern and
have its default state governed by the remote configuration or not - as i
see fit. for many classes that make use of the remotely configured objects
internally it is nice that the "new" instance points to the configured
machine automatically. but other classes use the same remotely configured
objects and want to ensure they are local versions. now i am not wanting an
answer to how to get around this or emulate this. i really just want to
know if activator or some other such class can actually create a local
instance even if remoting is configured to create remote objects by default.

cheers

jason



to a problem that does not exist be nice to have the factory pattern you
described in reverse wherein the factory method takes a type and returns a
local instance of it perhpas. this is extrmeley useful for me because i can
design my objects to either default to the a "new" private internal worker
object which takes account of the rmeoting configuration - or not - as the
case may be. i need to bypass the remoting configuration

"Sunny" <sunny@newsgroups.nospam> wrote in message
news:ODVSDZPZEHA.384@TK2MSFTNGP10.phx.gbl...
> I do not think it is possible with config files. If I''d need that
> functionality, I''ll go with a factory pattern for the remoted objects
> and just plain "new" for local.
>
> Sunny
>
> In article <u9jtB9MZEHA.2844@TK2MSFTNGP12.phx.gbl>,
> microsoft@anywhere.com says...
> > guess it must be difficult then
> >
> > "Jason" <microsoft@anywhere.com> wrote in message
> > news:#5wInV1YEHA.1656@TK2MSFTNGP09.phx.gbl...
> > > i have the opposite problem to everyone else. i want to still create
a
> > > local instance of an object after i have loaded the remoting
> > configuration.
> > >
> > > so i want
> > >
> > > MyRemoteObject mro = new MyRemoteObject();
> > >
> > > to be a remote object
> > >
> > >
> > > but i want some thing like
> > >
> > > Activator.CreateInstance("MyRemoteObject", "MyRemoteObject", ...");
> > >
> > > where ... is the set of undocumented activation attributes which
would
> > > hopefully ignore the RemotingConfiguration and return me a local
instance,
> > > unless there is some other way of doing this?
> > >
> > > cheers
> > >
> > > Jason
> > >
> > >
> >
> >
> >


Jason

7/12/2004 9:57:00 AM

0

thanks for your reply daniel - however your answer has not actually
targetted the problem. the problem is:

administrator configures MyClass to be hosted on a different machine - this
is great - its what i want - for those classes of mine that that don''t care
where the instance is created

however

i have some local classes which also use instances of MyClass- but they need
MyClass instances to be created in my appdomain, in my context.

- it is here that the problem lays - how can i have remoted configured BUT
also ensure i can create local instances as i see fit.

cheers

jason


"DanClayden" <DanClayden@discussions.microsoft.com> wrote in message
news:EEF8496D-8651-499A-9490-C713831ACACE@microsoft.com...
> Have you tried using RemotingServices.Marshal ? We create an object using
new, as usual, then call RemotingServices.Marshal() to get an ObjRef.
>
> You can then call RemotingServices.Unmarshal on the ObjRef to get a proxy,
or get the URI from the ObjRef and then call RemotingServices.Connect() to
connect to it from another machine.
>
> Daniel


Jason

7/21/2004 10:11:00 AM

0

well i guess this most simple sounding problem has no answer. thanks to
those who responded.

cheers

jason


"Jason" <microsoft@anywhere.com> wrote in message
news:O4Vf0a$ZEHA.2792@TK2MSFTNGP09.phx.gbl...
> thanks for your reply daniel - however your answer has not actually
> targetted the problem. the problem is:
>
> administrator configures MyClass to be hosted on a different machine -
this
> is great - its what i want - for those classes of mine that that don't
care
> where the instance is created
>
> however
>
> i have some local classes which also use instances of MyClass- but they
need
> MyClass instances to be created in my appdomain, in my context.
>
> - it is here that the problem lays - how can i have remoted configured BUT
> also ensure i can create local instances as i see fit.
>
> cheers
>
> jason
>
>
> "DanClayden" <DanClayden@discussions.microsoft.com> wrote in message
> news:EEF8496D-8651-499A-9490-C713831ACACE@microsoft.com...
> > Have you tried using RemotingServices.Marshal ? We create an object
using
> new, as usual, then call RemotingServices.Marshal() to get an ObjRef.
> >
> > You can then call RemotingServices.Unmarshal on the ObjRef to get a
proxy,
> or get the URI from the ObjRef and then call RemotingServices.Connect() to
> connect to it from another machine.
> >
> > Daniel
>
>


Sunny

7/21/2004 2:38:00 PM

0

You can not bypass the configuration. After all with the config you tell
exactly that: "I want this object to be remote".

But still, I'll go with a (double) factory pattern :)

Lets say at server I have a factory, which returns a remote reference to
the CAO I need.

And on the client I can configure the remoting only for that factory. So
the administrator still can configure where from you get your remote
objects.

And on the client I will implement some helper method like:


MyRemObj CreateObject(bool local)
{
MyRemObj ret = null;
if (local)
ret = new MyRemObj();//create a local copy
else
ret = myRemoteFactory.CreateObject();

return ret;
}

Still not convinced?

Sunny

In article <O4Vf0a$ZEHA.2792@TK2MSFTNGP09.phx.gbl>,
microsoft@anywhere.com says...
> thanks for your reply daniel - however your answer has not actually
> targetted the problem. the problem is:
>
> administrator configures MyClass to be hosted on a different machine - this
> is great - its what i want - for those classes of mine that that don't care
> where the instance is created
>
> however
>
> i have some local classes which also use instances of MyClass- but they need
> MyClass instances to be created in my appdomain, in my context.
>
> - it is here that the problem lays - how can i have remoted configured BUT
> also ensure i can create local instances as i see fit.
>
> cheers
>
> jason
>
>
> "DanClayden" <DanClayden@discussions.microsoft.com> wrote in message
> news:EEF8496D-8651-499A-9490-C713831ACACE@microsoft.com...
> > Have you tried using RemotingServices.Marshal ? We create an object using
> new, as usual, then call RemotingServices.Marshal() to get an ObjRef.
> >
> > You can then call RemotingServices.Unmarshal on the ObjRef to get a proxy,
> or get the URI from the ObjRef and then call RemotingServices.Connect() to
> connect to it from another machine.
> >
> > Daniel
>
>
>

Jason

8/4/2004 3:48:00 PM

0

thanks for the idea sunny

cheers
"Sunny" <sunny@newsgroups.nospam> wrote in message
news:OnjLFBzbEHA.2408@tk2msftngp13.phx.gbl...
> You can not bypass the configuration. After all with the config you tell
> exactly that: "I want this object to be remote".
>
> But still, I'll go with a (double) factory pattern :)
>
> Lets say at server I have a factory, which returns a remote reference to
> the CAO I need.
>
> And on the client I can configure the remoting only for that factory. So
> the administrator still can configure where from you get your remote
> objects.
>
> And on the client I will implement some helper method like:
>
>
> MyRemObj CreateObject(bool local)
> {
> MyRemObj ret = null;
> if (local)
> ret = new MyRemObj();//create a local copy
> else
> ret = myRemoteFactory.CreateObject();
>
> return ret;
> }
>
> Still not convinced?
>
> Sunny
>
> In article <O4Vf0a$ZEHA.2792@TK2MSFTNGP09.phx.gbl>,
> microsoft@anywhere.com says...
> > thanks for your reply daniel - however your answer has not actually
> > targetted the problem. the problem is:
> >
> > administrator configures MyClass to be hosted on a different machine -
this
> > is great - its what i want - for those classes of mine that that don't
care
> > where the instance is created
> >
> > however
> >
> > i have some local classes which also use instances of MyClass- but they
need
> > MyClass instances to be created in my appdomain, in my context.
> >
> > - it is here that the problem lays - how can i have remoted configured
BUT
> > also ensure i can create local instances as i see fit.
> >
> > cheers
> >
> > jason
> >
> >
> > "DanClayden" <DanClayden@discussions.microsoft.com> wrote in message
> > news:EEF8496D-8651-499A-9490-C713831ACACE@microsoft.com...
> > > Have you tried using RemotingServices.Marshal ? We create an object
using
> > new, as usual, then call RemotingServices.Marshal() to get an ObjRef.
> > >
> > > You can then call RemotingServices.Unmarshal on the ObjRef to get a
proxy,
> > or get the URI from the ObjRef and then call RemotingServices.Connect()
to
> > connect to it from another machine.
> > >
> > > Daniel
> >
> >
> >


Evolution

5/3/2008 8:29:00 PM

0

Greg Weber wrote:
> On Sat, 3 May 2008 13:44:38 -0500, Evolution wrote
> (in article <9_ydnQtNpsEGL4HVnZ2dnUVZ_t2inZ2d@wavecable.com>):
>
>> matt.orel@gmail.com wrote:
>>> On May 3, 12:01 am, Evolution <myn...@rcn.com> wrote:
>>>> matt.o...@gmail.com wrote:
>>>>> On May 2, 8:32 pm, Evolution <myn...@rcn.com> wrote:
>>>>>> matt.o...@gmail.com wrote:
>>>>>>> On May 2, 7:41 pm, Evolution <myn...@rcn.com> wrote:
>>>>>>>> PatsSox wrote:
>>>>>>>>> "EStreetJoe" <estju...@aol.com> wrote in message ...
>>>>>>>>>> This 16-year old clip probably won't hurt Hillary, but it definitely
>>>>>>>>>> won't help her
>>>>>>>>>> http://www.youtube.com/watch?v=s...
>>>>>>>>> This is hilarious. Kantor apologizes for saying shit and people
>>>>>>>>> think he's saying 'worthless white nigger'? Nice editing job
>>>>>>>>> there.
>>>>>>>>> Desperation is setting in. Polls show Obama's 20 point lead in
>>>>>>>>> Indiana
>>>>>>>>> dwindling and is now at single digits. He was leading in North
>>>>>>>>> Carolina
>>>>>>>>> by 10 and that's been cut to 5.
>>>>>>>> The last poll on CNN had them tied in IN with 10% undecided. And those
>>>>>>>> late deciders generally go for Hillary. Especially after this kind of
>>>>>>>> dirty trick will get credited to Obama.
>>>>>>> Why the hell would Obama, or anyone associated with Obama, do this?
>>>>>>> Let's see the impact... ooooh, easy denial, fast poll swing in
>>>>>>> Hillary's favor.
>>>>>>> And you think *Obama* did this? Are you nuts?
>>>>>>> Oh, wait... never mind...
>>>>>> Well, right... then I guess you're saying that Obama supporters are
>>>>>> idiots in spreading this around? See black helicopters much?
>>>>> The spectacle of Laurie calling out black helicopters is too much.
>>>>> Hey, have you figured out what happened on 9/11 yet?
>>>> Well, it's pretty absurd to lay this on Hillary. It was obviously an
>>>> amateur stunt by Obama supporters, since it was so easily countered.
>>> Right on the first part: It's obviously an amateur stunt.
>>> Wrong on the 2nd part: That requires one to assume that Obama and/or
>>> his supporters are morons.
>> No, only the ones who made it and the ones who spread it.
>>
>> We know that YOU make that assumption, but
>>> then again you compared Obama to Curious George and to this day you
>>> haven't figured out what's wrong with that.
>> I have accepted the fact that it is okay to compare a white man to a
>> chimp, but not okay to compare a black man to a cartoon character. And
>> someone who continues to bring this up is someone who is so devoid of
>> ideas that they have to go for cheap insults instead.
>
> Sorry Laurie, but you've woven a rich tapestry of idiocy on RMAS. You really
> can't blame people for remembering their favorites.
>
> I admit to having two of my own:
>
> "Yes, a source where I have to go out and buy a book... surely there is
> something on the internet, if this is not a myth."
> (in article <g_2dnTIVSNs88HbYnZ2dnUVZ_tern...@rcn.net>)
>
> "Really now, how much of jumping is the talent of the rider and how much
> is the talent of the horse? You have a million dollar horse, and I could
> ride it and win..."
> (in news:XLGdnVnpOYrJGpfanZ2dnUVZ_qqgnZ2d@rcn.net)
>
> --Fr. G.
>
>
>
>
>
>
>
>
>
Aww... my stalker is back. Here's my favorite of yours:

Greg Weber wrote:
> On Wed, 9 Jan 2008 19:59:28 -0600, Evolution wrote
> (in article <CLqdnZ3VAI244RjanZ2dnUVZ_qiin...@wavecable.com>):

>> Can we make a new start in the New Year? Let's pledge not to insult
>> each other this year.

> Done.

Laurie

Greg Weber

5/3/2008 11:29:00 PM

0

On Sat, 3 May 2008 15:29:00 -0500, Evolution wrote
(in article <ieSdnSCb29uOVoHVnZ2dnUVZ_vednZ2d@wavecable.com>):

> Greg Weber wrote:
>> On Sat, 3 May 2008 13:44:38 -0500, Evolution wrote
>> (in article <9_ydnQtNpsEGL4HVnZ2dnUVZ_t2inZ2d@wavecable.com>):
>>
>>> matt.orel@gmail.com wrote:
>>>> On May 3, 12:01 am, Evolution <myn...@rcn.com> wrote:
>>>>> matt.o...@gmail.com wrote:
>>>>>> On May 2, 8:32 pm, Evolution <myn...@rcn.com> wrote:
>>>>>>> matt.o...@gmail.com wrote:
>>>>>>>> On May 2, 7:41 pm, Evolution <myn...@rcn.com> wrote:
>>>>>>>>> PatsSox wrote:
>>>>>>>>>> "EStreetJoe" <estju...@aol.com> wrote in message ...
>>>>>>>>>>> This 16-year old clip probably won't hurt Hillary, but it
>>>>>>>>>>> definitely
>>>>>>>>>>> won't help her
>>>>>>>>>>> http://www.youtube.com/watch?v=s...
>>>>>>>>>> This is hilarious. Kantor apologizes for saying shit and people
>>>>>>>>>> think he's saying 'worthless white nigger'? Nice editing job
>>>>>>>>>> there.
>>>>>>>>>> Desperation is setting in. Polls show Obama's 20 point lead in
>>>>>>>>>> Indiana
>>>>>>>>>> dwindling and is now at single digits. He was leading in North
>>>>>>>>>> Carolina
>>>>>>>>>> by 10 and that's been cut to 5.
>>>>>>>>> The last poll on CNN had them tied in IN with 10% undecided. And
>>>>>>>>> those
>>>>>>>>> late deciders generally go for Hillary. Especially after this kind
>>>>>>>>> of
>>>>>>>>> dirty trick will get credited to Obama.
>>>>>>>> Why the hell would Obama, or anyone associated with Obama, do this?
>>>>>>>> Let's see the impact... ooooh, easy denial, fast poll swing in
>>>>>>>> Hillary's favor.
>>>>>>>> And you think *Obama* did this? Are you nuts?
>>>>>>>> Oh, wait... never mind...
>>>>>>> Well, right... then I guess you're saying that Obama supporters are
>>>>>>> idiots in spreading this around? See black helicopters much?
>>>>>> The spectacle of Laurie calling out black helicopters is too much.
>>>>>> Hey, have you figured out what happened on 9/11 yet?
>>>>> Well, it's pretty absurd to lay this on Hillary. It was obviously an
>>>>> amateur stunt by Obama supporters, since it was so easily countered.
>>>> Right on the first part: It's obviously an amateur stunt.
>>>> Wrong on the 2nd part: That requires one to assume that Obama and/or
>>>> his supporters are morons.
>>> No, only the ones who made it and the ones who spread it.
>>>
>>> We know that YOU make that assumption, but
>>>> then again you compared Obama to Curious George and to this day you
>>>> haven't figured out what's wrong with that.
>>> I have accepted the fact that it is okay to compare a white man to a
>>> chimp, but not okay to compare a black man to a cartoon character. And
>>> someone who continues to bring this up is someone who is so devoid of
>>> ideas that they have to go for cheap insults instead.
>>
>> Sorry Laurie, but you've woven a rich tapestry of idiocy on RMAS. You
>> really
>> can't blame people for remembering their favorites.
>>
>> I admit to having two of my own:
>>
>> "Yes, a source where I have to go out and buy a book... surely there is
>> something on the internet, if this is not a myth."
>> (in article <g_2dnTIVSNs88HbYnZ2dnUVZ_tern...@rcn.net>)
>>
>> "Really now, how much of jumping is the talent of the rider and how much
>> is the talent of the horse? You have a million dollar horse, and I could
>> ride it and win..."
>> (in news:XLGdnVnpOYrJGpfanZ2dnUVZ_qqgnZ2d@rcn.net)
>>
>> --Fr. G.
>>

> Aww... my stalker is back.

I work in law enforcement, Laurie. I've been here for the majority of my
professional life. I understand why you'd love to pin this label on me. I
also understand why it doesn't apply. Others do too.

Count the number of people who support you and then come back to me.

--Fr. G.

Evolution

5/4/2008 12:14:00 AM

0

Greg Weber wrote:

>
>> Aww... my stalker is back.
>
> I work in law enforcement, Laurie. I've been here for the majority of my
> professional life. I understand why you'd love to pin this label on me. I
> also understand why it doesn't apply. Others do too.
>


I notice you snipped the part where you had promised to not insult me.
I can certainly understand why some people disagree with me. But you
post only to insult me whenever you get the chance. Do you feel good
about that? Why do you feel that is necessary? Like it or not, it's
stalking behavior.

Laurie