Archived

This forum has been archived. Please start a new discussion on GitHub.

Multi ObjectAdapter

I want to use for my application more ObjectAdapter:
one for ServiceObject (for example UserService)
one for EntityObject (for example User)

this because these two ObjectADapter have different policy

now if I wont create form UserService in createUser method a new User i need to get EntityObject Adapter from ServiceObject Adapter: how can I do this?

Comments

  • Re: Multi ObjectAdapter
    Originally posted by dashie
    I want to use for my application more ObjectAdapter:
    one for ServiceObject (for example UserService)
    one for EntityObject (for example User)

    this because these two ObjectADapter have different policy

    What do you mean by "different policy"? There are no policies attached to Ice object adapters, and a single object adapter can support multiple servant implementation strategies simultaneously. For example, you can have a single object adapter with a servant locator, a default servant, and, additionally, servants in the Active Servant Map.

    Typically, different object adapters are used if you want separate thread pools for different some objects, or if you want a separate endpoint for some objects. If neither of these conditions apply in your situation, you might as well use a single object adapter.
    now if I wont create form UserService in createUser method a new User i need to get EntityObject Adapter from ServiceObject Adapter: how can I do this?

    One option would be to add a static member variable to the servants on the first adapter. That variable can store the Ptr to the other object adapter. You can then read the contents of the variable to get from one adapter to the other.

    Cheers,

    Michi.
  • Re: Re: Multi ObjectAdapter

    Thanks: this is a good news! I think I need only one ObjectAdapter.
    Originally posted by michi
    What do you mean by "different policy"? There are no policies attached to Ice object adapters, and a single object adapter can support multiple servant implementation strategies simultaneously. For example, you can have a single object adapter with a servant locator, a default servant, and, additionally, servants in the Active Servant Map.

    Typically, different object adapters are used if you want separate thread pools for different some objects, or if you want a separate endpoint for some objects. If neither of these conditions apply in your situation, you might as well use a single object adapter.



    One option would be to add a static member variable to the servants on the first adapter. That variable can store the Ptr to the other object adapter. You can then read the contents of the variable to get from one adapter to the other.

    Cheers,

    Michi.