Results 1 to 7 of 7

Thread: Best practices: using ICE with object containers

  1. #1
    kwaclaw is offline Registered User
    Name: Karl Waclawek
    Organization: Personal
    Project: Whiteboard application
    Join Date
    Sep 2004
    Location
    Oshawa, Canada
    Posts
    159

    Best practices: using ICE with object containers

    This relates to my last question regarding ICE and EJBs.

    I am wondering if there are any best practices for how one should expose existing container managed objects (like EJBs or Spring beans, or objects managed by some IoC container) through an ICE API.

    It seems that with ICE favouring one approach to concurrency control and life-cycle management, and the container having its own ideas about the same issues, there is some mismatch that seems hard to resolve.

    Are there some special techniques that are helpful?

    Karl
    Karl Waclawek

  2. #2
    matthew's Avatar
    matthew is offline ZeroC Staff
    Name: Matthew Newhook
    Organization: ZeroC, Inc.
    Project: Internet Communications Engine
    Join Date
    Feb 2003
    Location
    NL, Canada
    Posts
    1,458
    Hi Karl,

    I'm not really sure what problems you are encountering. Perhaps if you expressed the question in more concrete terms, it would be easier to help you. For example, what lifecycle does the container impose, and why can't you similarly match the Ice object's lifecycle.

  3. #3
    kwaclaw is offline Registered User
    Name: Karl Waclawek
    Organization: Personal
    Project: Whiteboard application
    Join Date
    Sep 2004
    Location
    Oshawa, Canada
    Posts
    159
    Quote Originally Posted by matthew View Post
    Hi Karl,

    I'm not really sure what problems you are encountering. Perhaps if you expressed the question in more concrete terms, it would be easier to help you. For example, what lifecycle does the container impose, and why can't you similarly match the Ice object's lifecycle.
    I may not have expressed myself clearly, as things are not clear in my head.

    For instance, if the application server receives a call for an object (EJB), it gets (or instantiates) the object from the container (factory) and dispatches the call to it. I don't see how ICE comes into the picture, as it would have to do what the application server does.

    Obviously I can write a separate ICE process that calls into the application server as a client (through remoting), but that adds a level of complexity.

    EJB containers support calling EJBs through IIOP without such a proxy server. So, I assume proper ICE support would have to be built into the application server itself.

    Now, given a framework like Spring, which does not necessarily require an application server, things look more hopeful, as ICE can assume the role of the server. But is still more cumbersome compared to the built-in Spring remoting which allows for declaratively exposing a bean as a remote service. See for instance here: Chapter 17. Remoting and web services using Spring


    Just trying to find an elegant way to get ICE inserted.

    Karl
    Karl Waclawek

  4. #4
    joshmoore is offline Registered User
    Name: Josh Moore
    Organization: Glencoe Software, Inc.
    Project: OMERO, http://trac.openmicroscopy.org.uk/omero
    Join Date
    Feb 2007
    Location
    Germany
    Posts
    115
    Our initial implementation of the OMERO server was a Spring context within a JBoss server. We currently support both a JBoss and an Ice-based server, which was relatively straight-forward using Ice's tie classes and the Spring interceptors which were already in place within JBoss.

    If you have JBoss with Spring, I can explain how to go about this.

    If not, keep things simple. Using Ice and Spring together is really no issue at all. The only way to get Ice and JBoss to work together short of significant work on the JBoss remoting library is to have the Ice thread pool active "symbiotically" within JBoss. This works and we've done it, but it's not really sensible.

  5. #5
    kwaclaw is offline Registered User
    Name: Karl Waclawek
    Organization: Personal
    Project: Whiteboard application
    Join Date
    Sep 2004
    Location
    Oshawa, Canada
    Posts
    159
    Thank you for your feedback.
    Quote Originally Posted by joshmoore View Post
    Our initial implementation of the OMERO server was a Spring context within a JBoss server. We currently support both a JBoss and an Ice-based server, which was relatively straight-forward using Ice's tie classes and the Spring interceptors which were already in place within JBoss.

    If you have JBoss with Spring, I can explain how to go about this.
    Actually, I am in the position of recommending how to structure the application server. So far, I am kind of fixed on Spring, but as I may have to expose some services as web services, something beside ICE may have to be used as server. It could be JBOSS (or similar) or it could be a SOAP/web service wrapper for the ICE-based application.

    If not, keep things simple. Using Ice and Spring together is really no issue at all. The only way to get Ice and JBoss to work together short of significant work on the JBoss remoting library is to have the Ice thread pool active "symbiotically" within JBoss. This works and we've done it, but it's not really sensible.
    Violates the KISS principle...
    Just curious, If you have an ICE-based OMERO server, why do you also offer a JBOSS based version?

    Karl
    Karl Waclawek

  6. #6
    joshmoore is offline Registered User
    Name: Josh Moore
    Organization: Glencoe Software, Inc.
    Project: OMERO, http://trac.openmicroscopy.org.uk/omero
    Join Date
    Feb 2007
    Location
    Germany
    Posts
    115
    Quote Originally Posted by kwaclaw View Post
    Just curious, If you have an ICE-based OMERO server, why do you also offer a JBOSS based version?
    Karl
    JBoss is what we shipped first, and so there are already clients written to the RMI interface which must be supported.

    As for your architecture, if I were in your position I'd suggest coming up with a stable Ice server, using Spring internally. When it comes time for web services, you can either:
    • have a Java web container act as a client to Ice
    • use Ice's PHP bindings to build a REST interface
    • start a second Ice.Communicator within the web/app server using co-location.

    Hope that's of some use.
    ~Josh.

  7. #7
    kwaclaw is offline Registered User
    Name: Karl Waclawek
    Organization: Personal
    Project: Whiteboard application
    Join Date
    Sep 2004
    Location
    Oshawa, Canada
    Posts
    159
    Quote Originally Posted by joshmoore View Post
    As for your architecture, if I were in your position I'd suggest coming up with a stable Ice server, using Spring internally. When it comes time for web services, you can either:
    • have a Java web container act as a client to Ice
    • use Ice's PHP bindings to build a REST interface
    • start a second Ice.Communicator within the web/app server using co-location.

    Hope that's of some use.
    ~Josh.
    Yes, I was already contemplating the first option, but possibly with ASP.NET.

    Thank you very much,

    Karl
    Karl Waclawek

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Best practices for junit?
    By philion in forum Help Center
    Replies: 1
    Last Post: 09-23-2010, 02:52 AM
  2. Replies: 1
    Last Post: 04-23-2008, 06:38 PM
  3. Replies: 2
    Last Post: 06-23-2007, 07:19 AM
  4. Replies: 2
    Last Post: 06-04-2007, 01:54 AM
  5. How to pass complex C++ containers in ICE?
    By jvme in forum Help Center
    Replies: 1
    Last Post: 08-04-2005, 05:30 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •