Home Help Center

Multi ObjectAdapter

dashiedashie Member Maurizio MerliOrganization: Università degli Studi di MilanoProject: N/A
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

  • michimichi Member Michi HenningOrganization: Triodia TechnologiesProject: I have a passing interest in Ice :-) ✭✭✭
    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.
  • dashiedashie Member Maurizio MerliOrganization: Università degli Studi di MilanoProject: N/A
    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.
Sign In or Register to comment.