Results 1 to 5 of 5

Thread: Accessing spring beans from outside

  1. #1
    Join Date
    Mar 2006
    Posts
    23

    Default Accessing spring beans from outside

    Hi everybody,

    If I code some beans witch are POJOs (not EJBs) with spring, can I access them from:
    - an other application in the same container?
    - an other application in a remote server?

    Thanks for yours answers.

  2. #2
    Join Date
    Feb 2005
    Location
    Boston, MA
    Posts
    1,142

    Default

    In the same container, but different application I don't think you'd be able to because I believe each application has its own classloader. I guess it might depend on the application server.

    Unless you export your POJO using some remoting strategy (of which there are several) you can't access the object remotely. Take a look at the Spring reference manual for more details.
    Bill

  3. #3
    Join Date
    Aug 2004
    Location
    Chester Springs, PA
    Posts
    18

    Default accessing

    if the beans are singletons then its a non issue as log as you can get to them... via some other means like RMI or JAXRPC, etc.... (because it will be the same object)

    if they are prototype beans then from within another webapp in the same container shoudl be possible...
    by using a common classpath (system classpath)
    and J2EE 1.4 also allows for Session sharing between webapps, which might also be of some benefit to you, depending on your exact needs.

    -jp
    In theory there is no difference between theory and practice, but in practice there is.

  4. #4
    Join Date
    Mar 2006
    Posts
    23

    Default easiest method?

    What is the easiest method (to implement and access from outside)?

    RMI? Hessian/Burlap? Spring's own HTTP invoker? Web services?

  5. #5
    Join Date
    Mar 2006
    Posts
    7

    Default and what about jmx

    in a java world : add jmx in your list (rmi extention) : i think it's spring gurus
    secret blow of heart
    (you can expose a business layer with rmi exposer with 10 lines and some good interfaces in spring config : that's rock ! usefull for an admin service)

    info from the root :
    http://blog.springframework.com/rob/...management.pdf
    see jmx :
    # expose any spring bean to JMX
    # dependency inject to JMX proxies

    for other interop caller: hmmm the ugly webservice soup (be careful of what type of soap you choose !? )
    with axis or xfire

    ps : for 24/7 application ... or to help the turtle to become a rabbit help me to integrate apache mina (a generic protocol layer builder) to spring
    see "spring nio" in spring modules ( any suggestions are welcome ...)

    i3
    Last edited by icube; Mar 10th, 2006 at 08:11 AM.

Posting Permissions

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