I don't think I understand what you're saying. If I don't specify
anything in MyComponent config, its ServiceBus property is set to null
after resolving. How to make the container resolve it automatically?

<facilities>
      <facility id="rhino.esb" >
        <bus threadCount="1"
           numberOfRetries="5"
           endpoint="msmq://localhost/messagebus"
             />
        <messages>
          <add name="WindsorTest1"
             endpoint="msmq://localhost/messagebus"/>
        </messages>
      </facility>
    </facilities>


    <components>

      <component id="MyComponent" type="WindsorTest1.MyDearComponent,
WindsorTest1" service="WindsorTest1.IMyDearComponent, WindsorTest1">

      </component>

And my test code:
WindsorContainer wc = new WindsorContainer(new
Castle.Windsor.Configuration.Interpreters.XmlInterpreter());

                IMyDearComponent mc = wc.Resolve<IMyDearComponent>();
                mc.Test();

After wc.Resolve I get MyDearComponent instance, but its ServiceBus
property is null.
The component:

public class MyDearComponent : IMyDearComponent
    {
        private IServiceBus _sb;

        public IServiceBus ServiceBus
        {
            get { return _sb; }
            set { _sb = value; }
        }

        public void Test()
        {
            if (ServiceBus == null) throw new Exception("NO SB");
            ServiceBus.Notify("Ala ma kota!");
        }
    }

So, can you please give one more hint?
Thx
R

On Apr 13, 8:16 pm, Ayende Rahien <[email protected]> wrote:
> <component id="MyComponent" type="some type">
>
>     </component>
>
> On Mon, Apr 13, 2009 at 9:01 PM, nightwatch77 <[email protected]>wrote:
>
>
>
> > Hi, suppose we configure RSB facility with windsor XML configuration
> > like below. I'm also configuring MyComponent with BusEndpoint property
> > that should be set to IServiceBus instance configured in rhino.esb
> > facility. How to initialize that property??? Does rhino facility give
> > any ID to components it registers in container? Or did I get it
> > completely wrong and IServiceBus should be resolved in some other way?
> > Thx
> > R
>
> > <castle>
> > <facilities>
> > <facility id="rhino.esb" >
> >                        <bus threadCount="1"
> >           numberOfRetries="5"
> >           endpoint="msmq://localhost/init_test"
> >             />
> >                        <messages>
> >                                <add name="Rhino.ServiceBus.Tests"
> >             endpoint="msmq://localhost/init_test"/>
> >                        </messages>
> >                </facility>
> > </facilities>
> > <components>
> >     <component id="MyComponent" type="some type">
> >        <parameters>
> >           <BusEndpoint>${What to put here to set BusEndpoint property
> > to RSB bus?}</BusEndpoint>
> >        </parameters>
> >     </component>
> > </components>
> > </castle>
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Rhino Tools Dev" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/rhino-tools-dev?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to